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.
1262 lines
1.2 MiB
1262 lines
1.2 MiB
!(function(){var Wl=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[3897],{70557:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return fe}});var F=ie(72308),Le=ie(59301),Ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},ge=Ze,ne=ie(7657),v=function(he,$){return Le.createElement(ne.Z,(0,F.Z)({},he,{ref:$,icon:ge}))},we=Le.forwardRef(v),fe=we},35593:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return Ot}});var F=ie(77321),Le=ie(52487),Ze=ie(74416),ge=ie(43403),ne=ie(92310),v=ie.n(ne),we=ie(29301),fe=ie(76846),u=ie(96452),he=ie(6089),$=ie(80402),b=ie(34280),k=ie(49658),A=ie(59301),C=ie(72308),K=ie(77900),Z=ie(8654);function U(ze){var Ke=ze.prefixCls,se=ze.align,Ne=ze.arrow,Fe=ze.arrowPos,R=Ne||{},V=R.className,ee=R.content,j=Fe.x,W=j===void 0?0:j,ke=Fe.y,Pe=ke===void 0?0:ke,Be=A.useRef();if(!se||!se.points)return null;var Ce={position:"absolute"};if(se.autoArrow!==!1){var De=se.points[0],Ye=se.points[1],Ve=De[0],it=De[1],ut=Ye[0],bt=Ye[1];Ve===ut||!["t","b"].includes(Ve)?Ce.top=Pe:Ve==="t"?Ce.top=0:Ce.bottom=0,it===bt||!["l","r"].includes(it)?Ce.left=W:it==="l"?Ce.left=0:Ce.right=0}return A.createElement("div",{ref:Be,className:v()("".concat(Ke,"-arrow"),V),style:Ce},ee)}function M(ze){var Ke=ze.prefixCls,se=ze.open,Ne=ze.zIndex,Fe=ze.mask,R=ze.motion;return Fe?A.createElement(K.default,(0,C.Z)({},R,{motionAppear:!0,visible:se,removeOnLeave:!0}),function(V){var ee=V.className;return A.createElement("div",{style:{zIndex:Ne},className:v()("".concat(Ke,"-mask"),ee)})}):null}var J=A.memo(function(ze){var Ke=ze.children;return Ke},function(ze,Ke){return Ke.cache}),de=J,ue=A.forwardRef(function(ze,Ke){var se=ze.popup,Ne=ze.className,Fe=ze.prefixCls,R=ze.style,V=ze.target,ee=ze.onVisibleChanged,j=ze.open,W=ze.keepDom,ke=ze.fresh,Pe=ze.onClick,Be=ze.mask,Ce=ze.arrow,De=ze.arrowPos,Ye=ze.align,Ve=ze.motion,it=ze.maskMotion,ut=ze.forceRender,bt=ze.getPopupContainer,pt=ze.autoDestroy,mt=ze.portal,ct=ze.zIndex,_=ze.onMouseEnter,y=ze.onMouseLeave,Ge=ze.onPointerEnter,O=ze.ready,re=ze.offsetX,Et=ze.offsetY,Ee=ze.offsetR,Ae=ze.offsetB,je=ze.onAlign,B=ze.onPrepare,q=ze.stretch,oe=ze.targetWidth,Te=ze.targetHeight,P=typeof se=="function"?se():se,vt=j||W,me=(bt==null?void 0:bt.length)>0,Dt=A.useState(!bt||!me),Mt=(0,Le.Z)(Dt,2),zt=Mt[0],Ar=Mt[1];if((0,b.Z)(function(){!zt&&me&&V&&Ar(!0)},[zt,me,V]),!zt)return null;var Qt="auto",Bt={left:"-1000vw",top:"-1000vh",right:Qt,bottom:Qt};if(O||!j){var Sr,Tr=Ye.points,Yr=Ye.dynamicInset||((Sr=Ye._experimental)===null||Sr===void 0?void 0:Sr.dynamicInset),qr=Yr&&Tr[0][1]==="r",It=Yr&&Tr[0][0]==="b";qr?(Bt.right=Ee,Bt.left=Qt):(Bt.left=re,Bt.right=Qt),It?(Bt.bottom=Ae,Bt.top=Qt):(Bt.top=Et,Bt.bottom=Qt)}var Jt={};return q&&(q.includes("height")&&Te?Jt.height=Te:q.includes("minHeight")&&Te&&(Jt.minHeight=Te),q.includes("width")&&oe?Jt.width=oe:q.includes("minWidth")&&oe&&(Jt.minWidth=oe)),j||(Jt.pointerEvents="none"),A.createElement(mt,{open:ut||vt,getContainer:bt&&function(){return bt(V)},autoDestroy:pt},A.createElement(M,{prefixCls:Fe,open:j,zIndex:ct,mask:Be,motion:it}),A.createElement(we.Z,{onResize:je,disabled:!j},function(mr){return A.createElement(K.default,(0,C.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:ut,leavedClassName:"".concat(Fe,"-hidden")},Ve,{onAppearPrepare:B,onEnterPrepare:B,visible:j,onVisibleChanged:function(Lr){var _n;Ve==null||(_n=Ve.onVisibleChanged)===null||_n===void 0||_n.call(Ve,Lr),ee(Lr)}}),function(Zr,Lr){var _n=Zr.className,_r=Zr.style,xn=v()(Fe,_n,Ne);return A.createElement("div",{ref:(0,Z.sQ)(mr,Ke,Lr),className:xn,style:(0,F.Z)((0,F.Z)((0,F.Z)((0,F.Z)({"--arrow-x":"".concat(De.x||0,"px"),"--arrow-y":"".concat(De.y||0,"px")},Bt),Jt),_r),{},{boxSizing:"border-box",zIndex:ct},R),onMouseEnter:_,onMouseLeave:y,onPointerEnter:Ge,onClick:Pe},Ce&&A.createElement(U,{prefixCls:Fe,arrow:Ce,arrowPos:De,align:Ye}),A.createElement(de,{cache:!j&&!ke},P))})}))}),be=ue,Ie=A.forwardRef(function(ze,Ke){var se=ze.children,Ne=ze.getTriggerDOMNode,Fe=(0,Z.Yr)(se),R=A.useCallback(function(ee){(0,Z.mH)(Ke,Ne?Ne(ee):ee)},[Ne]),V=(0,Z.x1)(R,se.ref);return Fe?A.cloneElement(se,{ref:V}):se}),ye=Ie,xe=A.createContext(null),$e=xe;function Oe(ze){return ze?Array.isArray(ze)?ze:[ze]:[]}function He(ze,Ke,se,Ne){return A.useMemo(function(){var Fe=Oe(se!=null?se:Ke),R=Oe(Ne!=null?Ne:Ke),V=new Set(Fe),ee=new Set(R);return ze&&(V.has("hover")&&(V.delete("hover"),V.add("click")),ee.has("hover")&&(ee.delete("hover"),ee.add("click"))),[V,ee]},[ze,Ke,se,Ne])}var Q=ie(29194);function G(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],se=arguments.length>2?arguments[2]:void 0;return se?ze[0]===Ke[0]:ze[0]===Ke[0]&&ze[1]===Ke[1]}function Y(ze,Ke,se,Ne){for(var Fe=se.points,R=Object.keys(ze),V=0;V<R.length;V+=1){var ee,j=R[V];if(G((ee=ze[j])===null||ee===void 0?void 0:ee.points,Fe,Ne))return"".concat(Ke,"-placement-").concat(j)}return""}function te(ze,Ke,se,Ne){return Ke||(se?{motionName:"".concat(ze,"-").concat(se)}:Ne?{motionName:Ne}:null)}function ve(ze){return ze.ownerDocument.defaultView}function ae(ze){for(var Ke=[],se=ze==null?void 0:ze.parentElement,Ne=["hidden","scroll","clip","auto"];se;){var Fe=ve(se).getComputedStyle(se),R=Fe.overflowX,V=Fe.overflowY,ee=Fe.overflow;[R,V,ee].some(function(j){return Ne.includes(j)})&&Ke.push(se),se=se.parentElement}return Ke}function S(ze){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(ze)?Ke:ze}function E(ze){return S(parseFloat(ze),0)}function z(ze,Ke){var se=(0,F.Z)({},ze);return(Ke||[]).forEach(function(Ne){if(!(Ne instanceof HTMLBodyElement||Ne instanceof HTMLHtmlElement)){var Fe=ve(Ne).getComputedStyle(Ne),R=Fe.overflow,V=Fe.overflowClipMargin,ee=Fe.borderTopWidth,j=Fe.borderBottomWidth,W=Fe.borderLeftWidth,ke=Fe.borderRightWidth,Pe=Ne.getBoundingClientRect(),Be=Ne.offsetHeight,Ce=Ne.clientHeight,De=Ne.offsetWidth,Ye=Ne.clientWidth,Ve=E(ee),it=E(j),ut=E(W),bt=E(ke),pt=S(Math.round(Pe.width/De*1e3)/1e3),mt=S(Math.round(Pe.height/Be*1e3)/1e3),ct=(De-Ye-ut-bt)*pt,_=(Be-Ce-Ve-it)*mt,y=Ve*mt,Ge=it*mt,O=ut*pt,re=bt*pt,Et=0,Ee=0;if(R==="clip"){var Ae=E(V);Et=Ae*pt,Ee=Ae*mt}var je=Pe.x+O-Et,B=Pe.y+y-Ee,q=je+Pe.width+2*Et-O-re-ct,oe=B+Pe.height+2*Ee-y-Ge-_;se.left=Math.max(se.left,je),se.top=Math.max(se.top,B),se.right=Math.min(se.right,q),se.bottom=Math.min(se.bottom,oe)}}),se}function ce(ze){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,se="".concat(Ke),Ne=se.match(/^(.*)\%$/);return Ne?ze*(parseFloat(Ne[1])/100):parseFloat(se)}function qe(ze,Ke){var se=Ke||[],Ne=(0,Le.Z)(se,2),Fe=Ne[0],R=Ne[1];return[ce(ze.width,Fe),ce(ze.height,R)]}function Xe(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[ze[0],ze[1]]}function tt(ze,Ke){var se=Ke[0],Ne=Ke[1],Fe,R;return se==="t"?R=ze.y:se==="b"?R=ze.y+ze.height:R=ze.y+ze.height/2,Ne==="l"?Fe=ze.x:Ne==="r"?Fe=ze.x+ze.width:Fe=ze.x+ze.width/2,{x:Fe,y:R}}function gt(ze,Ke){var se={t:"b",b:"t",l:"r",r:"l"};return ze.map(function(Ne,Fe){return Fe===Ke?se[Ne]||"c":Ne}).join("")}function Rt(ze,Ke,se,Ne,Fe,R,V){var ee=A.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Fe[Ne]||{}}),j=(0,Le.Z)(ee,2),W=j[0],ke=j[1],Pe=A.useRef(0),Be=A.useMemo(function(){return Ke?ae(Ke):[]},[Ke]),Ce=A.useRef({}),De=function(){Ce.current={}};ze||De();var Ye=(0,he.Z)(function(){if(Ke&&se&&ze){let rn=function(Dn,ei){var ci=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xn,hi=P.x+Dn,ti=P.y+ei,xr=hi+Sr,fn=ti+Bt,Fi=Math.max(hi,ci.left),Ai=Math.max(ti,ci.top),Bi=Math.min(xr,ci.right),Ni=Math.min(fn,ci.bottom);return Math.max(0,(Bi-Fi)*(Ni-Ai))},kr=function(){tr=P.y+wr,Fr=tr+Bt,Br=P.x+ur,xi=Br+Sr};var ut,bt,pt=Ke,mt=pt.ownerDocument,ct=ve(pt),_=ct.getComputedStyle(pt),y=_.width,Ge=_.height,O=_.position,re=pt.style.left,Et=pt.style.top,Ee=pt.style.right,Ae=pt.style.bottom,je=pt.style.overflow,B=(0,F.Z)((0,F.Z)({},Fe[Ne]),R),q=mt.createElement("div");(ut=pt.parentElement)===null||ut===void 0||ut.appendChild(q),q.style.left="".concat(pt.offsetLeft,"px"),q.style.top="".concat(pt.offsetTop,"px"),q.style.position=O,q.style.height="".concat(pt.offsetHeight,"px"),q.style.width="".concat(pt.offsetWidth,"px"),pt.style.left="0",pt.style.top="0",pt.style.right="auto",pt.style.bottom="auto",pt.style.overflow="hidden";var oe;if(Array.isArray(se))oe={x:se[0],y:se[1],width:0,height:0};else{var Te=se.getBoundingClientRect();oe={x:Te.x,y:Te.y,width:Te.width,height:Te.height}}var P=pt.getBoundingClientRect(),vt=mt.documentElement,me=vt.clientWidth,Dt=vt.clientHeight,Mt=vt.scrollWidth,zt=vt.scrollHeight,Ar=vt.scrollTop,Qt=vt.scrollLeft,Bt=P.height,Sr=P.width,Tr=oe.height,Yr=oe.width,qr={left:0,top:0,right:me,bottom:Dt},It={left:-Qt,top:-Ar,right:Mt-Qt,bottom:zt-Ar},Jt=B.htmlRegion,mr="visible",Zr="visibleFirst";Jt!=="scroll"&&Jt!==Zr&&(Jt=mr);var Lr=Jt===Zr,_n=z(It,Be),_r=z(qr,Be),xn=Jt===mr?_r:_n,cn=Lr?_r:xn;pt.style.left="auto",pt.style.top="auto",pt.style.right="0",pt.style.bottom="0";var Ut=pt.getBoundingClientRect();pt.style.left=re,pt.style.top=Et,pt.style.right=Ee,pt.style.bottom=Ae,pt.style.overflow=je,(bt=pt.parentElement)===null||bt===void 0||bt.removeChild(q);var Ft=S(Math.round(Sr/parseFloat(y)*1e3)/1e3),sr=S(Math.round(Bt/parseFloat(Ge)*1e3)/1e3);if(Ft===0||sr===0||(0,fe.Sh)(se)&&!(0,Q.Z)(se))return;var Pr=B.offset,Er=B.targetOffset,fr=qe(P,Pr),On=(0,Le.Z)(fr,2),Or=On[0],Rr=On[1],Hr=qe(oe,Er),vr=(0,Le.Z)(Hr,2),Xr=vr[0],an=vr[1];oe.x-=Xr,oe.y-=an;var on=B.points||[],hr=(0,Le.Z)(on,2),lr=hr[0],Mr=hr[1],zr=Xe(Mr),Dr=Xe(lr),mn=tt(oe,zr),si=tt(P,Dr),Mn=(0,F.Z)({},B),ur=mn.x-si.x+Or,wr=mn.y-si.y+Rr,Ln=rn(ur,wr),Fn=rn(ur,wr,_r),Hn=tt(oe,["t","l"]),Ii=tt(P,["t","l"]),Xn=tt(oe,["b","r"]),bi=tt(P,["b","r"]),gn=B.overflow||{},ai=gn.adjustX,Qn=gn.adjustY,oi=gn.shiftX,en=gn.shiftY,st=function(ei){return typeof ei=="boolean"?ei:ei>=0},tr,Fr,Br,xi;kr();var Kn=st(Qn),Sn=Dr[0]===zr[0];if(Kn&&Dr[0]==="t"&&(Fr>cn.bottom||Ce.current.bt)){var dr=wr;Sn?dr-=Bt-Tr:dr=Hn.y-bi.y-Rr;var An=rn(ur,dr),Rn=rn(ur,dr,_r);An>Ln||An===Ln&&(!Lr||Rn>=Fn)?(Ce.current.bt=!0,wr=dr,Rr=-Rr,Mn.points=[gt(Dr,0),gt(zr,0)]):Ce.current.bt=!1}if(Kn&&Dr[0]==="b"&&(tr<cn.top||Ce.current.tb)){var hn=wr;Sn?hn+=Bt-Tr:hn=Xn.y-Ii.y-Rr;var ji=rn(ur,hn),Hi=rn(ur,hn,_r);ji>Ln||ji===Ln&&(!Lr||Hi>=Fn)?(Ce.current.tb=!0,wr=hn,Rr=-Rr,Mn.points=[gt(Dr,0),gt(zr,0)]):Ce.current.tb=!1}var li=st(ai),Vn=Dr[1]===zr[1];if(li&&Dr[1]==="l"&&(xi>cn.right||Ce.current.rl)){var Gt=ur;Vn?Gt-=Sr-Yr:Gt=Hn.x-bi.x-Or;var Bn=rn(Gt,wr),tn=rn(Gt,wr,_r);Bn>Ln||Bn===Ln&&(!Lr||tn>=Fn)?(Ce.current.rl=!0,ur=Gt,Or=-Or,Mn.points=[gt(Dr,1),gt(zr,1)]):Ce.current.rl=!1}if(li&&Dr[1]==="r"&&(Br<cn.left||Ce.current.lr)){var vn=ur;Vn?vn+=Sr-Yr:vn=Xn.x-Ii.x-Or;var Ki=rn(vn,wr),En=rn(vn,wr,_r);Ki>Ln||Ki===Ln&&(!Lr||En>=Fn)?(Ce.current.lr=!0,ur=vn,Or=-Or,Mn.points=[gt(Dr,1),gt(zr,1)]):Ce.current.lr=!1}kr();var Nn=oi===!0?0:oi;typeof Nn=="number"&&(Br<_r.left&&(ur-=Br-_r.left-Or,oe.x+Yr<_r.left+Nn&&(ur+=oe.x-_r.left+Yr-Nn)),xi>_r.right&&(ur-=xi-_r.right-Or,oe.x>_r.right-Nn&&(ur+=oe.x-_r.right+Nn)));var Wn=en===!0?0:en;typeof Wn=="number"&&(tr<_r.top&&(wr-=tr-_r.top-Rr,oe.y+Tr<_r.top+Wn&&(wr+=oe.y-_r.top+Tr-Wn)),Fr>_r.bottom&&(wr-=Fr-_r.bottom-Rr,oe.y>_r.bottom-Wn&&(wr+=oe.y-_r.bottom+Wn)));var Kr=P.x+ur,Jn=Kr+Sr,er=P.y+wr,Pi=er+Bt,Un=oe.x,wn=Un+Yr,yr=oe.y,Ei=yr+Tr,Oi=Math.max(Kr,Un),wi=Math.min(Jn,wn),pr=(Oi+wi)/2,ui=pr-Kr,ns=Math.max(er,yr),kt=Math.min(Pi,Ei),yn=(ns+kt)/2,Mi=yn-er;V==null||V(Ke,Mn);var Si=Ut.right-P.x-(ur+P.width),ln=Ut.bottom-P.y-(wr+P.height);ke({ready:!0,offsetX:ur/Ft,offsetY:wr/sr,offsetR:Si/Ft,offsetB:ln/sr,arrowX:ui/Ft,arrowY:Mi/sr,scaleX:Ft,scaleY:sr,align:Mn})}}),Ve=function(){Pe.current+=1;var bt=Pe.current;Promise.resolve().then(function(){Pe.current===bt&&Ye()})},it=function(){ke(function(bt){return(0,F.Z)((0,F.Z)({},bt),{},{ready:!1})})};return(0,b.Z)(it,[Ne]),(0,b.Z)(function(){ze||it()},[ze]),[W.ready,W.offsetX,W.offsetY,W.offsetR,W.offsetB,W.arrowX,W.arrowY,W.scaleX,W.scaleY,W.align,Ve]}var ht=ie(80702);function at(ze,Ke,se,Ne,Fe){(0,b.Z)(function(){if(ze&&Ke&&se){let Pe=function(){Ne(),Fe()};var R=Ke,V=se,ee=ae(R),j=ae(V),W=ve(V),ke=new Set([W].concat((0,ht.Z)(ee),(0,ht.Z)(j)));return ke.forEach(function(Be){Be.addEventListener("scroll",Pe,{passive:!0})}),W.addEventListener("resize",Pe,{passive:!0}),Ne(),function(){ke.forEach(function(Be){Be.removeEventListener("scroll",Pe),W.removeEventListener("resize",Pe)})}}},[ze,Ke,se])}var Ct=ie(48736),Vt=ie(16089);function St(ze,Ke,se,Ne,Fe,R,V,ee){var j=A.useRef(ze),W=A.useRef(!1);j.current!==ze&&(W.current=!0,j.current=ze),A.useEffect(function(){var ke=(0,Vt.Z)(function(){W.current=!1});return function(){Vt.Z.cancel(ke)}},[ze]),A.useEffect(function(){if(Ke&&Ne&&(!Fe||R)){var ke=function(){var O=!1,re=function(Ae){var je=Ae.target;O=V(je)},Et=function(Ae){var je=Ae.target;!W.current&&j.current&&!O&&!V(je)&&ee(!1)};return[re,Et]},Pe=ke(),Be=(0,Le.Z)(Pe,2),Ce=Be[0],De=Be[1],Ye=ke(),Ve=(0,Le.Z)(Ye,2),it=Ve[0],ut=Ve[1],bt=ve(Ne);bt.addEventListener("mousedown",Ce,!0),bt.addEventListener("click",De,!0),bt.addEventListener("contextmenu",De,!0);var pt=(0,u.A)(se);if(pt&&(pt.addEventListener("mousedown",it,!0),pt.addEventListener("click",ut,!0),pt.addEventListener("contextmenu",ut,!0)),0)var mt,ct,_,y;return function(){bt.removeEventListener("mousedown",Ce,!0),bt.removeEventListener("click",De,!0),bt.removeEventListener("contextmenu",De,!0),pt&&(pt.removeEventListener("mousedown",it,!0),pt.removeEventListener("click",ut,!0),pt.removeEventListener("contextmenu",ut,!0))}}},[Ke,se,Ne,Fe,R])}var Wt=["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 Nt(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ge.Z,Ke=A.forwardRef(function(se,Ne){var Fe=se.prefixCls,R=Fe===void 0?"rc-trigger-popup":Fe,V=se.children,ee=se.action,j=ee===void 0?"hover":ee,W=se.showAction,ke=se.hideAction,Pe=se.popupVisible,Be=se.defaultPopupVisible,Ce=se.onPopupVisibleChange,De=se.afterPopupVisibleChange,Ye=se.mouseEnterDelay,Ve=se.mouseLeaveDelay,it=Ve===void 0?.1:Ve,ut=se.focusDelay,bt=se.blurDelay,pt=se.mask,mt=se.maskClosable,ct=mt===void 0?!0:mt,_=se.getPopupContainer,y=se.forceRender,Ge=se.autoDestroy,O=se.destroyPopupOnHide,re=se.popup,Et=se.popupClassName,Ee=se.popupStyle,Ae=se.popupPlacement,je=se.builtinPlacements,B=je===void 0?{}:je,q=se.popupAlign,oe=se.zIndex,Te=se.stretch,P=se.getPopupClassNameFromAlign,vt=se.fresh,me=se.alignPoint,Dt=se.onPopupClick,Mt=se.onPopupAlign,zt=se.arrow,Ar=se.popupMotion,Qt=se.maskMotion,Bt=se.popupTransitionName,Sr=se.popupAnimation,Tr=se.maskTransitionName,Yr=se.maskAnimation,qr=se.className,It=se.getTriggerDOMNode,Jt=(0,Ze.Z)(se,Wt),mr=Ge||O||!1,Zr=A.useState(!1),Lr=(0,Le.Z)(Zr,2),_n=Lr[0],_r=Lr[1];(0,b.Z)(function(){_r((0,k.Z)())},[]);var xn=A.useRef({}),cn=A.useContext($e),Ut=A.useMemo(function(){return{registerSubPopup:function(qt,Gr){xn.current[qt]=Gr,cn==null||cn.registerSubPopup(qt,Gr)}}},[cn]),Ft=(0,$.Z)(),sr=A.useState(null),Pr=(0,Le.Z)(sr,2),Er=Pr[0],fr=Pr[1],On=(0,he.Z)(function(jt){(0,fe.Sh)(jt)&&Er!==jt&&fr(jt),cn==null||cn.registerSubPopup(Ft,jt)}),Or=A.useState(null),Rr=(0,Le.Z)(Or,2),Hr=Rr[0],vr=Rr[1],Xr=A.useRef(null),an=(0,he.Z)(function(jt){(0,fe.Sh)(jt)&&Hr!==jt&&(vr(jt),Xr.current=jt)}),on=A.Children.only(V),hr=(on==null?void 0:on.props)||{},lr={},Mr=(0,he.Z)(function(jt){var qt,Gr,nn=Hr;return(nn==null?void 0:nn.contains(jt))||((qt=(0,u.A)(nn))===null||qt===void 0?void 0:qt.host)===jt||jt===nn||(Er==null?void 0:Er.contains(jt))||((Gr=(0,u.A)(Er))===null||Gr===void 0?void 0:Gr.host)===jt||jt===Er||Object.values(xn.current).some(function(Vr){return(Vr==null?void 0:Vr.contains(jt))||jt===Vr})}),zr=te(R,Ar,Sr,Bt),Dr=te(R,Qt,Yr,Tr),mn=A.useState(Be||!1),si=(0,Le.Z)(mn,2),Mn=si[0],ur=si[1],wr=Pe!=null?Pe:Mn,Ln=(0,he.Z)(function(jt){Pe===void 0&&ur(jt)});(0,b.Z)(function(){ur(Pe||!1)},[Pe]);var Fn=A.useRef(wr);Fn.current=wr;var Hn=A.useRef([]);Hn.current=[];var Ii=(0,he.Z)(function(jt){var qt;Ln(jt),((qt=Hn.current[Hn.current.length-1])!==null&&qt!==void 0?qt:wr)!==jt&&(Hn.current.push(jt),Ce==null||Ce(jt))}),Xn=A.useRef(),bi=function(){clearTimeout(Xn.current)},gn=function(qt){var Gr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;bi(),Gr===0?Ii(qt):Xn.current=setTimeout(function(){Ii(qt)},Gr*1e3)};A.useEffect(function(){return bi},[]);var ai=A.useState(!1),Qn=(0,Le.Z)(ai,2),oi=Qn[0],en=Qn[1];(0,b.Z)(function(jt){(!jt||wr)&&en(!0)},[wr]);var st=A.useState(null),tr=(0,Le.Z)(st,2),Fr=tr[0],Br=tr[1],xi=A.useState([0,0]),Kn=(0,Le.Z)(xi,2),Sn=Kn[0],dr=Kn[1],An=function(qt){dr([qt.clientX,qt.clientY])},Rn=Rt(wr,Er,me?Sn:Hr,Ae,B,q,Mt),hn=(0,Le.Z)(Rn,11),ji=hn[0],Hi=hn[1],li=hn[2],Vn=hn[3],Gt=hn[4],Bn=hn[5],tn=hn[6],vn=hn[7],Ki=hn[8],En=hn[9],Nn=hn[10],Wn=He(_n,j,W,ke),Kr=(0,Le.Z)(Wn,2),Jn=Kr[0],er=Kr[1],Pi=Jn.has("click"),Un=er.has("click")||er.has("contextMenu"),wn=(0,he.Z)(function(){oi||Nn()}),yr=function(){Fn.current&&me&&Un&&gn(!1)};at(wr,Hr,Er,wn,yr),(0,b.Z)(function(){wn()},[Sn,Ae]),(0,b.Z)(function(){wr&&!(B!=null&&B[Ae])&&wn()},[JSON.stringify(q)]);var Ei=A.useMemo(function(){var jt=Y(B,R,En,me);return v()(jt,P==null?void 0:P(En))},[En,P,B,R,me]);A.useImperativeHandle(Ne,function(){return{nativeElement:Xr.current,forceAlign:wn}});var Oi=A.useState(0),wi=(0,Le.Z)(Oi,2),pr=wi[0],ui=wi[1],ns=A.useState(0),kt=(0,Le.Z)(ns,2),yn=kt[0],Mi=kt[1],Si=function(){if(Te&&Hr){var qt=Hr.getBoundingClientRect();ui(qt.width),Mi(qt.height)}},ln=function(){Si(),wn()},rn=function(qt){en(!1),Nn(),De==null||De(qt)},kr=function(){return new Promise(function(qt){Si(),Br(function(){return qt})})};(0,b.Z)(function(){Fr&&(Nn(),Fr(),Br(null))},[Fr]);function Dn(jt,qt,Gr,nn){lr[jt]=function(Vr){var $n;nn==null||nn(Vr),gn(qt,Gr);for(var ri=arguments.length,is=new Array(ri>1?ri-1:0),Yn=1;Yn<ri;Yn++)is[Yn-1]=arguments[Yn];($n=hr[jt])===null||$n===void 0||$n.call.apply($n,[hr,Vr].concat(is))}}(Pi||Un)&&(lr.onClick=function(jt){var qt;Fn.current&&Un?gn(!1):!Fn.current&&Pi&&(An(jt),gn(!0));for(var Gr=arguments.length,nn=new Array(Gr>1?Gr-1:0),Vr=1;Vr<Gr;Vr++)nn[Vr-1]=arguments[Vr];(qt=hr.onClick)===null||qt===void 0||qt.call.apply(qt,[hr,jt].concat(nn))}),St(wr,Un,Hr,Er,pt,ct,Mr,gn);var ei=Jn.has("hover"),ci=er.has("hover"),hi,ti;ei&&(Dn("onMouseEnter",!0,Ye,function(jt){An(jt)}),Dn("onPointerEnter",!0,Ye,function(jt){An(jt)}),hi=function(qt){(wr||oi)&&Er!==null&&Er!==void 0&&Er.contains(qt.target)&&gn(!0,Ye)},me&&(lr.onMouseMove=function(jt){var qt;(qt=hr.onMouseMove)===null||qt===void 0||qt.call(hr,jt)})),ci&&(Dn("onMouseLeave",!1,it),Dn("onPointerLeave",!1,it),ti=function(){gn(!1,it)}),Jn.has("focus")&&Dn("onFocus",!0,ut),er.has("focus")&&Dn("onBlur",!1,bt),Jn.has("contextMenu")&&(lr.onContextMenu=function(jt){var qt;Fn.current&&er.has("contextMenu")?gn(!1):(An(jt),gn(!0)),jt.preventDefault();for(var Gr=arguments.length,nn=new Array(Gr>1?Gr-1:0),Vr=1;Vr<Gr;Vr++)nn[Vr-1]=arguments[Vr];(qt=hr.onContextMenu)===null||qt===void 0||qt.call.apply(qt,[hr,jt].concat(nn))}),qr&&(lr.className=v()(hr.className,qr));var xr=(0,F.Z)((0,F.Z)({},hr),lr),fn={},Fi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Fi.forEach(function(jt){Jt[jt]&&(fn[jt]=function(){for(var qt,Gr=arguments.length,nn=new Array(Gr),Vr=0;Vr<Gr;Vr++)nn[Vr]=arguments[Vr];(qt=xr[jt])===null||qt===void 0||qt.call.apply(qt,[xr].concat(nn)),Jt[jt].apply(Jt,nn)})});var Ai=A.cloneElement(on,(0,F.Z)((0,F.Z)({},xr),fn)),Bi={x:Bn,y:tn},Ni=zt?(0,F.Z)({},zt!==!0?zt:{}):null;return A.createElement(A.Fragment,null,A.createElement(we.Z,{disabled:!wr,ref:an,onResize:ln},A.createElement(ye,{getTriggerDOMNode:It},Ai)),A.createElement($e.Provider,{value:Ut},A.createElement(be,{portal:ze,ref:On,prefixCls:R,popup:re,className:v()(Et,Ei),style:Ee,target:Hr,onMouseEnter:hi,onMouseLeave:ti,onPointerEnter:hi,zIndex:oe,open:wr,keepDom:oi,fresh:vt,onClick:Dt,mask:pt,motion:zr,maskMotion:Dr,onVisibleChanged:rn,onPrepare:kr,forceRender:y,autoDestroy:mr,getPopupContainer:_,align:En,arrow:Ni,arrowPos:Bi,ready:ji,offsetX:Hi,offsetY:li,offsetR:Vn,offsetB:Gt,onAlign:wn,stretch:Te,targetWidth:pr/vn,targetHeight:yn/Ki})))});return Ke}var Ot=Nt(ge.Z)},50304:function(){"use strict"},53660:function($t,dt){(function(ie,F){F(dt)})(this,function(ie){"use strict";var F=function(){return(F=Object.assign||function(se){for(var Ne,Fe=1,R=arguments.length;Fe<R;Fe++)for(var V in Ne=arguments[Fe])Object.prototype.hasOwnProperty.call(Ne,V)&&(se[V]=Ne[V]);return se}).apply(this,arguments)};function Le(se,Ne,Fe,R){return new(Fe||(Fe=Promise))(function(V,ee){function j(Pe){try{ke(R.next(Pe))}catch(Be){ee(Be)}}function W(Pe){try{ke(R.throw(Pe))}catch(Be){ee(Be)}}function ke(Pe){var Be;Pe.done?V(Pe.value):(Be=Pe.value,Be instanceof Fe?Be:new Fe(function(Ce){Ce(Be)})).then(j,W)}ke((R=R.apply(se,Ne||[])).next())})}function Ze(se,Ne){var Fe,R,V,ee,j={label:0,sent:function(){if(1&V[0])throw V[1];return V[1]},trys:[],ops:[]};return ee={next:W(0),throw:W(1),return:W(2)},typeof Symbol=="function"&&(ee[Symbol.iterator]=function(){return this}),ee;function W(ke){return function(Pe){return function(Be){if(Fe)throw new TypeError("Generator is already executing.");for(;j;)try{if(Fe=1,R&&(V=2&Be[0]?R.return:Be[0]?R.throw||((V=R.return)&&V.call(R),0):R.next)&&!(V=V.call(R,Be[1])).done)return V;switch(R=0,V&&(Be=[2&Be[0],V.value]),Be[0]){case 0:case 1:V=Be;break;case 4:return j.label++,{value:Be[1],done:!1};case 5:j.label++,R=Be[1],Be=[0];continue;case 7:Be=j.ops.pop(),j.trys.pop();continue;default:if(!(V=(V=j.trys).length>0&&V[V.length-1])&&(Be[0]===6||Be[0]===2)){j=0;continue}if(Be[0]===3&&(!V||Be[1]>V[0]&&Be[1]<V[3])){j.label=Be[1];break}if(Be[0]===6&&j.label<V[1]){j.label=V[1],V=Be;break}if(V&&j.label<V[2]){j.label=V[2],j.ops.push(Be);break}V[2]&&j.ops.pop(),j.trys.pop();continue}Be=Ne.call(se,j)}catch(Ce){Be=[6,Ce],R=0}finally{Fe=V=0}if(5&Be[0])throw Be[1];return{value:Be[0]?Be[1]:void 0,done:!0}}([ke,Pe])}}}var ge=function(){function se(){}return se.add=function(Ne){se.HANDLE_LIST.push(Ne),window.addEventListener("message",Ne,!1)},se.remove=function(Ne){var Fe=se.HANDLE_LIST.indexOf(Ne);Fe>=0&&se.HANDLE_LIST.splice(Fe,1),window.removeEventListener("message",Ne,!1)},se.empty=function(){for(;se.HANDLE_LIST.length;)window.removeEventListener("message",se.HANDLE_LIST.shift(),!1)},se.parse=function(Ne){try{return typeof Ne=="object"?Ne:Ne&&JSON.parse(Ne)}catch(Fe){return console.log("Message.parse Error:",Fe),Ne}},se.HANDLE_LIST=[],se}();function ne(se){return{}.toString.call(se)==="[object Function]"}var v,we,fe,u,he={origin:""};function $(se,Ne){he[se]=Ne}function b(se){return he[se]}function k(se){var Ne=b("origin");return!!function(Fe,R){return Fe!==R&&(Fe.replace(/www\./i,"").toLowerCase()!==R.replace(/www\./i,"").toLowerCase()||(Fe.match("www.")?void 0:($("origin",R),!1)))}(Ne,se.origin)&&(console.warn("postMessage \u57DF\u540D\u68C0\u67E5\u4E0D\u901A\u8FC7",{safeOrigin:Ne,eventOrigin:se.origin}),!0)}(function(se){se.unknown="unknown",se.spreadsheet="s",se.writer="w",se.presentation="p",se.pdf="f"})(v||(v={})),function(se){se.wps="w",se.et="s",se.presentation="p",se.pdf="f"}(we||(we={})),function(se){se.nomal="nomal",se.simple="simple"}(fe||(fe={})),function(se){se[se.requestFullscreen=1]="requestFullscreen",se[se.exitFullscreen=0]="exitFullscreen"}(u||(u={}));var A,C,K,Z=(A=0,function(){return A+=1}),U=function(se,Ne,Fe){Fe===void 0&&(Fe=!0);var R=Ne;if(!C){var V=function W(ke){var Pe=ke.clientHeight,Be=ke.clientWidth;Pe!==0||Be!==0||K?Pe===0&&Be===0||!K||(K.disconnect(),K=null):window.ResizeObserver&&(K=new ResizeObserver(function(Ce){W(ke)})).observe(ke),C.style.cssText+="height: "+Pe+"px; width: "+Be+"px"}.bind(null,R);(C=document.createElement("iframe")).classList.add("web-office-iframe");var ee={id:"office-iframe",src:se,scrolling:"no",frameborder:"0",allowfullscreen:"allowfullscreen",webkitallowfullscreen:"true",mozallowfullscreen:"true",allow:"clipboard-read; clipboard-write"};for(var j in R?(ee.style="width: "+R.clientWidth+"px; height: "+R.clientHeight+"px;",Fe&&window.addEventListener("resize",V)):((R=document.createElement("div")).classList.add("web-office-default-container"),function(W){var ke=document.createElement("style");document.head.appendChild(ke);var Pe=ke.sheet;Pe.insertRule(W,Pe.cssRules.length)}(".web-office-default-container {position: absolute; padding: 0; margin: 0; width: 100%; height: 100%; left: 0; top: 0;}"),document.body.appendChild(R),ee.style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;"),ee)C.setAttribute(j,ee[j]);R.appendChild(C),C.destroy=function(){C.parentNode.removeChild(C),C=null,window.removeEventListener("resize",V),K&&(K.disconnect(),K=null)}}return C},M=function(se){U().contentWindow&&U().contentWindow.postMessage(JSON.stringify(se),b("origin"))};function J(se,Ne,Fe){return new Promise(function(R){var V=Z(),ee=function(j){if(!k(j)){var W=ge.parse(j.data);W.eventName===Fe&&W.msgId===V&&(R(W.data),ge.remove(ee))}};ge.add(ee),M({data:se,msgId:V,eventName:Ne})})}var de=function(se){return J(se,"wps.jssdk.api","wps.api.reply")},ue=function(se){return J(se,"api.basic","api.basic.reply")},be={idMap:{}};function Ie(se){return Le(this,void 0,void 0,function(){var Ne,Fe,R,V,ee,j,W,ke,Pe,Be;return Ze(this,function(Ce){switch(Ce.label){case 0:return k(se)?[2]:(Ne=ge.parse(se.data),Fe=Ne.eventName,R=Ne.callbackId,V=Ne.data,R&&(ee=be.idMap[R])?(j=ee.split(":"),W=j[0],ke=j[1],Fe==="api.callback"&&be[W]&&be[W][ke]?[4,(Be=be[W][ke]).callback.apply(Be,V.args)]:[3,2]):[3,2]);case 1:Pe=Ce.sent(),M({result:Pe,callbackId:R,eventName:"api.callback.reply"}),Ce.label=2;case 2:return[2]}})})}var ye=function(se){return Le(void 0,void 0,void 0,function(){function Ne(){return Object.keys(be.idMap).find(function(Ce){return be.idMap[Ce]===R+":"+Fe})}var Fe,R,V,ee,j,W,ke,Pe,Be;return Ze(this,function(Ce){switch(Ce.label){case 0:return Fe=se.prop,R=se.parentObjId,[4,$e([V=se.value])];case 1:return ee=Ce.sent(),j=ee[0],W=ee[1],se.value=j[0],ke=Object.keys(W)[0],Pe=be[R],V===null&&Pe&&Pe[Fe]&&((Be=Ne())&&delete be.idMap[Be],delete Pe[Fe],Object.keys(Pe).length||delete be[R],Object.keys(be.idMap).length||ge.remove(Ie)),ke&&(Object.keys(be.idMap).length||ge.add(Ie),be[R]||(be[R]={}),be[R][Fe]={callbackId:ke,callback:W[ke]},(Be=Ne())&&delete be.idMap[Be],be.idMap[ke]=R+":"+Fe),[2]}})})},xe=function(se,Ne,Fe,R){return Le(void 0,void 0,void 0,function(){var V,ee,j,W,ke,Pe,Be,Ce;return Ze(this,function(De){switch(De.label){case 0:return V=Z(),W=new Promise(function(Ye,Ve){ee=Ye,j=Ve}),ke={},Ne.args?[4,$e(Ne.args)]:[3,2];case 1:Pe=De.sent(),Be=Pe[0],Ce=Pe[1],Ne.args=Be,ke=Ce,De.label=2;case 2:return se!=="api.setter"?[3,4]:[4,ye(Ne)];case 3:De.sent(),De.label=4;case 4:return function(Ye){var Ve=Ye[0],it=Ye[1];typeof(Ve=F({},Ve)).data=="function"&&(Ve.data=Ve.data()),it(),M(Ve)}([{eventName:se,data:Ne,msgId:V},function(){var Ye=this,Ve=function(it){return Le(Ye,void 0,void 0,function(){var ut,bt,pt;return Ze(this,function(mt){switch(mt.label){case 0:return k(it)?[2]:(ut=ge.parse(it.data)).eventName==="api.callback"&&ut.callbackId&&ke[ut.callbackId]?[4,ke[ut.callbackId].apply(ke,ut.data.args)]:[3,2];case 1:bt=mt.sent(),M({result:bt,eventName:"api.callback.reply",callbackId:ut.callbackId}),mt.label=2;case 2:return ut.eventName===se+".reply"&&ut.msgId===V&&(ut.error?((pt=new Error("")).stack=ut.error+`
|
|
`+Fe,R&&R(),j(pt)):ee(ut.result),ge.remove(Ve)),[2]}})})};return ge.add(Ve),W}]),[2,W]}})})};function $e(se){return Le(this,void 0,void 0,function(){var Ne,Fe,R,V,ee,j,W,ke,Pe,Be,Ce;return Ze(this,function(De){switch(De.label){case 0:Ne={},Fe=[],R=se.slice(0),De.label=1;case 1:return R.length?(V=void 0,[4,R.shift()]):[3,13];case 2:return(ee=De.sent())&&ee.done?[4,ee.done()]:[3,4];case 3:De.sent(),De.label=4;case 4:if(!function(Ye){if(!Ye)return!1;for(var Ve=Ye;Object.getPrototypeOf(Ve)!==null;)Ve=Object.getPrototypeOf(Ve);return Object.getPrototypeOf(Ye)===Ve}(V))return[3,11];for(W in V={},j=[],ee)j.push(W);ke=0,De.label=5;case 5:return ke<j.length?(Pe=j[ke],Be=ee[Pe],/^[A-Z]/.test(Pe)?Be&&Be.done?[4,Be.done()]:[3,7]:[3,8]):[3,10];case 6:De.sent(),De.label=7;case 7:Be&&Be.objId?Be={objId:Be.objId}:typeof Be=="function"&&(Ce=Z(),Ne[Ce]=Be,Be={callbackId:Ce}),De.label=8;case 8:V[Pe]=Be,De.label=9;case 9:return ke++,[3,5];case 10:return[3,12];case 11:ee&&ee.objId?V={objId:ee.objId}:typeof ee=="function"&&ee.objId===void 0?(Ce=Z(),Ne[Ce]=ee,V={callbackId:Ce}):V=ee,De.label=12;case 12:return Fe.push(V),[3,1];case 13:return[2,[Fe,Ne]]}})})}var Oe=function(se,Ne){Ne===void 0&&(Ne=!0);var Fe=F({},se),R=Fe.headers,V=R===void 0?{}:R,ee=Fe.subscriptions,j=ee===void 0?{}:ee,W=Fe.mode,ke=W===void 0?fe.nomal:W,Pe=Fe.commonOptions,Be=V.backBtn,Ce=Be===void 0?{}:Be,De=V.shareBtn,Ye=De===void 0?{}:De,Ve=V.otherMenuBtn,it=Ve===void 0?{}:Ve,ut=function(ct,_){ct.subscribe&&typeof ct.subscribe=="function"&&(ct.callback=_,j[_]=ct.subscribe,Ne&&delete ct.subscribe)};if(ut(Ce,"wpsconfig_back_btn"),ut(Ye,"wpsconfig_share_btn"),ut(it,"wpsconfig_other_menu_btn"),it.items&&Array.isArray(it.items)){var bt=[];it.items.forEach(function(ct,_){switch(ct===void 0&&(ct={}),ct.type){case"export_img":ct.type=1,ct.callback="export_img";break;case"export_pdf":ct.type=1,ct.callback="export_pdf";break;case"save_version":ct.type=1,ct.callback="save_version";break;case"about_wps":ct.type=1,ct.callback="about_wps";break;case"split_line":ct.type=2;break;case"custom":ct.type=3,ut(ct,"wpsconfig_other_menu_btn_"+_),bt.push(ct)}}),bt.length&&(Y||te)&&(it.items=bt)}Fe.url=Fe.url||Fe.wpsUrl;var pt=[];if((ke===fe.simple||Pe&&Pe.isShowTopArea===!1)&&pt.push("simple","hidecmb"),Fe.debug&&pt.push("debugger"),Fe.url&&pt.length&&(Fe.url=Fe.url+(Fe.url.indexOf("?")>=0?"&":"?")+pt.join("&")),Pe&&(Pe.isParentFullscreen||Pe.isBrowserViewFullscreen)&&(document.addEventListener("fullscreenchange",ve),document.addEventListener("webkitfullscreenchange",ve),document.addEventListener("mozfullscreenchange",ve)),Fe.wordOptions&&(Fe.wpsOptions=Fe.wordOptions),Fe.excelOptions&&(Fe.etOptions=Fe.excelOptions),Fe.pptOptions&&(Fe.wppOptions=Fe.pptOptions),typeof j.print=="object"){var mt="wpsconfig_print";typeof j.print.subscribe=="function"&&(j[mt]=j.print.subscribe,Fe.print={callback:mt},j.print.custom!==void 0&&(Fe.print.custom=j.print.custom)),delete j.print}return typeof j.exportPdf=="function"&&(j[mt="wpsconfig_export_pdf"]=j.exportPdf,Fe.exportPdf={callback:mt},delete j.exportPdf),Fe.commandBars&&Q(Fe.commandBars,!1),F(F({},Fe),{subscriptions:j})},He=function(se){se===void 0&&(se="");var Ne="";if(!Ne&&se){var Fe=se.toLowerCase();Fe.indexOf("/office/s/")!==-1&&(Ne=v.spreadsheet),Fe.indexOf("/office/w/")!==-1&&(Ne=v.writer),Fe.indexOf("/office/p/")!==-1&&(Ne=v.presentation),Fe.indexOf("/office/f/")!==-1&&(Ne=v.pdf)}if(!Ne){var R=se.match(/[\?&]type=([a-z]+)/)||[];Ne=we[R[1]]||""}return Ne};function Q(se,Ne){Ne===void 0&&(Ne=!0);var Fe=se.map(function(R){var V=R.attributes;if(!Array.isArray(V)){var ee=[];for(var j in V)if(V.hasOwnProperty(j)){var W={name:j,value:V[j]};ee.push(W)}R.attributes=ee}return R});return Ne&&M({data:Fe,eventName:"setCommandBars"}),Fe}var G=window.navigator.userAgent.toLowerCase(),Y=/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(G),te=function(){try{return window._parent.location.search.indexOf("from=wxminiprogram")!==-1}catch(se){return!1}}();function ve(){var se={status:u.requestFullscreen},Ne=document,Fe=Ne.fullscreenElement||Ne.webkitFullscreenElement||Ne.mozFullScreenElement;se.status=Fe?u.requestFullscreen:u.exitFullscreen,M({data:se,eventName:"fullscreenchange"})}var ae=function(){be.idMap={}};function S(){console.group("JSSDK \u4E8B\u4EF6\u673A\u5236\u8C03\u6574\u8BF4\u660E"),console.warn("jssdk.on\u3001jssdk.off \u548C jssdk.Application.Sub \u5C06\u5728\u540E\u7EED\u7248\u672C\u4E2D\u88AB\u5F03\u7528\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u6539\u8FDB\u540E\u7684 ApiEvent"),console.warn("\u5177\u4F53\u8BF7\u53C2\u8003\uFF1Ahttps://wwo.wps.cn/docs/front-end/basic-usage/events/intro/"),console.groupEnd()}var E=0,z=new Set;function ce(se){return E+=1,!se&&function(Ne){z.forEach(function(Fe){return Fe(Ne)})}(E),E}function qe(){var se=new Error("");return(se.stack||se.message||"").split(`
|
|
`).slice(2).join(`
|
|
`)}function Xe(se,Ne){var Fe,R=this,V=Ne.Events,ee=Ne.Enum,j=Ne.Props,W=j[0],ke=j[1],Pe={objId:E};switch(function Ye(Ve,it,ut){for(var bt=it.slice(0),pt=function(){var mt=bt.shift();!mt.alias&&~tt.indexOf(mt.prop)&&bt.push(F(F({},mt),{alias:mt.prop+"Async"})),Object.defineProperty(Ve,mt.alias||mt.prop,{get:function(){var ct=this,_=mt.cache===1,y=_&&this["__"+mt.prop+"CacheValue"];if(!y){var Ge=qe(),O=ce(_),re=function(){for(var Et,Ee=[],Ae=0;Ae<arguments.length;Ae++)Ee[Ae]=arguments[Ae];return mt.caller!==void 0?function je(B,q,oe){for(var Te=q.slice(0),P=function(){var vt=Te.shift();!vt.alias&&~tt.indexOf(vt.prop)&&Te.push(F(F({},vt),{alias:vt.prop+"Async"})),Object.defineProperty(B,vt.alias||vt.prop,{get:function(){var me=this,Dt=vt.cache===1,Mt=Dt&&this["__"+vt.prop+"CacheValue"];if(!Mt){var zt=qe(),Ar=ce(Dt),Qt=function(){for(var Bt,Sr=[],Tr=0;Tr<arguments.length;Tr++)Sr[Tr]=arguments[Tr];return vt.caller!==void 0?je(Bt={objId:ce()},oe[vt.caller],oe):Bt={},Rt(Qt,Bt,"api.caller",{obj:Qt,args:Sr,parentObjId:B.objId,objId:Bt.objId,prop:vt.prop},zt),Bt};return Qt.objId=-1,vt.getter!==void 0&&(Qt.objId=Ar,je(Qt,oe[vt.getter],oe)),Rt(B,Qt,"api.getter",{parentObjId:B.objId,objId:Qt.objId,prop:vt.prop},zt,function(){delete me["__"+vt.prop+"CacheValue"]}),Dt&&(this["__"+vt.prop+"CacheValue"]=Qt),Qt}return Mt},set:function(me){var Dt=qe();return Rt(B,{},"api.setter",{value:me,parentObjId:B.objId,objId:-1,prop:vt.prop},Dt)}})};Te.length;)P()}(Et={objId:ce()},ut[mt.caller],ut):Et={},Rt(re,Et,"api.caller",{obj:re,args:Ee,parentObjId:Ve.objId,objId:Et.objId,prop:mt.prop},Ge),Et};return re.objId=-1,mt.getter!==void 0&&(re.objId=O,Ye(re,ut[mt.getter],ut)),Rt(Ve,re,"api.getter",{parentObjId:Ve.objId,objId:re.objId,prop:mt.prop},Ge,function(){delete ct["__"+mt.prop+"CacheValue"]}),_&&(this["__"+mt.prop+"CacheValue"]=re),re}return y},set:function(ct){var _=qe();return Rt(Ve,{},"api.setter",{value:ct,parentObjId:Ve.objId,objId:-1,prop:mt.prop},_)}})};bt.length;)pt()}(Pe,W,ke),Pe.Events=V,Pe.Enum=ee,se.Enum=Pe.Enum,se.Events=Pe.Events,se.Props=j,He(se.url)){case v.writer:se.WordApplication=se.WpsApplication=function(){return Pe};break;case v.spreadsheet:se.ExcelApplication=se.EtApplication=function(){return Pe};break;case v.presentation:se.PPTApplication=se.WppApplication=function(){return Pe};break;case v.pdf:se.PDFApplication=function(){return Pe}}se.Application=Pe,se.Free=function(Ye){return xe("api.free",{objId:Ye},"")},se.Stack=Pe.Stack=(Fe=function(Ye){se&&se.Free(Ye)},function(){var Ye=[],Ve=function(it){Ye.push(it)};return z.add(Ve),{End:function(){Fe(Ye),z.delete(Ve)}}});var Be={};ge.add(function(Ye){return Le(R,void 0,void 0,function(){var Ve,it,ut,bt,pt;return Ze(this,function(mt){switch(mt.label){case 0:return k(Ye)?[2]:(Ve=ge.parse(Ye.data)).eventName==="api.event"&&Ve.data?(it=Ve.data,ut=it.eventName,bt=it.data,(pt=Be[ut])?[4,pt(bt)]:[3,2]):[3,2];case 1:mt.sent(),mt.label=2;case 2:return[2]}})})}),Pe.Sub={};var Ce=function(Ye){var Ve=V[Ye];Object.defineProperty(Pe.Sub,Ve,{set:function(it){S(),Be[Ve]=it,M({eventName:"api.event.register",data:{eventName:Ve,register:!!it,objId:E+=1}})}})};for(var De in V)Ce(De)}var tt=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"];function gt(se,Ne,Fe){for(var R=Ne.slice(0),V=function(){var ee=R.shift();!ee.alias&&~tt.indexOf(ee.prop)&&R.push(F(F({},ee),{alias:ee.prop+"Async"})),Object.defineProperty(se,ee.alias||ee.prop,{get:function(){var j=this,W=ee.cache===1,ke=W&&this["__"+ee.prop+"CacheValue"];if(!ke){var Pe=qe(),Be=ce(W),Ce=function(){for(var Ye=[],Ve=0,it;Ve<arguments.length;Ve++)Ye[Ve]=arguments[Ve];return ee.caller!==void 0?(it={objId:ce()},gt(it,Fe[ee.caller],Fe)):it={},Rt(De,it,"api.caller",{obj:De,args:Ye,parentObjId:se.objId,objId:it.objId,prop:ee.prop},Pe),it},De=Ce;return De.objId=-1,ee.getter!==void 0&&(De.objId=Be,gt(De,Fe[ee.getter],Fe)),Rt(se,De,"api.getter",{parentObjId:se.objId,objId:De.objId,prop:ee.prop},Pe,function(){delete j["__"+ee.prop+"CacheValue"]}),W&&(this["__"+ee.prop+"CacheValue"]=De),De}return ke},set:function(j){var W=qe();return Rt(se,{},"api.setter",{value:j,parentObjId:se.objId,objId:-1,prop:ee.prop},W)}})};R.length;)V()}function Rt(se,Ne,Fe,R,V,ee){var j,W=(se.done?se.done():Promise.resolve()).then(function(){return j||(j=xe(Fe,R,V,ee)),j});Ne.done=function(){return W},Ne.then=function(ke,Pe){return R.objId>=0?(Ne.then=null,Ne.catch=null,W.then(function(){ke(Ne)}).catch(function(Be){return Pe(Be)})):W.then(ke,Pe)},Ne.catch=function(ke){return W.catch(ke)},Ne.Destroy=function(){return xe("api.free",{objId:Ne.objId},"")}}var ht={},at=null,Ct={fileOpen:"fileOpen",tabSwitch:"tabSwitch",fileSaved:"fileSaved",fileStatus:"fileStatus",fullscreenChange:"fullscreenChange",error:"error",stage:"stage"},Vt={getToken:"api.getToken",onToast:"event.toast",onHyperLinkOpen:"event.hyperLinkOpen",getClipboardData:"api.getClipboardData"};function St(se,Ne,Fe,R,V,ee,j){var W=this;Fe===void 0&&(Fe={}),ge.add(function(ke){return Le(W,void 0,void 0,function(){var Pe,Be,Ce,De,Ye,Ve,it,ut,bt,pt,mt,ct,_,y,Ge,O,re,Et,Ee;return Ze(this,function(Ae){switch(Ae.label){case 0:return k(ke)?[2]:(Pe=ge.parse(ke.data),Be=Pe.eventName,Ce=Be===void 0?"":Be,De=Pe.data,Ye=De===void 0?null:De,Ve=Pe.url,it=Ve===void 0?null:Ve,["wps.jssdk.api"].indexOf(Ce)!==-1?[2]:Ce!=="ready"?[3,1]:(V.apiReadySended&&function(je){var B=[];Object.keys(ht).forEach(function(q){ht[q].forEach(function(oe){var Te=q;je.off(Te,oe),B.push({handle:oe,eventName:Te})}),delete ht[q]}),B.forEach(function(q){var oe=q.eventName,Te=q.handle;at==null||at.ApiEvent.AddApiEventListener(oe,Te)})}(Ne),M({eventName:"setConfig",data:F(F({},Fe),{version:se.version})}),se.tokenData&&se.setToken(F(F({},se.tokenData),{hasRefreshTokenConfig:!!Fe.refreshToken})),se.iframeReady=!0,[3,15]));case 1:return Ce!=="error"?[3,2]:(Ne.emit(Ct.error,Ye),[3,15]);case 2:return Ce!=="open.result"?[3,3]:(((re=Ye==null?void 0:Ye.fileInfo)===null||re===void 0?void 0:re.officeVersion)!==void 0&&(se.mainVersion=Ye.fileInfo.officeVersion,console.log("aliyun Main Version: V"+se.mainVersion)),Ne.emit(Ct.fileOpen,Ye),[3,15]);case 3:return Ce!=="api.scroll"?[3,4]:(window.scrollTo(Ye.x,Ye.y),[3,15]);case 4:if(Ce!==Vt.getToken)return[3,9];ut={token:!1},Ae.label=5;case 5:return Ae.trys.push([5,7,,8]),[4,V.refreshToken()];case 6:return ut=Ae.sent(),[3,8];case 7:return bt=Ae.sent(),console.error("refreshToken: "+(bt||"fail to get")),[3,8];case 8:return M({eventName:Vt.getToken+".reply",data:ut}),[3,15];case 9:if(Ce!==Vt.getClipboardData)return[3,14];pt={text:"",html:""},Ae.label=10;case 10:return Ae.trys.push([10,12,,13]),[4,V.getClipboardData()];case 11:return pt=Ae.sent(),[3,13];case 12:return mt=Ae.sent(),console.error("getClipboardData: "+(mt||"fail to get")),[3,13];case 13:return M({eventName:Vt.getClipboardData+".reply",data:pt}),[3,15];case 14:Ce===Vt.onToast?V.onToast(Ye):Ce===Vt.onHyperLinkOpen?V.onHyperLinkOpen(Ye):Ce==="stage"?Ne.emit(Ct.stage,Ye):Ce==="event.callback"?(ct=Ye.eventName,_=Ye.data,y=ct,ct==="fullScreenChange"&&(y=Ct.fullscreenChange),ct==="file.saved"&&(y=Ct.fileStatus),(!((Et=Fe.commonOptions)===null||Et===void 0)&&Et.isBrowserViewFullscreen||!((Ee=Fe.commonOptions)===null||Ee===void 0)&&Ee.isParentFullscreen)&&y==="fullscreenchange"&&(Ge=_.status,O=_.isDispatchEvent,Fe.commonOptions.isBrowserViewFullscreen?function(je,B,q,oe){je===0?B.style="position: static; width: "+q.width+"; height: "+q.height:je===1&&(B.style="position: absolute; width: 100%; height: 100%"),oe&&function(Te){["fullscreen","fullscreenElement"].forEach(function(vt){Object.defineProperty(document,vt,{get:function(){return!!Te.status},configurable:!0})});var P=new CustomEvent("fullscreenchange");document.dispatchEvent(P)}({status:je})}(Ge,ee,j,O):Fe.commonOptions.isParentFullscreen&&function(je,B,q){var oe=document.querySelector(q),Te=oe&&oe.nodeType===1?oe:B;if(je===0){var P=document,vt=P.exitFullscreen||P.mozCancelFullScreen||P.msExitFullscreen||P.webkitCancelFullScreen||P.webkitExitFullscreen;vt.call(document)}else if(je===1){var me=Te.requestFullscreen||Te.mozRequestFullScreen||Te.msRequestFullscreen||Te.webkitRequestFullscreen;me.call(Te)}}(Ge,ee,Fe.commonOptions.isParentFullscreen)),Ne.emit(y,_)):Ce==="api.ready"&&Xe(se,Ye),Ae.label=15;case 15:return typeof R[Ce]=="function"&&R[Ce](se,it||Ye),[2]}})})})}function Wt(se){return new Promise(function(Ne){var Fe=function(R){k(R)||ge.parse(R.data).eventName===se&&(Ne(),ge.remove(Fe))};ge.add(Fe)})}function Nt(se){var Ne,Fe=this;se===void 0&&(se={}),at&&at.destroy();try{var R=Oe(se),V=R.subscriptions,ee=V===void 0?{}:V,j=R.mount,W=j===void 0?null:j,ke=R.url,Pe=R.refreshToken,Be=R.onToast,Ce=R.onHyperLinkOpen,De=R.getClipboardData;$("origin",(ke.match(/https*:\/\/[^\/]+/g)||[])[0]);var Ye=U(ke,W),Ve=Wt("ready"),it=Wt("open.result"),ut=Wt("api.ready"),bt=W?{width:W.clientWidth+"px",height:W.clientHeight+"px"}:{width:"100vw",height:"100vh"};delete R.mount,ke&&delete R.url,delete R.subscriptions;var pt=(Ne=Ne||Object.create(null),{on:function(_,y){(Ne[_]||(Ne[_]=[])).push(y)},off:function(_,y){Ne[_]&&Ne[_].splice(Ne[_].indexOf(y)>>>0,1)},emit:function(_,y){(Ne[_]||[]).slice().map(function(Ge){Ge(y)}),(Ne["*"]||[]).slice().map(function(Ge){Ge(_,y)})}}),mt={apiReadySended:!1},ct=function(_,y,Ge){return Le(Fe,void 0,void 0,function(){return Ze(this,function(O){switch(O.label){case 0:return function(re,Et,Ee){if(ht[re]){var Ae=!!ht[re].find(function(je){return je===Et});return Ae&&Ee==="off"?(pt.off(re,Et),ht[re]=ht[re].filter(function(je){return je!==Et}),!!ht[re].length||(ht[re]=void 0,!1)):(Ae||Ee!=="on"||(ht[re].push(Et),pt.on(re,Et)),!0)}return Ee==="on"?(ht[re]=[],ht[re].push(Et),!1):Ee==="off"||void 0}(_,y,Ge)?[3,2]:[4,Ve];case 1:O.sent(),function(re,Et){var Ee=re.eventName,Ae=re.type,je=re.handle;Et==="on"?pt.on(Ee,je):pt.off(Ee,je),Ae==="base.event"&&M({eventName:"basic.event",data:{eventName:Ee,action:Et}}),S()}(function(re,Et){var Ee=re,Ae="base.event";switch(Ee){case Ct.fileSaved:console.warn("fileSaved\u4E8B\u4EF6\u76D1\u542C\u5373\u5C06\u5F03\u7528\uFF0C \u63A8\u8350\u4F7F\u7528fileStatus\u8FDB\u884C\u6587\u4EF6\u72B6\u6001\u7684\u76D1\u542C"),Ee="fileStatus";break;case Ct.fullscreenChange:Ee="fullscreenchange";break;case"error":case"fileOpen":Ae="callback.event"}return{eventName:Ee,type:Ae,handle:Et}}(_,y),Ge),O.label=2;case 2:return[2]}})})};return at={url:ke,iframe:Ye,version:"1.1.19",iframeReady:!1,tokenData:null,commandBars:null,tabs:{getTabs:function(){return Le(this,void 0,void 0,function(){return Ze(this,function(_){switch(_.label){case 0:return[4,Ve];case 1:return _.sent(),[2,ue({api:"tab.getTabs"})]}})})},switchTab:function(_){return Le(this,void 0,void 0,function(){return Ze(this,function(y){switch(y.label){case 0:return[4,Ve];case 1:return y.sent(),[2,ue({api:"tab.switchTab",args:{tabKey:_}})]}})})}},setCooperUserColor:function(_){return Le(this,void 0,void 0,function(){return Ze(this,function(y){switch(y.label){case 0:return[4,Ve];case 1:return y.sent(),[2,ue({api:"setCooperUserColor",args:_})]}})})},setToken:function(_){return Le(this,void 0,void 0,function(){return Ze(this,function(y){switch(y.label){case 0:return[4,Ve];case 1:return y.sent(),at.tokenData=_,M({eventName:"setToken",data:_}),[2]}})})},ready:function(){return Le(this,void 0,void 0,function(){return Ze(this,function(_){switch(_.label){case 0:return mt.apiReadySended?[3,2]:[4,it];case 1:_.sent(),mt.apiReadySended=!0,M({eventName:"api.ready"}),_.label=2;case 2:return[4,ut];case 3:return _.sent(),[2,new Promise(function(y){return setTimeout(function(){return y(at==null?void 0:at.Application)},0)})]}})})},destroy:function(){ht={},Ye.destroy(),ge.empty(),at=null,z=new Set,E=0,document.removeEventListener("fullscreenchange",ve),ae()},save:function(){return Le(this,void 0,void 0,function(){return Ze(this,function(_){switch(_.label){case 0:return[4,Ve];case 1:return _.sent(),[2,de({api:"save"})]}})})},setCommandBars:function(_){return Le(this,void 0,void 0,function(){return Ze(this,function(y){switch(y.label){case 0:return[4,Ve];case 1:return y.sent(),Q(_),[2]}})})},updateConfig:function(_){return _===void 0&&(_={}),Le(this,void 0,void 0,function(){return Ze(this,function(y){switch(y.label){case 0:return[4,Ve];case 1:return y.sent(),_.commandBars?(console.warn("Deprecated: `updateConfig()` \u65B9\u6CD5\u5373\u5C06\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528`setCommandBars()`\u4EE3\u66FF`updateConfig()`\u66F4\u65B0`commandBars`\u914D\u7F6E\u3002"),[4,Q(_.commandBars)]):[3,3];case 2:y.sent(),y.label=3;case 3:return[2]}})})},executeCommandBar:function(_){return Le(this,void 0,void 0,function(){return Ze(this,function(y){switch(y.label){case 0:return[4,Ve];case 1:return y.sent(),Q([{cmbId:_,attributes:[{name:"click",value:!0}]}]),[2]}})})},on:function(_,y){return Le(this,void 0,void 0,function(){return Ze(this,function(Ge){return[2,this.ApiEvent.AddApiEventListener(_,y)]})})},off:function(_,y){return Le(this,void 0,void 0,function(){return Ze(this,function(Ge){return[2,this.ApiEvent.RemoveApiEventListener(_,y)]})})},ApiEvent:{AddApiEventListener:function(_,y){return Le(this,void 0,void 0,function(){return Ze(this,function(Ge){switch(Ge.label){case 0:return[4,ct(_,y,"on")];case 1:return[2,Ge.sent()]}})})},RemoveApiEventListener:function(_,y){return Le(this,void 0,void 0,function(){return Ze(this,function(Ge){switch(Ge.label){case 0:return[4,ct(_,y,"off")];case 1:return[2,Ge.sent()]}})})}}},function(_,y,Ge,O,re,Et){y&&ne(y)&&(re.refreshToken=y,_.refreshToken={eventName:Vt.getToken}),Et&&ne(Et)&&(re.getClipboardData=Et,_.getClipboardData={eventName:Vt.getClipboardData}),Ge&&ne(Ge)&&(re.onToast=Ge,_.onToast={eventName:Vt.onToast}),O&&ne(O)&&(re.onHyperLinkOpen=O,_.onHyperLinkOpen={eventName:Vt.onHyperLinkOpen})}(R,Pe,Be,Ce,mt,De),St(at,pt,R,ee,mt,Ye,bt),at}catch(_){console.error(_)}}console.log("aliyun JS-SDK V1.1.19");var Ot=Object.freeze({__proto__:null,listener:St,config:Nt});window.WPS=Ot;var ze=Nt,Ke={config:ze};ie.config=ze,ie.default=Ke,Object.defineProperty(ie,"__esModule",{value:!0})})},8797:function($t,dt,ie){"use strict";var F=ie(59301),Le=ie(93314),Ze=ie(3113),ge=Object.defineProperty,ne=Object.defineProperties,v=Object.getOwnPropertyDescriptors,we=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,he=(A,C,K)=>C in A?ge(A,C,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[C]=K,$=(A,C)=>{for(var K in C||(C={}))fe.call(C,K)&&he(A,K,C[K]);if(we)for(var K of we(C))u.call(C,K)&&he(A,K,C[K]);return A},b=(A,C)=>ne(A,v(C));const k=({img:A,buttonProps:C={},styles:K={},customText:Z,ButtonText:U,ButtonClick:M,Buttonclass:J,ButtonTwo:de,imgStyles:ue,loading:be=!1,className:Ie=""})=>F.createElement("section",{className:`tc animated fadeIn ${Ie}`,style:$({color:"#999",margin:"100px auto",visibility:be?"hidden":"visible"},K)},F.createElement("img",{src:A||Le,style:b($({},ue),{pointerEvents:"none",userSelect:"none"})}),F.createElement("p",{className:"mt20 font14"},Z||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),U&&F.createElement(Ze.ZP,$({className:J,onClick:M},C),U),de&&de);dt.Z=k},23210:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return J}});var F=ie(59301),Le={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Ze=ie(3113),ge=ie(70557),ne=ie(23954),v=ie(6848),we=ie(955),fe=ie(94941),u=ie(8797),he=ie(3294),$=ie(19381),b=ie(59301),k=Object.defineProperty,A=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,Z=(de,ue,be)=>ue in de?k(de,ue,{enumerable:!0,configurable:!0,writable:!0,value:be}):de[ue]=be,U=(de,ue)=>{for(var be in ue||(ue={}))C.call(ue,be)&&Z(de,be,ue[be]);if(A)for(var be of A(ue))K.call(ue,be)&&Z(de,be,ue[be]);return de},M=(de,ue,be)=>new Promise((Ie,ye)=>{var xe=He=>{try{Oe(be.next(He))}catch(Q){ye(Q)}},$e=He=>{try{Oe(be.throw(He))}catch(Q){ye(Q)}},Oe=He=>He.done?Ie(He.value):Promise.resolve(He.value).then(xe,$e);Oe((be=be.apply(de,ue)).next())}),J=({editOffice:de="view",data:ue,theme:be,type:Ie,filename:ye,monacoEditor:xe,className:$e,style:Oe,close:He,onClose:Q,hasMask:G,disabledDownload:Y,onImgDimensions:te,showNodata:ve,recordInfo:ae})=>{const[S,E]=(0,F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[z,ce]=(0,F.useState)(""),[qe,Xe]=(0,F.useState)(),tt=window.ENV==="build"?"/react/build":"",gt=location.host.startsWith("localhost")?he.Z.PROXY_SERVER:he.Z.API_SERVER,ht=10*(1024*1024),at=(0,F.useRef)();ue!=null&&ue.startsWith("/api")&&Ie!=="txt"&&(ue=he.Z.API_SERVER+ue);const Ct=Nt=>Nt.substring(Nt.lastIndexOf("/")+1).split(".").pop();ye&&xe&&(xe.filename=ye),(0,F.useEffect)(()=>{var Nt,Ot;const ze=(Ot=(Nt=document.cookie)==null?void 0:Nt.replace(/\s/g,""))==null?void 0:Ot.split(";");ze==null||ze.map(Ke=>{let se=Ke.split("=");se[0]==="_educoder_session"&&ce(se[1])})},[]),(0,F.useEffect)(()=>{Ie==="office"&&(ue.indexOf("bigfilescdn.")>-1||ue.indexOf("bigfiles1")>-1?Xe({url:ue,fileType:Ct(ue),model:ue.indexOf("model=edit")?"edit":"view"}):Vt())},[Ie,ue]);const Vt=()=>M(void 0,null,function*(){console.log("data:",ue);let Nt=ue;ue.startsWith("http")||(Nt=location.origin+Nt);let Ot=new URL(Nt).pathname.split("/").pop();const ze=yield(0,fe.gJ)({attachment_id:Ot});ze.url=gt+ze.url,Xe(ze)}),St=()=>{if(ue.startsWith("http")||ue.startsWith("blob:")){Wt();return}(0,we.Sv)(ye||"educoder",ue,ye)},Wt=()=>{ae&&(0,$.fc)({id:ae==null?void 0:ae.id,watch_type:1,course_id:ae==null?void 0:ae.course_id}),(0,we.Nd)(ye||"educoder",decodeURIComponent(ue))};return b.createElement("div",{style:U({},Oe||{}),className:`${G&&Le.bgBlack} ${Ie?Le.wrp:"hide"}`},He&&b.createElement("div",{className:Le.close,ref:at},!!te&&b.createElement(v.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>at.current},b.createElement("span",{onClick:()=>{Q(),te()}},b.createElement("i",{className:"icon-yulanpizhu"}))),!Y&&b.createElement(v.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>at.current},b.createElement("span",{onClick:Wt},b.createElement("i",{className:"icon-quxiaozhiding"}))),b.createElement(v.Z,{title:"\u5173\u95ED",getPopupContainer:()=>at.current},b.createElement("span",{className:"",onClick:Q},b.createElement("i",{className:"icon-guanbi1"})))),b.createElement("div",{className:`${Le[$e]} ${$e} ${Le.monaco} ${Ie==="txt"?"show":"hide"}`},Ie==="txt"&&b.createElement(b.Fragment,null,b.createElement(ne.ZP,U({},xe)))),Ie==="audio"&&b.createElement("audio",{src:`${(ue==null?void 0:ue.indexOf("http://"))>-1||(ue==null?void 0:ue.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${ue}`,autoPlay:!0}),Ie==="video"&&b.createElement(b.Fragment,null,(ue==null?void 0:ue.indexOf("http"))>-1?b.createElement("video",{controls:!0,src:`${ue}`,autoPlay:!0}):b.createElement("video",{controls:!0,src:`data:video/mp4;base64,${ue}`,autoPlay:!0})),Ie==="office"&&qe&&b.createElement("iframe",{src:`${tt}/office.html?key=${qe.key}&url=${btoa(qe.url)}&callbackUrl=${gt+(qe.callbackUrl||"")}&fileType=${qe.fileType}&title=${qe.title||""}&model=${de}&officeServer=${he.Z.ONLYOFFICE}&disabledDownload=${!!Y}`}),Ie==="html"&&b.createElement("iframe",{src:ue+"&disposition=inline"}),Ie==="pdf"&&b.createElement("iframe",{src:`${tt}/js/pdfview/index.html?filename=${ye||"educoder.pdf"}&url=${encodeURIComponent(ue)}&disabledDownload=${!!Y}`}),Ie==="image"&&b.createElement("img",{src:`${(ue==null?void 0:ue.indexOf("http://"))>-1||(ue==null?void 0:ue.indexOf("https://"))>-1?"":"data:image/png;base64,"}${ue}`}),(Ie==="other"||Ie==="download")&&b.createElement(b.Fragment,null,ve?b.createElement(u.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:b.createElement(Ze.ZP,{icon:b.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:St,disabled:Y},"\u4E0B\u8F7D")}):b.createElement(Ze.ZP,{type:"primary",size:"middle",onClick:St,disabled:Y},b.createElement(ge.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},85149:function($t,dt,ie){"use strict";ie.d(dt,{z:function(){return Ie},Z:function(){return ye}});var F=ie(59301),Le=ie(50304),Ze=ie(24768),ge=ie(64018),ne=ie(65157),v=ie(3294),we=ie(955),fe=ie(15342),u=ie(1012),he=ie(23210),$=ie(59301),k=({html:xe})=>{const $e=(0,F.useRef)(null),Oe=(0,F.useRef)(null),He=`.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 36px !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,F.useEffect)(()=>{const Q=$e.current.attachShadow({mode:"open"});Oe.current=document.createElement("div"),Oe.current.className="markdown-body",Oe.current.innerHTML=xe,Q.appendChild(Oe.current);const G=document.createElement("style");return G.textContent=He,Q.appendChild(G),()=>{Q.innerHTML=""}},[]),(0,F.useEffect)(()=>{Oe.current&&(Oe.current.innerHTML=xe)},[xe]),$.createElement("div",{ref:$e})},A=Object.defineProperty,C=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,U=(xe,$e,Oe)=>$e in xe?A(xe,$e,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):xe[$e]=Oe,M=(xe,$e)=>{for(var Oe in $e||($e={}))K.call($e,Oe)&&U(xe,Oe,$e[Oe]);if(C)for(var Oe of C($e))Z.call($e,Oe)&&U(xe,Oe,$e[Oe]);return xe};const J="@\u2581\u2581@",de="@\u2581@",ue=/<pre[^>]*>/g;function be(xe){let $e=document.createElement("div");return $e.innerHTML=xe,$e.childNodes.length===0?"":$e.childNodes[0].nodeValue}const Ie=(xe,$e)=>{xe=xe||"";const Oe=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,He=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Q=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,G=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return $e?xe.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Oe,(Y,te,ve,ae,S,E,z)=>{const ce=te||ae||E,qe=ve||S||z||"?";return v.Z.API_SERVER+"/api/attachments/"+ce+qe+"&t="+(0,we.Jn)(ce,Date.now())+(Y.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(xe=xe.replace(G,(Y,te,ve,ae,S,E,z)=>{const ce=te||ae||E,qe=ve||S||z||"?";return v.Z.API_SERVER+"/attachments/download/"+ce+qe+"&t="+(0,we.Jn)(ce,Date.now())+(Y.indexOf(")")>-1?")":"&")}).replace(Oe,(Y,te,ve,ae,S,E,z)=>{const ce=te||ae||E,qe=ve||S||z||"?";return v.Z.API_SERVER+"/api/attachments/"+ce+qe+"&t="+(0,we.Jn)(ce,Date.now())+(Y.indexOf(")")>-1?")":"&")}).replace(He,(Y,te,ve,ae,S)=>{const E=te||ae,z=ve||S||"";return'"'+v.Z.API_SERVER+"/api/attachments/"+E+z+E+z+"&t="+(0,we.Jn)(E,Date.now())}).replace(Q,(Y,te,ve,ae,S)=>{const E=te||ae,z=ve||S||"";return"("+v.Z.API_SERVER+"/files/uploads/"+E+z+E+z+"&t="+(0,we.Jn)(E,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,`
|
|
`),xe)};var ye=({value:xe="",className:$e,showTextOnly:Oe,showLines:He,style:Q={},stylesPrev:G={},highlightKeywords:Y,showProgramFill:te,isProgramFill:ve,disabledFill:ae=!1,programFillValue:S,onFillChange:E=qe=>{},onFillBlur:z=()=>{},onFillFocus:ce=()=>{}})=>{let qe=String(xe);const[Xe,tt]=(0,F.useState)(""),[gt,Rt]=(0,F.useState)("office"),[ht,at]=(0,F.useState)([]),Ct=(0,F.useRef)("a"+(0,u.Z)()),Vt={},St=(j,W,ke)=>{const Pe=document.createElement(j===de?"input":"textarea");Pe.style.width="100%",Pe.style.height=j===de?"40px":"151px",Pe.rows=5,Pe.spellcheck=!1,Pe.name="edu-program-fill",Pe.placeholder="\u8BF7\u8F93\u5165",Pe.dataset.id=W;const Be=Object.keys(Vt).length;return Vt[Be]=Pe,`<span class="edu-program-fill-wrap ${j===de?"":"show"}" style="width:${j===de?"400px":"100%"}" title=${ke||""}><span>${Pe.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Wt(j){return j=j.replace(/!\[.*?\]\(.*?\)/g,""),j=j.replace(/\[.*?\]\(.*?\)/g,""),j=j.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),j=j.replace(/<embed.*?>/g,""),j=j.replace(/<img.*?>/g,""),j=j.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),j=j.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),j=j.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),j=j.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),j}const Nt=j=>j.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(W,ke){let Pe=ke.replace(/(\n|\r)/g,"").split("}"),Be=[];return Pe.map(Ce=>{Ce!=""&&Be.push(`.${Ct.current} ${Ce}`)}),`<style>${Be.join("}")}</style>`}),Ot=(0,F.useMemo)(()=>{try{const Pe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Be=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ce=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,De=/\(\/attachments\/download\//g;qe=qe.replace(De,"("+v.Z.API_SERVER+"/attachments/download/").replace(Pe,"("+v.Z.API_SERVER+"/api/attachments/").replace(Be,'"'+v.Z.API_SERVER+"/api/attachments/").replace(Ce,'"'+v.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Pe){}if(te){let Pe=-1;return qe=qe.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(Be,Ce,De){var Ye;return++Pe,St(Be,Pe,(Ye=S==null?void 0:S[Pe])==null?void 0:Ye.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Nt(qe||"")}</pre>`}let j=Nt(qe);j=(0,Ze.ZP)(j);const W=(0,Ze.ez)();qe.match(/\[TOC\]/)&&(j=j.replace("<p>[TOC]</p>",(0,Ze.Qv)()),(0,Ze.Iy)()),j=j.replace(/(__special_katext_id_\d+__)/g,(Pe,Be)=>{const{type:Ce,expression:De}=W[Be];return(0,fe.renderToString)(be(De)||"",{displayMode:Ce==="block",throwOnError:!1,output:"html"})}),j=j.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Ze.AL)();const ke=document.createElement("div");if(ke.innerHTML=j,Oe)return ke.innerText;if(Y){const Pe=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Ne(ke,Pe),ke.innerHTML}return setTimeout(()=>V(),500),ke.innerHTML},[qe,Y]);(0,F.useEffect)(()=>{Fe.current&&Fe.current.querySelectorAll(["input","textarea"]).forEach(W=>{W.oninput=ze,W.onblur=Ke,W.onfocus=se})},[ht]),(0,F.useEffect)(()=>{var j,W,ke,Pe,Be;if(S!=null&&S.length)try{const Ce=Fe.current.querySelectorAll(".edu-program-fill-score"),De=Fe.current.querySelectorAll('[name="edu-program-fill"]');for(const[Ye,Ve]of De.entries())Ve.value=((j=S==null?void 0:S[Ye])==null?void 0:j.value)||"",((W=S==null?void 0:S[Ye])==null?void 0:W.type)==="warning"?Ve.className="program-fill-warning":((ke=S==null?void 0:S[Ye])==null?void 0:ke.type)==="success"?Ve.className="program-fill-success":Ve.className="";for(const[Ye,Ve]of Ce.entries())Ve.innerHTML=(Pe=S==null?void 0:S[Ye])!=null&&Pe.score?`${(Be=S==null?void 0:S[Ye])==null?void 0:Be.score}\u5206`:"";at(S)}catch(Ce){console.log(Ce,"error")}},[S]);const ze=j=>{ht[j.target.dataset.id]=ht[j.target.dataset.id]||{},ht[j.target.dataset.id].value=j.target.value,at([...ht]),E(ht,j.target.dataset.id)},Ke=j=>{ht[j.target.dataset.id]=ht[j.target.dataset.id]||{},ht[j.target.dataset.id].value=j.target.value,at([...ht]),z(ht,j.target.dataset.id)},se=j=>{ht[j.target.dataset.id]=ht[j.target.dataset.id]||{},ht[j.target.dataset.id].value=j.target.value,at([...ht]),ce(ht,j.target.dataset.id)};function Ne(j,W){return j.childNodes.forEach(ke=>{var Pe;if(ke.childNodes.length>0)Ne(ke,W);else if(ke.nodeName!=="IMG")if(ke.innerHTML)ke.innerHTML=(Pe=ke.innerHTML)==null?void 0:Pe.replace(new RegExp(W,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Be=document.createElement("span");Be.innerHTML=ke.textContent.replace(new RegExp(W,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),ke.replaceWith(Be)}})}const Fe=(0,F.useRef)();Ze.jb.WebkitLineClamp=He,He&&(Q=M(M({},Q),Ze.jb));function R(j){let W=j.target;if(W.tagName.toUpperCase()==="A"){let ke=W.getAttribute("href");if(ke.indexOf("office")>-1)j.preventDefault(),tt(ke),Rt("office");else if(ke.indexOf("application/pdf")>-1)j.preventDefault(),tt(ke),Rt("pdf");else if(ke.indexOf("text/html")>-1)j.preventDefault(),tt(ke),Rt("html");else if(ke.startsWith("#")){j.preventDefault();let Pe=document.getElementById(ke.replace("#",""));Pe&&Pe.scrollIntoView(!0)}}}const V=()=>{var j;const W=(j=Fe.current)==null?void 0:j.querySelectorAll("video");W==null||W.forEach(ke=>{if(ke.oncontextmenu=()=>!1,ke.src.indexOf(".m3u8")>-1&&!ke.canPlayType("application/vnd.apple.mpegurl")){if(ne.ZP.isSupported()){var Pe=new ne.ZP;Pe.loadSource(ke.src),Pe.attachMedia(ke)}}})};(0,F.useEffect)(()=>{if(Fe.current&&Ot&&Ot.match(ue)&&window.PR.prettyPrint(),Fe.current)return Fe.current.addEventListener("click",R),()=>{var j;(j=Fe.current)==null||j.removeEventListener("click",R),(0,Ze.AL)(),(0,Ze.Iy)()}},[Ot,Fe.current,R]),(0,F.useEffect)(()=>{var j;const W=ke=>{ke.preventDefault(),ke.clipboardData.setData("text",window.getSelection().toString())};return(j=Fe.current)==null||j.addEventListener("copy",W),()=>{var ke;(ke=Fe.current)==null||ke.removeEventListener("copy",W)}},[Fe.current]);const ee=j=>/<style[\s\S]*?>/i.test(j||"");return F.createElement(F.Fragment,null,Oe&&F.createElement("div",{ref:Fe},Ot),!Oe&&!ee(Ot)&&F.createElement("div",{ref:Fe,style:M({},Q),className:`${$e||""} ${ae?"disabled-fill":""} markdown-body ${Ct.current}`,dangerouslySetInnerHTML:{__html:Ot}}),!Oe&&ee(Ot)&&F.createElement(k,{html:Ot}),F.createElement(he.Z,{close:!0,data:Xe,type:Xe!=null&&Xe.length?gt:"",style:M({},G),onClose:()=>tt("")}))}},23954:function($t,dt,ie){"use strict";ie.d(dt,{SV:function(){return Fe},ZP:function(){return Ne}});var F=ie(59301),Le=ie(76374);const Ze={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"]},ge={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"]},ne={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(`
|
|
`)}]},v={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(`
|
|
`)}]},we={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 fe=ie(53184),u=ie.n(fe),he=Object.defineProperty,$=Object.defineProperties,b=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,K=(R,V,ee)=>V in R?he(R,V,{enumerable:!0,configurable:!0,writable:!0,value:ee}):R[V]=ee,Z=(R,V)=>{for(var ee in V||(V={}))A.call(V,ee)&&K(R,ee,V[ee]);if(k)for(var ee of k(V))C.call(V,ee)&&K(R,ee,V[ee]);return R},U=(R,V)=>$(R,b(V)),M=(R,V,ee)=>new Promise((j,W)=>{var ke=Ce=>{try{Be(ee.next(Ce))}catch(De){W(De)}},Pe=Ce=>{try{Be(ee.throw(Ce))}catch(De){W(De)}},Be=Ce=>Ce.done?j(Ce.value):Promise.resolve(Ce.value).then(ke,Pe);Be((ee=ee.apply(R,V)).next())});const J={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"]}},de=(R,V)=>V.map(ee=>({label:ee,kind:R.languages.CompletionItemKind.Keyword,insertText:ee})),ue=R=>Object.keys(J.tables).map(V=>({label:V,kind:R.languages.CompletionItemKind.Variable,insertText:V})),be=(R,V)=>{const ee=J.tables[R];return ee?ee.map(j=>({label:j,kind:V.languages.CompletionItemKind.Field,insertText:j})):[]};function Ie(R,V,ee,j,W){let ke=V.getWordUntilPosition(ee),Pe={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Be=j.map(Ce=>({label:Ce,kind:R.languages.CompletionItemKind.Keyword,insertText:Ce,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}));return W.map(Ce=>{Be.push(U(Z({},Ce),{range:Pe}))}),Be}var ye=R=>{J.languages.map(W=>(R.languages.registerDocumentFormattingEditProvider(W,{provideDocumentFormattingEdits(ke,Pe,Be){return M(this,null,function*(){const Ce=u()(ke.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:ke.getFullModelRange(),text:Ce}]})}}),W));const V=ne.quickKey.map(W=>({label:W.label,kind:R.languages.CompletionItemKind.Method,insertText:W.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet})),ee=v.quickKey.map(W=>({label:W.label,kind:R.languages.CompletionItemKind.Method,insertText:W.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet})),j=ge.quickKey.map(W=>({label:W.label,kind:R.languages.CompletionItemKind.Method,insertText:W.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}));R.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(W,ke){var Pe=W.getWordUntilPosition(ke),Be={startLineNumber:ke.lineNumber,endLineNumber:ke.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Ce=W.getLineContent(ke.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[...ne.keywords.map(De=>({label:De,kind:R.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be})),...ne.quickKey.map(De=>({label:De.label,kind:R.languages.CompletionItemKind.Function,documentation:De.content,insertText:Ce.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be}))]}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(W,ke){var Pe=W.getWordUntilPosition(ke),Be={startLineNumber:ke.lineNumber,endLineNumber:ke.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn};return{suggestions:[...Ze.keywords.map(Ce=>({label:Ce,kind:R.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be}))]}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(W,ke){var Pe=W.getWordUntilPosition(ke),Be={startLineNumber:ke.lineNumber,endLineNumber:ke.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Ce=W.getLineContent(ke.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[...ge.keywords.map(De=>({label:De,kind:R.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be})),...ge.quickKey.map(De=>({label:De.label,kind:R.languages.CompletionItemKind.Function,documentation:De.content,insertText:Ce.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be}))]}}}),R.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(W,ke){var Pe=W.getWordUntilPosition(ke),Be={startLineNumber:ke.lineNumber,endLineNumber:ke.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Ce=W.getLineContent(ke.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[...we.keywords.map(De=>({label:De,kind:R.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be})),...we.quickKey.map(De=>({label:De.label,kind:R.languages.CompletionItemKind.Function,documentation:De.content,insertText:Ce.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be}))]}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(W,ke){var Pe=W.getWordUntilPosition(ke),Be={startLineNumber:ke.lineNumber,endLineNumber:ke.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},Ce=W.getLineContent(ke.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[...v.keywords.map(De=>({label:De,kind:R.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be})),...v.quickKey.map(De=>({label:De.label,kind:R.languages.CompletionItemKind.Function,documentation:De.content,insertText:Ce.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be}))]}}})};const xe="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var $e=Object.defineProperty,Oe=(R,V,ee)=>V in R?$e(R,V,{enumerable:!0,configurable:!0,writable:!0,value:ee}):R[V]=ee,He=(R,V,ee)=>Oe(R,typeof V!="symbol"?V+"":V,ee);const Q=class Yl{constructor(V,ee,j){this.placeholder=V,this.editor=ee,this.monaco=j,ee.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Yl.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};He(Q,"ID","editor.widget.placeholderHint");var Y=Q,te=ie(96236),ve=ie(8591),ae=ie(6848),S=ie(89392),E=ie(34604),z=ie(56102),ce=Object.defineProperty,qe=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,ht=(R,V,ee)=>V in R?ce(R,V,{enumerable:!0,configurable:!0,writable:!0,value:ee}):R[V]=ee,at=(R,V)=>{for(var ee in V||(V={}))gt.call(V,ee)&&ht(R,ee,V[ee]);if(tt)for(var ee of tt(V))Rt.call(V,ee)&&ht(R,ee,V[ee]);return R},Ct=(R,V)=>qe(R,Xe(V)),Vt=(R,V)=>{var ee={};for(var j in R)gt.call(R,j)&&V.indexOf(j)<0&&(ee[j]=R[j]);if(R!=null&&tt)for(var j of tt(R))V.indexOf(j)<0&&Rt.call(R,j)&&(ee[j]=R[j]);return ee},St=(R,V,ee)=>new Promise((j,W)=>{var ke=Ce=>{try{Be(ee.next(Ce))}catch(De){W(De)}},Pe=Ce=>{try{Be(ee.throw(Ce))}catch(De){W(De)}},Be=Ce=>Ce.done?j(Ce.value):Promise.resolve(Ce.value).then(ke,Pe);Be((ee=ee.apply(R,V)).next())});function Wt(R){return/^\d+$/.test(R)?`${R}px`:R}function Nt(){}let Ot=!1;const ze={"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 Ke(R=[]){let V=R;if(Array.isArray(R)){for(let ee=0;ee<R.length;ee++){let j=ze[R[ee]];if(j)return j}return V[0]}return ze[V]||V}let se=null;var Ne=R=>{var V=R,{width:ee="100%",height:j="100%",value:W,language:ke="javascript",style:Pe={},options:Be={},overrideServices:Ce={},theme:De="vs-dark",onEditBlur:Ye,isCopy:Ve=!1,onSave:it,autoHeight:ut=!1,forbidCopy:bt=!1,onChange:pt=Nt,editorDidMount:mt=Nt,onFocus:ct=Nt,onBreakPoint:_=Nt,breakPointValue:y=[],filename:Ge="educoder.txt",errorLine:O,errorContent:re="",highlightLine:Et,openBreakPoint:Ee=!1,placeholder:Ae=""}=V,je=Vt(V,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder"]);const B=(0,F.useRef)(),q=(0,F.useRef)({}),oe=(0,F.useRef)(),Te=(0,F.useRef)(),P=(0,F.useRef)([]),vt=(0,F.useRef)(!1),me=(0,F.useRef)(),Dt=(0,F.useRef)(),Mt=(0,F.useRef)(!1),[zt,Ar]=(0,F.useState)(!1);function Qt(){let Ut;return B.current&&(Ut=new Le.Z(Ft=>{for(let sr of Ft)(sr.target.offsetHeight>0||sr.target.offsetWidth>0)&&q.current.instance.layout()}),Ut.observe(B.current)),Ut}function Bt(){ve.ZP.warning({content:decodeURIComponent(xe),key:"monaco-editor-tip"})}const Sr=()=>{let Ut=q.current.instance;if(W!=null&&Ut&&zt){const Ft=Ut.getModel();Ft&&W!==Ft.getValue()&&(Ot=!0,Ft.setValue(W),Ut.layout(),Ot=!1)}};(0,F.useEffect)(()=>{const Ut=E.Z.subscribe("formatDocument",Ft=>{var sr;let Pr=q.current.instance;(sr=Pr==null?void 0:Pr.getAction)==null||sr.call(Pr,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ft=>{pt(Ft)},Ut},[]),(0,F.useEffect)(()=>{var Ut;let Ft=q.current.instance;Te.current&&clearTimeout(Te.current),Te.current=setTimeout(()=>{Sr()},500),W&&(W!=null&&W.length)&&((Ut=Ft==null?void 0:Ft.updateOptions)==null||Ut.call(Ft,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(W.split(/\r\n|\r|\n/g).length))+3,5)}))},[W,zt,q.current]),(0,F.useEffect)(()=>{if(O&&q.current&&q.current.instance){let Ft=q.current.instance;Ft.changeViewZones(function(sr){var Pr=document.createElement("div");Pr.style.padding="10px 20px",Pr.style.width="calc(100% - 20px)",Pr.className="my-error-line-wrp",Pr.innerHTML=re,sr.addZone({afterLineNumber:O||11,heightInLines:3,domNode:Pr})});var Ut={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}};Ft.addOverlayWidget(Ut),Ft.revealPositionInCenter({lineNumber:20,column:1})}},[O,q.current,zt]);const Tr=(Ut="",Ft)=>{if(!Ut||Ut.trim()==="")return!0;const Pr=q.current.instance.getModel().getLineTokens(Ft);let Er=!1;for(let fr=0;fr<2;fr++)Pr.getStandardTokenType(fr)===1&&(Er=!0);return Er};(0,F.useEffect)(()=>{var Ut;const Ft=(Ut=q.current)==null?void 0:Ut.instance;if(Ft&&zt&&bt){const sr=Ft.onDidBlurEditorWidget(()=>{Mt.current=!1}),Pr=Ft.onDidFocusEditorText(()=>{Mt.current=!0});return()=>{sr.dispose(),Pr.dispose()}}},[q.current,zt,bt]),(0,F.useEffect)(()=>{var Ut;if((Ut=q.current)!=null&&Ut.instance&&zt&&Ee){let Ft=q.current.instance,sr=Ft.getModel();if(!sr)return;(()=>{var hr;let lr=[],Mr=[];const zr=sr.getAllDecorations();for(let mn of zr)mn.options.className==="highlighted-line"&&(lr.push((hr=mn==null?void 0:mn.range)==null?void 0:hr.startLineNumber),Mr.push(mn==null?void 0:mn.id));if(Et===lr[0])return;sr.deltaDecorations(Mr,[]);const Dr=sr.getLineCount();Et&&Et<=Dr&&(Ft.deltaDecorations([],[{range:new se.Range(Et,1,Et,sr.getLineMaxColumn(Et)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ft.revealLineInCenter(Et))})();const Er=(hr=!1)=>{var lr;let Mr=[],zr=[];const Dr=sr.getAllDecorations();for(let mn of Dr)mn.options.linesDecorationsClassName==="breakpoints-select"&&(Mr.push((lr=mn==null?void 0:mn.range)==null?void 0:lr.startLineNumber),zr.push(mn==null?void 0:mn.id));if(hr)return{lines:Mr,ids:zr};_(Mr)},fr=hr=>St(void 0,null,function*(){let lr={range:new se.Range(hr,1,hr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield sr.deltaDecorations([],[lr]),Er()}),On=hr=>St(void 0,null,function*(){let lr=[];const Mr=Ft.getLineDecorations(hr);for(let zr of Mr)zr.options.linesDecorationsClassName==="breakpoints-select"&&lr.push(zr.id);yield sr.deltaDecorations(lr,[]),Er()}),Or=hr=>{let lr=Ft.getLineDecorations(hr);for(let Mr of lr)if(Mr.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,S.isEqual)(y,Er(!0).lines)){sr.deltaDecorations(Er(!0).ids,[]);const hr=y.map(lr=>({range:new se.Range(lr,1,lr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));sr.deltaDecorations([],hr)}const Rr=Ft.onDidChangeModelContent(hr=>{let lr=Ft.getPosition();if(lr){let Mr=lr.lineNumber;clearTimeout(Dt.current),Dt.current=setTimeout(()=>{Tr(sr.getLineContent(Mr),Mr)?On(Mr):Or(Mr)?(On(Mr),fr(Mr)):Er()},100)}}),Hr=Ft.onMouseDown(hr=>{var lr,Mr,zr;if(hr.target.detail&&((zr=(Mr=(lr=hr.target)==null?void 0:lr.element)==null?void 0:Mr.className)!=null&&zr.includes("line-numbers"))){let Dr=hr.target.position.lineNumber;if(Tr(sr.getLineContent(Dr),Dr))return;Or(Dr)?On(Dr):fr(Dr)}}),vr=hr=>{let lr={range:new se.Range(hr,1,hr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};P.current=Ft.deltaDecorations(P.current,[lr])},Xr=()=>{P.current=Ft.deltaDecorations(P.current,[])},an=Ft.onMouseMove(hr=>{var lr,Mr,zr;if(Xr(),hr.target.detail&&((zr=(Mr=(lr=hr.target)==null?void 0:lr.element)==null?void 0:Mr.className)!=null&&zr.includes("line-numbers"))){let Dr=hr.target.position.lineNumber;if(Tr(sr.getLineContent(Dr),Dr))return;vr(Dr)}}),on=Ft.onMouseLeave(()=>{Xr()});return()=>{Rr.dispose(),Hr.dispose(),an.dispose(),on.dispose()}}},[q.current,zt,y,Et,Ee,ke]),(0,F.useEffect)(()=>{var Ut;(Ut=q.current)!=null&&Ut.instance&&Ee&&q.current.instance.setPosition({lineNumber:0,column:0})},[Et]);function Yr(){let Ut=q.current.instance;if(Ut){const Ft=Ut.getSelection(),sr=q.current.pastePos||{},Pr=new se.Range(sr.startLineNumber||Ft.endLineNumber,sr.startColumn||Ft.endColumn,sr.endLineNumber||Ft.endLineNumber,sr.endColumn||Ft.endColumn);setTimeout(()=>{Ut.executeEdits("",[{range:Pr,text:""}])},300)}}function qr(Ut){(window.navigator.platform.match("Mac")?Ut.metaKey:Ut.ctrlKey)&&Ut.keyCode==83&&(Ut.preventDefault(),it())}const It=()=>{if(ut&&q.current.instance){const Ut=q.current.instance.getContentHeight();xn(Ut<j?j:Ut)}else xn(j)};function Jt(Ut){var Ft=document.createEvent("MouseEvents");Ft.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ut.dispatchEvent(Ft)}const mr=Ut=>{if(!Mt.current)return;const{keyCode:Ft,ctrlKey:sr,metaKey:Pr,target:Er,type:fr}=Ut;return(fr==="paste"||(Ft===67||Ft===86)&&(Pr||sr))&&Er.nodeName==="TEXTAREA"&&(Bt(),Ut.preventDefault()),!1};function Zr(Ut,Ft){var sr=window.URL||window.webkitURL||window,Pr=new Blob([Ft]),Er=document.createElementNS("http://www.w3.org/1999/xhtml","a");Er.href=sr.createObjectURL(Pr),Er.download=Ut,Jt(Er)}(0,F.useEffect)(()=>{It()},[It]),(0,F.useEffect)(()=>{B.current&&!zt&&Promise.all([ie.e(8909),ie.e(3267)]).then(ie.bind(ie,71448)).then(Ut=>{try{se=Ut,q.current.instance=se.editor.create(B.current,{value:W,language:Ke(ke),theme:De,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ce);const Ft=q.current.instance;let Er=[...te.BH._menuItems].find(Rr=>Rr[0]._debugName=="EditorContext")[1],fr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],On=(Rr,Hr)=>{var vr,Xr;let an=Rr._first;do Hr.includes((Xr=(vr=an.element)==null?void 0:vr.command)==null?void 0:Xr.id)&&Rr._remove(an);while(an=an.next)};if(mt(Ft,se),setTimeout(()=>{It(),q.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Zr(Ge||"educoder.txt",Ft.getValue())}})},500),q.current.subscription=Ft.onDidChangeModelContent(Rr=>{vt.current?clearTimeout(me.current):(It(),pt(Ft.getValue(),Rr)),me.current=setTimeout(()=>{vt.current=!1},500)}),window.Monaco||ye(se,Ke(ke)),bt&&(On(Er,fr),B.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",mr),window.removeEventListener("paste",mr),window.addEventListener("keydown",mr),window.addEventListener("paste",mr)),window.Monaco=se,Ye&&Ft.onDidBlurEditorWidget(()=>{Ye(Ft.getValue())}),ct&&Ft.onDidFocusEditorText(()=>{ct(Ft.getValue())}),bt)try{Ft.onDidPaste(Rr=>{const Hr=Ft.getSelection(),vr=q.current.pastePos||{},Xr=new se.Range(vr.startLineNumber||Hr.endLineNumber,vr.startColumn||Hr.endColumn,vr.endLineNumber||Hr.endLineNumber,vr.endColumn||Hr.endColumn);Ft.executeEdits("",[{range:Rr.range,text:""}])})}catch(Rr){}let Or=Qt();return Ae&&typeof Ae=="string"&&new Y(Ae,Ft,se),Ar(!0),()=>{const Rr=q.current.instance;Rr.dispose();const Hr=Rr.getModel();Hr&&Hr.dispose(),q.current.subscription&&q.current.subscription.dispose(),Or.unobserve(B.current)}}catch(Ft){}})},[]),(0,F.useEffect)(()=>{if(q.current.instance&&zt)return document.addEventListener("keydown",qr,!1),()=>{document.removeEventListener("keydown",qr)}},[it,zt]),(0,F.useEffect)(()=>{let Ut=q.current.instance;if(Ut&&zt){let Ft=Ke(ke);se.editor.setModelLanguage(Ut.getModel(),Ft)}},[ke,zt]),(0,F.useEffect)(()=>{q.current.instance&&zt&&se.editor.setTheme(De)},[De,zt]),(0,F.useEffect)(()=>{let Ut=q.current.instance;oe.current=Be,Ut&&zt&&(Ut.updateOptions(at({},Be)),setTimeout(()=>{Ut.getModel().updateOptions(at({},Be))},200))},[JSON.stringify(Be),zt]),(0,F.useEffect)(()=>{let Ut=q.current.instance;Ut&&zt&&Ut.layout()},[ee,j,zt]);const[Lr,_n]=(0,F.useState)(Wt(ee)),[_r,xn]=(0,F.useState)(Wt(j)),cn=Ct(at({},Pe),{width:Lr,height:_r,position:"relative"});return F.createElement("div",{className:"my-monaco-editor",ref:B,style:cn},Ve&&F.createElement(z.CopyToClipboard,{text:W,onCopy:()=>ve.ZP.success("\u590D\u5236\u6210\u529F")},F.createElement(ae.Z,{title:"\u590D\u5236\u4EE3\u7801"},F.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},F.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Fe({width:R="100%",height:V="100%",original:ee,modified:j,language:W,options:ke={}}){const Pe=(0,F.useRef)(),[Be,Ce]=(0,F.useState)(null);function De(ut){let bt;return Pe.current&&(bt=new Le.Z(pt=>{for(let mt of pt)(mt.target.offsetHeight>0||mt.target.offsetWidth>0)&&ut.layout()}),bt.observe(Pe.current)),bt}(0,F.useEffect)(()=>(Pe.current&&Promise.all([ie.e(8909),ie.e(9404)]).then(ie.bind(ie,2550)).then(ut=>{se=ut;const bt=se.editor.createDiffEditor(Pe.current,Ct(at({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},ke),{wordWrap:!0}));Ce(bt);let pt=De(bt);return()=>{bt.dispose();const mt=bt.getModel();mt&&mt.dispose(),pt.unobserve(Pe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,F.useEffect)(()=>{Be&&Be.setModel({original:se.editor.createModel(ee,W),modified:se.editor.createModel(j,W)})},[ee,j,W,Be]);const Ye=Wt(R),Ve=Wt(V),it={width:Ye,height:Ve};return F.createElement("div",{className:"my-diff-editor",ref:Pe,style:it})}},57528:function($t,dt,ie){"use strict";ie.r(dt),ie.d(dt,{default:function(){return V}});var F=ie(59301),Le=ie(53660),Ze=ie.n(Le),ge=ie(89070),ne={box:"box___JDRma",question_buuton:"question_buuton___tVuIm",selectQuestion:"selectQuestion___xdvxF",addQuestion:"addQuestion___FQqbC",submit_button:"submit_button___NUmmN"},v=ie(8591),we=ie(71418),fe=ie(24905),u=ie(3113),he=ie(89392),$={modalContent:"modalContent___hC3en",modalContentLeft:"modalContentLeft___v0x0I",green:"green___pAmUz",textArea:"textArea___ucgCJ",red:"red___eb0mt",row:"row___td54s",html:"html___F0iOy",line:"line___I6TCQ",submit_button:"submit_button___JCIit"},b=ie(85149),k=Object.defineProperty,A=Object.defineProperties,C=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,M=(ee,j,W)=>j in ee?k(ee,j,{enumerable:!0,configurable:!0,writable:!0,value:W}):ee[j]=W,J=(ee,j)=>{for(var W in j||(j={}))Z.call(j,W)&&M(ee,W,j[W]);if(K)for(var W of K(j))U.call(j,W)&&M(ee,W,j[W]);return ee},de=(ee,j)=>A(ee,C(j)),ue=(ee,j,W)=>new Promise((ke,Pe)=>{var Be=Ye=>{try{De(W.next(Ye))}catch(Ve){Pe(Ve)}},Ce=Ye=>{try{De(W.throw(Ye))}catch(Ve){Pe(Ve)}},De=Ye=>Ye.done?ke(Ye.value):Promise.resolve(Ye.value).then(Be,Ce);De((W=W.apply(ee,j)).next())});const be=({problemset:ee,dispatch:j,question:W,disabled:ke,onSubmit:Pe})=>{const[Be,Ce]=(0,F.useState)({}),[De,Ye]=(0,F.useState)([]),[Ve,it]=(0,F.useState)(!1),ut=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,F.useEffect)(()=>{const ct=(0,he.cloneDeep)(W);Ce(ct),Ye(ct.choices),it(!1)},[W]);const bt=()=>ue(void 0,null,function*(){var ct;if(!De.some(Ge=>Ge==null?void 0:Ge.checked)){v.ZP.warning("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4");return}const _=(ct=De==null?void 0:De.filter(Ge=>Ge==null?void 0:Ge.checked))==null?void 0:ct.map(Ge=>Ge==null?void 0:Ge.choice_id);if(yield Pe(W==null?void 0:W.smart_plan_item_bank_id,_)){if(Ve){const Ge=(0,he.cloneDeep)(W);Ye(Ge.choices)}it(!Ve)}}),pt=(ct,_)=>{console.log(ct.target.checked);const y=De.map((Ge,O)=>de(J({},Ge),{checked:O===_?ct.target.checked:Ge.checked}));Ye(y)},mt=(ct=!1)=>{let _="";return De.forEach((y,Ge)=>{ct?y!=null&&y.me_answered&&(_=_+ut[Ge]):y!=null&&y.is_answer&&(_=_+ut[Ge])}),_};return F.createElement("div",null,F.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),F.createElement(b.Z,{value:Be==null?void 0:Be.name}),De==null?void 0:De.map((ct,_)=>{const{is_answer:y,checked:Ge,choice_text:O,me_answered:re}=ct;let Et="";return(Ve||W!=null&&W.is_answered)&&y&&(Et=$.green),(Ve||W!=null&&W.is_answered)&&!y&&(Ge||re)&&(Et=$.red),F.createElement("div",{key:_,style:{pointerEvents:Ve?"none":"auto"},className:`${$.row} ${Et}`},F.createElement(fe.default,{disabled:ke||(W==null?void 0:W.is_answered),style:{padding:3},onChange:Ee=>pt(Ee,_),checked:Ge||(ct==null?void 0:ct.me_answered)}),F.createElement("span",null,ut[_],".\xA0"),F.createElement(b.Z,{className:$.html,value:O}),(Ve||(W==null?void 0:W.is_answered))&&y&&F.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),(Ve||(W==null?void 0:W.is_answered))&&!y&&(Ge||re)&&F.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),(Ve||(W==null?void 0:W.is_answered))&&F.createElement(F.Fragment,null,F.createElement("div",{className:$.line}),F.createElement("div",{className:"c-grey-333 mb5"},F.createElement("b",null,"\u6211\u7684\u7B54\u6848:\xA0"),mt(!0)),F.createElement("div",{className:"c-grey-333 mb5"},F.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),mt()),F.createElement("div",{className:"c-grey-333 mb10"},F.createElement("b",null,"\u89E3\u6790:\xA0"),(Be==null?void 0:Be.analysis)||"\u6682\u65E0\u89E3\u6790")),!Ve&&!ke&&!(W!=null&&W.is_answered)&&F.createElement("div",{className:"flex justify-center"},F.createElement(u.ZP,{className:$.submit_button,type:"primary",onClick:()=>{bt()}},"\u63D0\u4EA4")))};var Ie=(0,ge.connect)(({problemset:ee})=>({problemset:ee}))(be),ye=ie(5112),xe=ie(59301),$e=Object.defineProperty,Oe=Object.defineProperties,He=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,te=(ee,j,W)=>j in ee?$e(ee,j,{enumerable:!0,configurable:!0,writable:!0,value:W}):ee[j]=W,ve=(ee,j)=>{for(var W in j||(j={}))G.call(j,W)&&te(ee,W,j[W]);if(Q)for(var W of Q(j))Y.call(j,W)&&te(ee,W,j[W]);return ee},ae=(ee,j)=>Oe(ee,He(j)),S=(ee,j,W)=>new Promise((ke,Pe)=>{var Be=Ye=>{try{De(W.next(Ye))}catch(Ve){Pe(Ve)}},Ce=Ye=>{try{De(W.throw(Ye))}catch(Ve){Pe(Ve)}},De=Ye=>Ye.done?ke(Ye.value):Promise.resolve(Ye.value).then(Be,Ce);De((W=W.apply(ee,j)).next())});const E=({problemset:ee,dispatch:j,question:W,disabled:ke,onSubmit:Pe})=>{const[Be,Ce]=(0,F.useState)({}),[De,Ye]=(0,F.useState)([]),[Ve,it]=(0,F.useState)(!1),[ut]=(0,ge.useSearchParams)(),bt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,F.useEffect)(()=>{const ct=(0,he.cloneDeep)(W);Ce(ct),Ye(ct.choices),it(!1)},[W]);const pt=()=>S(void 0,null,function*(){var ct;if(!De.some(y=>y==null?void 0:y.checked)){v.ZP.warning("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4");return}if(yield Pe(W==null?void 0:W.smart_plan_item_bank_id,(ct=De.find(y=>y.checked))==null?void 0:ct.choice_id)){if(Ve){const y=(0,he.cloneDeep)(W);Ye(y.choices)}it(!Ve)}}),mt=(ct,_)=>{const y=De.map((Ge,O)=>ae(ve({},Ge),{checked:O===_?ct.target.checked:!1}));Ye(y)};return xe.createElement("div",null,xe.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),xe.createElement(b.Z,{value:Be==null?void 0:Be.name}),De==null?void 0:De.map((ct,_)=>{const{is_answer:y,checked:Ge,choice_text:O,me_answered:re}=ct;let Et="";return(Ve||W!=null&&W.is_answered)&&y&&(Et=$.green),(Ve||W!=null&&W.is_answered)&&!y&&(Ge||re)&&(Et=$.red),xe.createElement("div",{key:_,style:{pointerEvents:Ve?"none":"auto"},className:`${$.row} ${Et}`},xe.createElement(ye.ZP,{disabled:ke||(W==null?void 0:W.is_answered),onChange:Ee=>mt(Ee,_),checked:Ge||(ct==null?void 0:ct.me_answered)}),xe.createElement("span",null,bt[_],".\xA0"),xe.createElement(b.Z,{className:$.html,value:O}),(Ve||(W==null?void 0:W.is_answered))&&y&&xe.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),(Ve||(W==null?void 0:W.is_answered))&&!y&&(Ge||re)&&xe.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),(Ve||(W==null?void 0:W.is_answered))&&xe.createElement(F.Fragment,null,xe.createElement("div",{className:$.line}),xe.createElement("div",{className:"c-grey-333 mb5"},xe.createElement("b",null,"\u6211\u7684\u7B54\u6848:\xA0"),bt[De.findIndex(ct=>ct==null?void 0:ct.me_answered)]),xe.createElement("div",{className:"c-grey-333 mb5"},xe.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),bt[De.findIndex(ct=>ct==null?void 0:ct.is_answer)]),xe.createElement("div",{className:"c-grey-333 mb10"},xe.createElement("b",null,"\u89E3\u6790:\xA0"),(Be==null?void 0:Be.analysis)||"\u6682\u65E0\u89E3\u6790")),!ke&&(!Ve||!(W!=null&&W.is_answered))&&xe.createElement("div",{className:"flex justify-center"},xe.createElement(u.ZP,{className:$.submit_button,type:"primary",onClick:()=>{pt()}},"\u63D0\u4EA4")))};var z=(0,ge.connect)(({problemset:ee})=>({problemset:ee}))(E),ce=Object.defineProperty,qe=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,ht=(ee,j,W)=>j in ee?ce(ee,j,{enumerable:!0,configurable:!0,writable:!0,value:W}):ee[j]=W,at=(ee,j)=>{for(var W in j||(j={}))gt.call(j,W)&&ht(ee,W,j[W]);if(tt)for(var W of tt(j))Rt.call(j,W)&&ht(ee,W,j[W]);return ee},Ct=(ee,j)=>qe(ee,Xe(j)),Vt=(ee,j,W)=>new Promise((ke,Pe)=>{var Be=Ye=>{try{De(W.next(Ye))}catch(Ve){Pe(Ve)}},Ce=Ye=>{try{De(W.throw(Ye))}catch(Ve){Pe(Ve)}},De=Ye=>Ye.done?ke(Ye.value):Promise.resolve(Ye.value).then(Be,Ce);De((W=W.apply(ee,j)).next())});const St=({problemset:ee,dispatch:j,question:W,disabled:ke,onSubmit:Pe})=>{var Be,Ce;const[De,Ye]=(0,F.useState)({}),[Ve,it]=(0,F.useState)([]),[ut,bt]=(0,F.useState)(!1),pt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,F.useEffect)(()=>{const _=(0,he.cloneDeep)(W);Ye(_),it(_.choices),bt(!1)},[W]);const mt=()=>Vt(void 0,null,function*(){var _;if(!Ve.some(Ge=>Ge==null?void 0:Ge.checked)){v.ZP.warning("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4");return}if(yield Pe(W==null?void 0:W.smart_plan_item_bank_id,(_=Ve.find(Ge=>Ge.checked))==null?void 0:_.choice_id)){if(ut){const Ge=(0,he.cloneDeep)(W);it(Ge.choices)}bt(!ut)}}),ct=(_,y)=>{console.log(_.target.checked);const Ge=Ve.map((O,re)=>Ct(at({},O),{checked:re===y?_.target.checked:!1}));it(Ge)};return F.createElement("div",null,F.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),F.createElement(b.Z,{value:De==null?void 0:De.name}),Ve==null?void 0:Ve.map((_,y)=>{const{is_answer:Ge,checked:O,choice_text:re,me_answered:Et}=_;let Ee="";return(ut||W!=null&&W.is_answered)&&Ge&&(Ee=$.green),(ut||W!=null&&W.is_answered)&&!Ge&&(O||Et)&&(Ee=$.red),F.createElement("div",{key:y,style:{pointerEvents:ut?"none":"auto"},className:`${$.row} ${Ee}`},F.createElement(ye.ZP,{disabled:ke||(W==null?void 0:W.is_answered),onChange:Ae=>ct(Ae,y),checked:O||(_==null?void 0:_.me_answered)}),F.createElement(b.Z,{className:$.html,value:re}),(ut||(W==null?void 0:W.is_answered))&&Ge&&F.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),(ut||(W==null?void 0:W.is_answered))&&!Ge&&(O||Et)&&F.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),(ut||(W==null?void 0:W.is_answered))&&F.createElement(F.Fragment,null,F.createElement("div",{className:$.line}),F.createElement("div",{className:"c-grey-333 mb5"},F.createElement("b",null,"\u6211\u7684\u7B54\u6848:\xA0"),(Be=Ve.find(_=>_==null?void 0:_.me_answered))==null?void 0:Be.choice_text),F.createElement("div",{className:"c-grey-333 mb5"},F.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(Ce=Ve.find(_=>_==null?void 0:_.is_answer))==null?void 0:Ce.choice_text),F.createElement("div",{className:"c-grey-333 mb10"},F.createElement("b",null,"\u89E3\u6790:\xA0"),(De==null?void 0:De.analysis)||"\u6682\u65E0\u89E3\u6790")),!ut&&!ke&&!(W!=null&&W.is_answered)&&F.createElement("div",{className:"flex justify-center"},F.createElement(u.ZP,{className:$.submit_button,type:"primary",onClick:()=>{mt()}},"\u63D0\u4EA4")))};var Wt=(0,ge.connect)(({problemset:ee})=>({problemset:ee}))(St),Nt=ie(99064),Ot=ie(59301),ze=(ee,j,W)=>new Promise((ke,Pe)=>{var Be=Ye=>{try{De(W.next(Ye))}catch(Ve){Pe(Ve)}},Ce=Ye=>{try{De(W.throw(Ye))}catch(Ve){Pe(Ve)}},De=Ye=>Ye.done?ke(Ye.value):Promise.resolve(Ye.value).then(Be,Ce);De((W=W.apply(ee,j)).next())});const Ke=({user:ee,officeToken:j,globalSetting:W,loading:ke,problemset:Pe,dispatch:Be,pageCache:Ce,pageNum:De})=>{var Ye,Ve,it;const[ut,bt]=(0,F.useState)([]),[pt]=(0,ge.useSearchParams)(),[mt,ct]=(0,F.useState)(0),[_,y]=(0,F.useState)(!1),[Ge,O]=(0,F.useState)(!(Ce!=null&&Ce.allow_answer&&!(Ce!=null&&Ce.is_end)&&(j==null?void 0:j.Status)!=="ended"));(0,F.useEffect)(()=>{O(!(Ce!=null&&Ce.allow_answer&&!(Ce!=null&&Ce.is_end)&&(j==null?void 0:j.Status)!=="ended"))},[Ce==null?void 0:Ce.allow_answer,!(Ce!=null&&Ce.is_end),(j==null?void 0:j.Status)!=="ended"]),(0,F.useEffect)(()=>{(De||Ce!=null&&Ce.page)&&re()},[De,Ce==null?void 0:Ce.page,Ce==null?void 0:Ce.allow_answer,Ce==null?void 0:Ce.has_item_bank,Ce==null?void 0:Ce.randomData]);const re=()=>ze(void 0,null,function*(){var Ee;y(!0);let Ae=yield(0,Nt.ZP)(`/api/courses/${pt.get("course_id")}/smart_plans/${pt.get("id")}/item_banks.json`,{method:"get",params:{position:De||(Ce==null?void 0:Ce.page)}});(Ae==null?void 0:Ae.status)==0&&(bt((Ee=Ae==null?void 0:Ae.data)==null?void 0:Ee.item_banks),ct(0)),y(!1)}),Et=(Ee,Ae)=>ze(void 0,null,function*(){const je=yield(0,Nt.ZP)(`/api/smart_plan_item_banks/${Ee}/user_answers.json`,{method:"post",body:{item_choice_id:Ae}});return(je==null?void 0:je.status)===0?(yield re(),v.ZP.success("\u63D0\u4EA4\u6210\u529F"),!0):!1});return Ot.createElement("section",null,Ot.createElement(we.Z,{spinning:_},Ot.createElement("div",{className:ne.box},ut[mt]&&Ot.createElement("div",null,((Ye=ut[mt])==null?void 0:Ye.item_type)==="SINGLE"&&Ot.createElement(z,{question:ut[mt],onSubmit:Et,disabled:Ge}),((Ve=ut[mt])==null?void 0:Ve.item_type)==="MULTIPLE"&&Ot.createElement(Ie,{question:ut[mt],onSubmit:Et,disabled:Ge}),((it=ut[mt])==null?void 0:it.item_type)==="JUDGMENT"&&Ot.createElement(Wt,{question:ut[mt],onSubmit:Et,disabled:Ge})))))};var se=(0,ge.connect)(({user:ee,classroomList:j,loading:W,globalSetting:ke,problemset:Pe})=>({user:ee,classroomList:j,globalSetting:ke,loading:W.effects,problemset:Pe}))(Ke),Ne=ie(955),Fe=(ee,j,W)=>new Promise((ke,Pe)=>{var Be=Ye=>{try{De(W.next(Ye))}catch(Ve){Pe(Ve)}},Ce=Ye=>{try{De(W.throw(Ye))}catch(Ve){Pe(Ve)}},De=Ye=>Ye.done?ke(Ye.value):Promise.resolve(Ye.value).then(Be,Ce);De((W=W.apply(ee,j)).next())});const R=({user:ee,classroomList:j,globalSetting:W,loading:ke,dispatch:Pe})=>{const Be=(0,F.useRef)(),Ce=(0,ge.useParams)(),[De]=(0,ge.useSearchParams)(),[Ye,Ve]=(0,F.useState)(),[it,ut]=(0,F.useState)(),[bt,pt]=(0,F.useState)(),[mt,ct]=(0,F.useState)(""),[_,y]=(0,F.useState)("380rem"),Ge=(0,F.useRef)(it),O=(0,F.useRef)();De.get("educoder_session")&&(0,Ne.d8)("_educoder_session",De.get("educoder_session"),30),(0,F.useEffect)(()=>{Ye!=null&&Ye.WebofficeURL&&je()},[Ye]),(0,F.useEffect)(()=>{if(Ee(),localStorage.userInfo)try{JSON.parse(localStorage.userInfo).real_name!=="\u6E38\u5BA2"&&(O.current=document.createElement("meta"),O.current.name="viewport",O.current.content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",document.head.appendChild(O.current))}catch(oe){}return()=>{document.head.removeChild(O.current)}},[]),(0,F.useEffect)(()=>{if(it!=null&&it.is_end&&!(Ye!=null&&Ye.IsCreator)){let oe=JSON.parse(sessionStorage.getItem("endPPTIds"))||[];oe&&(oe!=null&&oe.includes(De.get("id")))||(v.ZP.info("\u672C\u6B21\u6388\u8BFE\u5DF2\u7ED3\u675F\uFF0C\u611F\u8C22\u60A8\u7684\u53C2\u4E0E\uFF01"),(oe==null?void 0:oe.length)===0?oe=[De.get("id")]:oe.push(De.get("id")),sessionStorage.setItem("endPPTIds",JSON.stringify(oe)))}return()=>{localStorage.removeItem("endPPTIds")}},[it==null?void 0:it.is_end,Ye]),(0,F.useEffect)(()=>{(it==null?void 0:it.is_end)===!1&&(Ye==null?void 0:Ye.Status)=="in_progress"&&re()},[it==null?void 0:it.is_end,Ye]),(0,F.useEffect)(()=>{bt&&Et(bt)},[bt]),(0,F.useEffect)(()=>{Ge.current=it},[it]);const re=()=>Fe(void 0,null,function*(){const oe=yield(0,Nt.ZP)(`/api/courses/${De.get("course_id")}/smart_plans/${De.get("id")}/start_class.json`,{method:"post"})});(0,F.useEffect)(()=>{var oe;((oe=ee==null?void 0:ee.userInfo)==null?void 0:oe.real_name)==="\u6E38\u5BA2"&&Pe({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!1}})},[ee==null?void 0:ee.userInfo]);function Et(oe){return Fe(this,null,function*(){yield Be.current.ready();const Te=Be.current.Application;Te.ActivePresentation.SlideShowWindow.View.GotoSlide(oe),yield(yield Te.ActivePresentation.SlideShowSettings).Run()})}function Ee(){return Fe(this,null,function*(){var oe;const Te=yield(0,Nt.ZP)(`/api/courses/${De.get("course_id")}/smart_plans/${De.get("id")}/get_office_token.json`,{method:"get",params:{is_student:!0}}),P=((oe=Te==null?void 0:Te.data)==null?void 0:oe.FileName)||"";document.title=P,Ve(Te==null?void 0:Te.data),Ae()})}function Ae(){return Fe(this,null,function*(){var oe,Te;try{const P=yield(0,Nt.ZP)(`/api/courses/${De.get("course_id")}/smart_plans/${De.get("id")}/set_page_cache.json`,{method:"post",body:{type:1}});(oe=P==null?void 0:P.data)!=null&&oe.page&&pt((Te=P==null?void 0:P.data)==null?void 0:Te.page),ut(P==null?void 0:P.data)}catch(P){}setTimeout(()=>{var P;((P=Ge.current)==null?void 0:P.is_end)===!1&&Ae()},1e3)})}function je(){return Fe(this,null,function*(){var oe=document.getElementById("weboffice-zone");Be.current=Ze().config({mount:oe,url:Ye.WebofficeURL,refreshToken:B}),Be.current.setToken({token:Ye.AccessToken,timeout:25*60*1e3}),q()})}function B(){return new Promise(function(oe){return Fe(this,null,function*(){const Te=yield(0,Nt.ZP)(`/api/courses/${De.get("course_id")}/smart_plans/${De.get("id")}/refresh_office_token.json`,{method:"get",access_token:Ye==null?void 0:Ye.AccessToken,refresh_token:Ye==null?void 0:Ye.RefreshToken});oe(Te==null?void 0:Te.data)})})}function q(){return Fe(this,null,function*(){yield Be.current.ready();const oe=Be.current.Application;console.log("app:",oe);const vt=yield(yield(yield oe.ActivePresentation).Slides).Count;console.log("count:",vt);const me=yield oe.ActivePresentation.SlideShowWindow.View.Slide.SlideIndex;console.log("curryPage:",me),ct(me);try{oe.Sub.SlideSelectionChanged=Dt=>Fe(this,null,function*(){console.log("\u5207\u6362\u540E\u7684\u9875\u7801\uFF1A",Dt),ct(Dt)})}catch(Dt){console.error("\u4E8B\u4EF6\u7ED1\u5B9A\u51FA\u9519:",Dt)}oe.Sub.SlideShowEnd=()=>Fe(this,null,function*(){y("380rem")}),setTimeout(()=>Fe(this,null,function*(){yield(yield oe.ActivePresentation.SlideShowSettings).Run()}),500)})}return F.createElement("div",null,F.createElement("div",{id:"weboffice-zone",style:{height:_}}),F.createElement(se,{pageCache:it,pageNum:mt,officeToken:Ye}))};var V=(0,ge.connect)(({user:ee,classroomList:j,loading:W,globalSetting:ke})=>({user:ee,classroomList:j,globalSetting:ke,loading:W.effects}))(R)},24768:function($t,dt,ie){"use strict";ie.d(dt,{AL:function(){return de},Iy:function(){return $},Qv:function(){return A},ez:function(){return J},jb:function(){return b}});var F=ie(32834),Le=ie.n(F),Ze=ie(11690),ge=ie.n(Ze);let ne=1;function v(xe,$e){const Oe=xe.match(/^(\s+)(?:```)/);if(Oe===null)return $e;const He=Oe[1];return $e.split(`
|
|
`).map(Q=>{const G=Q.match(/^\s+/);if(G===null)return Q;const[Y]=G;return Y.length>=He.length?Q.slice(He.length):Q}).join(`
|
|
`)}let we=[],fe=["<ul>"];const u=new(Le()).Renderer,he=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function $(){we.length=0,fe=["<ul>"]}const b={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function k(xe,$e,Oe,He){if($e>=xe.length||xe[$e].level<=Oe)return $e;var Q=xe[$e];He.push("<li><a href='#"+ne+Q.anchor+"'>"+Q.text+"</a>"),$e++;var G=[];return $e=k(xe,$e,Q.level,G),G.length>0&&(He.push("<ul>"),G.forEach(function(Y){He.push(Y)}),He.push("</ul>")),He.push("</li>"),$e=k(xe,$e,Oe,He),$e}function A(){return k(we,0,0,fe),fe.push("</ul>"),fe.join("")}const C={heading(xe){const $e=he.exec(xe);if(ne+=1,$e)return{type:"heading",raw:$e[0],depth:$e[1].length,text:$e[2]}},fences(xe){const $e=this.rules.block.fences.exec(xe);if($e){const Oe=$e[0];let He=v(Oe,$e[3]||"");const Q=$e[2]?$e[2].trim():$e[2];if(["latex","katex","math"].indexOf(Q)>=0){const G=U(),Y=He;He=G,M[G]={type:"block",expression:Y}}return{type:"code",raw:Oe,lang:Q,text:He}}}},K=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let Z=0;const U=()=>`__special_katext_id_${Z++}__`;let M={};function J(){return M}function de(){Z=0,M={}}function ue(xe){return xe=xe.replace(K,($e,Oe)=>{const He=U();return M[He]={type:"inline",expression:Oe},He}),xe}const be=u.listitem;u.listitem=function(xe){return be(ue(xe))};const Ie=u.paragraph;u.paragraph=function(xe){return Ie(ue(xe))};const ye=u.tablecell;u.tablecell=function(xe,$e){return ye(ue(xe),$e)},u.code=function(xe,$e,Oe){const He=($e||"").match(/\S*/)[0];return He?["latex","katex","math"].indexOf(He)>=0?`<p class='editormd-tex'>${xe}</p>`:`<pre class="prettyprint linenums"><code class="language-${$e}">${Oe?xe:(0,Ze.escape)(xe,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(Oe?xe:(0,Ze.escape)(xe,!0))+"</code></pre>"},u.heading=function(xe,$e,Oe){let He=this.options.headerPrefix+Oe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return we.push({anchor:He,level:$e,text:xe}),"<h"+$e+' id="'+ne+He+'">'+xe+"</h"+$e+">"},Le().setOptions({silent:!0,gfm:!0,pedantic:!1}),Le().use({tokenizer:C,renderer:u}),dt.ZP=Le()},36785:function($t,dt,ie){"use strict";ie.d(dt,{o2:function(){return ne},yT:function(){return v}});var F=ie(80702),Le=ie(33166);const Ze=Le.i.map(we=>`${we}-inverse`),ge=["success","processing","error","default","warning"];function ne(we){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,F.Z)(Ze),(0,F.Z)(Le.i)).includes(we):Le.i.includes(we)}function v(we){return ge.includes(we)}},79676:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return v}});var F=ie(19447);function Le(we,fe,u,he){if(he===!1)return{adjustX:!1,adjustY:!1};const $=he&&typeof he=="object"?he:{},b={};switch(we){case"top":case"bottom":b.shiftX=fe.dropdownArrowOffset*2+u;break;case"left":case"right":b.shiftY=fe.dropdownArrowOffsetVertical*2+u;break}const k=Object.assign(Object.assign({},b),$);return k.shiftX||(k.adjustX=!0),k.shiftY||(k.adjustY=!0),k}const Ze={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},ge={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},ne=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function v(we){const{arrowWidth:fe,autoAdjustOverflow:u,arrowPointAtCenter:he,offset:$,borderRadius:b,visibleFirst:k}=we,A=fe/2,C={};return Object.keys(Ze).forEach(K=>{const Z=he&&ge[K]||Ze[K],U=Object.assign(Object.assign({},Z),{offset:[0,0]});switch(C[K]=U,ne.has(K)&&(U.autoArrow=!1),K){case"top":case"topLeft":case"topRight":U.offset[1]=-A-$;break;case"bottom":case"bottomLeft":case"bottomRight":U.offset[1]=A+$;break;case"left":case"leftTop":case"leftBottom":U.offset[0]=-A-$;break;case"right":case"rightTop":case"rightBottom":U.offset[0]=A+$;break}const M=(0,F.fS)({contentRadius:b,limitVerticalRadius:!0});if(he)switch(K){case"topLeft":case"bottomLeft":U.offset[0]=-M.dropdownArrowOffset-A;break;case"topRight":case"bottomRight":U.offset[0]=M.dropdownArrowOffset+A;break;case"leftTop":case"rightTop":U.offset[1]=-M.dropdownArrowOffset-A;break;case"leftBottom":case"rightBottom":U.offset[1]=M.dropdownArrowOffset+A;break}U.overflow=Le(K,M,fe,u),k&&(U.htmlRegion="visibleFirst")}),C}},24905:function($t,dt,ie){"use strict";ie.d(dt,{default:function(){return Ie}});var F=ie(92310),Le=ie.n(F),Ze=ie(5630),ge=ie(59301),ne=ie(36355),v=ie(1684),we=ie(32441),u=ge.createContext(null),he=ie(98447),$=ie(14088),b=ie(4572),k=function(ye,xe){var $e={};for(var Oe in ye)Object.prototype.hasOwnProperty.call(ye,Oe)&&xe.indexOf(Oe)<0&&($e[Oe]=ye[Oe]);if(ye!=null&&typeof Object.getOwnPropertySymbols=="function")for(var He=0,Oe=Object.getOwnPropertySymbols(ye);He<Oe.length;He++)xe.indexOf(Oe[He])<0&&Object.prototype.propertyIsEnumerable.call(ye,Oe[He])&&($e[Oe[He]]=ye[Oe[He]]);return $e};const A=(ye,xe)=>{var $e;const{prefixCls:Oe,className:He,rootClassName:Q,children:G,indeterminate:Y=!1,style:te,onMouseEnter:ve,onMouseLeave:ae,skipGroup:S=!1,disabled:E}=ye,z=k(ye,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:ce,direction:qe,checkbox:Xe}=ge.useContext(ne.E_),tt=ge.useContext(u),{isFormItemInput:gt}=ge.useContext(we.aM),Rt=ge.useContext(v.Z),ht=($e=(tt==null?void 0:tt.disabled)||E)!==null&&$e!==void 0?$e:Rt,at=ge.useRef(z.value);ge.useEffect(()=>{tt==null||tt.registerValue(z.value)},[]),ge.useEffect(()=>{if(!S)return z.value!==at.current&&(tt==null||tt.cancelValue(at.current),tt==null||tt.registerValue(z.value),at.current=z.value),()=>tt==null?void 0:tt.cancelValue(z.value)},[z.value]);const Ct=ce("checkbox",Oe),[Vt,St]=(0,he.ZP)(Ct),Wt=Object.assign({},z);tt&&!S&&(Wt.onChange=function(){z.onChange&&z.onChange.apply(z,arguments),tt.toggleOption&&tt.toggleOption({label:G,value:z.value})},Wt.name=tt.name,Wt.checked=tt.value.includes(z.value));const Nt=Le()(`${Ct}-wrapper`,{[`${Ct}-rtl`]:qe==="rtl",[`${Ct}-wrapper-checked`]:Wt.checked,[`${Ct}-wrapper-disabled`]:ht,[`${Ct}-wrapper-in-form-item`]:gt},Xe==null?void 0:Xe.className,He,Q,St),Ot=Le()({[`${Ct}-indeterminate`]:Y},b.A,St),ze=Y?"mixed":void 0;return Vt(ge.createElement($.Z,{component:"Checkbox",disabled:ht},ge.createElement("label",{className:Nt,style:Object.assign(Object.assign({},Xe==null?void 0:Xe.style),te),onMouseEnter:ve,onMouseLeave:ae},ge.createElement(Ze.Z,Object.assign({"aria-checked":ze},Wt,{prefixCls:Ct,className:Ot,disabled:ht,ref:xe})),G!==void 0&&ge.createElement("span",null,G))))};var K=ge.forwardRef(A),Z=ie(80702),U=ie(2738),M=function(ye,xe){var $e={};for(var Oe in ye)Object.prototype.hasOwnProperty.call(ye,Oe)&&xe.indexOf(Oe)<0&&($e[Oe]=ye[Oe]);if(ye!=null&&typeof Object.getOwnPropertySymbols=="function")for(var He=0,Oe=Object.getOwnPropertySymbols(ye);He<Oe.length;He++)xe.indexOf(Oe[He])<0&&Object.prototype.propertyIsEnumerable.call(ye,Oe[He])&&($e[Oe[He]]=ye[Oe[He]]);return $e};const J=(ye,xe)=>{const{defaultValue:$e,children:Oe,options:He=[],prefixCls:Q,className:G,rootClassName:Y,style:te,onChange:ve}=ye,ae=M(ye,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:S,direction:E}=ge.useContext(ne.E_),[z,ce]=ge.useState(ae.value||$e||[]),[qe,Xe]=ge.useState([]);ge.useEffect(()=>{"value"in ae&&ce(ae.value||[])},[ae.value]);const tt=ge.useMemo(()=>He.map(Ke=>typeof Ke=="string"||typeof Ke=="number"?{label:Ke,value:Ke}:Ke),[He]),gt=Ke=>{Xe(se=>se.filter(Ne=>Ne!==Ke))},Rt=Ke=>{Xe(se=>[].concat((0,Z.Z)(se),[Ke]))},ht=Ke=>{const se=z.indexOf(Ke.value),Ne=(0,Z.Z)(z);se===-1?Ne.push(Ke.value):Ne.splice(se,1),"value"in ae||ce(Ne),ve==null||ve(Ne.filter(Fe=>qe.includes(Fe)).sort((Fe,R)=>{const V=tt.findIndex(j=>j.value===Fe),ee=tt.findIndex(j=>j.value===R);return V-ee}))},at=S("checkbox",Q),Ct=`${at}-group`,[Vt,St]=(0,he.ZP)(at),Wt=(0,U.Z)(ae,["value","disabled"]),Nt=He.length?tt.map(Ke=>ge.createElement(K,{prefixCls:at,key:Ke.value.toString(),disabled:"disabled"in Ke?Ke.disabled:ae.disabled,value:Ke.value,checked:z.includes(Ke.value),onChange:Ke.onChange,className:`${Ct}-item`,style:Ke.style,title:Ke.title},Ke.label)):Oe,Ot={toggleOption:ht,value:z,disabled:ae.disabled,name:ae.name,registerValue:Rt,cancelValue:gt},ze=Le()(Ct,{[`${Ct}-rtl`]:E==="rtl"},G,Y,St);return Vt(ge.createElement("div",Object.assign({className:ze,style:te},Wt,{ref:xe}),ge.createElement(u.Provider,{value:Ot},Nt)))},de=ge.forwardRef(J);var ue=ge.memo(de);const be=K;be.Group=ue,be.__ANT_CHECKBOX=!0;var Ie=be},98447:function($t,dt,ie){"use strict";ie.d(dt,{C2:function(){return ne}});var F=ie(17313),Le=ie(37613),Ze=ie(83116);const ge=v=>{const{checkboxCls:we}=v,fe=`${we}-wrapper`;return[{[`${we}-group`]:Object.assign(Object.assign({},(0,F.Wf)(v)),{display:"inline-flex",flexWrap:"wrap",columnGap:v.marginXS,[`> ${v.antCls}-row`]:{flex:1}}),[fe]:Object.assign(Object.assign({},(0,F.Wf)(v)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${fe}`]:{marginInlineStart:0},[`&${fe}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[we]:Object.assign(Object.assign({},(0,F.Wf)(v)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:v.borderRadiusSM,alignSelf:"center",[`${we}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${we}-inner`]:Object.assign({},(0,F.oN)(v))},[`${we}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:v.checkboxSize,height:v.checkboxSize,direction:"ltr",backgroundColor:v.colorBgContainer,border:`${v.lineWidth}px ${v.lineType} ${v.colorBorder}`,borderRadius:v.borderRadiusSM,borderCollapse:"separate",transition:`all ${v.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:v.checkboxSize/14*5,height:v.checkboxSize/14*8,border:`${v.lineWidthBold}px solid ${v.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${v.motionDurationFast} ${v.motionEaseInBack}, opacity ${v.motionDurationFast}`}},"& + span":{paddingInlineStart:v.paddingXS,paddingInlineEnd:v.paddingXS}})},{[`
|
|
${fe}:not(${fe}-disabled),
|
|
${we}:not(${we}-disabled)
|
|
`]:{[`&:hover ${we}-inner`]:{borderColor:v.colorPrimary}},[`${fe}:not(${fe}-disabled)`]:{[`&:hover ${we}-checked:not(${we}-disabled) ${we}-inner`]:{backgroundColor:v.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${we}-checked:not(${we}-disabled):after`]:{borderColor:v.colorPrimaryHover}}},{[`${we}-checked`]:{[`${we}-inner`]:{backgroundColor:v.colorPrimary,borderColor:v.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${v.motionDurationMid} ${v.motionEaseOutBack} ${v.motionDurationFast}`}}},[`
|
|
${fe}-checked:not(${fe}-disabled),
|
|
${we}-checked:not(${we}-disabled)
|
|
`]:{[`&:hover ${we}-inner`]:{backgroundColor:v.colorPrimaryHover,borderColor:"transparent"}}},{[we]:{"&-indeterminate":{[`${we}-inner`]:{backgroundColor:v.colorBgContainer,borderColor:v.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:v.fontSizeLG/2,height:v.fontSizeLG/2,backgroundColor:v.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${fe}-disabled`]:{cursor:"not-allowed"},[`${we}-disabled`]:{[`&, ${we}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${we}-inner`]:{background:v.colorBgContainerDisabled,borderColor:v.colorBorder,"&:after":{borderColor:v.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:v.colorTextDisabled},[`&${we}-indeterminate ${we}-inner::after`]:{background:v.colorTextDisabled}}}]};function ne(v,we){const fe=(0,Le.TS)(we,{checkboxCls:`.${v}`,checkboxSize:we.controlInteractiveSize});return[ge(fe)]}dt.ZP=(0,Ze.Z)("Checkbox",(v,we)=>{let{prefixCls:fe}=we;return[ne(fe,v)]})},5112:function($t,dt,ie){"use strict";ie.d(dt,{ZP:function(){return E}});var F=ie(92310),Le=ie.n(F),Ze=ie(18929),ge=ie(26112),ne=ie(59301),v=ie(36355),we=ie(19716);const fe=ne.createContext(null),u=fe.Provider;var he=fe;const $=ne.createContext(null),b=$.Provider;var k=ie(5630),A=ie(8654),C=ie(1684),K=ie(32441),Z=ie(17313),U=ie(83116),M=ie(37613);const J=z=>{const{componentCls:ce,antCls:qe}=z,Xe=`${ce}-group`;return{[Xe]:Object.assign(Object.assign({},(0,Z.Wf)(z)),{display:"inline-block",fontSize:0,[`&${Xe}-rtl`]:{direction:"rtl"},[`${qe}-badge ${qe}-badge-count`]:{zIndex:1},[`> ${qe}-badge:not(:first-child) > ${qe}-button-wrapper`]:{borderInlineStart:"none"}})}},de=z=>{const{componentCls:ce,wrapperMarginInlineEnd:qe,colorPrimary:Xe,radioSize:tt,motionDurationSlow:gt,motionDurationMid:Rt,motionEaseInOutCirc:ht,colorBgContainer:at,colorBorder:Ct,lineWidth:Vt,dotSize:St,colorBgContainerDisabled:Wt,colorTextDisabled:Nt,paddingXS:Ot,dotColorDisabled:ze,lineType:Ke,radioDotDisabledSize:se,wireframe:Ne,colorWhite:Fe}=z,R=`${ce}-inner`;return{[`${ce}-wrapper`]:Object.assign(Object.assign({},(0,Z.Wf)(z)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:qe,cursor:"pointer",[`&${ce}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:z.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${ce}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Vt}px ${Ke} ${Xe}`,borderRadius:"50%",visibility:"hidden",content:'""'},[ce]:Object.assign(Object.assign({},(0,Z.Wf)(z)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${ce}-wrapper:hover &,
|
|
&:hover ${R}`]:{borderColor:Xe},[`${ce}-input:focus-visible + ${R}`]:Object.assign({},(0,Z.oN)(z)),[`${ce}:hover::after, ${ce}-wrapper:hover &::after`]:{visibility:"visible"},[`${ce}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:tt,height:tt,marginBlockStart:tt/-2,marginInlineStart:tt/-2,backgroundColor:Ne?Xe:Fe,borderBlockStart:0,borderInlineStart:0,borderRadius:tt,transform:"scale(0)",opacity:0,transition:`all ${gt} ${ht}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:tt,height:tt,backgroundColor:at,borderColor:Ct,borderStyle:"solid",borderWidth:Vt,borderRadius:"50%",transition:`all ${Rt}`},[`${ce}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${ce}-checked`]:{[R]:{borderColor:Xe,backgroundColor:Ne?at:Xe,"&::after":{transform:`scale(${St/tt})`,opacity:1,transition:`all ${gt} ${ht}`}}},[`${ce}-disabled`]:{cursor:"not-allowed",[R]:{backgroundColor:Wt,borderColor:Ct,cursor:"not-allowed","&::after":{backgroundColor:ze}},[`${ce}-input`]:{cursor:"not-allowed"},[`${ce}-disabled + span`]:{color:Nt,cursor:"not-allowed"},[`&${ce}-checked`]:{[R]:{"&::after":{transform:`scale(${se/tt})`}}}},[`span${ce} + *`]:{paddingInlineStart:Ot,paddingInlineEnd:Ot}})}},ue=z=>{const{buttonColor:ce,controlHeight:qe,componentCls:Xe,lineWidth:tt,lineType:gt,colorBorder:Rt,motionDurationSlow:ht,motionDurationMid:at,buttonPaddingInline:Ct,fontSize:Vt,buttonBg:St,fontSizeLG:Wt,controlHeightLG:Nt,controlHeightSM:Ot,paddingXS:ze,borderRadius:Ke,borderRadiusSM:se,borderRadiusLG:Ne,buttonCheckedBg:Fe,buttonSolidCheckedColor:R,colorTextDisabled:V,colorBgContainerDisabled:ee,buttonCheckedBgDisabled:j,buttonCheckedColorDisabled:W,colorPrimary:ke,colorPrimaryHover:Pe,colorPrimaryActive:Be,buttonSolidCheckedBg:Ce,buttonSolidCheckedHoverBg:De,buttonSolidCheckedActiveBg:Ye}=z;return{[`${Xe}-button-wrapper`]:{position:"relative",display:"inline-block",height:qe,margin:0,paddingInline:Ct,paddingBlock:0,color:ce,fontSize:Vt,lineHeight:`${qe-tt*2}px`,background:St,border:`${tt}px ${gt} ${Rt}`,borderBlockStartWidth:tt+.02,borderInlineStartWidth:0,borderInlineEndWidth:tt,cursor:"pointer",transition:[`color ${at}`,`background ${at}`,`box-shadow ${at}`].join(","),a:{color:ce},[`> ${Xe}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-tt,insetInlineStart:-tt,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:tt,paddingInline:0,backgroundColor:Rt,transition:`background-color ${ht}`,content:'""'}},"&:first-child":{borderInlineStart:`${tt}px ${gt} ${Rt}`,borderStartStartRadius:Ke,borderEndStartRadius:Ke},"&:last-child":{borderStartEndRadius:Ke,borderEndEndRadius:Ke},"&:first-child:last-child":{borderRadius:Ke},[`${Xe}-group-large &`]:{height:Nt,fontSize:Wt,lineHeight:`${Nt-tt*2}px`,"&:first-child":{borderStartStartRadius:Ne,borderEndStartRadius:Ne},"&:last-child":{borderStartEndRadius:Ne,borderEndEndRadius:Ne}},[`${Xe}-group-small &`]:{height:Ot,paddingInline:ze-tt,paddingBlock:0,lineHeight:`${Ot-tt*2}px`,"&:first-child":{borderStartStartRadius:se,borderEndStartRadius:se},"&:last-child":{borderStartEndRadius:se,borderEndEndRadius:se}},"&:hover":{position:"relative",color:ke},"&:has(:focus-visible)":Object.assign({},(0,Z.oN)(z)),[`${Xe}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Xe}-button-wrapper-disabled)`]:{zIndex:1,color:ke,background:Fe,borderColor:ke,"&::before":{backgroundColor:ke},"&:first-child":{borderColor:ke},"&:hover":{color:Pe,borderColor:Pe,"&::before":{backgroundColor:Pe}},"&:active":{color:Be,borderColor:Be,"&::before":{backgroundColor:Be}}},[`${Xe}-group-solid &-checked:not(${Xe}-button-wrapper-disabled)`]:{color:R,background:Ce,borderColor:Ce,"&:hover":{color:R,background:De,borderColor:De},"&:active":{color:R,background:Ye,borderColor:Ye}},"&-disabled":{color:V,backgroundColor:ee,borderColor:Rt,cursor:"not-allowed","&:first-child, &:hover":{color:V,backgroundColor:ee,borderColor:Rt}},[`&-disabled${Xe}-button-wrapper-checked`]:{color:W,backgroundColor:j,borderColor:Rt,boxShadow:"none"}}}},be=z=>z-4*2;var Ie=(0,U.Z)("Radio",z=>{const{controlOutline:ce,controlOutlineWidth:qe,radioSize:Xe}=z,tt=`0 0 0 ${qe}px ${ce}`,gt=tt,Rt=be(Xe),ht=(0,M.TS)(z,{radioDotDisabledSize:Rt,radioFocusShadow:tt,radioButtonFocusShadow:gt});return[J(ht),de(ht),ue(ht)]},z=>{const{wireframe:ce,padding:qe,marginXS:Xe,lineWidth:tt,fontSizeLG:gt,colorText:Rt,colorBgContainer:ht,colorTextDisabled:at,controlItemBgActiveDisabled:Ct,colorTextLightSolid:Vt,colorPrimary:St,colorPrimaryHover:Wt,colorPrimaryActive:Nt}=z,Ot=4,ze=gt,Ke=ce?be(ze):ze-(Ot+tt)*2;return{radioSize:ze,dotSize:Ke,dotColorDisabled:at,buttonSolidCheckedColor:Vt,buttonSolidCheckedBg:St,buttonSolidCheckedHoverBg:Wt,buttonSolidCheckedActiveBg:Nt,buttonBg:ht,buttonCheckedBg:ht,buttonColor:Rt,buttonCheckedBgDisabled:Ct,buttonCheckedColorDisabled:at,buttonPaddingInline:qe-tt,wrapperMarginInlineEnd:Xe}}),ye=ie(14088),xe=ie(4572),$e=function(z,ce){var qe={};for(var Xe in z)Object.prototype.hasOwnProperty.call(z,Xe)&&ce.indexOf(Xe)<0&&(qe[Xe]=z[Xe]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,Xe=Object.getOwnPropertySymbols(z);tt<Xe.length;tt++)ce.indexOf(Xe[tt])<0&&Object.prototype.propertyIsEnumerable.call(z,Xe[tt])&&(qe[Xe[tt]]=z[Xe[tt]]);return qe};const Oe=(z,ce)=>{var qe,Xe;const tt=ne.useContext(he),gt=ne.useContext($),{getPrefixCls:Rt,direction:ht,radio:at}=ne.useContext(v.E_),Ct=ne.useRef(null),Vt=(0,A.sQ)(ce,Ct),{isFormItemInput:St}=ne.useContext(K.aM),Wt=Be=>{var Ce,De;(Ce=z.onChange)===null||Ce===void 0||Ce.call(z,Be),(De=tt==null?void 0:tt.onChange)===null||De===void 0||De.call(tt,Be)},{prefixCls:Nt,className:Ot,rootClassName:ze,children:Ke,style:se}=z,Ne=$e(z,["prefixCls","className","rootClassName","children","style"]),Fe=Rt("radio",Nt),R=((tt==null?void 0:tt.optionType)||gt)==="button",V=R?`${Fe}-button`:Fe,[ee,j]=Ie(Fe),W=Object.assign({},Ne),ke=ne.useContext(C.Z);tt&&(W.name=tt.name,W.onChange=Wt,W.checked=z.value===tt.value,W.disabled=(qe=W.disabled)!==null&&qe!==void 0?qe:tt.disabled),W.disabled=(Xe=W.disabled)!==null&&Xe!==void 0?Xe:ke;const Pe=Le()(`${V}-wrapper`,{[`${V}-wrapper-checked`]:W.checked,[`${V}-wrapper-disabled`]:W.disabled,[`${V}-wrapper-rtl`]:ht==="rtl",[`${V}-wrapper-in-form-item`]:St},at==null?void 0:at.className,Ot,ze,j);return ee(ne.createElement(ye.Z,{component:"Radio",disabled:W.disabled},ne.createElement("label",{className:Pe,style:Object.assign(Object.assign({},at==null?void 0:at.style),se),onMouseEnter:z.onMouseEnter,onMouseLeave:z.onMouseLeave},ne.createElement(k.Z,Object.assign({},W,{className:Le()(W.className,!R&&xe.A),type:"radio",prefixCls:V,ref:Vt})),Ke!==void 0?ne.createElement("span",null,Ke):null)))};var Q=ne.forwardRef(Oe);const G=ne.forwardRef((z,ce)=>{const{getPrefixCls:qe,direction:Xe}=ne.useContext(v.E_),[tt,gt]=(0,Ze.Z)(z.defaultValue,{value:z.value}),Rt=Ce=>{const De=tt,Ye=Ce.target.value;"value"in z||gt(Ye);const{onChange:Ve}=z;Ve&&Ye!==De&&Ve(Ce)},{prefixCls:ht,className:at,rootClassName:Ct,options:Vt,buttonStyle:St="outline",disabled:Wt,children:Nt,size:Ot,style:ze,id:Ke,onMouseEnter:se,onMouseLeave:Ne,onFocus:Fe,onBlur:R}=z,V=qe("radio",ht),ee=`${V}-group`,[j,W]=Ie(V);let ke=Nt;Vt&&Vt.length>0&&(ke=Vt.map(Ce=>typeof Ce=="string"||typeof Ce=="number"?ne.createElement(Q,{key:Ce.toString(),prefixCls:V,disabled:Wt,value:Ce,checked:tt===Ce},Ce):ne.createElement(Q,{key:`radio-group-value-options-${Ce.value}`,prefixCls:V,disabled:Ce.disabled||Wt,value:Ce.value,checked:tt===Ce.value,title:Ce.title,style:Ce.style},Ce.label)));const Pe=(0,we.Z)(Ot),Be=Le()(ee,`${ee}-${St}`,{[`${ee}-${Pe}`]:Pe,[`${ee}-rtl`]:Xe==="rtl"},at,Ct,W);return j(ne.createElement("div",Object.assign({},(0,ge.Z)(z,{aria:!0,data:!0}),{className:Be,style:ze,onMouseEnter:se,onMouseLeave:Ne,onFocus:Fe,onBlur:R,id:Ke,ref:ce}),ne.createElement(u,{value:{onChange:Rt,value:tt,disabled:z.disabled,name:z.name,optionType:z.optionType}},ke)))});var Y=ne.memo(G),te=function(z,ce){var qe={};for(var Xe in z)Object.prototype.hasOwnProperty.call(z,Xe)&&ce.indexOf(Xe)<0&&(qe[Xe]=z[Xe]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,Xe=Object.getOwnPropertySymbols(z);tt<Xe.length;tt++)ce.indexOf(Xe[tt])<0&&Object.prototype.propertyIsEnumerable.call(z,Xe[tt])&&(qe[Xe[tt]]=z[Xe[tt]]);return qe};const ve=(z,ce)=>{const{getPrefixCls:qe}=ne.useContext(v.E_),{prefixCls:Xe}=z,tt=te(z,["prefixCls"]),gt=qe("radio",Xe);return ne.createElement(b,{value:"button"},ne.createElement(Q,Object.assign({prefixCls:gt},tt,{type:"radio",ref:ce})))};var ae=ne.forwardRef(ve);const S=Q;S.Button=ae,S.Group=Y,S.__ANT_RADIO=!0;var E=S},19447:function($t,dt,ie){"use strict";ie.d(dt,{ZP:function(){return ne},fS:function(){return Ze},qN:function(){return Le}});var F=ie(47585);const Le=8;function Ze(v){const we=Le,{contentRadius:fe,limitVerticalRadius:u}=v,he=fe>12?fe+2:12;return{dropdownArrowOffset:he,dropdownArrowOffsetVertical:u?we:he}}function ge(v,we){return v?we:{}}function ne(v,we){const{componentCls:fe,sizePopupArrow:u,borderRadiusXS:he,borderRadiusOuter:$,boxShadowPopoverArrow:b}=v,{colorBg:k,contentRadius:A=v.borderRadiusLG,limitVerticalRadius:C,arrowDistance:K=0,arrowPlacement:Z={left:!0,right:!0,top:!0,bottom:!0}}=we,{dropdownArrowOffsetVertical:U,dropdownArrowOffset:M}=Ze({contentRadius:A,limitVerticalRadius:C});return{[fe]:Object.assign(Object.assign(Object.assign(Object.assign({[`${fe}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,F.r)(u,he,$,k,b)),{"&:before":{background:k}})]},ge(!!Z.top,{[[`&-placement-top ${fe}-arrow`,`&-placement-topLeft ${fe}-arrow`,`&-placement-topRight ${fe}-arrow`].join(",")]:{bottom:K,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${fe}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${fe}-arrow`]:{left:{_skip_check_:!0,value:M}},[`&-placement-topRight ${fe}-arrow`]:{right:{_skip_check_:!0,value:M}}})),ge(!!Z.bottom,{[[`&-placement-bottom ${fe}-arrow`,`&-placement-bottomLeft ${fe}-arrow`,`&-placement-bottomRight ${fe}-arrow`].join(",")]:{top:K,transform:"translateY(-100%)"},[`&-placement-bottom ${fe}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${fe}-arrow`]:{left:{_skip_check_:!0,value:M}},[`&-placement-bottomRight ${fe}-arrow`]:{right:{_skip_check_:!0,value:M}}})),ge(!!Z.left,{[[`&-placement-left ${fe}-arrow`,`&-placement-leftTop ${fe}-arrow`,`&-placement-leftBottom ${fe}-arrow`].join(",")]:{right:{_skip_check_:!0,value:K},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${fe}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${fe}-arrow`]:{top:U},[`&-placement-leftBottom ${fe}-arrow`]:{bottom:U}})),ge(!!Z.right,{[[`&-placement-right ${fe}-arrow`,`&-placement-rightTop ${fe}-arrow`,`&-placement-rightBottom ${fe}-arrow`].join(",")]:{left:{_skip_check_:!0,value:K},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${fe}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${fe}-arrow`]:{top:U},[`&-placement-rightBottom ${fe}-arrow`]:{bottom:U}}))}}},47585:function($t,dt,ie){"use strict";ie.d(dt,{r:function(){return F}});const F=(Le,Ze,ge,ne,v)=>{const we=Le/2,fe=0,u=we,he=ge*1/Math.sqrt(2),$=we-ge*(1-1/Math.sqrt(2)),b=we-Ze*(1/Math.sqrt(2)),k=ge*(Math.sqrt(2)-1)+Ze*(1/Math.sqrt(2)),A=2*we-b,C=k,K=2*we-he,Z=$,U=2*we-fe,M=u,J=we*Math.sqrt(2)+ge*(Math.sqrt(2)-2),de=ge*(Math.sqrt(2)-1);return{pointerEvents:"none",width:Le,height:Le,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:Le,height:Le/2,background:ne,clipPath:{_multi_value_:!0,value:[`polygon(${de}px 100%, 50% ${de}px, ${2*we-de}px 100%, ${de}px 100%)`,`path('M ${fe} ${u} A ${ge} ${ge} 0 0 0 ${he} ${$} L ${b} ${k} A ${Ze} ${Ze} 0 0 1 ${A} ${C} L ${K} ${Z} A ${ge} ${ge} 0 0 0 ${U} ${M} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:J,height:J,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Ze}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:v,zIndex:0,background:"transparent"}}}},33166:function($t,dt,ie){"use strict";ie.d(dt,{i:function(){return F}});const F=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return Le}});var F=ie(33166);function Le(Ze,ge){return F.i.reduce((ne,v)=>{const we=Ze[`${v}1`],fe=Ze[`${v}3`],u=Ze[`${v}6`],he=Ze[`${v}7`];return Object.assign(Object.assign({},ne),ge(v,{lightColor:we,lightBorderColor:fe,darkColor:u,textColor:he}))},{})}},6848:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return Oe}});var F=ie(59301),Le=ie(92310),Ze=ie.n(Le),ge=ie(55477),ne=ie(18929),v=ie(62892),we=ie(79676),fe=ie(92343),u=ie(36355),he=ie(33234),$=ie(88088),b=ie(17313),k=ie(29878),A=ie(19447),C=ie(45157),K=ie(37613),Z=ie(83116);const U=He=>{const{componentCls:Q,tooltipMaxWidth:G,tooltipColor:Y,tooltipBg:te,tooltipBorderRadius:ve,zIndexPopup:ae,controlHeight:S,boxShadowSecondary:E,paddingSM:z,paddingXS:ce,tooltipRadiusOuter:qe}=He;return[{[Q]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(He)),{position:"absolute",zIndex:ae,display:"block",width:"max-content",maxWidth:G,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":te,[`${Q}-inner`]:{minWidth:S,minHeight:S,padding:`${z/2}px ${ce}px`,color:Y,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:te,borderRadius:ve,boxShadow:E,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${Q}-inner`]:{borderRadius:Math.min(ve,A.qN)}},[`${Q}-content`]:{position:"relative"}}),(0,C.Z)(He,(Xe,tt)=>{let{darkColor:gt}=tt;return{[`&${Q}-${Xe}`]:{[`${Q}-inner`]:{backgroundColor:gt},[`${Q}-arrow`]:{"--antd-arrow-background-color":gt}}}})),{"&-rtl":{direction:"rtl"}})},(0,A.ZP)((0,K.TS)(He,{borderRadiusOuter:qe}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:ve,limitVerticalRadius:!0}),{[`${Q}-pure`]:{position:"relative",maxWidth:"none",margin:He.sizePopupArrow}}]};var M=(He,Q)=>(0,Z.Z)("Tooltip",Y=>{if(Q===!1)return[];const{borderRadius:te,colorTextLightSolid:ve,colorBgDefault:ae,borderRadiusOuter:S}=Y,E=(0,K.TS)(Y,{tooltipMaxWidth:250,tooltipColor:ve,tooltipBorderRadius:te,tooltipBg:ae,tooltipRadiusOuter:S>4?4:S});return[U(E),(0,k._y)(Y,"zoom-big-fast")]},Y=>{let{zIndexPopupBase:te,colorBgSpotlight:ve}=Y;return{zIndexPopup:te+70,colorBgDefault:ve}},{resetStyle:!1})(He),J=ie(36785);function de(He,Q){const G=(0,J.o2)(Q),Y=Ze()({[`${He}-${Q}`]:Q&&G}),te={},ve={};return Q&&!G&&(te.background=Q,ve["--antd-arrow-background-color"]=Q),{className:Y,overlayStyle:te,arrowStyle:ve}}var be=He=>{const{prefixCls:Q,className:G,placement:Y="top",title:te,color:ve,overlayInnerStyle:ae}=He,{getPrefixCls:S}=F.useContext(u.E_),E=S("tooltip",Q),[z,ce]=M(E,!0),qe=de(E,ve),Xe=qe.arrowStyle,tt=Object.assign(Object.assign({},ae),qe.overlayStyle),gt=Ze()(ce,E,`${E}-pure`,`${E}-placement-${Y}`,G,qe.className);return z(F.createElement("div",{className:gt,style:Xe},F.createElement("div",{className:`${E}-arrow`}),F.createElement(ge.G,Object.assign({},He,{className:ce,prefixCls:E,overlayInnerStyle:tt}),te)))},Ie=function(He,Q){var G={};for(var Y in He)Object.prototype.hasOwnProperty.call(He,Y)&&Q.indexOf(Y)<0&&(G[Y]=He[Y]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var te=0,Y=Object.getOwnPropertySymbols(He);te<Y.length;te++)Q.indexOf(Y[te])<0&&Object.prototype.propertyIsEnumerable.call(He,Y[te])&&(G[Y[te]]=He[Y[te]]);return G};const ye=(He,Q)=>{const G={},Y=Object.assign({},He);return Q.forEach(te=>{He&&te in He&&(G[te]=He[te],delete Y[te])}),{picked:G,omitted:Y}};function xe(He,Q){const G=He.type;if((G.__ANT_BUTTON===!0||He.type==="button")&&He.props.disabled||G.__ANT_SWITCH===!0&&(He.props.disabled||He.props.loading)||G.__ANT_RADIO===!0&&He.props.disabled){const{picked:Y,omitted:te}=ye(He.props.style,["position","left","right","top","bottom","float","display","zIndex"]),ve=Object.assign(Object.assign({display:"inline-block"},Y),{cursor:"not-allowed",width:He.props.block?"100%":void 0}),ae=Object.assign(Object.assign({},te),{pointerEvents:"none"}),S=(0,fe.Tm)(He,{style:ae,className:null});return F.createElement("span",{style:ve,className:Ze()(He.props.className,`${Q}-disabled-compatible-wrapper`)},S)}return He}const $e=F.forwardRef((He,Q)=>{var G,Y;const{prefixCls:te,openClassName:ve,getTooltipContainer:ae,overlayClassName:S,color:E,overlayInnerStyle:z,children:ce,afterOpenChange:qe,afterVisibleChange:Xe,destroyTooltipOnHide:tt,arrow:gt=!0,title:Rt,overlay:ht,builtinPlacements:at,arrowPointAtCenter:Ct=!1,autoAdjustOverflow:Vt=!0}=He,St=!!gt,[,Wt]=(0,$.Z)(),{getPopupContainer:Nt,getPrefixCls:Ot,direction:ze}=F.useContext(u.E_),Ke=F.useRef(null),se=()=>{var Ae;(Ae=Ke.current)===null||Ae===void 0||Ae.forceAlign()};F.useImperativeHandle(Q,()=>({forceAlign:se,forcePopupAlign:()=>{se()}}));const[Ne,Fe]=(0,ne.Z)(!1,{value:(G=He.open)!==null&&G!==void 0?G:He.visible,defaultValue:(Y=He.defaultOpen)!==null&&Y!==void 0?Y:He.defaultVisible}),R=!Rt&&!ht&&Rt!==0,V=Ae=>{var je,B;Fe(R?!1:Ae),R||((je=He.onOpenChange)===null||je===void 0||je.call(He,Ae),(B=He.onVisibleChange)===null||B===void 0||B.call(He,Ae))},ee=F.useMemo(()=>{var Ae,je;let B=Ct;return typeof gt=="object"&&(B=(je=(Ae=gt.pointAtCenter)!==null&&Ae!==void 0?Ae:gt.arrowPointAtCenter)!==null&&je!==void 0?je:Ct),at||(0,we.Z)({arrowPointAtCenter:B,autoAdjustOverflow:Vt,arrowWidth:St?Wt.sizePopupArrow:0,borderRadius:Wt.borderRadius,offset:Wt.marginXXS,visibleFirst:!0})},[Ct,gt,at,Wt]),j=F.useMemo(()=>Rt===0?Rt:ht||Rt||"",[ht,Rt]),W=F.createElement(he.BR,null,typeof j=="function"?j():j),{getPopupContainer:ke,placement:Pe="top",mouseEnterDelay:Be=.1,mouseLeaveDelay:Ce=.1,overlayStyle:De,rootClassName:Ye}=He,Ve=Ie(He,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),it=Ot("tooltip",te),ut=Ot(),bt=He["data-popover-inject"];let pt=Ne;!("open"in He)&&!("visible"in He)&&R&&(pt=!1);const mt=xe((0,fe.l$)(ce)&&!(0,fe.M2)(ce)?ce:F.createElement("span",null,ce),it),ct=mt.props,_=!ct.className||typeof ct.className=="string"?Ze()(ct.className,ve||`${it}-open`):ct.className,[y,Ge]=M(it,!bt),O=de(it,E),re=O.arrowStyle,Et=Object.assign(Object.assign({},z),O.overlayStyle),Ee=Ze()(S,{[`${it}-rtl`]:ze==="rtl"},O.className,Ye,Ge);return y(F.createElement(ge.Z,Object.assign({},Ve,{showArrow:St,placement:Pe,mouseEnterDelay:Be,mouseLeaveDelay:Ce,prefixCls:it,overlayClassName:Ee,overlayStyle:Object.assign(Object.assign({},re),De),getTooltipContainer:ke||ae||Nt,ref:Ke,builtinPlacements:ee,overlay:W,visible:pt,onVisibleChange:V,afterVisibleChange:qe!=null?qe:Xe,overlayInnerStyle:Et,arrowContent:F.createElement("span",{className:`${it}-arrow-content`}),motion:{motionName:(0,v.m)(ut,"zoom-big-fast",He.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!tt}),pt?(0,fe.Tm)(mt,{className:_}):mt))});$e._InternalPanelDoNotUseOrYouWillBeFired=be;var Oe=$e},64018:function(){var $t,dt,ie,F=!1,Le,Ze;window.PR_SHOULD_USE_CONTINUATION=!0;var ge,ne;(function(){var v=window,we=["break,continue,do,else,for,if,return,while"],fe=[we,"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"],u=[fe,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],he=[u,"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"],$=[u,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],b=[u,"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"],k="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",A=[u,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],C="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",K=[we,"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"],Z=[we,"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"],U=[we,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],M=[he,b,$,A,C,K,Z,U],J=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,de="str",ue="kwd",be="com",Ie="typ",ye="lit",xe="pun",$e="pln",Oe="tag",He="dec",Q="src",G="atn",Y="atv",te="nocode",ve="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function ae(ze){for(var Ke=0,se=!1,Ne=!1,Fe=0,R=ze.length;Fe<R;++Fe){var V=ze[Fe];if(V.ignoreCase)Ne=!0;else if(/[a-z]/i.test(V.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){se=!0,Ne=!1;break}}var ee={b:8,t:9,n:10,v:11,f:12,r:13};function j(Ce){var De=Ce.charCodeAt(0);if(De!==92)return De;var Ye=Ce.charAt(1);return De=ee[Ye],De||("0"<=Ye&&Ye<="7"?parseInt(Ce.substring(1),8):Ye==="u"||Ye==="x"?parseInt(Ce.substring(2),16):Ce.charCodeAt(1))}function W(Ce){if(Ce<32)return(Ce<16?"\\x0":"\\x")+Ce.toString(16);var De=String.fromCharCode(Ce);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function ke(Ce){var De=Ce.substring(1,Ce.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")),Ye=[],Ve=De[0]==="^",it=["["];Ve&&it.push("^");for(var ut=Ve?1:0,bt=De.length;ut<bt;++ut){var pt=De[ut];if(/\\[bdsw]/i.test(pt))it.push(pt);else{var mt=j(pt),ct;ut+2<bt&&De[ut+1]==="-"?(ct=j(De[ut+2]),ut+=2):ct=mt,Ye.push([mt,ct]),ct<65||mt>122||(ct<65||mt>90||Ye.push([Math.max(65,mt)|32,Math.min(ct,90)|32]),ct<97||mt>122||Ye.push([Math.max(97,mt)&-33,Math.min(ct,122)&-33]))}}Ye.sort(function(O,re){return O[0]-re[0]||re[1]-O[1]});for(var _=[],y=[],ut=0;ut<Ye.length;++ut){var Ge=Ye[ut];Ge[0]<=y[1]+1?y[1]=Math.max(y[1],Ge[1]):_.push(y=Ge)}for(var ut=0;ut<_.length;++ut){var Ge=_[ut];it.push(W(Ge[0])),Ge[1]>Ge[0]&&(Ge[1]+1>Ge[0]&&it.push("-"),it.push(W(Ge[1])))}return it.push("]"),it.join("")}function Pe(Ce){for(var De=Ce.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")),Ye=De.length,Ve=[],it=0,ut=0;it<Ye;++it){var bt=De[it];if(bt==="(")++ut;else if(bt.charAt(0)==="\\"){var pt=+bt.substring(1);pt&&(pt<=ut?Ve[pt]=-1:De[it]=W(pt))}}for(var it=1;it<Ve.length;++it)Ve[it]===-1&&(Ve[it]=++Ke);for(var it=0,ut=0;it<Ye;++it){var bt=De[it];if(bt==="(")++ut,Ve[ut]||(De[it]="(?:");else if(bt.charAt(0)==="\\"){var pt=+bt.substring(1);pt&&pt<=ut&&(De[it]="\\"+Ve[pt])}}for(var it=0;it<Ye;++it)De[it]==="^"&&De[it+1]!=="^"&&(De[it]="");if(Ce.ignoreCase&&se)for(var it=0;it<Ye;++it){var bt=De[it],mt=bt.charAt(0);bt.length>=2&&mt==="["?De[it]=ke(bt):mt!=="\\"&&(De[it]=bt.replace(/[a-zA-Z]/g,function(y){var Ge=y.charCodeAt(0);return"["+String.fromCharCode(Ge&-33,Ge|32)+"]"}))}return De.join("")}for(var Be=[],Fe=0,R=ze.length;Fe<R;++Fe){var V=ze[Fe];if(V.global||V.multiline)throw new Error(""+V);Be.push("(?:"+Pe(V)+")")}return new RegExp(Be.join("|"),Ne?"gi":"g")}function S(ze,Ke){var se=/(?:^|\s)nocode(?:\s|$)/,Ne=[],Fe=0,R=[],V=0;function ee(j){var W=j.nodeType;if(W==1){if(se.test(j.className))return;for(var ke=j.firstChild;ke;ke=ke.nextSibling)ee(ke);var Pe=j.nodeName.toLowerCase();(Pe==="br"||Pe==="li")&&(Ne[V]=`
|
|
`,R[V<<1]=Fe++,R[V++<<1|1]=j)}else if(W==3||W==4){var Be=j.nodeValue;Be.length&&(Ke?Be=Be.replace(/\r\n?/g,`
|
|
`):Be=Be.replace(/[ \t\r\n]+/g," "),Ne[V]=Be,R[V<<1]=Fe,Fe+=Be.length,R[V++<<1|1]=j)}}return ee(ze),{sourceCode:Ne.join("").replace(/\n$/,""),spans:R}}function E(ze,Ke,se,Ne,Fe){if(se){var R={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:se,spans:null,basePos:Ke,decorations:null};Ne(R),Fe.push.apply(Fe,R.decorations)}}var z=/\S/;function ce(ze){for(var Ke=void 0,se=ze.firstChild;se;se=se.nextSibling){var Ne=se.nodeType;Ke=Ne===1?Ke?ze:se:Ne===3&&z.test(se.nodeValue)?ze:Ke}return Ke===ze?void 0:Ke}function qe(ze,Ke){var se={},Ne;(function(){for(var V=ze.concat(Ke),ee=[],j={},W=0,ke=V.length;W<ke;++W){var Pe=V[W],Be=Pe[3];if(Be)for(var Ce=Be.length;--Ce>=0;)se[Be.charAt(Ce)]=Pe;var De=Pe[1],Ye=""+De;j.hasOwnProperty(Ye)||(ee.push(De),j[Ye]=null)}ee.push(/[\0-\uffff]/),Ne=ae(ee)})();var Fe=Ke.length,R=function(V){for(var ee=V.sourceCode,j=V.basePos,W=V.sourceNode,ke=[j,$e],Pe=0,Be=ee.match(Ne)||[],Ce={},De=0,Ye=Be.length;De<Ye;++De){var Ve=Be[De],it=Ce[Ve],ut=void 0,bt;if(typeof it=="string")bt=!1;else{var pt=se[Ve.charAt(0)];if(pt)ut=Ve.match(pt[1]),it=pt[0];else{for(var mt=0;mt<Fe;++mt)if(pt=Ke[mt],ut=Ve.match(pt[1]),ut){it=pt[0];break}ut||(it=$e)}bt=it.length>=5&&it.substring(0,5)==="lang-",bt&&!(ut&&typeof ut[1]=="string")&&(bt=!1,it=Q),bt||(Ce[Ve]=it)}var ct=Pe;if(Pe+=Ve.length,!bt)ke.push(j+ct,it);else{var _=ut[1],y=Ve.indexOf(_),Ge=y+_.length;ut[2]&&(Ge=Ve.length-ut[2].length,y=Ge-_.length);var O=it.substring(5);E(W,j+ct,Ve.substring(0,y),R,ke),E(W,j+ct+y,_,Ct(O,_),ke),E(W,j+ct+Ge,Ve.substring(Ge),R,ke)}}V.decorations=ke};return R}function Xe(ze){var Ke=[],se=[];ze.tripleQuotedStrings?Ke.push([de,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Ke.push([de,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([de,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&se.push([de,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=ze.hashComments;Ne&&(ze.cStyleComments?(Ne>1?Ke.push([be,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([be,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),se.push([de,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([be,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(se.push([be,/^\/\/[^\r\n]*/,null]),se.push([be,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=ze.regexLiterals;if(Fe){var R=Fe>1?"":`
|
|
\r`,V=R?".":"[\\S\\s]",ee="/(?=[^/*"+R+"])(?:[^/\\x5B\\x5C"+R+"]|\\x5C"+V+"|\\x5B(?:[^\\x5C\\x5D"+R+"]|\\x5C"+V+")*(?:\\x5D|$))+/";se.push(["lang-regex",RegExp("^"+ve+"("+ee+")")])}var j=ze.types;j&&se.push([Ie,j]);var W=(""+ze.keywords).replace(/^ | $/g,"");W.length&&se.push([ue,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([$e,/^\s+/,null,` \r
|
|
\xA0`]);var ke="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(ke+="(?!s*/)"),se.push([ye,/^@[a-z_$][a-z_$@0-9]*/i,null],[Ie,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[$e,/^[a-z_$][a-z_$@0-9]*/i,null],[ye,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[$e,/^\\[\s\S]?/,null],[xe,new RegExp(ke),null]),qe(Ke,se)}var tt=Xe({keywords:M,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function gt(ze,Ke,se){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,R=ze.ownerDocument,V=R.createElement("li");ze.firstChild;)V.appendChild(ze.firstChild);var ee=[V];function j(De){var Ye=De.nodeType;if(Ye==1&&!Ne.test(De.className))if(De.nodeName==="br")W(De),De.parentNode&&De.parentNode.removeChild(De);else for(var Ve=De.firstChild;Ve;Ve=Ve.nextSibling)j(Ve);else if((Ye==3||Ye==4)&&se){var it=De.nodeValue,ut=it.match(Fe);if(ut){var bt=it.substring(0,ut.index);De.nodeValue=bt;var pt=it.substring(ut.index+ut[0].length);if(pt){var mt=De.parentNode;mt.insertBefore(R.createTextNode(pt),De.nextSibling)}W(De),bt||De.parentNode.removeChild(De)}}}function W(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function Ye(ut,bt){var pt=bt?ut.cloneNode(!1):ut,mt=ut.parentNode;if(mt){var ct=Ye(mt,1),_=ut.nextSibling;ct.appendChild(pt);for(var y=_;y;y=_)_=y.nextSibling,ct.appendChild(y)}return pt}for(var Ve=Ye(De.nextSibling,0),it;(it=Ve.parentNode)&&it.nodeType===1;)Ve=it;ee.push(Ve)}for(var ke=0;ke<ee.length;++ke)j(ee[ke]);Ke===(Ke|0)&&ee[0].setAttribute("value",Ke);var Pe=R.createElement("ol");Pe.className="linenums";for(var Be=Math.max(0,Ke-1|0)||0,ke=0,Ce=ee.length;ke<Ce;++ke)V=ee[ke],V.className="L"+(ke+Be)%10,V.firstChild||V.appendChild(R.createTextNode("\xA0")),Pe.appendChild(V);ze.appendChild(Pe)}function Rt(ze){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var se=/\n/g,Ne=ze.sourceCode,Fe=Ne.length,R=0,V=ze.spans,ee=V.length,j=0,W=ze.decorations,ke=W.length,Pe=0;W[ke]=Fe;var Be,Ce;for(Ce=Be=0;Ce<ke;)W[Ce]!==W[Ce+2]?(W[Be++]=W[Ce++],W[Be++]=W[Ce++]):Ce+=2;for(ke=Be,Ce=Be=0;Ce<ke;){for(var De=W[Ce],Ye=W[Ce+1],Ve=Ce+2;Ve+2<=ke&&W[Ve+1]===Ye;)Ve+=2;W[Be++]=De,W[Be++]=Ye,Ce=Ve}ke=W.length=Be;var it=ze.sourceNode,ut="";it&&(ut=it.style.display,it.style.display="none");try{for(var bt=null;j<ee;){var pt=V[j],mt=V[j+2]||Fe,ct=W[Pe+2]||Fe,Ve=Math.min(mt,ct),_=V[j+1],y;if(_.nodeType!==1&&(y=Ne.substring(R,Ve))){Ke&&(y=y.replace(se,"\r")),_.nodeValue=y;var Ge=_.ownerDocument,O=Ge.createElement("span");O.className=W[Pe+1];var re=_.parentNode;re.replaceChild(O,_),O.appendChild(_),R<mt&&(V[j+1]=_=Ge.createTextNode(Ne.substring(Ve,mt)),re.insertBefore(_,O.nextSibling))}R=Ve,R>=mt&&(j+=2),R>=ct&&(Pe+=2)}}finally{it&&(it.style.display=ut)}}var ht={};function at(ze,Ke){for(var se=Ke.length;--se>=0;){var Ne=Ke[se];ht.hasOwnProperty(Ne)?v.console&&console.warn("cannot override language handler %s",Ne):ht[Ne]=ze}}function Ct(ze,Ke){return ze&&ht.hasOwnProperty(ze)||(ze=/^\s*</.test(Ke)?"default-markup":"default-code"),ht[ze]}at(tt,["default-code"]),at(qe([],[[$e,/^[^<?]+/],[He,/^<!\w[^>]*(?:>|$)/],[be,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[xe,/^(?:<[%?]|[%?]>)/],["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"]),at(qe([[$e,/^[\s]+/,null,` \r
|
|
`],[Y,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Oe,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[G,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[xe,/^[=<>\/]+/],["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"]),at(qe([],[[Y,/^[\s\S]+/]]),["uq.val"]),at(Xe({keywords:he,hashComments:!0,cStyleComments:!0,types:J}),["c","cc","cpp","cxx","cyc","m"]),at(Xe({keywords:"null,true,false"}),["json"]),at(Xe({keywords:b,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:J}),["cs"]),at(Xe({keywords:$,cStyleComments:!0}),["java"]),at(Xe({keywords:U,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),at(Xe({keywords:K,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),at(Xe({keywords:C,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),at(Xe({keywords:Z,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),at(Xe({keywords:A,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),at(Xe({keywords:k,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),at(qe([],[[de,/^[\s\S]+/]]),["regex"]);function Vt(ze){var Ke=ze.langExtension;try{var se=S(ze.sourceNode,ze.pre),Ne=se.sourceCode;ze.sourceCode=Ne,ze.spans=se.spans,ze.basePos=0,Ct(Ke,Ne)(ze),Rt(ze)}catch(Fe){v.console&&console.log(Fe&&Fe.stack||Fe)}}function St(ze,Ke,se){var Ne=se||!1,Fe=Ke||null,R=document.createElement("div");R.innerHTML="<pre>"+ze+"</pre>",R=R.firstChild,Ne&>(R,Ne,!0);var V={langExtension:Fe,numberLines:Ne,sourceNode:R,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Vt(V),R.innerHTML}function Wt(ze,Ke){var se=Ke||document.body,Ne=se.ownerDocument||document;function Fe(pt){return se.getElementsByTagName(pt)}for(var R=[Fe("pre"),Fe("code"),Fe("xmp")],V=[],ee=0;ee<R.length;++ee)for(var j=0,W=R[ee].length;j<W;++j)V.push(R[ee][j]);R=null;var ke=Date;ke.now||(ke={now:function(){return+new Date}});var Pe=0,Be=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ce=/\bprettyprint\b/,De=/\bprettyprinted\b/,Ye=/pre|xmp/i,Ve=/^code$/i,it=/^(?:pre|code|xmp)$/i,ut={};function bt(){for(var pt=v.PR_SHOULD_USE_CONTINUATION?ke.now()+250:1/0;Pe<V.length&&ke.now()<pt;Pe++){for(var mt=V[Pe],ct=ut,_=mt;_=_.previousSibling;){var y=_.nodeType,Ge=(y===7||y===8)&&_.nodeValue;if(Ge?!/^\??prettify\b/.test(Ge):y!==3||/\S/.test(_.nodeValue))break;if(Ge){ct={},Ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(me,Dt,Mt){ct[Dt]=Mt});break}}var O=mt.className;if((ct!==ut||Ce.test(O))&&!De.test(O)){for(var re=!1,Et=mt.parentNode;Et;Et=Et.parentNode){var Ee=Et.tagName;if(it.test(Ee)&&Et.className&&Ce.test(Et.className)){re=!0;break}}if(!re){mt.className+=" prettyprinted";var Ae=ct.lang;if(!Ae){Ae=O.match(Be);var je;!Ae&&(je=ce(mt))&&Ve.test(je.tagName)&&(Ae=je.className.match(Be)),Ae&&(Ae=Ae[1])}var B;if(Ye.test(mt.tagName))B=1;else{var q=mt.currentStyle,oe=Ne.defaultView,Te=q?q.whiteSpace:oe&&oe.getComputedStyle?oe.getComputedStyle(mt,null).getPropertyValue("white-space"):0;B=Te&&Te.substring(0,3)==="pre"}var P=ct.linenums;(P=P==="true"||+P)||(P=O.match(/\blinenums\b(?::(\d+))?/),P=P?P[1]&&P[1].length?+P[1]:!0:!1),P&>(mt,P,B);var vt={langExtension:Ae,sourceNode:mt,numberLines:P,pre:B,sourceCode:null,basePos:null,spans:null,decorations:null};Vt(vt)}}}Pe<V.length?v.setTimeout(bt,250):typeof ze=="function"&&ze()}bt()}var Nt=v.PR={createSimpleLexer:qe,registerLangHandler:at,sourceDecorator:Xe,PR_ATTRIB_NAME:G,PR_ATTRIB_VALUE:Y,PR_COMMENT:be,PR_DECLARATION:He,PR_KEYWORD:ue,PR_LITERAL:ye,PR_NOCODE:te,PR_PLAIN:$e,PR_PUNCTUATION:xe,PR_SOURCE:Q,PR_STRING:de,PR_TAG:Oe,PR_TYPE:Ie,prettyPrintOne:F?v.prettyPrintOne=St:ge=St,prettyPrint:ne=F?v.prettyPrint=Wt:ne=Wt},Ot=v.define;typeof Ot=="function"&&Ot.amd&&Ot("google-code-prettify",[],function(){return Nt})})()},25769:function($t,dt,ie){"use strict";var F=ie(98040),Le={"text/plain":"Text","text/html":"Url",default:"Text"},Ze="Copy to clipboard: #{key}, Enter";function ge(v){var we=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return v.replace(/#{\s*key\s*}/g,we)}function ne(v,we){var fe,u,he,$,b,k,A=!1;we||(we={}),fe=we.debug||!1;try{he=F(),$=document.createRange(),b=document.getSelection(),k=document.createElement("span"),k.textContent=v,k.ariaHidden="true",k.style.all="unset",k.style.position="fixed",k.style.top=0,k.style.clip="rect(0, 0, 0, 0)",k.style.whiteSpace="pre",k.style.webkitUserSelect="text",k.style.MozUserSelect="text",k.style.msUserSelect="text",k.style.userSelect="text",k.addEventListener("copy",function(K){if(K.stopPropagation(),we.format)if(K.preventDefault(),typeof K.clipboardData=="undefined"){fe&&console.warn("unable to use e.clipboardData"),fe&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var Z=Le[we.format]||Le.default;window.clipboardData.setData(Z,v)}else K.clipboardData.clearData(),K.clipboardData.setData(we.format,v);we.onCopy&&(K.preventDefault(),we.onCopy(K.clipboardData))}),document.body.appendChild(k),$.selectNodeContents(k),b.addRange($);var C=document.execCommand("copy");if(!C)throw new Error("copy command was unsuccessful");A=!0}catch(K){fe&&console.error("unable to copy using execCommand: ",K),fe&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(we.format||"text",v),we.onCopy&&we.onCopy(window.clipboardData),A=!0}catch(Z){fe&&console.error("unable to copy using clipboardData: ",Z),fe&&console.error("falling back to prompt"),u=ge("message"in we?we.message:Ze),window.prompt(u,v)}}finally{b&&(typeof b.removeRange=="function"?b.removeRange($):b.removeAllRanges()),k&&document.body.removeChild(k),he()}return A}$t.exports=ne},53184:function($t,dt,ie){"use strict";var F,Le;function Ze(ge,ne,v){var we=function(fe,u){return ge.js_beautify(fe,u)};return we.js=ge.js_beautify,we.css=ne.css_beautify,we.html=v.html_beautify,we.js_beautify=ge.js_beautify,we.css_beautify=ne.css_beautify,we.html_beautify=v.html_beautify,we}F=[ie(58553),ie(87804),ie(40998)],Le=function(ge,ne,v){return Ze(ge,ne,v)}.apply(dt,F),Le!==void 0&&($t.exports=Le)},87804:function($t,dt){var ie,F;(function(){var Le;(function(){"use strict";var ge=[,,function(fe){function u(b){this.__parent=b,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=[]}u.prototype.clone_empty=function(){var b=new u(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},u.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},u.prototype.has_match=function(b){for(var k=this.__items.length-1;k>=0;k--)if(this.__items[k].match(b))return!0;return!1},u.prototype.set_indent=function(b,k){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=k||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(b){this.__items.push(b);var k=b.lastIndexOf(`
|
|
`);k!==-1?this.__character_count=b.length-k:this.__character_count+=b.length},u.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function he(b,k){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),k=k||"",b.indent_level>0&&(k=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=k,this.__base_string_length=k.length}he.prototype.get_indent_size=function(b,k){var A=this.__base_string_length;return k=k||0,b<0&&(A=0),A+=b*this.__indent_size,A+=k,A},he.prototype.get_indent_string=function(b,k){var A=this.__base_string;return k=k||0,b<0&&(b=0,A=""),k+=b*this.__indent_size,this.__ensure_cache(k),A+=this.__cache[k],A},he.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},he.prototype.__add_column=function(){var b=this.__cache.length,k=0,A="";this.__indent_size&&b>=this.__indent_size&&(k=Math.floor(b/this.__indent_size),b-=k*this.__indent_size,A=new Array(k+1).join(this.__indent_string)),b&&(A+=new Array(b+1).join(" ")),this.__cache.push(A)};function $(b,k){this.__indent_cache=new he(b,k),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}$.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},$.prototype.get_line_number=function(){return this.__lines.length},$.prototype.get_indent_string=function(b,k){return this.__indent_cache.get_indent_string(b,k)},$.prototype.get_indent_size=function(b,k){return this.__indent_cache.get_indent_size(b,k)},$.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},$.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},$.prototype.get_code=function(b){this.trim(!0);var k=this.current_line.pop();k&&(k[k.length-1]===`
|
|
`&&(k=k.replace(/\n+$/g,"")),this.current_line.push(k)),this._end_with_newline&&this.__add_outputline();var A=this.__lines.join(`
|
|
`);return b!==`
|
|
`&&(A=A.replace(/[\n]/g,b)),A},$.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},$.prototype.set_indent=function(b,k){return b=b||0,k=k||0,this.next_line.set_indent(b,k),this.__lines.length>1?(this.current_line.set_indent(b,k),!0):(this.current_line.set_indent(),!1)},$.prototype.add_raw_token=function(b){for(var k=0;k<b.newlines;k++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},$.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},$.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},$.prototype.remove_indent=function(b){for(var k=this.__lines.length;b<k;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},$.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},$.prototype.just_added_newline=function(){return this.current_line.is_empty()},$.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},$.prototype.ensure_empty_line_above=function(b,k){for(var A=this.__lines.length-2;A>=0;){var C=this.__lines[A];if(C.is_empty())break;if(C.item(0).indexOf(b)!==0&&C.item(-1)!==k){this.__lines.splice(A+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}A--}},fe.exports.Output=$},,,,function(fe){function u(b,k){this.raw_options=he(b,k),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"])}u.prototype._get_array=function(b,k){var A=this.raw_options[b],C=k||[];return typeof A=="object"?A!==null&&typeof A.concat=="function"&&(C=A.concat()):typeof A=="string"&&(C=A.split(/[^a-zA-Z0-9_\/\-]+/)),C},u.prototype._get_boolean=function(b,k){var A=this.raw_options[b],C=A===void 0?!!k:!!A;return C},u.prototype._get_characters=function(b,k){var A=this.raw_options[b],C=k||"";return typeof A=="string"&&(C=A.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),C},u.prototype._get_number=function(b,k){var A=this.raw_options[b];k=parseInt(k,10),isNaN(k)&&(k=0);var C=parseInt(A,10);return isNaN(C)&&(C=k),C},u.prototype._get_selection=function(b,k,A){var C=this._get_selection_list(b,k,A);if(C.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
|
|
`+k+`
|
|
You passed in: '`+this.raw_options[b]+"'");return C[0]},u.prototype._get_selection_list=function(b,k,A){if(!k||k.length===0)throw new Error("Selection list cannot be empty.");if(A=A||[k[0]],!this._is_valid_selection(A,k))throw new Error("Invalid Default Value!");var C=this._get_array(b,A);if(!this._is_valid_selection(C,k))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
|
|
`+k+`
|
|
You passed in: '`+this.raw_options[b]+"'");return C},u.prototype._is_valid_selection=function(b,k){return b.length&&k.length&&!b.some(function(A){return k.indexOf(A)===-1})};function he(b,k){var A={};b=$(b);var C;for(C in b)C!==k&&(A[C]=b[C]);if(k&&b[k])for(C in b[k])A[C]=b[k][C];return A}function $(b){var k={},A;for(A in b){var C=A.replace(/-/g,"_");k[C]=b[A]}return k}fe.exports.Options=u,fe.exports.normalizeOpts=$,fe.exports.mergeOpts=he},,function(fe){var u=RegExp.prototype.hasOwnProperty("sticky");function he($){this.__input=$||"",this.__input_length=this.__input.length,this.__position=0}he.prototype.restart=function(){this.__position=0},he.prototype.back=function(){this.__position>0&&(this.__position-=1)},he.prototype.hasNext=function(){return this.__position<this.__input_length},he.prototype.next=function(){var $=null;return this.hasNext()&&($=this.__input.charAt(this.__position),this.__position+=1),$},he.prototype.peek=function($){var b=null;return $=$||0,$+=this.__position,$>=0&&$<this.__input_length&&(b=this.__input.charAt($)),b},he.prototype.__match=function($,b){$.lastIndex=b;var k=$.exec(this.__input);return k&&!(u&&$.sticky)&&k.index!==b&&(k=null),k},he.prototype.test=function($,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match($,b):!1},he.prototype.testChar=function($,b){var k=this.peek(b);return $.lastIndex=0,k!==null&&$.test(k)},he.prototype.match=function($){var b=this.__match($,this.__position);return b?this.__position+=b[0].length:b=null,b},he.prototype.read=function($,b,k){var A="",C;return $&&(C=this.match($),C&&(A+=C[0])),b&&(C||!$)&&(A+=this.readUntil(b,k)),A},he.prototype.readUntil=function($,b){var k="",A=this.__position;$.lastIndex=this.__position;var C=$.exec(this.__input);return C?(A=C.index,b&&(A+=C[0].length)):A=this.__input_length,k=this.__input.substring(this.__position,A),this.__position=A,k},he.prototype.readUntilAfter=function($){return this.readUntil($,!0)},he.prototype.get_regexp=function($,b){var k=null,A="g";return b&&u&&(A="y"),typeof $=="string"&&$!==""?k=new RegExp($,A):$&&(k=new RegExp($.source,A)),k},he.prototype.get_literal_regexp=function($){return RegExp($.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},he.prototype.peekUntilAfter=function($){var b=this.__position,k=this.readUntilAfter($);return this.__position=b,k},he.prototype.lookBack=function($){var b=this.__position-1;return b>=$.length&&this.__input.substring(b-$.length,b).toLowerCase()===$},fe.exports.InputScanner=he},,,,,function(fe){function u(he,$){he=typeof he=="string"?he:he.source,$=typeof $=="string"?$:$.source,this.__directives_block_pattern=new RegExp(he+/ beautify( \w+[:]\w+)+ /.source+$,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(he+/\sbeautify\signore:end\s/.source+$,"g")}u.prototype.get_directives=function(he){if(!he.match(this.__directives_block_pattern))return null;var $={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(he);b;)$[b[1]]=b[2],b=this.__directive_pattern.exec(he);return $},u.prototype.readIgnored=function(he){return he.readUntilAfter(this.__directives_end_ignore_pattern)},fe.exports.Directives=u},,function(fe,u,he){var $=he(16).Beautifier,b=he(17).Options;function k(A,C){var K=new $(A,C);return K.beautify()}fe.exports=k,fe.exports.defaultOptions=function(){return new b}},function(fe,u,he){var $=he(17).Options,b=he(2).Output,k=he(8).InputScanner,A=he(13).Directives,C=new A(/\/\*/,/\*\//),K=/\r\n|[\r\n]/,Z=/\r\n|[\r\n]/g,U=/\s/,M=/(?:\s|\n)+/g,J=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,de=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ue(be,Ie){this._source_text=be||"",this._options=new $(Ie),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"]}ue.prototype.eatString=function(be){var Ie="";for(this._ch=this._input.next();this._ch;){if(Ie+=this._ch,this._ch==="\\")Ie+=this._input.next();else if(be.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return Ie},ue.prototype.eatWhitespace=function(be){for(var Ie=U.test(this._input.peek()),ye=0;U.test(this._input.peek());)this._ch=this._input.next(),be&&this._ch===`
|
|
`&&(ye===0||ye<this._options.max_preserve_newlines)&&(ye++,this._output.add_new_line(!0));return Ie},ue.prototype.foundNestedPseudoClass=function(){for(var be=0,Ie=1,ye=this._input.peek(Ie);ye;){if(ye==="{")return!0;if(ye==="(")be+=1;else if(ye===")"){if(be===0)return!1;be-=1}else if(ye===";"||ye==="}")return!1;Ie++,ye=this._input.peek(Ie)}return!1},ue.prototype.print_string=function(be){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(be)},ue.prototype.preserveSingleSpace=function(be){be&&(this._output.space_before_token=!0)},ue.prototype.indent=function(){this._indentLevel++},ue.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ue.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var be=this._source_text,Ie=this._options.eol;Ie==="auto"&&(Ie=`
|
|
`,be&&K.test(be||"")&&(Ie=be.match(K)[0])),be=be.replace(Z,`
|
|
`);var ye=be.match(/^[\t ]*/)[0];this._output=new b(this._options,ye),this._input=new k(be),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var xe=0,$e=!1,Oe=!1,He=!1,Q=!1,G=!1,Y=this._ch,te=!1,ve,ae,S;ve=this._input.read(M),ae=ve!=="",S=Y,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),Y=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var E=this._input.read(J),z=C.get_directives(E);z&&z.ignore==="start"&&(E+=C.readIgnored(this._input)),this.print_string(E),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(de)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(ae),this.print_string(this._ch);var ce=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ce.match(/[ :]$/)&&(ce=this.eatString(": ").replace(/\s+$/,""),this.print_string(ce),this._output.space_before_token=!0),xe===0&&ce.indexOf(":")!==-1&&(Oe=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(ae),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var qe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);qe.match(/[ :]$/)&&(qe=this.eatString(": ").replace(/\s+$/,""),this.print_string(qe),this._output.space_before_token=!0),xe===0&&qe.indexOf(":")!==-1?(Oe=!0,this.indent()):qe in this.NESTED_AT_RULE?(this._nestedLevel+=1,qe in this.CONDITIONAL_GROUP_RULE&&(He=!0)):xe===0&&!Oe&&(Q=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(ae),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Oe&&(Oe=!1,this.outdent()),Q=!1,He?(He=!1,$e=this._indentLevel>=this._nestedLevel):$e=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&$e&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(S==="("?this._output.space_before_token=!1:S!==","&&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(),S==="{"&&this._output.trim(!0),Oe&&(this.outdent(),Oe=!1),this.print_string(this._ch),$e=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Xe=0;Xe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Xe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Xe])){te=!0;break}($e||He)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Q&&xe===0?(this.print_string(":"),Oe||(Oe=!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 tt=S==='"'||S==="'";this.preserveSingleSpace(tt||ae),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")te=!1,xe===0?(Oe&&(this.outdent(),Oe=!1),Q=!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(),xe++,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(")")),xe&&(xe--,this.outdent()));else{var gt=!1;this._input.lookBack("with")&&(gt=!0),this.preserveSingleSpace(ae||gt),this.print_string(this._ch),Oe&&S==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),G=!0):(this.eatWhitespace(),xe++,this.indent())}else if(this._ch===")")xe&&(xe--,this.outdent()),G&&this._input.peek()===";"&&this._options.selector_separator_newline&&(G=!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&&(!Oe||G)&&xe===0&&!Q?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Oe&&xe===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&&U.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(ae),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),U.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 Rt=S==='"'||S==="'";this.preserveSingleSpace(Rt||ae),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&te&&this._output.add_new_line()}var ht=this._output.get_code(Ie);return ht},fe.exports.Beautifier=ue},function(fe,u,he){var $=he(6).Options;function b(k){$.call(this,k,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var A=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||A;var C=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var K=0;K<C.length;K++)C[K]!=="expand"?this.brace_style="collapse":this.brace_style=C[K]}b.prototype=new $,fe.exports.Options=b}],ne={};function v(fe){var u=ne[fe];if(u!==void 0)return u.exports;var he=ne[fe]={exports:{}};return ge[fe](he,he.exports,v),he.exports}var we=v(15);Le=we})();var Ze=Le;ie=[],F=function(){return{css_beautify:Ze}}.apply(dt,ie),F!==void 0&&($t.exports=F)})()},40998:function($t,dt,ie){var F,Le;(function(){var Ze;(function(){"use strict";var we=[,,function($){function b(C){this.__parent=C,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=[]}b.prototype.clone_empty=function(){var C=new b(this.__parent);return C.set_indent(this.__indent_count,this.__alignment_count),C},b.prototype.item=function(C){return C<0?this.__items[this.__items.length+C]:this.__items[C]},b.prototype.has_match=function(C){for(var K=this.__items.length-1;K>=0;K--)if(this.__items[K].match(C))return!0;return!1},b.prototype.set_indent=function(C,K){this.is_empty()&&(this.__indent_count=C||0,this.__alignment_count=K||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},b.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)},b.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},b.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var C=this.__parent.current_line;return C.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),C.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),C.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,C.__items[0]===" "&&(C.__items.splice(0,1),C.__character_count-=1),!0}return!1},b.prototype.is_empty=function(){return this.__items.length===0},b.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},b.prototype.push=function(C){this.__items.push(C);var K=C.lastIndexOf(`
|
|
`);K!==-1?this.__character_count=C.length-K:this.__character_count+=C.length},b.prototype.pop=function(){var C=null;return this.is_empty()||(C=this.__items.pop(),this.__character_count-=C.length),C},b.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},b.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},b.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},b.prototype.toString=function(){var C="";return this.is_empty()?this.__parent.indent_empty_lines&&(C=this.__parent.get_indent_string(this.__indent_count)):(C=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),C+=this.__items.join("")),C};function k(C,K){this.__cache=[""],this.__indent_size=C.indent_size,this.__indent_string=C.indent_char,C.indent_with_tabs||(this.__indent_string=new Array(C.indent_size+1).join(C.indent_char)),K=K||"",C.indent_level>0&&(K=new Array(C.indent_level+1).join(this.__indent_string)),this.__base_string=K,this.__base_string_length=K.length}k.prototype.get_indent_size=function(C,K){var Z=this.__base_string_length;return K=K||0,C<0&&(Z=0),Z+=C*this.__indent_size,Z+=K,Z},k.prototype.get_indent_string=function(C,K){var Z=this.__base_string;return K=K||0,C<0&&(C=0,Z=""),K+=C*this.__indent_size,this.__ensure_cache(K),Z+=this.__cache[K],Z},k.prototype.__ensure_cache=function(C){for(;C>=this.__cache.length;)this.__add_column()},k.prototype.__add_column=function(){var C=this.__cache.length,K=0,Z="";this.__indent_size&&C>=this.__indent_size&&(K=Math.floor(C/this.__indent_size),C-=K*this.__indent_size,Z=new Array(K+1).join(this.__indent_string)),C&&(Z+=new Array(C+1).join(" ")),this.__cache.push(Z)};function A(C,K){this.__indent_cache=new k(C,K),this.raw=!1,this._end_with_newline=C.end_with_newline,this.indent_size=C.indent_size,this.wrap_line_length=C.wrap_line_length,this.indent_empty_lines=C.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new b(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}A.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},A.prototype.get_line_number=function(){return this.__lines.length},A.prototype.get_indent_string=function(C,K){return this.__indent_cache.get_indent_string(C,K)},A.prototype.get_indent_size=function(C,K){return this.__indent_cache.get_indent_size(C,K)},A.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},A.prototype.add_new_line=function(C){return this.is_empty()||!C&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},A.prototype.get_code=function(C){this.trim(!0);var K=this.current_line.pop();K&&(K[K.length-1]===`
|
|
`&&(K=K.replace(/\n+$/g,"")),this.current_line.push(K)),this._end_with_newline&&this.__add_outputline();var Z=this.__lines.join(`
|
|
`);return C!==`
|
|
`&&(Z=Z.replace(/[\n]/g,C)),Z},A.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},A.prototype.set_indent=function(C,K){return C=C||0,K=K||0,this.next_line.set_indent(C,K),this.__lines.length>1?(this.current_line.set_indent(C,K),!0):(this.current_line.set_indent(),!1)},A.prototype.add_raw_token=function(C){for(var K=0;K<C.newlines;K++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(C.whitespace_before),this.current_line.push(C.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},A.prototype.add_token=function(C){this.__add_space_before_token(),this.current_line.push(C),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},A.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(" "))},A.prototype.remove_indent=function(C){for(var K=this.__lines.length;C<K;)this.__lines[C]._remove_indent(),C++;this.current_line._remove_wrap_indent()},A.prototype.trim=function(C){for(C=C===void 0?!1:C,this.current_line.trim();C&&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},A.prototype.just_added_newline=function(){return this.current_line.is_empty()},A.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},A.prototype.ensure_empty_line_above=function(C,K){for(var Z=this.__lines.length-2;Z>=0;){var U=this.__lines[Z];if(U.is_empty())break;if(U.item(0).indexOf(C)!==0&&U.item(-1)!==K){this.__lines.splice(Z+1,0,new b(this)),this.previous_line=this.__lines[this.__lines.length-2];break}Z--}},$.exports.Output=A},function($){function b(k,A,C,K){this.type=k,this.text=A,this.comments_before=null,this.newlines=C||0,this.whitespace_before=K||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}$.exports.Token=b},,,function($){function b(C,K){this.raw_options=k(C,K),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"])}b.prototype._get_array=function(C,K){var Z=this.raw_options[C],U=K||[];return typeof Z=="object"?Z!==null&&typeof Z.concat=="function"&&(U=Z.concat()):typeof Z=="string"&&(U=Z.split(/[^a-zA-Z0-9_\/\-]+/)),U},b.prototype._get_boolean=function(C,K){var Z=this.raw_options[C],U=Z===void 0?!!K:!!Z;return U},b.prototype._get_characters=function(C,K){var Z=this.raw_options[C],U=K||"";return typeof Z=="string"&&(U=Z.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),U},b.prototype._get_number=function(C,K){var Z=this.raw_options[C];K=parseInt(K,10),isNaN(K)&&(K=0);var U=parseInt(Z,10);return isNaN(U)&&(U=K),U},b.prototype._get_selection=function(C,K,Z){var U=this._get_selection_list(C,K,Z);if(U.length!==1)throw new Error("Invalid Option Value: The option '"+C+`' can only be one of the following values:
|
|
`+K+`
|
|
You passed in: '`+this.raw_options[C]+"'");return U[0]},b.prototype._get_selection_list=function(C,K,Z){if(!K||K.length===0)throw new Error("Selection list cannot be empty.");if(Z=Z||[K[0]],!this._is_valid_selection(Z,K))throw new Error("Invalid Default Value!");var U=this._get_array(C,Z);if(!this._is_valid_selection(U,K))throw new Error("Invalid Option Value: The option '"+C+`' can contain only the following values:
|
|
`+K+`
|
|
You passed in: '`+this.raw_options[C]+"'");return U},b.prototype._is_valid_selection=function(C,K){return C.length&&K.length&&!C.some(function(Z){return K.indexOf(Z)===-1})};function k(C,K){var Z={};C=A(C);var U;for(U in C)U!==K&&(Z[U]=C[U]);if(K&&C[K])for(U in C[K])Z[U]=C[K][U];return Z}function A(C){var K={},Z;for(Z in C){var U=Z.replace(/-/g,"_");K[U]=C[Z]}return K}$.exports.Options=b,$.exports.normalizeOpts=A,$.exports.mergeOpts=k},,function($){var b=RegExp.prototype.hasOwnProperty("sticky");function k(A){this.__input=A||"",this.__input_length=this.__input.length,this.__position=0}k.prototype.restart=function(){this.__position=0},k.prototype.back=function(){this.__position>0&&(this.__position-=1)},k.prototype.hasNext=function(){return this.__position<this.__input_length},k.prototype.next=function(){var A=null;return this.hasNext()&&(A=this.__input.charAt(this.__position),this.__position+=1),A},k.prototype.peek=function(A){var C=null;return A=A||0,A+=this.__position,A>=0&&A<this.__input_length&&(C=this.__input.charAt(A)),C},k.prototype.__match=function(A,C){A.lastIndex=C;var K=A.exec(this.__input);return K&&!(b&&A.sticky)&&K.index!==C&&(K=null),K},k.prototype.test=function(A,C){return C=C||0,C+=this.__position,C>=0&&C<this.__input_length?!!this.__match(A,C):!1},k.prototype.testChar=function(A,C){var K=this.peek(C);return A.lastIndex=0,K!==null&&A.test(K)},k.prototype.match=function(A){var C=this.__match(A,this.__position);return C?this.__position+=C[0].length:C=null,C},k.prototype.read=function(A,C,K){var Z="",U;return A&&(U=this.match(A),U&&(Z+=U[0])),C&&(U||!A)&&(Z+=this.readUntil(C,K)),Z},k.prototype.readUntil=function(A,C){var K="",Z=this.__position;A.lastIndex=this.__position;var U=A.exec(this.__input);return U?(Z=U.index,C&&(Z+=U[0].length)):Z=this.__input_length,K=this.__input.substring(this.__position,Z),this.__position=Z,K},k.prototype.readUntilAfter=function(A){return this.readUntil(A,!0)},k.prototype.get_regexp=function(A,C){var K=null,Z="g";return C&&b&&(Z="y"),typeof A=="string"&&A!==""?K=new RegExp(A,Z):A&&(K=new RegExp(A.source,Z)),K},k.prototype.get_literal_regexp=function(A){return RegExp(A.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},k.prototype.peekUntilAfter=function(A){var C=this.__position,K=this.readUntilAfter(A);return this.__position=C,K},k.prototype.lookBack=function(A){var C=this.__position-1;return C>=A.length&&this.__input.substring(C-A.length,C).toLowerCase()===A},$.exports.InputScanner=k},function($,b,k){var A=k(8).InputScanner,C=k(3).Token,K=k(10).TokenStream,Z=k(11).WhitespacePattern,U={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},M=function(J,de){this._input=new A(J),this._options=de||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Z(this._input)};M.prototype.tokenize=function(){this._input.restart(),this.__tokens=new K,this._reset();for(var J,de=new C(U.START,""),ue=null,be=[],Ie=new K;de.type!==U.EOF;){for(J=this._get_next_token(de,ue);this._is_comment(J);)Ie.add(J),J=this._get_next_token(de,ue);Ie.isEmpty()||(J.comments_before=Ie,Ie=new K),J.parent=ue,this._is_opening(J)?(be.push(ue),ue=J):ue&&this._is_closing(J,ue)&&(J.opened=ue,ue.closed=J,ue=be.pop(),J.parent=ue),J.previous=de,de.next=J,this.__tokens.add(J),de=J}return this.__tokens},M.prototype._is_first_token=function(){return this.__tokens.isEmpty()},M.prototype._reset=function(){},M.prototype._get_next_token=function(J,de){this._readWhitespace();var ue=this._input.read(/.+/g);return ue?this._create_token(U.RAW,ue):this._create_token(U.EOF,"")},M.prototype._is_comment=function(J){return!1},M.prototype._is_opening=function(J){return!1},M.prototype._is_closing=function(J,de){return!1},M.prototype._create_token=function(J,de){var ue=new C(J,de,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return ue},M.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},$.exports.Tokenizer=M,$.exports.TOKEN=U},function($){function b(k){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=k}b.prototype.restart=function(){this.__position=0},b.prototype.isEmpty=function(){return this.__tokens_length===0},b.prototype.hasNext=function(){return this.__position<this.__tokens_length},b.prototype.next=function(){var k=null;return this.hasNext()&&(k=this.__tokens[this.__position],this.__position+=1),k},b.prototype.peek=function(k){var A=null;return k=k||0,k+=this.__position,k>=0&&k<this.__tokens_length&&(A=this.__tokens[k]),A},b.prototype.add=function(k){this.__parent_token&&(k.parent=this.__parent_token),this.__tokens.push(k),this.__tokens_length+=1},$.exports.TokenStream=b},function($,b,k){var A=k(12).Pattern;function C(K,Z){A.call(this,K,Z),Z?this._line_regexp=this._input.get_regexp(Z._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}C.prototype=new A,C.prototype.__set_whitespace_patterns=function(K,Z){K+="\\t ",Z+="\\n\\r",this._match_pattern=this._input.get_regexp("["+K+Z+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+Z+"]")},C.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var K=this._input.read(this._match_pattern);if(K===" ")this.whitespace_before_token=" ";else if(K){var Z=this.__split(this._newline_regexp,K);this.newline_count=Z.length-1,this.whitespace_before_token=Z[this.newline_count]}return K},C.prototype.matching=function(K,Z){var U=this._create();return U.__set_whitespace_patterns(K,Z),U._update(),U},C.prototype._create=function(){return new C(this._input,this)},C.prototype.__split=function(K,Z){K.lastIndex=0;for(var U=0,M=[],J=K.exec(Z);J;)M.push(Z.substring(U,J.index)),U=J.index+J[0].length,J=K.exec(Z);return U<Z.length?M.push(Z.substring(U,Z.length)):M.push(""),M},$.exports.WhitespacePattern=C},function($){function b(k,A){this._input=k,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,A&&(this._starting_pattern=this._input.get_regexp(A._starting_pattern,!0),this._match_pattern=this._input.get_regexp(A._match_pattern,!0),this._until_pattern=this._input.get_regexp(A._until_pattern),this._until_after=A._until_after)}b.prototype.read=function(){var k=this._input.read(this._starting_pattern);return(!this._starting_pattern||k)&&(k+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),k},b.prototype.read_match=function(){return this._input.match(this._match_pattern)},b.prototype.until_after=function(k){var A=this._create();return A._until_after=!0,A._until_pattern=this._input.get_regexp(k),A._update(),A},b.prototype.until=function(k){var A=this._create();return A._until_after=!1,A._until_pattern=this._input.get_regexp(k),A._update(),A},b.prototype.starting_with=function(k){var A=this._create();return A._starting_pattern=this._input.get_regexp(k,!0),A._update(),A},b.prototype.matching=function(k){var A=this._create();return A._match_pattern=this._input.get_regexp(k,!0),A._update(),A},b.prototype._create=function(){return new b(this._input,this)},b.prototype._update=function(){},$.exports.Pattern=b},function($){function b(k,A){k=typeof k=="string"?k:k.source,A=typeof A=="string"?A:A.source,this.__directives_block_pattern=new RegExp(k+/ beautify( \w+[:]\w+)+ /.source+A,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(k+/\sbeautify\signore:end\s/.source+A,"g")}b.prototype.get_directives=function(k){if(!k.match(this.__directives_block_pattern))return null;var A={};this.__directive_pattern.lastIndex=0;for(var C=this.__directive_pattern.exec(k);C;)A[C[1]]=C[2],C=this.__directive_pattern.exec(k);return A},b.prototype.readIgnored=function(k){return k.readUntilAfter(this.__directives_end_ignore_pattern)},$.exports.Directives=b},function($,b,k){var A=k(12).Pattern,C={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function K(Z,U){A.call(this,Z,U),this.__template_pattern=null,this._disabled=Object.assign({},C),this._excluded=Object.assign({},C),U&&(this.__template_pattern=this._input.get_regexp(U.__template_pattern),this._excluded=Object.assign(this._excluded,U._excluded),this._disabled=Object.assign(this._disabled,U._disabled));var M=new A(Z);this.__patterns={handlebars_comment:M.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:M.starting_with(/{{{/).until_after(/}}}/),handlebars:M.starting_with(/{{/).until_after(/}}/),php:M.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:M.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:M.starting_with(/{%/).until_after(/%}/),django_value:M.starting_with(/{{/).until_after(/}}/),django_comment:M.starting_with(/{#/).until_after(/#}/),smarty:M.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:M.starting_with(/{\*/).until_after(/\*}/),smarty_literal:M.starting_with(/{literal}/).until_after(/{\/literal}/)}}K.prototype=new A,K.prototype._create=function(){return new K(this._input,this)},K.prototype._update=function(){this.__set_templated_pattern()},K.prototype.disable=function(Z){var U=this._create();return U._disabled[Z]=!0,U._update(),U},K.prototype.read_options=function(Z){var U=this._create();for(var M in C)U._disabled[M]=Z.templating.indexOf(M)===-1;return U._update(),U},K.prototype.exclude=function(Z){var U=this._create();return U._excluded[Z]=!0,U._update(),U},K.prototype.read=function(){var Z="";this._match_pattern?Z=this._input.read(this._starting_pattern):Z=this._input.read(this._starting_pattern,this.__template_pattern);for(var U=this._read_template();U;)this._match_pattern?U+=this._input.read(this._match_pattern):U+=this._input.readUntil(this.__template_pattern),Z+=U,U=this._read_template();return this._until_after&&(Z+=this._input.readUntilAfter(this._until_pattern)),Z},K.prototype.__set_templated_pattern=function(){var Z=[];this._disabled.php||Z.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||Z.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||Z.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||Z.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(Z.push(this.__patterns.django._starting_pattern.source),Z.push(this.__patterns.django_value._starting_pattern.source),Z.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||Z.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&Z.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+Z.join("|")+")")},K.prototype._read_template=function(){var Z="",U=this._input.peek();if(U==="<"){var M=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&M==="?"&&(Z=Z||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&M==="%"&&(Z=Z||this.__patterns.erb.read())}else U==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(Z=Z||this.__patterns.handlebars_comment.read(),Z=Z||this.__patterns.handlebars_unescaped.read(),Z=Z||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(Z=Z||this.__patterns.django_value.read()),this._excluded.django||(Z=Z||this.__patterns.django_comment.read(),Z=Z||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(Z=Z||this.__patterns.smarty_comment.read(),Z=Z||this.__patterns.smarty_literal.read(),Z=Z||this.__patterns.smarty.read()));return Z},$.exports.TemplatablePattern=K},,,,function($,b,k){var A=k(19).Beautifier,C=k(20).Options;function K(Z,U,M,J){var de=new A(Z,U,M,J);return de.beautify()}$.exports=K,$.exports.defaultOptions=function(){return new C}},function($,b,k){var A=k(20).Options,C=k(2).Output,K=k(21).Tokenizer,Z=k(21).TOKEN,U=/\r\n|[\r\n]/,M=/\r\n|[\r\n]/g,J=function(Q,G){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=Q.max_preserve_newlines,this.preserve_newlines=Q.preserve_newlines,this._output=new C(Q,G)};J.prototype.current_line_has_match=function(Q){return this._output.current_line.has_match(Q)},J.prototype.set_space_before_token=function(Q,G){this._output.space_before_token=Q,this._output.non_breaking_space=G},J.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},J.prototype.add_raw_token=function(Q){this._output.add_raw_token(Q)},J.prototype.print_preserved_newlines=function(Q){var G=0;Q.type!==Z.TEXT&&Q.previous.type!==Z.TEXT&&(G=Q.newlines?1:0),this.preserve_newlines&&(G=Q.newlines<this.max_preserve_newlines+1?Q.newlines:this.max_preserve_newlines+1);for(var Y=0;Y<G;Y++)this.print_newline(Y>0);return G!==0},J.prototype.traverse_whitespace=function(Q){return Q.whitespace_before||Q.newlines?(this.print_preserved_newlines(Q)||(this._output.space_before_token=!0),!0):!1},J.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},J.prototype.print_newline=function(Q){this._output.add_new_line(Q)},J.prototype.print_token=function(Q){Q.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Q.text))},J.prototype.indent=function(){this.indent_level++},J.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},J.prototype.get_full_indent=function(Q){return Q=this.indent_level+(Q||0),Q<1?"":this._output.get_indent_string(Q)};var de=function(Q){for(var G=null,Y=Q.next;Y.type!==Z.EOF&&Q.closed!==Y;){if(Y.type===Z.ATTRIBUTE&&Y.text==="type"){Y.next&&Y.next.type===Z.EQUALS&&Y.next.next&&Y.next.next.type===Z.VALUE&&(G=Y.next.next.text);break}Y=Y.next}return G},ue=function(Q,G){var Y=null,te=null;return G.closed?(Q==="script"?Y="text/javascript":Q==="style"&&(Y="text/css"),Y=de(G)||Y,Y.search("text/css")>-1?te="css":Y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?te="javascript":Y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?te="html":Y.search(/test\/null/)>-1&&(te="null"),te):null};function be(Q,G){return G.indexOf(Q)!==-1}function Ie(Q,G,Y){this.parent=Q||null,this.tag=G?G.tag_name:"",this.indent_level=Y||0,this.parser_token=G||null}function ye(Q){this._printer=Q,this._current_frame=null}ye.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ye.prototype.record_tag=function(Q){var G=new Ie(this._current_frame,Q,this._printer.indent_level);this._current_frame=G},ye.prototype._try_pop_frame=function(Q){var G=null;return Q&&(G=Q.parser_token,this._printer.indent_level=Q.indent_level,this._current_frame=Q.parent),G},ye.prototype._get_frame=function(Q,G){for(var Y=this._current_frame;Y&&Q.indexOf(Y.tag)===-1;){if(G&&G.indexOf(Y.tag)!==-1){Y=null;break}Y=Y.parent}return Y},ye.prototype.try_pop=function(Q,G){var Y=this._get_frame([Q],G);return this._try_pop_frame(Y)},ye.prototype.indent_to_tag=function(Q){var G=this._get_frame(Q);G&&(this._printer.indent_level=G.indent_level)};function xe(Q,G,Y,te){this._source_text=Q||"",G=G||{},this._js_beautify=Y,this._css_beautify=te,this._tag_stack=null;var ve=new A(G,"html");this._options=ve,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"}xe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Q=this._source_text,G=this._options.eol;this._options.eol==="auto"&&(G=`
|
|
`,Q&&U.test(Q)&&(G=Q.match(U)[0])),Q=Q.replace(M,`
|
|
`);var Y=Q.match(/^[\t ]*/)[0],te={text:"",type:""},ve=new $e(this._options),ae=new J(this._options,Y),S=new K(Q,this._options).tokenize();this._tag_stack=new ye(ae);for(var E=null,z=S.next();z.type!==Z.EOF;)z.type===Z.TAG_OPEN||z.type===Z.COMMENT?(E=this._handle_tag_open(ae,z,ve,te,S),ve=E):z.type===Z.ATTRIBUTE||z.type===Z.EQUALS||z.type===Z.VALUE||z.type===Z.TEXT&&!ve.tag_complete?E=this._handle_inside_tag(ae,z,ve,te):z.type===Z.TAG_CLOSE?E=this._handle_tag_close(ae,z,ve):z.type===Z.TEXT?E=this._handle_text(ae,z,ve):z.type===Z.CONTROL_FLOW_OPEN?E=this._handle_control_flow_open(ae,z):z.type===Z.CONTROL_FLOW_CLOSE?E=this._handle_control_flow_close(ae,z):ae.add_raw_token(z),te=E,z=S.next();var ce=ae._output.get_code(G);return ce},xe.prototype._handle_control_flow_open=function(Q,G){var Y={text:G.text,type:G.type};return Q.set_space_before_token(G.newlines||G.whitespace_before!=="",!0),G.newlines?Q.print_preserved_newlines(G):Q.set_space_before_token(G.newlines||G.whitespace_before!=="",!0),Q.print_token(G),Q.indent(),Y},xe.prototype._handle_control_flow_close=function(Q,G){var Y={text:G.text,type:G.type};return Q.deindent(),G.newlines?Q.print_preserved_newlines(G):Q.set_space_before_token(G.newlines||G.whitespace_before!=="",!0),Q.print_token(G),Y},xe.prototype._handle_tag_close=function(Q,G,Y){var te={text:G.text,type:G.type};return Q.alignment_size=0,Y.tag_complete=!0,Q.set_space_before_token(G.newlines||G.whitespace_before!=="",!0),Y.is_unformatted?Q.add_raw_token(G):(Y.tag_start_char==="<"&&(Q.set_space_before_token(G.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&Y.has_wrapped_attrs&&Q.print_newline(!1)),Q.print_token(G)),Y.indent_content&&!(Y.is_unformatted||Y.is_content_unformatted)&&(Q.indent(),Y.indent_content=!1),!Y.is_inline_element&&!(Y.is_unformatted||Y.is_content_unformatted)&&Q.set_wrap_point(),te},xe.prototype._handle_inside_tag=function(Q,G,Y,te){var ve=Y.has_wrapped_attrs,ae={text:G.text,type:G.type};return Q.set_space_before_token(G.newlines||G.whitespace_before!=="",!0),Y.is_unformatted?Q.add_raw_token(G):Y.tag_start_char==="{"&&G.type===Z.TEXT?Q.print_preserved_newlines(G)?(G.newlines=0,Q.add_raw_token(G)):Q.print_token(G):(G.type===Z.ATTRIBUTE?Q.set_space_before_token(!0):(G.type===Z.EQUALS||G.type===Z.VALUE&&G.previous.type===Z.EQUALS)&&Q.set_space_before_token(!1),G.type===Z.ATTRIBUTE&&Y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Q.traverse_whitespace(G),ve=ve||G.newlines!==0),this._is_wrap_attributes_force&&Y.attr_count>=this._options.wrap_attributes_min_attrs&&(te.type!==Z.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Q.print_newline(!1),ve=!0)),Q.print_token(G),ve=ve||Q.previous_token_wrapped(),Y.has_wrapped_attrs=ve),ae},xe.prototype._handle_text=function(Q,G,Y){var te={text:G.text,type:"TK_CONTENT"};return Y.custom_beautifier_name?this._print_custom_beatifier_text(Q,G,Y):Y.is_unformatted||Y.is_content_unformatted?Q.add_raw_token(G):(Q.traverse_whitespace(G),Q.print_token(G)),te},xe.prototype._print_custom_beatifier_text=function(Q,G,Y){var te=this;if(G.text!==""){var ve=G.text,ae,S=1,E="",z="";Y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?ae=this._js_beautify:Y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?ae=this._css_beautify:Y.custom_beautifier_name==="html"&&(ae=function(Rt,ht){var at=new xe(Rt,ht,te._js_beautify,te._css_beautify);return at.beautify()}),this._options.indent_scripts==="keep"?S=0:this._options.indent_scripts==="separate"&&(S=-Q.indent_level);var ce=Q.get_full_indent(S);if(ve=ve.replace(/\n[ \t]*$/,""),Y.custom_beautifier_name!=="html"&&ve[0]==="<"&&ve.match(/^(<!--|<!\[CDATA\[)/)){var qe=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(ve);if(!qe){Q.add_raw_token(G);return}E=ce+qe[1]+`
|
|
`,ve=qe[4],qe[5]&&(z=ce+qe[5]),ve=ve.replace(/\n[ \t]*$/,""),(qe[2]||qe[3].indexOf(`
|
|
`)!==-1)&&(qe=qe[3].match(/[ \t]+$/),qe&&(G.whitespace_before=qe[0]))}if(ve)if(ae){var Xe=function(){this.eol=`
|
|
`};Xe.prototype=this._options.raw_options;var tt=new Xe;ve=ae(ce+ve,tt)}else{var gt=G.whitespace_before;gt&&(ve=ve.replace(new RegExp(`
|
|
(`+gt+")?","g"),`
|
|
`)),ve=ce+ve.replace(/\n/g,`
|
|
`+ce)}E&&(ve?ve=E+ve+`
|
|
`+z:ve=E+z),Q.print_newline(!1),ve&&(G.text=ve,G.whitespace_before="",G.newlines=0,Q.add_raw_token(G),Q.print_newline(!0))}},xe.prototype._handle_tag_open=function(Q,G,Y,te,ve){var ae=this._get_tag_open_token(G);if((Y.is_unformatted||Y.is_content_unformatted)&&!Y.is_empty_element&&G.type===Z.TAG_OPEN&&!ae.is_start_tag?(Q.add_raw_token(G),ae.start_tag_token=this._tag_stack.try_pop(ae.tag_name)):(Q.traverse_whitespace(G),this._set_tag_position(Q,G,ae,Y,te),ae.is_inline_element||Q.set_wrap_point(),Q.print_token(G)),ae.is_start_tag&&this._is_wrap_attributes_force){var S=0,E;do E=ve.peek(S),E.type===Z.ATTRIBUTE&&(ae.attr_count+=1),S+=1;while(E.type!==Z.EOF&&E.type!==Z.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(ae.alignment_size=G.text.length+1),!ae.tag_complete&&!ae.is_unformatted&&(Q.alignment_size=ae.alignment_size),ae};var $e=function(Q,G,Y){if(this.parent=G||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="",!Y)this.tag_complete=!0;else{var te;this.tag_start_char=Y.text[0],this.text=Y.text,this.tag_start_char==="<"?(te=Y.text.match(/^<([^\s>]*)/),this.tag_check=te?te[1]:""):(te=Y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=te?te[1]:"",(Y.text.startsWith("{{#>")||Y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&Y.next!==null?this.tag_check=Y.next.text.split(" ")[0]:this.tag_check=Y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),Y.type===Z.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||Y.closed&&Y.closed.text==="/>";var ve=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(ve=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!Q.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(ve)))}};xe.prototype._get_tag_open_token=function(Q){var G=new $e(this._options,this._tag_stack.get_parser_token(),Q);return G.alignment_size=this._options.wrap_attributes_indent_size,G.is_end_tag=G.is_end_tag||be(G.tag_check,this._options.void_elements),G.is_empty_element=G.tag_complete||G.is_start_tag&&G.is_end_tag,G.is_unformatted=!G.tag_complete&&be(G.tag_check,this._options.unformatted),G.is_content_unformatted=!G.is_empty_element&&be(G.tag_check,this._options.content_unformatted),G.is_inline_element=be(G.tag_name,this._options.inline)||this._options.inline_custom_elements&&G.tag_name.includes("-")||G.tag_start_char==="{",G},xe.prototype._set_tag_position=function(Q,G,Y,te,ve){if(Y.is_empty_element||(Y.is_end_tag?Y.start_tag_token=this._tag_stack.try_pop(Y.tag_name):(this._do_optional_end_element(Y)&&(Y.is_inline_element||Q.print_newline(!1)),this._tag_stack.record_tag(Y),(Y.tag_name==="script"||Y.tag_name==="style")&&!(Y.is_unformatted||Y.is_content_unformatted)&&(Y.custom_beautifier_name=ue(Y.tag_check,G)))),be(Y.tag_check,this._options.extra_liners)&&(Q.print_newline(!1),Q._output.just_added_blankline()||Q.print_newline(!0)),Y.is_empty_element){if(Y.tag_start_char==="{"&&Y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),Y.indent_content=!0;var ae=Q.current_line_has_match(/{{#if/);ae||Q.print_newline(!1)}Y.tag_name==="!--"&&ve.type===Z.TAG_CLOSE&&te.is_end_tag&&Y.text.indexOf(`
|
|
`)===-1||(Y.is_inline_element||Y.is_unformatted||Q.print_newline(!1),this._calcluate_parent_multiline(Q,Y))}else if(Y.is_end_tag){var S=!1;S=Y.start_tag_token&&Y.start_tag_token.multiline_content,S=S||!Y.is_inline_element&&!(te.is_inline_element||te.is_unformatted)&&!(ve.type===Z.TAG_CLOSE&&Y.start_tag_token===te)&&ve.type!=="TK_CONTENT",(Y.is_content_unformatted||Y.is_unformatted)&&(S=!1),S&&Q.print_newline(!1)}else Y.indent_content=!Y.custom_beautifier_name,Y.tag_start_char==="<"&&(Y.tag_name==="html"?Y.indent_content=this._options.indent_inner_html:Y.tag_name==="head"?Y.indent_content=this._options.indent_head_inner_html:Y.tag_name==="body"&&(Y.indent_content=this._options.indent_body_inner_html)),!(Y.is_inline_element||Y.is_unformatted)&&(ve.type!=="TK_CONTENT"||Y.is_content_unformatted)&&Q.print_newline(!1),this._calcluate_parent_multiline(Q,Y)},xe.prototype._calcluate_parent_multiline=function(Q,G){G.parent&&Q._output.just_added_newline()&&!((G.is_inline_element||G.is_unformatted)&&G.parent.is_inline_element)&&(G.parent.multiline_content=!0)};var Oe=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],He=["a","audio","del","ins","map","noscript","video"];xe.prototype._do_optional_end_element=function(Q){var G=null;if(!(Q.is_empty_element||!Q.is_start_tag||!Q.parent)){if(Q.tag_name==="body")G=G||this._tag_stack.try_pop("head");else if(Q.tag_name==="li")G=G||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Q.tag_name==="dd"||Q.tag_name==="dt")G=G||this._tag_stack.try_pop("dt",["dl"]),G=G||this._tag_stack.try_pop("dd",["dl"]);else if(Q.parent.tag_name==="p"&&Oe.indexOf(Q.tag_name)!==-1){var Y=Q.parent.parent;(!Y||He.indexOf(Y.tag_name)===-1)&&(G=G||this._tag_stack.try_pop("p"))}else Q.tag_name==="rp"||Q.tag_name==="rt"?(G=G||this._tag_stack.try_pop("rt",["ruby","rtc"]),G=G||this._tag_stack.try_pop("rp",["ruby","rtc"])):Q.tag_name==="optgroup"?G=G||this._tag_stack.try_pop("optgroup",["select"]):Q.tag_name==="option"?G=G||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Q.tag_name==="colgroup"?G=G||this._tag_stack.try_pop("caption",["table"]):Q.tag_name==="thead"?(G=G||this._tag_stack.try_pop("caption",["table"]),G=G||this._tag_stack.try_pop("colgroup",["table"])):Q.tag_name==="tbody"||Q.tag_name==="tfoot"?(G=G||this._tag_stack.try_pop("caption",["table"]),G=G||this._tag_stack.try_pop("colgroup",["table"]),G=G||this._tag_stack.try_pop("thead",["table"]),G=G||this._tag_stack.try_pop("tbody",["table"])):Q.tag_name==="tr"?(G=G||this._tag_stack.try_pop("caption",["table"]),G=G||this._tag_stack.try_pop("colgroup",["table"]),G=G||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Q.tag_name==="th"||Q.tag_name==="td")&&(G=G||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),G=G||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Q.parent=this._tag_stack.get_parser_token(),G}},$.exports.Beautifier=xe},function($,b,k){var A=k(6).Options;function C(K){A.call(this,K,"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"])}C.prototype=new A,$.exports.Options=C},function($,b,k){var A=k(9).Tokenizer,C=k(9).TOKEN,K=k(13).Directives,Z=k(14).TemplatablePattern,U=k(12).Pattern,M={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:C.START,RAW:C.RAW,EOF:C.EOF},J=new K(/<\!--/,/-->/),de=function(ue,be){A.call(this,ue,be),this._current_tag_name="";var Ie=new Z(this._input).read_options(this._options),ye=new U(this._input);if(this.__patterns={word:Ie.until(/[\n\r\t <]/),word_control_flow_close_excluded:Ie.until(/[\n\r\t <}]/),single_quote:Ie.until_after(/'/),double_quote:Ie.until_after(/"/),attribute:Ie.until(/[\n\r\t =>]|\/>/),element_name:Ie.until(/[\n\r\t >\/]/),angular_control_flow_start:ye.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ye.starting_with(/{{!--/).until_after(/--}}/),handlebars:ye.starting_with(/{{/).until_after(/}}/),handlebars_open:ye.until(/[\n\r\t }]/),handlebars_raw_close:ye.until(/}}/),comment:ye.starting_with(/<!--/).until_after(/-->/),cdata:ye.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ye.starting_with(/<!\[/).until_after(/]>/),processing:ye.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 xe=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ye.matching(xe).until_after(xe)}};de.prototype=new A,de.prototype._is_comment=function(ue){return!1},de.prototype._is_opening=function(ue){return ue.type===M.TAG_OPEN||ue.type===M.CONTROL_FLOW_OPEN},de.prototype._is_closing=function(ue,be){return ue.type===M.TAG_CLOSE&&be&&((ue.text===">"||ue.text==="/>")&&be.text[0]==="<"||ue.text==="}}"&&be.text[0]==="{"&&be.text[1]==="{")||ue.type===M.CONTROL_FLOW_CLOSE&&ue.text==="}"&&be.text.endsWith("{")},de.prototype._reset=function(){this._current_tag_name=""},de.prototype._get_next_token=function(ue,be){var Ie=null;this._readWhitespace();var ye=this._input.peek();return ye===null?this._create_token(M.EOF,""):(Ie=Ie||this._read_open_handlebars(ye,be),Ie=Ie||this._read_attribute(ye,ue,be),Ie=Ie||this._read_close(ye,be),Ie=Ie||this._read_script_and_style(ye,ue),Ie=Ie||this._read_control_flows(ye,be),Ie=Ie||this._read_raw_content(ye,ue,be),Ie=Ie||this._read_content_word(ye,be),Ie=Ie||this._read_comment_or_cdata(ye),Ie=Ie||this._read_processing(ye),Ie=Ie||this._read_open(ye,be),Ie=Ie||this._create_token(M.UNKNOWN,this._input.next()),Ie)},de.prototype._read_comment_or_cdata=function(ue){var be=null,Ie=null,ye=null;if(ue==="<"){var xe=this._input.peek(1);xe==="!"&&(Ie=this.__patterns.comment.read(),Ie?(ye=J.get_directives(Ie),ye&&ye.ignore==="start"&&(Ie+=J.readIgnored(this._input))):Ie=this.__patterns.cdata.read()),Ie&&(be=this._create_token(M.COMMENT,Ie),be.directives=ye)}return be},de.prototype._read_processing=function(ue){var be=null,Ie=null,ye=null;if(ue==="<"){var xe=this._input.peek(1);(xe==="!"||xe==="?")&&(Ie=this.__patterns.conditional_comment.read(),Ie=Ie||this.__patterns.processing.read()),Ie&&(be=this._create_token(M.COMMENT,Ie),be.directives=ye)}return be},de.prototype._read_open=function(ue,be){var Ie=null,ye=null;return(!be||be.type===M.CONTROL_FLOW_OPEN)&&ue==="<"&&(Ie=this._input.next(),this._input.peek()==="/"&&(Ie+=this._input.next()),Ie+=this.__patterns.element_name.read(),ye=this._create_token(M.TAG_OPEN,Ie)),ye},de.prototype._read_open_handlebars=function(ue,be){var Ie=null,ye=null;return(!be||be.type===M.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&ue==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(Ie=this.__patterns.handlebars_comment.read(),Ie=Ie||this.__patterns.handlebars.read(),ye=this._create_token(M.COMMENT,Ie)):(Ie=this.__patterns.handlebars_open.read(),ye=this._create_token(M.TAG_OPEN,Ie))),ye},de.prototype._read_control_flows=function(ue,be){var Ie="",ye=null;if(!this._options.templating.includes("angular"))return ye;if(ue==="@"){if(Ie=this.__patterns.angular_control_flow_start.read(),Ie==="")return ye;for(var xe=Ie.endsWith("(")?1:0,$e=0;!(Ie.endsWith("{")&&xe===$e);){var Oe=this._input.next();if(Oe===null)break;Oe==="("?xe++:Oe===")"&&$e++,Ie+=Oe}ye=this._create_token(M.CONTROL_FLOW_OPEN,Ie)}else ue==="}"&&be&&be.type===M.CONTROL_FLOW_OPEN&&(Ie=this._input.next(),ye=this._create_token(M.CONTROL_FLOW_CLOSE,Ie));return ye},de.prototype._read_close=function(ue,be){var Ie=null,ye=null;return be&&be.type===M.TAG_OPEN&&(be.text[0]==="<"&&(ue===">"||ue==="/"&&this._input.peek(1)===">")?(Ie=this._input.next(),ue==="/"&&(Ie+=this._input.next()),ye=this._create_token(M.TAG_CLOSE,Ie)):be.text[0]==="{"&&ue==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ye=this._create_token(M.TAG_CLOSE,"}}"))),ye},de.prototype._read_attribute=function(ue,be,Ie){var ye=null,xe="";if(Ie&&Ie.text[0]==="<")if(ue==="=")ye=this._create_token(M.EQUALS,this._input.next());else if(ue==='"'||ue==="'"){var $e=this._input.next();ue==='"'?$e+=this.__patterns.double_quote.read():$e+=this.__patterns.single_quote.read(),ye=this._create_token(M.VALUE,$e)}else xe=this.__patterns.attribute.read(),xe&&(be.type===M.EQUALS?ye=this._create_token(M.VALUE,xe):ye=this._create_token(M.ATTRIBUTE,xe));return ye},de.prototype._is_content_unformatted=function(ue){return this._options.void_elements.indexOf(ue)===-1&&(this._options.content_unformatted.indexOf(ue)!==-1||this._options.unformatted.indexOf(ue)!==-1)},de.prototype._read_raw_content=function(ue,be,Ie){var ye="";if(Ie&&Ie.text[0]==="{")ye=this.__patterns.handlebars_raw_close.read();else if(be.type===M.TAG_CLOSE&&be.opened.text[0]==="<"&&be.text[0]!=="/"){var xe=be.opened.text.substr(1).toLowerCase();this._is_content_unformatted(xe)&&(ye=this._input.readUntil(new RegExp("</"+xe+"[\\n\\r\\t ]*?>","ig")))}return ye?this._create_token(M.TEXT,ye):null},de.prototype._read_script_and_style=function(ue,be){if(be.type===M.TAG_CLOSE&&be.opened.text[0]==="<"&&be.text[0]!=="/"){var Ie=be.opened.text.substr(1).toLowerCase();if(Ie==="script"||Ie==="style"){var ye=this._read_comment_or_cdata(ue);if(ye)return ye.type=M.TEXT,ye;var xe=this._input.readUntil(new RegExp("</"+Ie+"[\\n\\r\\t ]*?>","ig"));if(xe)return this._create_token(M.TEXT,xe)}}return null},de.prototype._read_content_word=function(ue,be){var Ie="";return this._options.unformatted_content_delimiter&&ue===this._options.unformatted_content_delimiter[0]&&(Ie=this.__patterns.unformatted_content_delimiter.read()),Ie||(Ie=be&&be.type===M.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),Ie?this._create_token(M.TEXT,Ie):null},$.exports.Tokenizer=de,$.exports.TOKEN=M}],fe={};function u($){var b=fe[$];if(b!==void 0)return b.exports;var k=fe[$]={exports:{}};return we[$](k,k.exports,u),k.exports}var he=u(18);Ze=he})();var ge=Ze;if(1)F=[ie,ie(58553),ie(87804)],Le=function(we){var fe=ie(58553),u=ie(87804);return{html_beautify:function(he,$){return ge(he,$,fe.js_beautify,u.css_beautify)}}}.apply(dt,F),Le!==void 0&&($t.exports=Le);else var ne,v})()},58553:function($t,dt){var ie,F;(function(){var Le;(function(){"use strict";var ge=[function(fe,u,he){var $=he(1).Beautifier,b=he(5).Options;function k(A,C){var K=new $(A,C);return K.beautify()}fe.exports=k,fe.exports.defaultOptions=function(){return new b}},function(fe,u,he){var $=he(2).Output,b=he(3).Token,k=he(4),A=he(5).Options,C=he(7).Tokenizer,K=he(7).line_starters,Z=he(7).positionable_operators,U=he(7).TOKEN;function M(E,z){return z.indexOf(E)!==-1}function J(E){return E.replace(/^\s+/g,"")}function de(E){for(var z={},ce=0;ce<E.length;ce++)z[E[ce].replace(/-/g,"_")]=E[ce];return z}function ue(E,z){return E&&E.type===U.RESERVED&&E.text===z}function be(E,z){return E&&E.type===U.RESERVED&&M(E.text,z)}var Ie=["case","return","do","if","throw","else","await","break","continue","async"],ye=["before-newline","after-newline","preserve-newline"],xe=de(ye),$e=[xe.before_newline,xe.preserve_newline],Oe={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function He(E,z){z.multiline_frame||z.mode===Oe.ForInitializer||z.mode===Oe.Conditional||E.remove_indent(z.start_line_index)}function Q(E){E=E.replace(k.allLineBreaks,`
|
|
`);for(var z=[],ce=E.indexOf(`
|
|
`);ce!==-1;)z.push(E.substring(0,ce)),E=E.substring(ce+1),ce=E.indexOf(`
|
|
`);return E.length&&z.push(E),z}function G(E){return E===Oe.ArrayLiteral}function Y(E){return M(E,[Oe.Expression,Oe.ForInitializer,Oe.Conditional])}function te(E,z){for(var ce=0;ce<E.length;ce++){var qe=E[ce].trim();if(qe.charAt(0)!==z)return!1}return!0}function ve(E,z){for(var ce=0,qe=E.length,Xe;ce<qe;ce++)if(Xe=E[ce],Xe&&Xe.indexOf(z)!==0)return!1;return!0}function ae(E,z){z=z||{},this._source_text=E||"",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 A(z)}ae.prototype.create_flags=function(E,z){var ce=0;E&&(ce=E.indentation_level,!this._output.just_added_newline()&&E.line_indent_level>ce&&(ce=E.line_indent_level));var qe={mode:z,parent:E,last_token:E?E.last_token:new b(U.START_BLOCK,""),last_word:E?E.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:ce,alignment:0,line_indent_level:E?E.line_indent_level:ce,start_line_index:this._output.get_line_number(),ternary_depth:0};return qe},ae.prototype._reset=function(E){var z=E.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new $(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Oe.BlockStatement);var ce=new C(E,this._options);return this._tokens=ce.tokenize(),E},ae.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E,z=this._reset(this._source_text),ce=this._options.eol;this._options.eol==="auto"&&(ce=`
|
|
`,z&&k.lineBreak.test(z||"")&&(ce=z.match(k.lineBreak)[0]));for(var qe=this._tokens.next();qe;)this.handle_token(qe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=qe,qe=this._tokens.next();return E=this._output.get_code(ce),E},ae.prototype.handle_token=function(E,z){E.type===U.START_EXPR?this.handle_start_expr(E):E.type===U.END_EXPR?this.handle_end_expr(E):E.type===U.START_BLOCK?this.handle_start_block(E):E.type===U.END_BLOCK?this.handle_end_block(E):E.type===U.WORD?this.handle_word(E):E.type===U.RESERVED?this.handle_word(E):E.type===U.SEMICOLON?this.handle_semicolon(E):E.type===U.STRING?this.handle_string(E):E.type===U.EQUALS?this.handle_equals(E):E.type===U.OPERATOR?this.handle_operator(E):E.type===U.COMMA?this.handle_comma(E):E.type===U.BLOCK_COMMENT?this.handle_block_comment(E,z):E.type===U.COMMENT?this.handle_comment(E,z):E.type===U.DOT?this.handle_dot(E):E.type===U.EOF?this.handle_eof(E):E.type===U.UNKNOWN?this.handle_unknown(E,z):this.handle_unknown(E,z)},ae.prototype.handle_whitespace_and_comments=function(E,z){var ce=E.newlines,qe=this._options.keep_array_indentation&&G(this._flags.mode);if(E.comments_before)for(var Xe=E.comments_before.next();Xe;)this.handle_whitespace_and_comments(Xe,z),this.handle_token(Xe,z),Xe=E.comments_before.next();if(qe)for(var tt=0;tt<ce;tt+=1)this.print_newline(tt>0,z);else if(this._options.max_preserve_newlines&&ce>this._options.max_preserve_newlines&&(ce=this._options.max_preserve_newlines),this._options.preserve_newlines&&ce>1){this.print_newline(!1,z);for(var gt=1;gt<ce;gt+=1)this.print_newline(!0,z)}};var S=["async","break","continue","return","throw","yield"];ae.prototype.allow_wrap_or_preserved_newline=function(E,z){if(z=z===void 0?!1:z,!this._output.just_added_newline()){var ce=this._options.preserve_newlines&&E.newlines||z,qe=M(this._flags.last_token.text,Z)||M(E.text,Z);if(qe){var Xe=M(this._flags.last_token.text,Z)&&M(this._options.operator_position,$e)||M(E.text,Z);ce=ce&&Xe}if(ce)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(be(this._flags.last_token,S))return;this._output.set_wrap_point()}}},ae.prototype.print_newline=function(E,z){if(!z&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==U.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var ce=this._tokens.peek();this._flags.mode===Oe.Statement&&!(this._flags.if_block&&ue(ce,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(E)&&(this._flags.multiline_frame=!0)},ae.prototype.print_token_line_indentation=function(E){this._output.just_added_newline()&&(this._options.keep_array_indentation&&E.newlines&&(E.text==="["||G(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(E.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))},ae.prototype.print_token=function(E){if(this._output.raw){this._output.add_raw_token(E);return}if(this._options.comma_first&&E.previous&&E.previous.type===U.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(E),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(E),this._output.non_breaking_space=!0,this._output.add_token(E.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},ae.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},ae.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))},ae.prototype.set_mode=function(E){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,E),this._flags=this.create_flags(this._previous_flags,E),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},ae.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Oe.Statement&&He(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},ae.prototype.start_of_object_property=function(){return this._flags.parent.mode===Oe.ObjectLiteral&&this._flags.mode===Oe.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||be(this._flags.last_token,["get","set"]))},ae.prototype.start_of_statement=function(E){var z=!1;return z=z||be(this._flags.last_token,["var","let","const"])&&E.type===U.WORD,z=z||ue(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===Oe.ObjectLiteral&&this._flags.mode===Oe.Statement)&&be(this._flags.last_token,S)&&!E.newlines,z=z||ue(this._flags.last_token,"else")&&!(ue(E,"if")&&!E.comments_before),z=z||this._flags.last_token.type===U.END_EXPR&&(this._previous_flags.mode===Oe.ForInitializer||this._previous_flags.mode===Oe.Conditional),z=z||this._flags.last_token.type===U.WORD&&this._flags.mode===Oe.BlockStatement&&!this._flags.in_case&&!(E.text==="--"||E.text==="++")&&this._last_last_text!=="function"&&E.type!==U.WORD&&E.type!==U.RESERVED,z=z||this._flags.mode===Oe.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||be(this._flags.last_token,["get","set"])),z?(this.set_mode(Oe.Statement),this.indent(),this.handle_whitespace_and_comments(E,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E,be(E,["do","for","if","while"])),!0):!1},ae.prototype.handle_start_expr=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E);var z=Oe.Expression;if(E.text==="["){if(this._flags.last_token.type===U.WORD||this._flags.last_token.text===")"){be(this._flags.last_token,K)&&(this._output.space_before_token=!0),this.print_token(E),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=Oe.ArrayLiteral,G(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()),M(this._flags.last_token.type,[U.START_EXPR,U.END_EXPR,U.WORD,U.OPERATOR,U.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===U.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=Oe.ForInitializer):M(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=Oe.Conditional):M(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&E.whitespace_before===""?this._output.space_before_token=!1:(M(this._flags.last_token.text,K)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E);else if(this._flags.last_token.type===U.WORD){this._output.space_before_token=!1;var ce=this._tokens.peek(-3);if(this._options.space_after_named_function&&ce){var qe=this._tokens.peek(-4);be(ce,["async","function"])||ce.text==="*"&&be(qe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Oe.ObjectLiteral?(ce.text==="{"||ce.text===","||ce.text==="*"&&(qe.text==="{"||qe.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(E);(this._flags.last_token.type===U.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(M(this._last_last_text,["function","yield"])||this._flags.mode===Oe.ObjectLiteral&&M(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===U.START_BLOCK?this.print_newline():(this._flags.last_token.type===U.END_EXPR||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===U.COMMA)&&this.allow_wrap_or_preserved_newline(E,E.newlines),this.print_token(E),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},ae.prototype.handle_end_expr=function(E){for(;this._flags.mode===Oe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(E,E.text==="]"&&G(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===U.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(E),this.restore_mode(),He(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Oe.Conditional&&(this._previous_flags.mode=Oe.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},ae.prototype.handle_start_block=function(E){this.handle_whitespace_and_comments(E);var z=this._tokens.peek(),ce=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===U.END_EXPR?(this.set_mode(Oe.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Oe.BlockStatement):ce&&(M(ce.text,[":",","])&&M(z.type,[U.STRING,U.WORD,U.RESERVED])||M(z.text,["get","set","..."])&&M(ce.type,[U.WORD,U.RESERVED]))?M(this._last_last_text,["class","interface"])&&!M(ce.text,[":",","])?this.set_mode(Oe.BlockStatement):this.set_mode(Oe.ObjectLiteral):this._flags.last_token.type===U.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Oe.BlockStatement):M(this._flags.last_token.type,[U.EQUALS,U.START_EXPR,U.COMMA,U.OPERATOR])||be(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Oe.ObjectLiteral):this.set_mode(Oe.BlockStatement),this._flags.last_token&&be(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var qe=!z.comments_before&&z.text==="}",Xe=qe&&this._flags.last_word==="function"&&this._flags.last_token.type===U.END_EXPR;if(this._options.brace_preserve_inline){var tt=0,gt=null;this._flags.inline_frame=!0;do if(tt+=1,gt=this._tokens.peek(tt-1),gt.newlines){this._flags.inline_frame=!1;break}while(gt.type!==U.EOF&&!(gt.type===U.END_BLOCK&>.opened===E))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==U.OPERATOR&&(Xe||this._flags.last_token.type===U.EQUALS||be(this._flags.last_token,Ie)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(G(this._previous_flags.mode)&&(this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.COMMA)&&((this._flags.last_token.type===U.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(E),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==U.OPERATOR&&this._flags.last_token.type!==U.START_EXPR&&(M(this._flags.last_token.type,[U.START_BLOCK,U.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(E),this.indent(),!qe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},ae.prototype.handle_end_block=function(E){for(this.handle_whitespace_and_comments(E);this._flags.mode===Oe.Statement;)this.restore_mode();var z=this._flags.last_token.type===U.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(G(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(E)},ae.prototype.handle_word=function(E){if(E.type===U.RESERVED){if(M(E.text,["set","get"])&&this._flags.mode!==Oe.ObjectLiteral)E.type=U.WORD;else if(E.text==="import"&&M(this._tokens.peek().text,["(","."]))E.type=U.WORD;else if(M(E.text,["as","from"])&&!this._flags.import_block)E.type=U.WORD;else if(this._flags.mode===Oe.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(E.type=U.WORD)}}if(this.start_of_statement(E)?be(this._flags.last_token,["var","let","const"])&&E.type===U.WORD&&(this._flags.declaration_statement=!0):E.newlines&&!Y(this._flags.mode)&&(this._flags.last_token.type!==U.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==U.EQUALS&&(this._options.preserve_newlines||!be(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(E),this.print_newline()):this.handle_whitespace_and_comments(E),this._flags.do_block&&!this._flags.do_while)if(ue(E,"while")){this._output.space_before_token=!0,this.print_token(E),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&&ue(E,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Oe.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&be(E,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(E),this._flags.in_case=!0;return}if((this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR)&&!this.start_of_object_property()&&!(M(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Oe.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(E),ue(E,"function")){(M(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(M(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===U.OPERATOR))&&!this._output.just_added_blankline()&&!E.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD?be(this._flags.last_token,["get","set","new","export"])||be(this._flags.last_token,S)?this._output.space_before_token=!0:ue(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===U.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(Y(this._flags.mode)||G(this._flags.mode))||this.print_newline(),this.print_token(E),this._flags.last_word=E.text;return}var ce="NONE";if(this._flags.last_token.type===U.END_BLOCK?this._previous_flags.inline_frame?ce="SPACE":be(E,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines?ce="NEWLINE":(ce="SPACE",this._output.space_before_token=!0):ce="NEWLINE":this._flags.last_token.type===U.SEMICOLON&&this._flags.mode===Oe.BlockStatement?ce="NEWLINE":this._flags.last_token.type===U.SEMICOLON&&Y(this._flags.mode)?ce="SPACE":this._flags.last_token.type===U.STRING?ce="NEWLINE":this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD||this._flags.last_token.text==="*"&&(M(this._last_last_text,["function","yield"])||this._flags.mode===Oe.ObjectLiteral&&M(this._last_last_text,["{",","]))?ce="SPACE":this._flags.last_token.type===U.START_BLOCK?this._flags.inline_frame?ce="SPACE":ce="NEWLINE":this._flags.last_token.type===U.END_EXPR&&(this._output.space_before_token=!0,ce="NEWLINE"),be(E,K)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ce="SPACE":ce="NEWLINE"),be(E,["else","catch","finally"]))if((!(this._flags.last_token.type===U.END_BLOCK&&this._previous_flags.mode===Oe.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var qe=this._output.current_line;qe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ce==="NEWLINE"?be(this._flags.last_token,Ie)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&be(E,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==U.END_EXPR?(this._flags.last_token.type!==U.START_EXPR||!be(E,["var","let","const"]))&&this._flags.last_token.text!==":"&&(ue(E,"if")&&ue(E.previous,"else")?this._output.space_before_token=!0:this.print_newline()):be(E,K)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&G(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ce==="SPACE"&&(this._output.space_before_token=!0);E.previous&&(E.previous.type===U.WORD||E.previous.type===U.RESERVED)&&(this._output.space_before_token=!0),this.print_token(E),this._flags.last_word=E.text,E.type===U.RESERVED&&(E.text==="do"?this._flags.do_block=!0:E.text==="if"?this._flags.if_block=!0:E.text==="import"?this._flags.import_block=!0:this._flags.import_block&&ue(E,"from")&&(this._flags.import_block=!1))},ae.prototype.handle_semicolon=function(E){this.start_of_statement(E)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(E);for(var z=this._tokens.peek();this._flags.mode===Oe.Statement&&!(this._flags.if_block&&ue(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(E)},ae.prototype.handle_string=function(E){E.text.startsWith("`")&&E.newlines===0&&E.whitespace_before===""&&(E.previous.text===")"||this._flags.last_token.type===U.WORD)||(this.start_of_statement(E)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(E),this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E):E.text.startsWith("`")&&this._flags.last_token.type===U.END_EXPR&&(E.previous.text==="]"||E.previous.text===")")&&E.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(E)},ae.prototype.handle_equals=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0},ae.prototype.handle_comma=function(E){this.handle_whitespace_and_comments(E,!0),this.print_token(E),this._output.space_before_token=!0,this._flags.declaration_statement?(Y(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(E)):this._flags.mode===Oe.ObjectLiteral||this._flags.mode===Oe.Statement&&this._flags.parent.mode===Oe.ObjectLiteral?(this._flags.mode===Oe.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(E)},ae.prototype.handle_operator=function(E){var z=E.text==="*"&&(be(this._flags.last_token,["function","yield"])||M(this._flags.last_token.type,[U.START_BLOCK,U.COMMA,U.END_BLOCK,U.SEMICOLON])),ce=M(E.text,["-","+"])&&(M(this._flags.last_token.type,[U.START_BLOCK,U.START_EXPR,U.EQUALS,U.OPERATOR])||M(this._flags.last_token.text,K)||this._flags.last_token.text===",");if(!this.start_of_statement(E)){var qe=!z;this.handle_whitespace_and_comments(E,qe)}if(E.text==="*"&&this._flags.last_token.type===U.DOT){this.print_token(E);return}if(E.text==="::"){this.print_token(E);return}if(M(E.text,["-","+"])&&this.start_of_object_property()){this.print_token(E);return}if(this._flags.last_token.type===U.OPERATOR&&M(this._options.operator_position,$e)&&this.allow_wrap_or_preserved_newline(E),E.text===":"&&this._flags.in_case){this.print_token(E),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==U.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Xe=!0,tt=!0,gt=!1;if(E.text===":"?this._flags.ternary_depth===0?Xe=!1:(this._flags.ternary_depth-=1,gt=!0):E.text==="?"&&(this._flags.ternary_depth+=1),!ce&&!z&&this._options.preserve_newlines&&M(E.text,Z)){var Rt=E.text===":",ht=Rt&>,at=Rt&&!gt;switch(this._options.operator_position){case xe.before_newline:this._output.space_before_token=!at,this.print_token(E),(!Rt||ht)&&this.allow_wrap_or_preserved_newline(E),this._output.space_before_token=!0;return;case xe.after_newline:this._output.space_before_token=!0,!Rt||ht?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(E):this._output.space_before_token=!1,this.print_token(E),this._output.space_before_token=!0;return;case xe.preserve_newline:at||this.allow_wrap_or_preserved_newline(E),Xe=!(this._output.just_added_newline()||at),this._output.space_before_token=Xe,this.print_token(E),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(E),Xe=!1;var Ct=this._tokens.peek();tt=Ct&&M(Ct.type,[U.WORD,U.RESERVED])}else if(E.text==="...")this.allow_wrap_or_preserved_newline(E),Xe=this._flags.last_token.type===U.START_BLOCK,tt=!1;else if(M(E.text,["--","++","!","~"])||ce){if((this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR)&&this.allow_wrap_or_preserved_newline(E),Xe=!1,tt=!1,E.newlines&&(E.text==="--"||E.text==="++"||E.text==="~")){var Vt=be(this._flags.last_token,Ie)&&E.newlines;Vt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Vt,!0)}this._flags.last_token.text===";"&&Y(this._flags.mode)&&(Xe=!0),this._flags.last_token.type===U.RESERVED?Xe=!0:this._flags.last_token.type===U.END_EXPR?Xe=!(this._flags.last_token.text==="]"&&(E.text==="--"||E.text==="++")):this._flags.last_token.type===U.OPERATOR&&(Xe=M(E.text,["--","-","++","+"])&&M(this._flags.last_token.text,["--","-","++","+"]),M(E.text,["+","-"])&&M(this._flags.last_token.text,["--","++"])&&(tt=!0)),(this._flags.mode===Oe.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Oe.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Xe,this.print_token(E),this._output.space_before_token=tt},ae.prototype.handle_block_comment=function(E,z){if(this._output.raw){this._output.add_raw_token(E),E.directives&&E.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(E.directives){this.print_newline(!1,z),this.print_token(E),E.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!k.newline.test(E.text)&&!E.newlines){this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0;return}else this.print_block_commment(E,z)},ae.prototype.print_block_commment=function(E,z){var ce=Q(E.text),qe,Xe=!1,tt=!1,gt=E.whitespace_before,Rt=gt.length;if(this.print_newline(!1,z),this.print_token_line_indentation(E),this._output.add_token(ce[0]),this.print_newline(!1,z),ce.length>1){for(ce=ce.slice(1),Xe=te(ce,"*"),tt=ve(ce,gt),Xe&&(this._flags.alignment=1),qe=0;qe<ce.length;qe++)Xe?(this.print_token_line_indentation(E),this._output.add_token(J(ce[qe]))):tt&&ce[qe]?(this.print_token_line_indentation(E),this._output.add_token(ce[qe].substring(Rt))):(this._output.current_line.set_indent(-1),this._output.add_token(ce[qe])),this.print_newline(!1,z);this._flags.alignment=0}},ae.prototype.handle_comment=function(E,z){E.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(E),this.print_newline(!1,z)},ae.prototype.handle_dot=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),be(this._flags.last_token,Ie)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(E,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(E)},ae.prototype.handle_unknown=function(E,z){this.print_token(E),E.text[E.text.length-1]===`
|
|
`&&this.print_newline(!1,z)},ae.prototype.handle_eof=function(E){for(;this._flags.mode===Oe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E)},fe.exports.Beautifier=ae},function(fe){function u(b){this.__parent=b,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=[]}u.prototype.clone_empty=function(){var b=new u(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},u.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},u.prototype.has_match=function(b){for(var k=this.__items.length-1;k>=0;k--)if(this.__items[k].match(b))return!0;return!1},u.prototype.set_indent=function(b,k){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=k||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(b){this.__items.push(b);var k=b.lastIndexOf(`
|
|
`);k!==-1?this.__character_count=b.length-k:this.__character_count+=b.length},u.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function he(b,k){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),k=k||"",b.indent_level>0&&(k=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=k,this.__base_string_length=k.length}he.prototype.get_indent_size=function(b,k){var A=this.__base_string_length;return k=k||0,b<0&&(A=0),A+=b*this.__indent_size,A+=k,A},he.prototype.get_indent_string=function(b,k){var A=this.__base_string;return k=k||0,b<0&&(b=0,A=""),k+=b*this.__indent_size,this.__ensure_cache(k),A+=this.__cache[k],A},he.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},he.prototype.__add_column=function(){var b=this.__cache.length,k=0,A="";this.__indent_size&&b>=this.__indent_size&&(k=Math.floor(b/this.__indent_size),b-=k*this.__indent_size,A=new Array(k+1).join(this.__indent_string)),b&&(A+=new Array(b+1).join(" ")),this.__cache.push(A)};function $(b,k){this.__indent_cache=new he(b,k),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}$.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},$.prototype.get_line_number=function(){return this.__lines.length},$.prototype.get_indent_string=function(b,k){return this.__indent_cache.get_indent_string(b,k)},$.prototype.get_indent_size=function(b,k){return this.__indent_cache.get_indent_size(b,k)},$.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},$.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},$.prototype.get_code=function(b){this.trim(!0);var k=this.current_line.pop();k&&(k[k.length-1]===`
|
|
`&&(k=k.replace(/\n+$/g,"")),this.current_line.push(k)),this._end_with_newline&&this.__add_outputline();var A=this.__lines.join(`
|
|
`);return b!==`
|
|
`&&(A=A.replace(/[\n]/g,b)),A},$.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},$.prototype.set_indent=function(b,k){return b=b||0,k=k||0,this.next_line.set_indent(b,k),this.__lines.length>1?(this.current_line.set_indent(b,k),!0):(this.current_line.set_indent(),!1)},$.prototype.add_raw_token=function(b){for(var k=0;k<b.newlines;k++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},$.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},$.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},$.prototype.remove_indent=function(b){for(var k=this.__lines.length;b<k;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},$.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},$.prototype.just_added_newline=function(){return this.current_line.is_empty()},$.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},$.prototype.ensure_empty_line_above=function(b,k){for(var A=this.__lines.length-2;A>=0;){var C=this.__lines[A];if(C.is_empty())break;if(C.item(0).indexOf(b)!==0&&C.item(-1)!==k){this.__lines.splice(A+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}A--}},fe.exports.Output=$},function(fe){function u(he,$,b,k){this.type=he,this.text=$,this.comments_before=null,this.newlines=b||0,this.whitespace_before=k||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}fe.exports.Token=u},function(fe,u){var he="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",$="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",b="\\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",k="\\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",A="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",C="(?:"+A+"|["+he+b+"])",K="(?:"+A+"|["+$+b+k+"])*";u.identifier=new RegExp(C+K,"g"),u.identifierStart=new RegExp(C),u.identifierMatch=new RegExp("(?:"+A+"|["+$+b+k+"])+");var Z=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;u.newline=/[\n\r\u2028\u2029]/,u.lineBreak=new RegExp(`\r
|
|
|`+u.newline.source),u.allLineBreaks=new RegExp(u.lineBreak.source,"g")},function(fe,u,he){var $=he(6).Options,b=["before-newline","after-newline","preserve-newline"];function k(A){$.call(this,A,"js");var C=this.raw_options.brace_style||null;C==="expand-strict"?this.raw_options.brace_style="expand":C==="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 K=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var Z=0;Z<K.length;Z++)K[Z]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=K[Z];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",b),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}k.prototype=new $,fe.exports.Options=k},function(fe){function u(b,k){this.raw_options=he(b,k),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"])}u.prototype._get_array=function(b,k){var A=this.raw_options[b],C=k||[];return typeof A=="object"?A!==null&&typeof A.concat=="function"&&(C=A.concat()):typeof A=="string"&&(C=A.split(/[^a-zA-Z0-9_\/\-]+/)),C},u.prototype._get_boolean=function(b,k){var A=this.raw_options[b],C=A===void 0?!!k:!!A;return C},u.prototype._get_characters=function(b,k){var A=this.raw_options[b],C=k||"";return typeof A=="string"&&(C=A.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),C},u.prototype._get_number=function(b,k){var A=this.raw_options[b];k=parseInt(k,10),isNaN(k)&&(k=0);var C=parseInt(A,10);return isNaN(C)&&(C=k),C},u.prototype._get_selection=function(b,k,A){var C=this._get_selection_list(b,k,A);if(C.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
|
|
`+k+`
|
|
You passed in: '`+this.raw_options[b]+"'");return C[0]},u.prototype._get_selection_list=function(b,k,A){if(!k||k.length===0)throw new Error("Selection list cannot be empty.");if(A=A||[k[0]],!this._is_valid_selection(A,k))throw new Error("Invalid Default Value!");var C=this._get_array(b,A);if(!this._is_valid_selection(C,k))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
|
|
`+k+`
|
|
You passed in: '`+this.raw_options[b]+"'");return C},u.prototype._is_valid_selection=function(b,k){return b.length&&k.length&&!b.some(function(A){return k.indexOf(A)===-1})};function he(b,k){var A={};b=$(b);var C;for(C in b)C!==k&&(A[C]=b[C]);if(k&&b[k])for(C in b[k])A[C]=b[k][C];return A}function $(b){var k={},A;for(A in b){var C=A.replace(/-/g,"_");k[C]=b[A]}return k}fe.exports.Options=u,fe.exports.normalizeOpts=$,fe.exports.mergeOpts=he},function(fe,u,he){var $=he(8).InputScanner,b=he(9).Tokenizer,k=he(9).TOKEN,A=he(13).Directives,C=he(4),K=he(12).Pattern,Z=he(14).TemplatablePattern;function U(te,ve){return ve.indexOf(te)!==-1}var M={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:k.START,RAW:k.RAW,EOF:k.EOF},J=new A(/\/\*/,/\*\//),de=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ue=/[0-9]/,be=/[^\d\.]/,Ie=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ye=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ye=ye.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ye="\\?\\.(?!\\d) "+ye,ye=ye.replace(/ /g,"|");var xe=new RegExp(ye),$e="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Oe=$e.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),He=new RegExp("^(?:"+Oe.join("|")+")$"),Q,G=function(te,ve){b.call(this,te,ve),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var ae=new K(this._input),S=new Z(this._input).read_options(this._options);this.__patterns={template:S,identifier:S.starting_with(C.identifier).matching(C.identifierMatch),number:ae.matching(de),punct:ae.matching(xe),comment:ae.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:ae.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:ae.matching(/<!--/),html_comment_end:ae.matching(/-->/),include:ae.starting_with(/#include/).until_after(C.lineBreak),shebang:ae.starting_with(/#!/).until_after(C.lineBreak),xml:ae.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:S.until(/['\\\n\r\u2028\u2029]/),double_quote:S.until(/["\\\n\r\u2028\u2029]/),template_text:S.until(/[`\\$]/),template_expression:S.until(/[`}\\]/)}};G.prototype=new b,G.prototype._is_comment=function(te){return te.type===M.COMMENT||te.type===M.BLOCK_COMMENT||te.type===M.UNKNOWN},G.prototype._is_opening=function(te){return te.type===M.START_BLOCK||te.type===M.START_EXPR},G.prototype._is_closing=function(te,ve){return(te.type===M.END_BLOCK||te.type===M.END_EXPR)&&ve&&(te.text==="]"&&ve.text==="["||te.text===")"&&ve.text==="("||te.text==="}"&&ve.text==="{")},G.prototype._reset=function(){Q=!1},G.prototype._get_next_token=function(te,ve){var ae=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(M.EOF,""):(ae=ae||this._read_non_javascript(S),ae=ae||this._read_string(S),ae=ae||this._read_pair(S,this._input.peek(1)),ae=ae||this._read_word(te),ae=ae||this._read_singles(S),ae=ae||this._read_comment(S),ae=ae||this._read_regexp(S,te),ae=ae||this._read_xml(S,te),ae=ae||this._read_punctuation(),ae=ae||this._create_token(M.UNKNOWN,this._input.next()),ae)},G.prototype._read_word=function(te){var ve;if(ve=this.__patterns.identifier.read(),ve!=="")return ve=ve.replace(C.allLineBreaks,`
|
|
`),!(te.type===M.DOT||te.type===M.RESERVED&&(te.text==="set"||te.text==="get"))&&He.test(ve)?(ve==="in"||ve==="of")&&(te.type===M.WORD||te.type===M.STRING)?this._create_token(M.OPERATOR,ve):this._create_token(M.RESERVED,ve):this._create_token(M.WORD,ve);if(ve=this.__patterns.number.read(),ve!=="")return this._create_token(M.WORD,ve)},G.prototype._read_singles=function(te){var ve=null;return te==="("||te==="["?ve=this._create_token(M.START_EXPR,te):te===")"||te==="]"?ve=this._create_token(M.END_EXPR,te):te==="{"?ve=this._create_token(M.START_BLOCK,te):te==="}"?ve=this._create_token(M.END_BLOCK,te):te===";"?ve=this._create_token(M.SEMICOLON,te):te==="."&&be.test(this._input.peek(1))?ve=this._create_token(M.DOT,te):te===","&&(ve=this._create_token(M.COMMA,te)),ve&&this._input.next(),ve},G.prototype._read_pair=function(te,ve){var ae=null;return te==="#"&&ve==="{"&&(ae=this._create_token(M.START_BLOCK,te+ve)),ae&&(this._input.next(),this._input.next()),ae},G.prototype._read_punctuation=function(){var te=this.__patterns.punct.read();if(te!=="")return te==="="?this._create_token(M.EQUALS,te):te==="?."?this._create_token(M.DOT,te):this._create_token(M.OPERATOR,te)},G.prototype._read_non_javascript=function(te){var ve="";if(te==="#"){if(this._is_first_token()&&(ve=this.__patterns.shebang.read(),ve))return this._create_token(M.UNKNOWN,ve.trim()+`
|
|
`);if(ve=this.__patterns.include.read(),ve)return this._create_token(M.UNKNOWN,ve.trim()+`
|
|
`);te=this._input.next();var ae="#";if(this._input.hasNext()&&this._input.testChar(ue)){do te=this._input.next(),ae+=te;while(this._input.hasNext()&&te!=="#"&&te!=="=");return te==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(ae+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(ae+="{}",this._input.next(),this._input.next())),this._create_token(M.WORD,ae)}this._input.back()}else if(te==="<"&&this._is_first_token()){if(ve=this.__patterns.html_comment_start.read(),ve){for(;this._input.hasNext()&&!this._input.testChar(C.newline);)ve+=this._input.next();return Q=!0,this._create_token(M.COMMENT,ve)}}else if(Q&&te==="-"&&(ve=this.__patterns.html_comment_end.read(),ve))return Q=!1,this._create_token(M.COMMENT,ve);return null},G.prototype._read_comment=function(te){var ve=null;if(te==="/"){var ae="";if(this._input.peek(1)==="*"){ae=this.__patterns.block_comment.read();var S=J.get_directives(ae);S&&S.ignore==="start"&&(ae+=J.readIgnored(this._input)),ae=ae.replace(C.allLineBreaks,`
|
|
`),ve=this._create_token(M.BLOCK_COMMENT,ae),ve.directives=S}else this._input.peek(1)==="/"&&(ae=this.__patterns.comment.read(),ve=this._create_token(M.COMMENT,ae))}return ve},G.prototype._read_string=function(te){if(te==="`"||te==="'"||te==='"'){var ve=this._input.next();return this.has_char_escapes=!1,te==="`"?ve+=this._read_string_recursive("`",!0,"${"):ve+=this._read_string_recursive(te),this.has_char_escapes&&this._options.unescape_strings&&(ve=Y(ve)),this._input.peek()===te&&(ve+=this._input.next()),ve=ve.replace(C.allLineBreaks,`
|
|
`),this._create_token(M.STRING,ve)}return null},G.prototype._allow_regexp_or_xml=function(te){return te.type===M.RESERVED&&U(te.text,["return","case","throw","else","do","typeof","yield"])||te.type===M.END_EXPR&&te.text===")"&&te.opened.previous.type===M.RESERVED&&U(te.opened.previous.text,["if","while","for"])||U(te.type,[M.COMMENT,M.START_EXPR,M.START_BLOCK,M.START,M.END_BLOCK,M.OPERATOR,M.EQUALS,M.EOF,M.SEMICOLON,M.COMMA])},G.prototype._read_regexp=function(te,ve){if(te==="/"&&this._allow_regexp_or_xml(ve)){for(var ae=this._input.next(),S=!1,E=!1;this._input.hasNext()&&(S||E||this._input.peek()!==te)&&!this._input.testChar(C.newline);)ae+=this._input.peek(),S?S=!1:(S=this._input.peek()==="\\",this._input.peek()==="["?E=!0:this._input.peek()==="]"&&(E=!1)),this._input.next();return this._input.peek()===te&&(ae+=this._input.next(),ae+=this._input.read(C.identifier)),this._create_token(M.STRING,ae)}return null},G.prototype._read_xml=function(te,ve){if(this._options.e4x&&te==="<"&&this._allow_regexp_or_xml(ve)){var ae="",S=this.__patterns.xml.read_match();if(S){for(var E=S[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=E.indexOf("{")===0,ce=0;S;){var qe=!!S[1],Xe=S[2],tt=!!S[S.length-1]||Xe.slice(0,8)==="![CDATA[";if(!tt&&(Xe===E||z&&Xe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(qe?--ce:++ce),ae+=S[0],ce<=0)break;S=this.__patterns.xml.read_match()}return S||(ae+=this._input.match(/[\s\S]*/g)[0]),ae=ae.replace(C.allLineBreaks,`
|
|
`),this._create_token(M.STRING,ae)}}return null};function Y(te){for(var ve="",ae=0,S=new $(te),E=null;S.hasNext();)if(E=S.match(/([\s]|[^\\]|\\\\)+/g),E&&(ve+=E[0]),S.peek()==="\\"){if(S.next(),S.peek()==="x")E=S.match(/x([0-9A-Fa-f]{2})/g);else if(S.peek()==="u")E=S.match(/u([0-9A-Fa-f]{4})/g),E||(E=S.match(/u\{([0-9A-Fa-f]+)\}/g));else{ve+="\\",S.hasNext()&&(ve+=S.next());continue}if(!E||(ae=parseInt(E[1],16),ae>126&&ae<=255&&E[0].indexOf("x")===0))return te;ae>=0&&ae<32||ae>1114111?ve+="\\"+E[0]:ae===34||ae===39||ae===92?ve+="\\"+String.fromCharCode(ae):ve+=String.fromCharCode(ae)}return ve}G.prototype._read_string_recursive=function(te,ve,ae){var S,E;te==="'"?E=this.__patterns.single_quote:te==='"'?E=this.__patterns.double_quote:te==="`"?E=this.__patterns.template_text:te==="}"&&(E=this.__patterns.template_expression);for(var z=E.read(),ce="";this._input.hasNext();){if(ce=this._input.next(),ce===te||!ve&&C.newline.test(ce)){this._input.back();break}else ce==="\\"&&this._input.hasNext()?(S=this._input.peek(),S==="x"||S==="u"?this.has_char_escapes=!0:S==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ce+=this._input.next()):ae&&(ae==="${"&&ce==="$"&&this._input.peek()==="{"&&(ce+=this._input.next()),ae===ce&&(te==="`"?ce+=this._read_string_recursive("}",ve,"`"):ce+=this._read_string_recursive("`",ve,"${"),this._input.hasNext()&&(ce+=this._input.next())));ce+=E.read(),z+=ce}return z},fe.exports.Tokenizer=G,fe.exports.TOKEN=M,fe.exports.positionable_operators=Ie.slice(),fe.exports.line_starters=$e.slice()},function(fe){var u=RegExp.prototype.hasOwnProperty("sticky");function he($){this.__input=$||"",this.__input_length=this.__input.length,this.__position=0}he.prototype.restart=function(){this.__position=0},he.prototype.back=function(){this.__position>0&&(this.__position-=1)},he.prototype.hasNext=function(){return this.__position<this.__input_length},he.prototype.next=function(){var $=null;return this.hasNext()&&($=this.__input.charAt(this.__position),this.__position+=1),$},he.prototype.peek=function($){var b=null;return $=$||0,$+=this.__position,$>=0&&$<this.__input_length&&(b=this.__input.charAt($)),b},he.prototype.__match=function($,b){$.lastIndex=b;var k=$.exec(this.__input);return k&&!(u&&$.sticky)&&k.index!==b&&(k=null),k},he.prototype.test=function($,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match($,b):!1},he.prototype.testChar=function($,b){var k=this.peek(b);return $.lastIndex=0,k!==null&&$.test(k)},he.prototype.match=function($){var b=this.__match($,this.__position);return b?this.__position+=b[0].length:b=null,b},he.prototype.read=function($,b,k){var A="",C;return $&&(C=this.match($),C&&(A+=C[0])),b&&(C||!$)&&(A+=this.readUntil(b,k)),A},he.prototype.readUntil=function($,b){var k="",A=this.__position;$.lastIndex=this.__position;var C=$.exec(this.__input);return C?(A=C.index,b&&(A+=C[0].length)):A=this.__input_length,k=this.__input.substring(this.__position,A),this.__position=A,k},he.prototype.readUntilAfter=function($){return this.readUntil($,!0)},he.prototype.get_regexp=function($,b){var k=null,A="g";return b&&u&&(A="y"),typeof $=="string"&&$!==""?k=new RegExp($,A):$&&(k=new RegExp($.source,A)),k},he.prototype.get_literal_regexp=function($){return RegExp($.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},he.prototype.peekUntilAfter=function($){var b=this.__position,k=this.readUntilAfter($);return this.__position=b,k},he.prototype.lookBack=function($){var b=this.__position-1;return b>=$.length&&this.__input.substring(b-$.length,b).toLowerCase()===$},fe.exports.InputScanner=he},function(fe,u,he){var $=he(8).InputScanner,b=he(3).Token,k=he(10).TokenStream,A=he(11).WhitespacePattern,C={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},K=function(Z,U){this._input=new $(Z),this._options=U||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new A(this._input)};K.prototype.tokenize=function(){this._input.restart(),this.__tokens=new k,this._reset();for(var Z,U=new b(C.START,""),M=null,J=[],de=new k;U.type!==C.EOF;){for(Z=this._get_next_token(U,M);this._is_comment(Z);)de.add(Z),Z=this._get_next_token(U,M);de.isEmpty()||(Z.comments_before=de,de=new k),Z.parent=M,this._is_opening(Z)?(J.push(M),M=Z):M&&this._is_closing(Z,M)&&(Z.opened=M,M.closed=Z,M=J.pop(),Z.parent=M),Z.previous=U,U.next=Z,this.__tokens.add(Z),U=Z}return this.__tokens},K.prototype._is_first_token=function(){return this.__tokens.isEmpty()},K.prototype._reset=function(){},K.prototype._get_next_token=function(Z,U){this._readWhitespace();var M=this._input.read(/.+/g);return M?this._create_token(C.RAW,M):this._create_token(C.EOF,"")},K.prototype._is_comment=function(Z){return!1},K.prototype._is_opening=function(Z){return!1},K.prototype._is_closing=function(Z,U){return!1},K.prototype._create_token=function(Z,U){var M=new b(Z,U,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return M},K.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},fe.exports.Tokenizer=K,fe.exports.TOKEN=C},function(fe){function u(he){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=he}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var he=null;return this.hasNext()&&(he=this.__tokens[this.__position],this.__position+=1),he},u.prototype.peek=function(he){var $=null;return he=he||0,he+=this.__position,he>=0&&he<this.__tokens_length&&($=this.__tokens[he]),$},u.prototype.add=function(he){this.__parent_token&&(he.parent=this.__parent_token),this.__tokens.push(he),this.__tokens_length+=1},fe.exports.TokenStream=u},function(fe,u,he){var $=he(12).Pattern;function b(k,A){$.call(this,k,A),A?this._line_regexp=this._input.get_regexp(A._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}b.prototype=new $,b.prototype.__set_whitespace_patterns=function(k,A){k+="\\t ",A+="\\n\\r",this._match_pattern=this._input.get_regexp("["+k+A+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+A+"]")},b.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var k=this._input.read(this._match_pattern);if(k===" ")this.whitespace_before_token=" ";else if(k){var A=this.__split(this._newline_regexp,k);this.newline_count=A.length-1,this.whitespace_before_token=A[this.newline_count]}return k},b.prototype.matching=function(k,A){var C=this._create();return C.__set_whitespace_patterns(k,A),C._update(),C},b.prototype._create=function(){return new b(this._input,this)},b.prototype.__split=function(k,A){k.lastIndex=0;for(var C=0,K=[],Z=k.exec(A);Z;)K.push(A.substring(C,Z.index)),C=Z.index+Z[0].length,Z=k.exec(A);return C<A.length?K.push(A.substring(C,A.length)):K.push(""),K},fe.exports.WhitespacePattern=b},function(fe){function u(he,$){this._input=he,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,$&&(this._starting_pattern=this._input.get_regexp($._starting_pattern,!0),this._match_pattern=this._input.get_regexp($._match_pattern,!0),this._until_pattern=this._input.get_regexp($._until_pattern),this._until_after=$._until_after)}u.prototype.read=function(){var he=this._input.read(this._starting_pattern);return(!this._starting_pattern||he)&&(he+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),he},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(he){var $=this._create();return $._until_after=!0,$._until_pattern=this._input.get_regexp(he),$._update(),$},u.prototype.until=function(he){var $=this._create();return $._until_after=!1,$._until_pattern=this._input.get_regexp(he),$._update(),$},u.prototype.starting_with=function(he){var $=this._create();return $._starting_pattern=this._input.get_regexp(he,!0),$._update(),$},u.prototype.matching=function(he){var $=this._create();return $._match_pattern=this._input.get_regexp(he,!0),$._update(),$},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},fe.exports.Pattern=u},function(fe){function u(he,$){he=typeof he=="string"?he:he.source,$=typeof $=="string"?$:$.source,this.__directives_block_pattern=new RegExp(he+/ beautify( \w+[:]\w+)+ /.source+$,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(he+/\sbeautify\signore:end\s/.source+$,"g")}u.prototype.get_directives=function(he){if(!he.match(this.__directives_block_pattern))return null;var $={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(he);b;)$[b[1]]=b[2],b=this.__directive_pattern.exec(he);return $},u.prototype.readIgnored=function(he){return he.readUntilAfter(this.__directives_end_ignore_pattern)},fe.exports.Directives=u},function(fe,u,he){var $=he(12).Pattern,b={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function k(A,C){$.call(this,A,C),this.__template_pattern=null,this._disabled=Object.assign({},b),this._excluded=Object.assign({},b),C&&(this.__template_pattern=this._input.get_regexp(C.__template_pattern),this._excluded=Object.assign(this._excluded,C._excluded),this._disabled=Object.assign(this._disabled,C._disabled));var K=new $(A);this.__patterns={handlebars_comment:K.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:K.starting_with(/{{{/).until_after(/}}}/),handlebars:K.starting_with(/{{/).until_after(/}}/),php:K.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:K.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:K.starting_with(/{%/).until_after(/%}/),django_value:K.starting_with(/{{/).until_after(/}}/),django_comment:K.starting_with(/{#/).until_after(/#}/),smarty:K.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:K.starting_with(/{\*/).until_after(/\*}/),smarty_literal:K.starting_with(/{literal}/).until_after(/{\/literal}/)}}k.prototype=new $,k.prototype._create=function(){return new k(this._input,this)},k.prototype._update=function(){this.__set_templated_pattern()},k.prototype.disable=function(A){var C=this._create();return C._disabled[A]=!0,C._update(),C},k.prototype.read_options=function(A){var C=this._create();for(var K in b)C._disabled[K]=A.templating.indexOf(K)===-1;return C._update(),C},k.prototype.exclude=function(A){var C=this._create();return C._excluded[A]=!0,C._update(),C},k.prototype.read=function(){var A="";this._match_pattern?A=this._input.read(this._starting_pattern):A=this._input.read(this._starting_pattern,this.__template_pattern);for(var C=this._read_template();C;)this._match_pattern?C+=this._input.read(this._match_pattern):C+=this._input.readUntil(this.__template_pattern),A+=C,C=this._read_template();return this._until_after&&(A+=this._input.readUntilAfter(this._until_pattern)),A},k.prototype.__set_templated_pattern=function(){var A=[];this._disabled.php||A.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||A.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||A.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||A.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(A.push(this.__patterns.django._starting_pattern.source),A.push(this.__patterns.django_value._starting_pattern.source),A.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||A.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&A.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+A.join("|")+")")},k.prototype._read_template=function(){var A="",C=this._input.peek();if(C==="<"){var K=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&K==="?"&&(A=A||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&K==="%"&&(A=A||this.__patterns.erb.read())}else C==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(A=A||this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars_unescaped.read(),A=A||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(A=A||this.__patterns.django_value.read()),this._excluded.django||(A=A||this.__patterns.django_comment.read(),A=A||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(A=A||this.__patterns.smarty_comment.read(),A=A||this.__patterns.smarty_literal.read(),A=A||this.__patterns.smarty.read()));return A},fe.exports.TemplatablePattern=k}],ne={};function v(fe){var u=ne[fe];if(u!==void 0)return u.exports;var he=ne[fe]={exports:{}};return ge[fe](he,he.exports,v),he.exports}var we=v(0);Le=we})();var Ze=Le;ie=[],F=function(){return{js_beautify:Ze}}.apply(dt,ie),F!==void 0&&($t.exports=F)})()},15342:function($t){(function(ie,F){$t.exports=F()})(typeof self!="undefined"?self:this,function(){return function(dt){var ie={};function F(Le){if(ie[Le])return ie[Le].exports;var Ze=ie[Le]={i:Le,l:!1,exports:{}};return dt[Le].call(Ze.exports,Ze,Ze.exports,F),Ze.l=!0,Ze.exports}return F.m=dt,F.c=ie,F.d=function(Le,Ze,ge){F.o(Le,Ze)||Object.defineProperty(Le,Ze,{enumerable:!0,get:ge})},F.r=function(Le){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Le,"__esModule",{value:!0})},F.t=function(Le,Ze){if(Ze&1&&(Le=F(Le)),Ze&8||Ze&4&&typeof Le=="object"&&Le&&Le.__esModule)return Le;var ge=Object.create(null);if(F.r(ge),Object.defineProperty(ge,"default",{enumerable:!0,value:Le}),Ze&2&&typeof Le!="string")for(var ne in Le)F.d(ge,ne,function(v){return Le[v]}.bind(null,ne));return ge},F.n=function(Le){var Ze=Le&&Le.__esModule?function(){return Le.default}:function(){return Le};return F.d(Ze,"a",Ze),Ze},F.o=function(Le,Ze){return Object.prototype.hasOwnProperty.call(Le,Ze)},F.p="",F(F.s=1)}([function(dt,ie,F){},function(dt,ie,F){"use strict";F.r(ie);var Le=F(0),Ze=function(){function I(l,f,d){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=l,this.start=f,this.end=d}return I.range=function(f,d){return d?!f||!f.loc||!d.loc||f.loc.lexer!==d.loc.lexer?null:new I(f.loc.lexer,f.loc.start,d.loc.end):f&&f.loc},I}(),ge=function(){function I(f,d){this.text=void 0,this.loc=void 0,this.text=f,this.loc=d}var l=I.prototype;return l.range=function(d,m){return new I(m,Ze.range(this,d))},I}(),ne=function I(l,f){this.position=void 0;var d="KaTeX parse error: "+l,m,w=f&&f.loc;if(w&&w.start<=w.end){var L=w.lexer.input;m=w.start;var X=w.end;m===L.length?d+=" at end of input: ":d+=" at position "+(m+1)+": ";var le=L.slice(m,X).replace(/[^]/g,"$&\u0332"),Se;m>15?Se="\u2026"+L.slice(m-15,m):Se=L.slice(0,m);var We;X+15<L.length?We=L.slice(X,X+15)+"\u2026":We=L.slice(X),d+=Se+le+We}var rt=new Error(d);return rt.name="ParseError",rt.__proto__=I.prototype,rt.position=m,rt};ne.prototype.__proto__=Error.prototype;var v=ne,we=function(l,f){return l.indexOf(f)!==-1},fe=function(l,f){return l===void 0?f:l},u=/([A-Z])/g,he=function(l){return l.replace(u,"-$1").toLowerCase()},$={"&":"&",">":">","<":"<",'"':""","'":"'"},b=/[&><"']/g;function k(I){return String(I).replace(b,function(l){return $[l]})}var A=function I(l){return l.type==="ordgroup"||l.type==="color"?l.body.length===1?I(l.body[0]):l:l.type==="font"?I(l.body):l},C=function(l){var f=A(l);return f.type==="mathord"||f.type==="textord"||f.type==="atom"},K=function(l){if(!l)throw new Error("Expected non-null, but got "+String(l));return l},Z=function(l){var f=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(l);return f!=null?f[1]:"_relative"},U={contains:we,deflt:fe,escape:k,hyphenate:he,getBaseElem:A,isCharacterBox:C,protocolFromUrl:Z},M=function(){function I(f){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,f=f||{},this.displayMode=U.deflt(f.displayMode,!1),this.output=U.deflt(f.output,"htmlAndMathml"),this.leqno=U.deflt(f.leqno,!1),this.fleqn=U.deflt(f.fleqn,!1),this.throwOnError=U.deflt(f.throwOnError,!0),this.errorColor=U.deflt(f.errorColor,"#cc0000"),this.macros=f.macros||{},this.minRuleThickness=Math.max(0,U.deflt(f.minRuleThickness,0)),this.colorIsTextColor=U.deflt(f.colorIsTextColor,!1),this.strict=U.deflt(f.strict,"warn"),this.trust=U.deflt(f.trust,!1),this.maxSize=Math.max(0,U.deflt(f.maxSize,1/0)),this.maxExpand=Math.max(0,U.deflt(f.maxExpand,1e3))}var l=I.prototype;return l.reportNonstrict=function(d,m,w){var L=this.strict;if(typeof L=="function"&&(L=L(d,m,w)),!(!L||L==="ignore")){if(L===!0||L==="error")throw new v("LaTeX-incompatible input and strict mode is set to 'error': "+(m+" ["+d+"]"),w);L==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(m+" ["+d+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+L+"': "+m+" ["+d+"]"))}},l.useStrictBehavior=function(d,m,w){var L=this.strict;if(typeof L=="function")try{L=L(d,m,w)}catch(X){L="error"}return!L||L==="ignore"?!1:L===!0||L==="error"?!0:L==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(m+" ["+d+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+L+"': "+m+" ["+d+"]")),!1)},l.isTrusted=function(d){d.url&&!d.protocol&&(d.protocol=U.protocolFromUrl(d.url));var m=typeof this.trust=="function"?this.trust(d):this.trust;return!!m},I}(),J=function(){function I(f,d,m){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=f,this.size=d,this.cramped=m}var l=I.prototype;return l.sup=function(){return He[Q[this.id]]},l.sub=function(){return He[G[this.id]]},l.fracNum=function(){return He[Y[this.id]]},l.fracDen=function(){return He[te[this.id]]},l.cramp=function(){return He[ve[this.id]]},l.text=function(){return He[ae[this.id]]},l.isTight=function(){return this.size>=2},I}(),de=0,ue=1,be=2,Ie=3,ye=4,xe=5,$e=6,Oe=7,He=[new J(de,0,!1),new J(ue,0,!0),new J(be,1,!1),new J(Ie,1,!0),new J(ye,2,!1),new J(xe,2,!0),new J($e,3,!1),new J(Oe,3,!0)],Q=[ye,xe,ye,xe,$e,Oe,$e,Oe],G=[xe,xe,xe,xe,Oe,Oe,Oe,Oe],Y=[be,Ie,ye,xe,$e,Oe,$e,Oe],te=[Ie,Ie,xe,xe,Oe,Oe,Oe,Oe],ve=[ue,ue,Ie,Ie,xe,xe,Oe,Oe],ae=[de,ue,be,Ie,be,Ie,be,Ie],S={DISPLAY:He[de],TEXT:He[be],SCRIPT:He[ye],SCRIPTSCRIPT:He[$e]},E=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function z(I){for(var l=0;l<E.length;l++)for(var f=E[l],d=0;d<f.blocks.length;d++){var m=f.blocks[d];if(I>=m[0]&&I<=m[1])return f.name}return null}var ce=[];E.forEach(function(I){return I.blocks.forEach(function(l){return ce.push.apply(ce,l)})});function qe(I){for(var l=0;l<ce.length;l+=2)if(I>=ce[l]&&I<=ce[l+1])return!0;return!1}var Xe=80,tt=function(l,f){return"M95,"+(622+l+f)+`
|
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
c69,-144,104.5,-217.7,106.5,-221
|
|
l`+l/2.075+" -"+l+`
|
|
c5.3,-9.3,12,-14,20,-14
|
|
H400000v`+(40+l)+`H845.2724
|
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
M`+(834+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},gt=function(l,f){return"M263,"+(601+l+f)+`c0.7,0,18,39.7,52,119
|
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|
l`+l/2.084+" -"+l+`
|
|
c4.7,-7.3,11,-11,19,-11
|
|
H40000v`+(40+l)+`H1012.3
|
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
M`+(1001+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},Rt=function(l,f){return"M983 "+(10+l+f)+`
|
|
l`+l/3.13+" -"+l+`
|
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+l)+`
|
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
M`+(1001+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},ht=function(l,f){return"M424,"+(2398+l+f)+`
|
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
l`+l/4.223+" -"+l+`c4,-6.7,10,-10,18,-10 H400000
|
|
v`+(40+l)+`H1014.6
|
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
c-2,6,-10,9,-24,9
|
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+l)+" "+f+`
|
|
h400000v`+(40+l)+"h-400000z"},at=function(l,f){return"M473,"+(2713+l+f)+`
|
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+l/5.298+" -"+l+`
|
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+l)+`H1017.7
|
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
606zM`+(1001+l)+" "+f+"h400000v"+(40+l)+"H1017.7z"},Ct=function(l,f,d){var m=d-54-f-l;return"M702 "+(l+f)+"H400000"+(40+l)+`
|
|
H742v`+m+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
219 661 l218 661zM702 `+f+"H400000v"+(40+l)+"H742z"},Vt=function(l,f,d){f=1e3*f;var m="";switch(l){case"sqrtMain":m=tt(f,Xe);break;case"sqrtSize1":m=gt(f,Xe);break;case"sqrtSize2":m=Rt(f,Xe);break;case"sqrtSize3":m=ht(f,Xe);break;case"sqrtSize4":m=at(f,Xe);break;case"sqrtTall":m=Ct(f,Xe,d)}return m},St={doubleleftarrow:`M262 157
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Wt=function(){function I(f){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=f,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var l=I.prototype;return l.hasClass=function(d){return U.contains(this.classes,d)},l.toNode=function(){for(var d=document.createDocumentFragment(),m=0;m<this.children.length;m++)d.appendChild(this.children[m].toNode());return d},l.toMarkup=function(){for(var d="",m=0;m<this.children.length;m++)d+=this.children[m].toMarkup();return d},l.toText=function(){var d=function(w){return w.toText()};return this.children.map(d).join("")},I}(),Nt=function(l){return l.filter(function(f){return f}).join(" ")},Ot=function(l,f,d){if(this.classes=l||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=d||{},f){f.style.isTight()&&this.classes.push("mtight");var m=f.getColor();m&&(this.style.color=m)}},ze=function(l){var f=document.createElement(l);f.className=Nt(this.classes);for(var d in this.style)this.style.hasOwnProperty(d)&&(f.style[d]=this.style[d]);for(var m in this.attributes)this.attributes.hasOwnProperty(m)&&f.setAttribute(m,this.attributes[m]);for(var w=0;w<this.children.length;w++)f.appendChild(this.children[w].toNode());return f},Ke=function(l){var f="<"+l;this.classes.length&&(f+=' class="'+U.escape(Nt(this.classes))+'"');var d="";for(var m in this.style)this.style.hasOwnProperty(m)&&(d+=U.hyphenate(m)+":"+this.style[m]+";");d&&(f+=' style="'+U.escape(d)+'"');for(var w in this.attributes)this.attributes.hasOwnProperty(w)&&(f+=" "+w+'="'+U.escape(this.attributes[w])+'"');f+=">";for(var L=0;L<this.children.length;L++)f+=this.children[L].toMarkup();return f+="</"+l+">",f},se=function(){function I(f,d,m,w){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Ot.call(this,f,m,w),this.children=d||[]}var l=I.prototype;return l.setAttribute=function(d,m){this.attributes[d]=m},l.hasClass=function(d){return U.contains(this.classes,d)},l.toNode=function(){return ze.call(this,"span")},l.toMarkup=function(){return Ke.call(this,"span")},I}(),Ne=function(){function I(f,d,m,w){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Ot.call(this,d,w),this.children=m||[],this.setAttribute("href",f)}var l=I.prototype;return l.setAttribute=function(d,m){this.attributes[d]=m},l.hasClass=function(d){return U.contains(this.classes,d)},l.toNode=function(){return ze.call(this,"a")},l.toMarkup=function(){return Ke.call(this,"a")},I}(),Fe=function(){function I(f,d,m){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=d,this.src=f,this.classes=["mord"],this.style=m}var l=I.prototype;return l.hasClass=function(d){return U.contains(this.classes,d)},l.toNode=function(){var d=document.createElement("img");d.src=this.src,d.alt=this.alt,d.className="mord";for(var m in this.style)this.style.hasOwnProperty(m)&&(d.style[m]=this.style[m]);return d},l.toMarkup=function(){var d="<img src='"+this.src+" 'alt='"+this.alt+"' ",m="";for(var w in this.style)this.style.hasOwnProperty(w)&&(m+=U.hyphenate(w)+":"+this.style[w]+";");return m&&(d+=' style="'+U.escape(m)+'"'),d+="'/>",d},I}(),R={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},V=function(){function I(f,d,m,w,L,X,le,Se){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=f,this.height=d||0,this.depth=m||0,this.italic=w||0,this.skew=L||0,this.width=X||0,this.classes=le||[],this.style=Se||{},this.maxFontSize=0;var We=z(this.text.charCodeAt(0));We&&this.classes.push(We+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=R[this.text])}var l=I.prototype;return l.hasClass=function(d){return U.contains(this.classes,d)},l.toNode=function(){var d=document.createTextNode(this.text),m=null;this.italic>0&&(m=document.createElement("span"),m.style.marginRight=this.italic+"em"),this.classes.length>0&&(m=m||document.createElement("span"),m.className=Nt(this.classes));for(var w in this.style)this.style.hasOwnProperty(w)&&(m=m||document.createElement("span"),m.style[w]=this.style[w]);return m?(m.appendChild(d),m):d},l.toMarkup=function(){var d=!1,m="<span";this.classes.length&&(d=!0,m+=' class="',m+=U.escape(Nt(this.classes)),m+='"');var w="";this.italic>0&&(w+="margin-right:"+this.italic+"em;");for(var L in this.style)this.style.hasOwnProperty(L)&&(w+=U.hyphenate(L)+":"+this.style[L]+";");w&&(d=!0,m+=' style="'+U.escape(w)+'"');var X=U.escape(this.text);return d?(m+=">",m+=X,m+="</span>",m):X},I}(),ee=function(){function I(f,d){this.children=void 0,this.attributes=void 0,this.children=f||[],this.attributes=d||{}}var l=I.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",m=document.createElementNS(d,"svg");for(var w in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,w)&&m.setAttribute(w,this.attributes[w]);for(var L=0;L<this.children.length;L++)m.appendChild(this.children[L].toNode());return m},l.toMarkup=function(){var d="<svg";for(var m in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,m)&&(d+=" "+m+"='"+this.attributes[m]+"'");d+=">";for(var w=0;w<this.children.length;w++)d+=this.children[w].toMarkup();return d+="</svg>",d},I}(),j=function(){function I(f,d){this.pathName=void 0,this.alternate=void 0,this.pathName=f,this.alternate=d}var l=I.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",m=document.createElementNS(d,"path");return this.alternate?m.setAttribute("d",this.alternate):m.setAttribute("d",St[this.pathName]),m},l.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+St[this.pathName]+"'/>"},I}(),W=function(){function I(f){this.attributes=void 0,this.attributes=f||{}}var l=I.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",m=document.createElementNS(d,"line");for(var w in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,w)&&m.setAttribute(w,this.attributes[w]);return m},l.toMarkup=function(){var d="<line";for(var m in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,m)&&(d+=" "+m+"='"+this.attributes[m]+"'");return d+="/>",d},I}();function ke(I){if(I instanceof V)return I;throw new Error("Expected symbolNode but got "+String(I)+".")}function Pe(I){if(I instanceof se)return I;throw new Error("Expected span<HtmlDomNode> but got "+String(I)+".")}var Be={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ce={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},De={\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function Ye(I,l){Be[I]=l}function Ve(I,l,f){if(!Be[l])throw new Error("Font metrics not found for font: "+l+".");var d=I.charCodeAt(0),m=Be[l][d];if(!m&&I[0]in De&&(d=De[I[0]].charCodeAt(0),m=Be[l][d]),!m&&f==="text"&&qe(d)&&(m=Be[l][77]),m)return{depth:m[0],height:m[1],italic:m[2],skew:m[3],width:m[4]}}var it={};function ut(I){var l;if(I>=5?l=0:I>=3?l=1:l=2,!it[l]){var f=it[l]={cssEmPerMu:Ce.quad[l]/18};for(var d in Ce)Ce.hasOwnProperty(d)&&(f[d]=Ce[d][l])}return it[l]}var bt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},pt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},mt={math:{},text:{}},ct=mt;function _(I,l,f,d,m,w){mt[I][m]={font:l,group:f,replace:d},w&&d&&(mt[I][d]=mt[I][m])}var y="math",Ge="text",O="main",re="ams",Et="accent-token",Ee="bin",Ae="close",je="inner",B="mathord",q="op-token",oe="open",Te="punct",P="rel",vt="spacing",me="textord";_(y,O,P,"\u2261","\\equiv",!0),_(y,O,P,"\u227A","\\prec",!0),_(y,O,P,"\u227B","\\succ",!0),_(y,O,P,"\u223C","\\sim",!0),_(y,O,P,"\u22A5","\\perp"),_(y,O,P,"\u2AAF","\\preceq",!0),_(y,O,P,"\u2AB0","\\succeq",!0),_(y,O,P,"\u2243","\\simeq",!0),_(y,O,P,"\u2223","\\mid",!0),_(y,O,P,"\u226A","\\ll",!0),_(y,O,P,"\u226B","\\gg",!0),_(y,O,P,"\u224D","\\asymp",!0),_(y,O,P,"\u2225","\\parallel"),_(y,O,P,"\u22C8","\\bowtie",!0),_(y,O,P,"\u2323","\\smile",!0),_(y,O,P,"\u2291","\\sqsubseteq",!0),_(y,O,P,"\u2292","\\sqsupseteq",!0),_(y,O,P,"\u2250","\\doteq",!0),_(y,O,P,"\u2322","\\frown",!0),_(y,O,P,"\u220B","\\ni",!0),_(y,O,P,"\u221D","\\propto",!0),_(y,O,P,"\u22A2","\\vdash",!0),_(y,O,P,"\u22A3","\\dashv",!0),_(y,O,P,"\u220B","\\owns"),_(y,O,Te,".","\\ldotp"),_(y,O,Te,"\u22C5","\\cdotp"),_(y,O,me,"#","\\#"),_(Ge,O,me,"#","\\#"),_(y,O,me,"&","\\&"),_(Ge,O,me,"&","\\&"),_(y,O,me,"\u2135","\\aleph",!0),_(y,O,me,"\u2200","\\forall",!0),_(y,O,me,"\u210F","\\hbar",!0),_(y,O,me,"\u2203","\\exists",!0),_(y,O,me,"\u2207","\\nabla",!0),_(y,O,me,"\u266D","\\flat",!0),_(y,O,me,"\u2113","\\ell",!0),_(y,O,me,"\u266E","\\natural",!0),_(y,O,me,"\u2663","\\clubsuit",!0),_(y,O,me,"\u2118","\\wp",!0),_(y,O,me,"\u266F","\\sharp",!0),_(y,O,me,"\u2662","\\diamondsuit",!0),_(y,O,me,"\u211C","\\Re",!0),_(y,O,me,"\u2661","\\heartsuit",!0),_(y,O,me,"\u2111","\\Im",!0),_(y,O,me,"\u2660","\\spadesuit",!0),_(Ge,O,me,"\xA7","\\S",!0),_(Ge,O,me,"\xB6","\\P",!0),_(y,O,me,"\u2020","\\dag"),_(Ge,O,me,"\u2020","\\dag"),_(Ge,O,me,"\u2020","\\textdagger"),_(y,O,me,"\u2021","\\ddag"),_(Ge,O,me,"\u2021","\\ddag"),_(Ge,O,me,"\u2021","\\textdaggerdbl"),_(y,O,Ae,"\u23B1","\\rmoustache",!0),_(y,O,oe,"\u23B0","\\lmoustache",!0),_(y,O,Ae,"\u27EF","\\rgroup",!0),_(y,O,oe,"\u27EE","\\lgroup",!0),_(y,O,Ee,"\u2213","\\mp",!0),_(y,O,Ee,"\u2296","\\ominus",!0),_(y,O,Ee,"\u228E","\\uplus",!0),_(y,O,Ee,"\u2293","\\sqcap",!0),_(y,O,Ee,"\u2217","\\ast"),_(y,O,Ee,"\u2294","\\sqcup",!0),_(y,O,Ee,"\u25EF","\\bigcirc"),_(y,O,Ee,"\u2219","\\bullet"),_(y,O,Ee,"\u2021","\\ddagger"),_(y,O,Ee,"\u2240","\\wr",!0),_(y,O,Ee,"\u2A3F","\\amalg"),_(y,O,Ee,"&","\\And"),_(y,O,P,"\u27F5","\\longleftarrow",!0),_(y,O,P,"\u21D0","\\Leftarrow",!0),_(y,O,P,"\u27F8","\\Longleftarrow",!0),_(y,O,P,"\u27F6","\\longrightarrow",!0),_(y,O,P,"\u21D2","\\Rightarrow",!0),_(y,O,P,"\u27F9","\\Longrightarrow",!0),_(y,O,P,"\u2194","\\leftrightarrow",!0),_(y,O,P,"\u27F7","\\longleftrightarrow",!0),_(y,O,P,"\u21D4","\\Leftrightarrow",!0),_(y,O,P,"\u27FA","\\Longleftrightarrow",!0),_(y,O,P,"\u21A6","\\mapsto",!0),_(y,O,P,"\u27FC","\\longmapsto",!0),_(y,O,P,"\u2197","\\nearrow",!0),_(y,O,P,"\u21A9","\\hookleftarrow",!0),_(y,O,P,"\u21AA","\\hookrightarrow",!0),_(y,O,P,"\u2198","\\searrow",!0),_(y,O,P,"\u21BC","\\leftharpoonup",!0),_(y,O,P,"\u21C0","\\rightharpoonup",!0),_(y,O,P,"\u2199","\\swarrow",!0),_(y,O,P,"\u21BD","\\leftharpoondown",!0),_(y,O,P,"\u21C1","\\rightharpoondown",!0),_(y,O,P,"\u2196","\\nwarrow",!0),_(y,O,P,"\u21CC","\\rightleftharpoons",!0),_(y,re,P,"\u226E","\\nless",!0),_(y,re,P,"\uE010","\\@nleqslant"),_(y,re,P,"\uE011","\\@nleqq"),_(y,re,P,"\u2A87","\\lneq",!0),_(y,re,P,"\u2268","\\lneqq",!0),_(y,re,P,"\uE00C","\\@lvertneqq"),_(y,re,P,"\u22E6","\\lnsim",!0),_(y,re,P,"\u2A89","\\lnapprox",!0),_(y,re,P,"\u2280","\\nprec",!0),_(y,re,P,"\u22E0","\\npreceq",!0),_(y,re,P,"\u22E8","\\precnsim",!0),_(y,re,P,"\u2AB9","\\precnapprox",!0),_(y,re,P,"\u2241","\\nsim",!0),_(y,re,P,"\uE006","\\@nshortmid"),_(y,re,P,"\u2224","\\nmid",!0),_(y,re,P,"\u22AC","\\nvdash",!0),_(y,re,P,"\u22AD","\\nvDash",!0),_(y,re,P,"\u22EA","\\ntriangleleft"),_(y,re,P,"\u22EC","\\ntrianglelefteq",!0),_(y,re,P,"\u228A","\\subsetneq",!0),_(y,re,P,"\uE01A","\\@varsubsetneq"),_(y,re,P,"\u2ACB","\\subsetneqq",!0),_(y,re,P,"\uE017","\\@varsubsetneqq"),_(y,re,P,"\u226F","\\ngtr",!0),_(y,re,P,"\uE00F","\\@ngeqslant"),_(y,re,P,"\uE00E","\\@ngeqq"),_(y,re,P,"\u2A88","\\gneq",!0),_(y,re,P,"\u2269","\\gneqq",!0),_(y,re,P,"\uE00D","\\@gvertneqq"),_(y,re,P,"\u22E7","\\gnsim",!0),_(y,re,P,"\u2A8A","\\gnapprox",!0),_(y,re,P,"\u2281","\\nsucc",!0),_(y,re,P,"\u22E1","\\nsucceq",!0),_(y,re,P,"\u22E9","\\succnsim",!0),_(y,re,P,"\u2ABA","\\succnapprox",!0),_(y,re,P,"\u2246","\\ncong",!0),_(y,re,P,"\uE007","\\@nshortparallel"),_(y,re,P,"\u2226","\\nparallel",!0),_(y,re,P,"\u22AF","\\nVDash",!0),_(y,re,P,"\u22EB","\\ntriangleright"),_(y,re,P,"\u22ED","\\ntrianglerighteq",!0),_(y,re,P,"\uE018","\\@nsupseteqq"),_(y,re,P,"\u228B","\\supsetneq",!0),_(y,re,P,"\uE01B","\\@varsupsetneq"),_(y,re,P,"\u2ACC","\\supsetneqq",!0),_(y,re,P,"\uE019","\\@varsupsetneqq"),_(y,re,P,"\u22AE","\\nVdash",!0),_(y,re,P,"\u2AB5","\\precneqq",!0),_(y,re,P,"\u2AB6","\\succneqq",!0),_(y,re,P,"\uE016","\\@nsubseteqq"),_(y,re,Ee,"\u22B4","\\unlhd"),_(y,re,Ee,"\u22B5","\\unrhd"),_(y,re,P,"\u219A","\\nleftarrow",!0),_(y,re,P,"\u219B","\\nrightarrow",!0),_(y,re,P,"\u21CD","\\nLeftarrow",!0),_(y,re,P,"\u21CF","\\nRightarrow",!0),_(y,re,P,"\u21AE","\\nleftrightarrow",!0),_(y,re,P,"\u21CE","\\nLeftrightarrow",!0),_(y,re,P,"\u25B3","\\vartriangle"),_(y,re,me,"\u210F","\\hslash"),_(y,re,me,"\u25BD","\\triangledown"),_(y,re,me,"\u25CA","\\lozenge"),_(y,re,me,"\u24C8","\\circledS"),_(y,re,me,"\xAE","\\circledR"),_(Ge,re,me,"\xAE","\\circledR"),_(y,re,me,"\u2221","\\measuredangle",!0),_(y,re,me,"\u2204","\\nexists"),_(y,re,me,"\u2127","\\mho"),_(y,re,me,"\u2132","\\Finv",!0),_(y,re,me,"\u2141","\\Game",!0),_(y,re,me,"\u2035","\\backprime"),_(y,re,me,"\u25B2","\\blacktriangle"),_(y,re,me,"\u25BC","\\blacktriangledown"),_(y,re,me,"\u25A0","\\blacksquare"),_(y,re,me,"\u29EB","\\blacklozenge"),_(y,re,me,"\u2605","\\bigstar"),_(y,re,me,"\u2222","\\sphericalangle",!0),_(y,re,me,"\u2201","\\complement",!0),_(y,re,me,"\xF0","\\eth",!0),_(y,re,me,"\u2571","\\diagup"),_(y,re,me,"\u2572","\\diagdown"),_(y,re,me,"\u25A1","\\square"),_(y,re,me,"\u25A1","\\Box"),_(y,re,me,"\u25CA","\\Diamond"),_(y,re,me,"\xA5","\\yen",!0),_(Ge,re,me,"\xA5","\\yen",!0),_(y,re,me,"\u2713","\\checkmark",!0),_(Ge,re,me,"\u2713","\\checkmark"),_(y,re,me,"\u2136","\\beth",!0),_(y,re,me,"\u2138","\\daleth",!0),_(y,re,me,"\u2137","\\gimel",!0),_(y,re,me,"\u03DD","\\digamma",!0),_(y,re,me,"\u03F0","\\varkappa"),_(y,re,oe,"\u250C","\\ulcorner",!0),_(y,re,Ae,"\u2510","\\urcorner",!0),_(y,re,oe,"\u2514","\\llcorner",!0),_(y,re,Ae,"\u2518","\\lrcorner",!0),_(y,re,P,"\u2266","\\leqq",!0),_(y,re,P,"\u2A7D","\\leqslant",!0),_(y,re,P,"\u2A95","\\eqslantless",!0),_(y,re,P,"\u2272","\\lesssim",!0),_(y,re,P,"\u2A85","\\lessapprox",!0),_(y,re,P,"\u224A","\\approxeq",!0),_(y,re,Ee,"\u22D6","\\lessdot"),_(y,re,P,"\u22D8","\\lll",!0),_(y,re,P,"\u2276","\\lessgtr",!0),_(y,re,P,"\u22DA","\\lesseqgtr",!0),_(y,re,P,"\u2A8B","\\lesseqqgtr",!0),_(y,re,P,"\u2251","\\doteqdot"),_(y,re,P,"\u2253","\\risingdotseq",!0),_(y,re,P,"\u2252","\\fallingdotseq",!0),_(y,re,P,"\u223D","\\backsim",!0),_(y,re,P,"\u22CD","\\backsimeq",!0),_(y,re,P,"\u2AC5","\\subseteqq",!0),_(y,re,P,"\u22D0","\\Subset",!0),_(y,re,P,"\u228F","\\sqsubset",!0),_(y,re,P,"\u227C","\\preccurlyeq",!0),_(y,re,P,"\u22DE","\\curlyeqprec",!0),_(y,re,P,"\u227E","\\precsim",!0),_(y,re,P,"\u2AB7","\\precapprox",!0),_(y,re,P,"\u22B2","\\vartriangleleft"),_(y,re,P,"\u22B4","\\trianglelefteq"),_(y,re,P,"\u22A8","\\vDash",!0),_(y,re,P,"\u22AA","\\Vvdash",!0),_(y,re,P,"\u2323","\\smallsmile"),_(y,re,P,"\u2322","\\smallfrown"),_(y,re,P,"\u224F","\\bumpeq",!0),_(y,re,P,"\u224E","\\Bumpeq",!0),_(y,re,P,"\u2267","\\geqq",!0),_(y,re,P,"\u2A7E","\\geqslant",!0),_(y,re,P,"\u2A96","\\eqslantgtr",!0),_(y,re,P,"\u2273","\\gtrsim",!0),_(y,re,P,"\u2A86","\\gtrapprox",!0),_(y,re,Ee,"\u22D7","\\gtrdot"),_(y,re,P,"\u22D9","\\ggg",!0),_(y,re,P,"\u2277","\\gtrless",!0),_(y,re,P,"\u22DB","\\gtreqless",!0),_(y,re,P,"\u2A8C","\\gtreqqless",!0),_(y,re,P,"\u2256","\\eqcirc",!0),_(y,re,P,"\u2257","\\circeq",!0),_(y,re,P,"\u225C","\\triangleq",!0),_(y,re,P,"\u223C","\\thicksim"),_(y,re,P,"\u2248","\\thickapprox"),_(y,re,P,"\u2AC6","\\supseteqq",!0),_(y,re,P,"\u22D1","\\Supset",!0),_(y,re,P,"\u2290","\\sqsupset",!0),_(y,re,P,"\u227D","\\succcurlyeq",!0),_(y,re,P,"\u22DF","\\curlyeqsucc",!0),_(y,re,P,"\u227F","\\succsim",!0),_(y,re,P,"\u2AB8","\\succapprox",!0),_(y,re,P,"\u22B3","\\vartriangleright"),_(y,re,P,"\u22B5","\\trianglerighteq"),_(y,re,P,"\u22A9","\\Vdash",!0),_(y,re,P,"\u2223","\\shortmid"),_(y,re,P,"\u2225","\\shortparallel"),_(y,re,P,"\u226C","\\between",!0),_(y,re,P,"\u22D4","\\pitchfork",!0),_(y,re,P,"\u221D","\\varpropto"),_(y,re,P,"\u25C0","\\blacktriangleleft"),_(y,re,P,"\u2234","\\therefore",!0),_(y,re,P,"\u220D","\\backepsilon"),_(y,re,P,"\u25B6","\\blacktriangleright"),_(y,re,P,"\u2235","\\because",!0),_(y,re,P,"\u22D8","\\llless"),_(y,re,P,"\u22D9","\\gggtr"),_(y,re,Ee,"\u22B2","\\lhd"),_(y,re,Ee,"\u22B3","\\rhd"),_(y,re,P,"\u2242","\\eqsim",!0),_(y,O,P,"\u22C8","\\Join"),_(y,re,P,"\u2251","\\Doteq",!0),_(y,re,Ee,"\u2214","\\dotplus",!0),_(y,re,Ee,"\u2216","\\smallsetminus"),_(y,re,Ee,"\u22D2","\\Cap",!0),_(y,re,Ee,"\u22D3","\\Cup",!0),_(y,re,Ee,"\u2A5E","\\doublebarwedge",!0),_(y,re,Ee,"\u229F","\\boxminus",!0),_(y,re,Ee,"\u229E","\\boxplus",!0),_(y,re,Ee,"\u22C7","\\divideontimes",!0),_(y,re,Ee,"\u22C9","\\ltimes",!0),_(y,re,Ee,"\u22CA","\\rtimes",!0),_(y,re,Ee,"\u22CB","\\leftthreetimes",!0),_(y,re,Ee,"\u22CC","\\rightthreetimes",!0),_(y,re,Ee,"\u22CF","\\curlywedge",!0),_(y,re,Ee,"\u22CE","\\curlyvee",!0),_(y,re,Ee,"\u229D","\\circleddash",!0),_(y,re,Ee,"\u229B","\\circledast",!0),_(y,re,Ee,"\u22C5","\\centerdot"),_(y,re,Ee,"\u22BA","\\intercal",!0),_(y,re,Ee,"\u22D2","\\doublecap"),_(y,re,Ee,"\u22D3","\\doublecup"),_(y,re,Ee,"\u22A0","\\boxtimes",!0),_(y,re,P,"\u21E2","\\dashrightarrow",!0),_(y,re,P,"\u21E0","\\dashleftarrow",!0),_(y,re,P,"\u21C7","\\leftleftarrows",!0),_(y,re,P,"\u21C6","\\leftrightarrows",!0),_(y,re,P,"\u21DA","\\Lleftarrow",!0),_(y,re,P,"\u219E","\\twoheadleftarrow",!0),_(y,re,P,"\u21A2","\\leftarrowtail",!0),_(y,re,P,"\u21AB","\\looparrowleft",!0),_(y,re,P,"\u21CB","\\leftrightharpoons",!0),_(y,re,P,"\u21B6","\\curvearrowleft",!0),_(y,re,P,"\u21BA","\\circlearrowleft",!0),_(y,re,P,"\u21B0","\\Lsh",!0),_(y,re,P,"\u21C8","\\upuparrows",!0),_(y,re,P,"\u21BF","\\upharpoonleft",!0),_(y,re,P,"\u21C3","\\downharpoonleft",!0),_(y,re,P,"\u22B8","\\multimap",!0),_(y,re,P,"\u21AD","\\leftrightsquigarrow",!0),_(y,re,P,"\u21C9","\\rightrightarrows",!0),_(y,re,P,"\u21C4","\\rightleftarrows",!0),_(y,re,P,"\u21A0","\\twoheadrightarrow",!0),_(y,re,P,"\u21A3","\\rightarrowtail",!0),_(y,re,P,"\u21AC","\\looparrowright",!0),_(y,re,P,"\u21B7","\\curvearrowright",!0),_(y,re,P,"\u21BB","\\circlearrowright",!0),_(y,re,P,"\u21B1","\\Rsh",!0),_(y,re,P,"\u21CA","\\downdownarrows",!0),_(y,re,P,"\u21BE","\\upharpoonright",!0),_(y,re,P,"\u21C2","\\downharpoonright",!0),_(y,re,P,"\u21DD","\\rightsquigarrow",!0),_(y,re,P,"\u21DD","\\leadsto"),_(y,re,P,"\u21DB","\\Rrightarrow",!0),_(y,re,P,"\u21BE","\\restriction"),_(y,O,me,"\u2018","`"),_(y,O,me,"$","\\$"),_(Ge,O,me,"$","\\$"),_(Ge,O,me,"$","\\textdollar"),_(y,O,me,"%","\\%"),_(Ge,O,me,"%","\\%"),_(y,O,me,"_","\\_"),_(Ge,O,me,"_","\\_"),_(Ge,O,me,"_","\\textunderscore"),_(y,O,me,"\u2220","\\angle",!0),_(y,O,me,"\u221E","\\infty",!0),_(y,O,me,"\u2032","\\prime"),_(y,O,me,"\u25B3","\\triangle"),_(y,O,me,"\u0393","\\Gamma",!0),_(y,O,me,"\u0394","\\Delta",!0),_(y,O,me,"\u0398","\\Theta",!0),_(y,O,me,"\u039B","\\Lambda",!0),_(y,O,me,"\u039E","\\Xi",!0),_(y,O,me,"\u03A0","\\Pi",!0),_(y,O,me,"\u03A3","\\Sigma",!0),_(y,O,me,"\u03A5","\\Upsilon",!0),_(y,O,me,"\u03A6","\\Phi",!0),_(y,O,me,"\u03A8","\\Psi",!0),_(y,O,me,"\u03A9","\\Omega",!0),_(y,O,me,"A","\u0391"),_(y,O,me,"B","\u0392"),_(y,O,me,"E","\u0395"),_(y,O,me,"Z","\u0396"),_(y,O,me,"H","\u0397"),_(y,O,me,"I","\u0399"),_(y,O,me,"K","\u039A"),_(y,O,me,"M","\u039C"),_(y,O,me,"N","\u039D"),_(y,O,me,"O","\u039F"),_(y,O,me,"P","\u03A1"),_(y,O,me,"T","\u03A4"),_(y,O,me,"X","\u03A7"),_(y,O,me,"\xAC","\\neg",!0),_(y,O,me,"\xAC","\\lnot"),_(y,O,me,"\u22A4","\\top"),_(y,O,me,"\u22A5","\\bot"),_(y,O,me,"\u2205","\\emptyset"),_(y,re,me,"\u2205","\\varnothing"),_(y,O,B,"\u03B1","\\alpha",!0),_(y,O,B,"\u03B2","\\beta",!0),_(y,O,B,"\u03B3","\\gamma",!0),_(y,O,B,"\u03B4","\\delta",!0),_(y,O,B,"\u03F5","\\epsilon",!0),_(y,O,B,"\u03B6","\\zeta",!0),_(y,O,B,"\u03B7","\\eta",!0),_(y,O,B,"\u03B8","\\theta",!0),_(y,O,B,"\u03B9","\\iota",!0),_(y,O,B,"\u03BA","\\kappa",!0),_(y,O,B,"\u03BB","\\lambda",!0),_(y,O,B,"\u03BC","\\mu",!0),_(y,O,B,"\u03BD","\\nu",!0),_(y,O,B,"\u03BE","\\xi",!0),_(y,O,B,"\u03BF","\\omicron",!0),_(y,O,B,"\u03C0","\\pi",!0),_(y,O,B,"\u03C1","\\rho",!0),_(y,O,B,"\u03C3","\\sigma",!0),_(y,O,B,"\u03C4","\\tau",!0),_(y,O,B,"\u03C5","\\upsilon",!0),_(y,O,B,"\u03D5","\\phi",!0),_(y,O,B,"\u03C7","\\chi",!0),_(y,O,B,"\u03C8","\\psi",!0),_(y,O,B,"\u03C9","\\omega",!0),_(y,O,B,"\u03B5","\\varepsilon",!0),_(y,O,B,"\u03D1","\\vartheta",!0),_(y,O,B,"\u03D6","\\varpi",!0),_(y,O,B,"\u03F1","\\varrho",!0),_(y,O,B,"\u03C2","\\varsigma",!0),_(y,O,B,"\u03C6","\\varphi",!0),_(y,O,Ee,"\u2217","*"),_(y,O,Ee,"+","+"),_(y,O,Ee,"\u2212","-"),_(y,O,Ee,"\u22C5","\\cdot",!0),_(y,O,Ee,"\u2218","\\circ"),_(y,O,Ee,"\xF7","\\div",!0),_(y,O,Ee,"\xB1","\\pm",!0),_(y,O,Ee,"\xD7","\\times",!0),_(y,O,Ee,"\u2229","\\cap",!0),_(y,O,Ee,"\u222A","\\cup",!0),_(y,O,Ee,"\u2216","\\setminus"),_(y,O,Ee,"\u2227","\\land"),_(y,O,Ee,"\u2228","\\lor"),_(y,O,Ee,"\u2227","\\wedge",!0),_(y,O,Ee,"\u2228","\\vee",!0),_(y,O,me,"\u221A","\\surd"),_(y,O,oe,"(","("),_(y,O,oe,"[","["),_(y,O,oe,"\u27E8","\\langle",!0),_(y,O,oe,"\u2223","\\lvert"),_(y,O,oe,"\u2225","\\lVert"),_(y,O,Ae,")",")"),_(y,O,Ae,"]","]"),_(y,O,Ae,"?","?"),_(y,O,Ae,"!","!"),_(y,O,Ae,"\u27E9","\\rangle",!0),_(y,O,Ae,"\u2223","\\rvert"),_(y,O,Ae,"\u2225","\\rVert"),_(y,O,P,"=","="),_(y,O,P,"<","<"),_(y,O,P,">",">"),_(y,O,P,":",":"),_(y,O,P,"\u2248","\\approx",!0),_(y,O,P,"\u2245","\\cong",!0),_(y,O,P,"\u2265","\\ge"),_(y,O,P,"\u2265","\\geq",!0),_(y,O,P,"\u2190","\\gets"),_(y,O,P,">","\\gt"),_(y,O,P,"\u2208","\\in",!0),_(y,O,P,"\uE020","\\@not"),_(y,O,P,"\u2282","\\subset",!0),_(y,O,P,"\u2283","\\supset",!0),_(y,O,P,"\u2286","\\subseteq",!0),_(y,O,P,"\u2287","\\supseteq",!0),_(y,re,P,"\u2288","\\nsubseteq",!0),_(y,re,P,"\u2289","\\nsupseteq",!0),_(y,O,P,"\u22A8","\\models"),_(y,O,P,"\u2190","\\leftarrow",!0),_(y,O,P,"\u2264","\\le"),_(y,O,P,"\u2264","\\leq",!0),_(y,O,P,"<","\\lt"),_(y,O,P,"\u2192","\\rightarrow",!0),_(y,O,P,"\u2192","\\to"),_(y,re,P,"\u2271","\\ngeq",!0),_(y,re,P,"\u2270","\\nleq",!0),_(y,O,vt,"\xA0","\\ "),_(y,O,vt,"\xA0","~"),_(y,O,vt,"\xA0","\\space"),_(y,O,vt,"\xA0","\\nobreakspace"),_(Ge,O,vt,"\xA0","\\ "),_(Ge,O,vt,"\xA0","~"),_(Ge,O,vt,"\xA0","\\space"),_(Ge,O,vt,"\xA0","\\nobreakspace"),_(y,O,vt,null,"\\nobreak"),_(y,O,vt,null,"\\allowbreak"),_(y,O,Te,",",","),_(y,O,Te,";",";"),_(y,re,Ee,"\u22BC","\\barwedge",!0),_(y,re,Ee,"\u22BB","\\veebar",!0),_(y,O,Ee,"\u2299","\\odot",!0),_(y,O,Ee,"\u2295","\\oplus",!0),_(y,O,Ee,"\u2297","\\otimes",!0),_(y,O,me,"\u2202","\\partial",!0),_(y,O,Ee,"\u2298","\\oslash",!0),_(y,re,Ee,"\u229A","\\circledcirc",!0),_(y,re,Ee,"\u22A1","\\boxdot",!0),_(y,O,Ee,"\u25B3","\\bigtriangleup"),_(y,O,Ee,"\u25BD","\\bigtriangledown"),_(y,O,Ee,"\u2020","\\dagger"),_(y,O,Ee,"\u22C4","\\diamond"),_(y,O,Ee,"\u22C6","\\star"),_(y,O,Ee,"\u25C3","\\triangleleft"),_(y,O,Ee,"\u25B9","\\triangleright"),_(y,O,oe,"{","\\{"),_(Ge,O,me,"{","\\{"),_(Ge,O,me,"{","\\textbraceleft"),_(y,O,Ae,"}","\\}"),_(Ge,O,me,"}","\\}"),_(Ge,O,me,"}","\\textbraceright"),_(y,O,oe,"{","\\lbrace"),_(y,O,Ae,"}","\\rbrace"),_(y,O,oe,"[","\\lbrack"),_(Ge,O,me,"[","\\lbrack"),_(y,O,Ae,"]","\\rbrack"),_(Ge,O,me,"]","\\rbrack"),_(y,O,oe,"(","\\lparen"),_(y,O,Ae,")","\\rparen"),_(Ge,O,me,"<","\\textless"),_(Ge,O,me,">","\\textgreater"),_(y,O,oe,"\u230A","\\lfloor",!0),_(y,O,Ae,"\u230B","\\rfloor",!0),_(y,O,oe,"\u2308","\\lceil",!0),_(y,O,Ae,"\u2309","\\rceil",!0),_(y,O,me,"\\","\\backslash"),_(y,O,me,"\u2223","|"),_(y,O,me,"\u2223","\\vert"),_(Ge,O,me,"|","\\textbar"),_(y,O,me,"\u2225","\\|"),_(y,O,me,"\u2225","\\Vert"),_(Ge,O,me,"\u2225","\\textbardbl"),_(Ge,O,me,"~","\\textasciitilde"),_(Ge,O,me,"\\","\\textbackslash"),_(Ge,O,me,"^","\\textasciicircum"),_(y,O,P,"\u2191","\\uparrow",!0),_(y,O,P,"\u21D1","\\Uparrow",!0),_(y,O,P,"\u2193","\\downarrow",!0),_(y,O,P,"\u21D3","\\Downarrow",!0),_(y,O,P,"\u2195","\\updownarrow",!0),_(y,O,P,"\u21D5","\\Updownarrow",!0),_(y,O,q,"\u2210","\\coprod"),_(y,O,q,"\u22C1","\\bigvee"),_(y,O,q,"\u22C0","\\bigwedge"),_(y,O,q,"\u2A04","\\biguplus"),_(y,O,q,"\u22C2","\\bigcap"),_(y,O,q,"\u22C3","\\bigcup"),_(y,O,q,"\u222B","\\int"),_(y,O,q,"\u222B","\\intop"),_(y,O,q,"\u222C","\\iint"),_(y,O,q,"\u222D","\\iiint"),_(y,O,q,"\u220F","\\prod"),_(y,O,q,"\u2211","\\sum"),_(y,O,q,"\u2A02","\\bigotimes"),_(y,O,q,"\u2A01","\\bigoplus"),_(y,O,q,"\u2A00","\\bigodot"),_(y,O,q,"\u222E","\\oint"),_(y,O,q,"\u222F","\\oiint"),_(y,O,q,"\u2230","\\oiiint"),_(y,O,q,"\u2A06","\\bigsqcup"),_(y,O,q,"\u222B","\\smallint"),_(Ge,O,je,"\u2026","\\textellipsis"),_(y,O,je,"\u2026","\\mathellipsis"),_(Ge,O,je,"\u2026","\\ldots",!0),_(y,O,je,"\u2026","\\ldots",!0),_(y,O,je,"\u22EF","\\@cdots",!0),_(y,O,je,"\u22F1","\\ddots",!0),_(y,O,me,"\u22EE","\\varvdots"),_(y,O,Et,"\u02CA","\\acute"),_(y,O,Et,"\u02CB","\\grave"),_(y,O,Et,"\xA8","\\ddot"),_(y,O,Et,"~","\\tilde"),_(y,O,Et,"\u02C9","\\bar"),_(y,O,Et,"\u02D8","\\breve"),_(y,O,Et,"\u02C7","\\check"),_(y,O,Et,"^","\\hat"),_(y,O,Et,"\u20D7","\\vec"),_(y,O,Et,"\u02D9","\\dot"),_(y,O,Et,"\u02DA","\\mathring"),_(y,O,B,"\u0131","\\imath",!0),_(y,O,B,"\u0237","\\jmath",!0),_(Ge,O,me,"\u0131","\\i",!0),_(Ge,O,me,"\u0237","\\j",!0),_(Ge,O,me,"\xDF","\\ss",!0),_(Ge,O,me,"\xE6","\\ae",!0),_(Ge,O,me,"\xE6","\\ae",!0),_(Ge,O,me,"\u0153","\\oe",!0),_(Ge,O,me,"\xF8","\\o",!0),_(Ge,O,me,"\xC6","\\AE",!0),_(Ge,O,me,"\u0152","\\OE",!0),_(Ge,O,me,"\xD8","\\O",!0),_(Ge,O,Et,"\u02CA","\\'"),_(Ge,O,Et,"\u02CB","\\`"),_(Ge,O,Et,"\u02C6","\\^"),_(Ge,O,Et,"\u02DC","\\~"),_(Ge,O,Et,"\u02C9","\\="),_(Ge,O,Et,"\u02D8","\\u"),_(Ge,O,Et,"\u02D9","\\."),_(Ge,O,Et,"\u02DA","\\r"),_(Ge,O,Et,"\u02C7","\\v"),_(Ge,O,Et,"\xA8",'\\"'),_(Ge,O,Et,"\u02DD","\\H"),_(Ge,O,Et,"\u25EF","\\textcircled");var Dt={"--":!0,"---":!0,"``":!0,"''":!0};_(Ge,O,me,"\u2013","--"),_(Ge,O,me,"\u2013","\\textendash"),_(Ge,O,me,"\u2014","---"),_(Ge,O,me,"\u2014","\\textemdash"),_(Ge,O,me,"\u2018","`"),_(Ge,O,me,"\u2018","\\textquoteleft"),_(Ge,O,me,"\u2019","'"),_(Ge,O,me,"\u2019","\\textquoteright"),_(Ge,O,me,"\u201C","``"),_(Ge,O,me,"\u201C","\\textquotedblleft"),_(Ge,O,me,"\u201D","''"),_(Ge,O,me,"\u201D","\\textquotedblright"),_(y,O,me,"\xB0","\\degree",!0),_(Ge,O,me,"\xB0","\\degree"),_(Ge,O,me,"\xB0","\\textdegree",!0),_(y,O,B,"\xA3","\\pounds"),_(y,O,B,"\xA3","\\mathsterling",!0),_(Ge,O,B,"\xA3","\\pounds"),_(Ge,O,B,"\xA3","\\textsterling",!0),_(y,re,me,"\u2720","\\maltese"),_(Ge,re,me,"\u2720","\\maltese"),_(Ge,O,vt,"\xA0","\\ "),_(Ge,O,vt,"\xA0"," "),_(Ge,O,vt,"\xA0","~");for(var Mt='0123456789/@."',zt=0;zt<Mt.length;zt++){var Ar=Mt.charAt(zt);_(y,O,me,Ar,Ar)}for(var Qt='0123456789!@*()-=+[]<>|";:?/.,',Bt=0;Bt<Qt.length;Bt++){var Sr=Qt.charAt(Bt);_(Ge,O,me,Sr,Sr)}for(var Tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Yr=0;Yr<Tr.length;Yr++){var qr=Tr.charAt(Yr);_(y,O,B,qr,qr),_(Ge,O,me,qr,qr)}_(y,re,me,"C","\u2102"),_(Ge,re,me,"C","\u2102"),_(y,re,me,"H","\u210D"),_(Ge,re,me,"H","\u210D"),_(y,re,me,"N","\u2115"),_(Ge,re,me,"N","\u2115"),_(y,re,me,"P","\u2119"),_(Ge,re,me,"P","\u2119"),_(y,re,me,"Q","\u211A"),_(Ge,re,me,"Q","\u211A"),_(y,re,me,"R","\u211D"),_(Ge,re,me,"R","\u211D"),_(y,re,me,"Z","\u2124"),_(Ge,re,me,"Z","\u2124"),_(y,O,B,"h","\u210E"),_(Ge,O,B,"h","\u210E");for(var It="",Jt=0;Jt<Tr.length;Jt++){var mr=Tr.charAt(Jt);It=String.fromCharCode(55349,56320+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56372+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56424+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56580+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56736+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56788+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56840+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56944+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),Jt<26&&(It=String.fromCharCode(55349,56632+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It),It=String.fromCharCode(55349,56476+Jt),_(y,O,B,mr,It),_(Ge,O,me,mr,It))}It="\u{1D55C}",_(y,O,B,"k",It),_(Ge,O,me,"k",It);for(var Zr=0;Zr<10;Zr++){var Lr=Zr.toString();It=String.fromCharCode(55349,57294+Zr),_(y,O,B,Lr,It),_(Ge,O,me,Lr,It),It=String.fromCharCode(55349,57314+Zr),_(y,O,B,Lr,It),_(Ge,O,me,Lr,It),It=String.fromCharCode(55349,57324+Zr),_(y,O,B,Lr,It),_(Ge,O,me,Lr,It),It=String.fromCharCode(55349,57334+Zr),_(y,O,B,Lr,It),_(Ge,O,me,Lr,It)}for(var _n="\xC7\xD0\xDE\xE7\xFE",_r=0;_r<_n.length;_r++){var xn=_n.charAt(_r);_(y,O,B,xn,xn),_(Ge,O,me,xn,xn)}_(Ge,O,me,"\xF0","\xF0"),_(Ge,O,me,"\u2013","\u2013"),_(Ge,O,me,"\u2014","\u2014"),_(Ge,O,me,"\u2018","\u2018"),_(Ge,O,me,"\u2019","\u2019"),_(Ge,O,me,"\u201C","\u201C"),_(Ge,O,me,"\u201D","\u201D");var cn=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathdefault","textit","Math-Italic"],["mathdefault","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Ut=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ft=function(l,f){var d=l.charCodeAt(0),m=l.charCodeAt(1),w=(d-55296)*1024+(m-56320)+65536,L=f==="math"?0:1;if(119808<=w&&w<120484){var X=Math.floor((w-119808)/26);return[cn[X][2],cn[X][L]]}else if(120782<=w&&w<=120831){var le=Math.floor((w-120782)/10);return[Ut[le][2],Ut[le][L]]}else{if(w===120485||w===120486)return[cn[0][2],cn[0][L]];if(120486<w&&w<120782)return["",""];throw new v("Unsupported character: "+l)}},sr=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Pr=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Er=function(l,f){return f.size<2?l:sr[l-1][f.size-1]},fr=function(){function I(f){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=f.style,this.color=f.color,this.size=f.size||I.BASESIZE,this.textSize=f.textSize||this.size,this.phantom=!!f.phantom,this.font=f.font||"",this.fontFamily=f.fontFamily||"",this.fontWeight=f.fontWeight||"",this.fontShape=f.fontShape||"",this.sizeMultiplier=Pr[this.size-1],this.maxSize=f.maxSize,this.minRuleThickness=f.minRuleThickness,this._fontMetrics=void 0}var l=I.prototype;return l.extend=function(d){var m={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var w in d)d.hasOwnProperty(w)&&(m[w]=d[w]);return new I(m)},l.havingStyle=function(d){return this.style===d?this:this.extend({style:d,size:Er(this.textSize,d)})},l.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},l.havingSize=function(d){return this.size===d&&this.textSize===d?this:this.extend({style:this.style.text(),size:d,textSize:d,sizeMultiplier:Pr[d-1]})},l.havingBaseStyle=function(d){d=d||this.style.text();var m=Er(I.BASESIZE,d);return this.size===m&&this.textSize===I.BASESIZE&&this.style===d?this:this.extend({style:d,size:m})},l.havingBaseSizing=function(){var d;switch(this.style.id){case 4:case 5:d=3;break;case 6:case 7:d=1;break;default:d=6}return this.extend({style:this.style.text(),size:d})},l.withColor=function(d){return this.extend({color:d})},l.withPhantom=function(){return this.extend({phantom:!0})},l.withFont=function(d){return this.extend({font:d})},l.withTextFontFamily=function(d){return this.extend({fontFamily:d,font:""})},l.withTextFontWeight=function(d){return this.extend({fontWeight:d,font:""})},l.withTextFontShape=function(d){return this.extend({fontShape:d,font:""})},l.sizingClasses=function(d){return d.size!==this.size?["sizing","reset-size"+d.size,"size"+this.size]:[]},l.baseSizingClasses=function(){return this.size!==I.BASESIZE?["sizing","reset-size"+this.size,"size"+I.BASESIZE]:[]},l.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=ut(this.size)),this._fontMetrics},l.getColor=function(){return this.phantom?"transparent":this.color},I}();fr.BASESIZE=6;var On=fr,Or={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Rr={ex:!0,em:!0,mu:!0},Hr=function(l){return typeof l!="string"&&(l=l.unit),l in Or||l in Rr||l==="ex"},vr=function(l,f){var d;if(l.unit in Or)d=Or[l.unit]/f.fontMetrics().ptPerEm/f.sizeMultiplier;else if(l.unit==="mu")d=f.fontMetrics().cssEmPerMu;else{var m;if(f.style.isTight()?m=f.havingStyle(f.style.text()):m=f,l.unit==="ex")d=m.fontMetrics().xHeight;else if(l.unit==="em")d=m.fontMetrics().quad;else throw new v("Invalid unit: '"+l.unit+"'");m!==f&&(d*=m.sizeMultiplier/f.sizeMultiplier)}return Math.min(l.number*d,f.maxSize)},Xr=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],an=function(l,f,d){return ct[d][l]&&ct[d][l].replace&&(l=ct[d][l].replace),{value:l,metrics:Ve(l,f,d)}},on=function(l,f,d,m,w){var L=an(l,f,d),X=L.metrics;l=L.value;var le;if(X){var Se=X.italic;(d==="text"||m&&m.font==="mathit")&&(Se=0),le=new V(l,X.height,X.depth,Se,X.skew,X.width,w)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+l+"' in style '"+f+"' and mode '"+d+"'")),le=new V(l,0,0,0,0,0,w);if(m){le.maxFontSize=m.sizeMultiplier,m.style.isTight()&&le.classes.push("mtight");var We=m.getColor();We&&(le.style.color=We)}return le},hr=function(l,f,d,m){return m===void 0&&(m=[]),d.font==="boldsymbol"&&an(l,"Main-Bold",f).metrics?on(l,"Main-Bold",f,d,m.concat(["mathbf"])):l==="\\"||ct[f][l].font==="main"?on(l,"Main-Regular",f,d,m):on(l,"AMS-Regular",f,d,m.concat(["amsrm"]))},lr=function(l,f,d,m){return/[0-9]/.test(l.charAt(0))||U.contains(Xr,l)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Mr=function(l,f,d,m){return U.contains(Xr,l)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(l.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},zr=function(l,f,d,m){return an(l,"Math-BoldItalic",f).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Dr=function(l,f,d){var m=l.mode,w=l.text,L=["mord"],X=m==="math"||m==="text"&&f.font,le=X?f.font:f.fontFamily;if(w.charCodeAt(0)===55349){var Se=Ft(w,m),We=Se[0],rt=Se[1];return on(w,We,m,f,L.concat(rt))}else if(le){var lt,xt;if(le==="boldsymbol"||le==="mathnormal"){var wt=le==="boldsymbol"?zr(w,m,f,L):Mr(w,m,f,L);lt=wt.fontName,xt=[wt.fontClass]}else U.contains(Xr,w)?(lt="Main-Italic",xt=["mathit"]):X?(lt=Qn[le].fontName,xt=[le]):(lt=ai(le,f.fontWeight,f.fontShape),xt=[le,f.fontWeight,f.fontShape]);if(an(w,lt,m).metrics)return on(w,lt,m,f,L.concat(xt));if(Dt.hasOwnProperty(w)&<.substr(0,10)==="Typewriter"){for(var Me=[],Kt=0;Kt<w.length;Kt++)Me.push(on(w[Kt],lt,m,f,L.concat(xt)));return Hn(Me)}}if(d==="mathord"){var ir=lr(w,m,f,L);return on(w,ir.fontName,m,f,L.concat([ir.fontClass]))}else if(d==="textord"){var cr=ct[m][w]&&ct[m][w].font;if(cr==="ams"){var ar=ai("amsrm",f.fontWeight,f.fontShape);return on(w,ar,m,f,L.concat("amsrm",f.fontWeight,f.fontShape))}else if(cr==="main"||!cr){var jr=ai("textrm",f.fontWeight,f.fontShape);return on(w,jr,m,f,L.concat(f.fontWeight,f.fontShape))}else{var Ur=ai(cr,f.fontWeight,f.fontShape);return on(w,Ur,m,f,L.concat(Ur,f.fontWeight,f.fontShape))}}else throw new Error("unexpected type: "+d+" in makeOrd")},mn=function(l,f){if(Nt(l.classes)!==Nt(f.classes)||l.skew!==f.skew||l.maxFontSize!==f.maxFontSize)return!1;for(var d in l.style)if(l.style.hasOwnProperty(d)&&l.style[d]!==f.style[d])return!1;for(var m in f.style)if(f.style.hasOwnProperty(m)&&l.style[m]!==f.style[m])return!1;return!0},si=function(l){for(var f=0;f<l.length-1;f++){var d=l[f],m=l[f+1];d instanceof V&&m instanceof V&&mn(d,m)&&(d.text+=m.text,d.height=Math.max(d.height,m.height),d.depth=Math.max(d.depth,m.depth),d.italic=m.italic,l.splice(f+1,1),f--)}return l},Mn=function(l){for(var f=0,d=0,m=0,w=0;w<l.children.length;w++){var L=l.children[w];L.height>f&&(f=L.height),L.depth>d&&(d=L.depth),L.maxFontSize>m&&(m=L.maxFontSize)}l.height=f,l.depth=d,l.maxFontSize=m},ur=function(l,f,d,m){var w=new se(l,f,d,m);return Mn(w),w},wr=function(l,f,d,m){return new se(l,f,d,m)},Ln=function(l,f,d){var m=ur([l],[],f);return m.height=Math.max(d||f.fontMetrics().defaultRuleThickness,f.minRuleThickness),m.style.borderBottomWidth=m.height+"em",m.maxFontSize=1,m},Fn=function(l,f,d,m){var w=new Ne(l,f,d,m);return Mn(w),w},Hn=function(l){var f=new Wt(l);return Mn(f),f},Ii=function(l,f){return l instanceof Wt?ur([],[l],f):l},Xn=function(l){if(l.positionType==="individualShift"){for(var f=l.children,d=[f[0]],m=-f[0].shift-f[0].elem.depth,w=m,L=1;L<f.length;L++){var X=-f[L].shift-w-f[L].elem.depth,le=X-(f[L-1].elem.height+f[L-1].elem.depth);w=w+X,d.push({type:"kern",size:le}),d.push(f[L])}return{children:d,depth:m}}var Se;if(l.positionType==="top"){for(var We=l.positionData,rt=0;rt<l.children.length;rt++){var lt=l.children[rt];We-=lt.type==="kern"?lt.size:lt.elem.height+lt.elem.depth}Se=We}else if(l.positionType==="bottom")Se=-l.positionData;else{var xt=l.children[0];if(xt.type!=="elem")throw new Error('First child must have type "elem".');if(l.positionType==="shift")Se=-xt.elem.depth-l.positionData;else if(l.positionType==="firstBaseline")Se=-xt.elem.depth;else throw new Error("Invalid positionType "+l.positionType+".")}return{children:l.children,depth:Se}},bi=function(l,f){for(var d=Xn(l),m=d.children,w=d.depth,L=0,X=0;X<m.length;X++){var le=m[X];if(le.type==="elem"){var Se=le.elem;L=Math.max(L,Se.maxFontSize,Se.height)}}L+=2;var We=ur(["pstrut"],[]);We.style.height=L+"em";for(var rt=[],lt=w,xt=w,wt=w,Me=0;Me<m.length;Me++){var Kt=m[Me];if(Kt.type==="kern")wt+=Kt.size;else{var ir=Kt.elem,cr=Kt.wrapperClasses||[],ar=Kt.wrapperStyle||{},jr=ur(cr,[We,ir],void 0,ar);jr.style.top=-L-wt-ir.depth+"em",Kt.marginLeft&&(jr.style.marginLeft=Kt.marginLeft),Kt.marginRight&&(jr.style.marginRight=Kt.marginRight),rt.push(jr),wt+=ir.height+ir.depth}lt=Math.min(lt,wt),xt=Math.max(xt,wt)}var Ur=ur(["vlist"],rt);Ur.style.height=xt+"em";var Qr;if(lt<0){var Jr=ur([],[]),sn=ur(["vlist"],[Jr]);sn.style.height=-lt+"em";var un=ur(["vlist-s"],[new V("\u200B")]);Qr=[ur(["vlist-r"],[Ur,un]),ur(["vlist-r"],[sn])]}else Qr=[ur(["vlist-r"],[Ur])];var dn=ur(["vlist-t"],Qr);return Qr.length===2&&dn.classes.push("vlist-t2"),dn.height=xt,dn.depth=-lt,dn},gn=function(l,f){var d=ur(["mspace"],[],f),m=vr(l,f);return d.style.marginRight=m+"em",d},ai=function(l,f,d){var m="";switch(l){case"amsrm":m="AMS";break;case"textrm":m="Main";break;case"textsf":m="SansSerif";break;case"texttt":m="Typewriter";break;default:m=l}var w;return f==="textbf"&&d==="textit"?w="BoldItalic":f==="textbf"?w="Bold":f==="textit"?w="Italic":w="Regular",m+"-"+w},Qn={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},oi={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},en=function(l,f){var d=oi[l],m=d[0],w=d[1],L=d[2],X=new j(m),le=new ee([X],{width:w+"em",height:L+"em",style:"width:"+w+"em",viewBox:"0 0 "+1e3*w+" "+1e3*L,preserveAspectRatio:"xMinYMin"}),Se=wr(["overlay"],[le],f);return Se.height=L,Se.style.height=L+"em",Se.style.width=w+"em",Se},st={fontMap:Qn,makeSymbol:on,mathsym:hr,makeSpan:ur,makeSvgSpan:wr,makeLineSpan:Ln,makeAnchor:Fn,makeFragment:Hn,wrapFragment:Ii,makeVList:bi,makeOrd:Dr,makeGlue:gn,staticSvg:en,svgData:oi,tryCombineChars:si};function tr(I,l){var f=Fr(I,l);if(!f)throw new Error("Expected node of type "+l+", but got "+(I?"node of type "+I.type:String(I)));return f}function Fr(I,l){return I&&I.type===l?I:null}function Br(I,l){var f=xi(I,l);if(!f)throw new Error('Expected node of type "atom" and family "'+l+'", but got '+(I?I.type==="atom"?"atom of family "+I.family:"node of type "+I.type:String(I)));return f}function xi(I,l){return I&&I.type==="atom"&&I.family===l?I:null}function Kn(I){var l=Sn(I);if(!l)throw new Error("Expected node of symbol group type, but got "+(I?"node of type "+I.type:String(I)));return l}function Sn(I){return I&&(I.type==="atom"||pt.hasOwnProperty(I.type))?I:null}var dr={number:3,unit:"mu"},An={number:4,unit:"mu"},Rn={number:5,unit:"mu"},hn={mord:{mop:dr,mbin:An,mrel:Rn,minner:dr},mop:{mord:dr,mop:dr,mrel:Rn,minner:dr},mbin:{mord:An,mop:An,mopen:An,minner:An},mrel:{mord:Rn,mop:Rn,mopen:Rn,minner:Rn},mopen:{},mclose:{mop:dr,mbin:An,mrel:Rn,minner:dr},mpunct:{mord:dr,mop:dr,mrel:Rn,mopen:dr,mclose:dr,mpunct:dr,minner:dr},minner:{mord:dr,mop:dr,mbin:An,mrel:Rn,mopen:dr,mpunct:dr,minner:dr}},ji={mord:{mop:dr},mop:{mord:dr,mop:dr},mbin:{},mrel:{},mopen:{},mclose:{mop:dr},mpunct:{},minner:{mop:dr}},Hi={},li={},Vn={};function Gt(I){for(var l=I.type,f=I.names,d=I.props,m=I.handler,w=I.htmlBuilder,L=I.mathmlBuilder,X={type:l,numArgs:d.numArgs,argTypes:d.argTypes,greediness:d.greediness===void 0?1:d.greediness,allowedInText:!!d.allowedInText,allowedInMath:d.allowedInMath===void 0?!0:d.allowedInMath,numOptionalArgs:d.numOptionalArgs||0,infix:!!d.infix,handler:m},le=0;le<f.length;++le)Hi[f[le]]=X;l&&(w&&(li[l]=w),L&&(Vn[l]=L))}function Bn(I){var l=I.type,f=I.htmlBuilder,d=I.mathmlBuilder;Gt({type:l,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:f,mathmlBuilder:d})}var tn=function(l){var f=Fr(l,"ordgroup");return f?f.body:[l]},vn=st.makeSpan,Ki=["leftmost","mbin","mopen","mrel","mop","mpunct"],En=["rightmost","mrel","mclose","mpunct"],Nn={display:S.DISPLAY,text:S.TEXT,script:S.SCRIPT,scriptscript:S.SCRIPTSCRIPT},Wn={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Kr=function(l,f,d,m){m===void 0&&(m=[null,null]);for(var w=[],L=0;L<l.length;L++){var X=yr(l[L],f);if(X instanceof Wt){var le=X.children;w.push.apply(w,le)}else w.push(X)}if(!d)return w;var Se=f;if(l.length===1){var We=Fr(l[0],"sizing")||Fr(l[0],"styling");We&&(We.type==="sizing"?Se=f.havingSize(We.size):We.type==="styling"&&(Se=f.havingStyle(Nn[We.style])))}var rt=vn([m[0]||"leftmost"],[],f),lt=vn([m[1]||"rightmost"],[],f);return Jn(w,function(xt,wt){var Me=wt.classes[0],Kt=xt.classes[0];Me==="mbin"&&U.contains(En,Kt)?wt.classes[0]="mord":Kt==="mbin"&&U.contains(Ki,Me)&&(xt.classes[0]="mord")},{node:rt},lt),Jn(w,function(xt,wt){var Me=Un(wt),Kt=Un(xt),ir=Me&&Kt?xt.hasClass("mtight")?ji[Me][Kt]:hn[Me][Kt]:null;if(ir)return st.makeGlue(ir,Se)},{node:rt},lt),w},Jn=function I(l,f,d,m){m&&l.push(m);for(var w=0;w<l.length;w++){var L=l[w],X=er(L);if(X){I(X.children,f,d);continue}if(L.classes[0]!=="mspace"){var le=f(L,d.node);le&&(d.insertAfter?d.insertAfter(le):(l.unshift(le),w++)),d.node=L,d.insertAfter=function(Se){return function(We){l.splice(Se+1,0,We),w++}}(w)}}m&&l.pop()},er=function(l){return l instanceof Wt||l instanceof Ne?l:null},Pi=function I(l,f){var d=er(l);if(d){var m=d.children;if(m.length){if(f==="right")return I(m[m.length-1],"right");if(f==="left")return I(m[0],"left")}}return l},Un=function(l,f){return l?(f&&(l=Pi(l,f)),Wn[l.classes[0]]||null):null},wn=function(l,f){var d=["nulldelimiter"].concat(l.baseSizingClasses());return vn(f.concat(d))},yr=function(l,f,d){if(!l)return vn();if(li[l.type]){var m=li[l.type](l,f);if(d&&f.size!==d.size){m=vn(f.sizingClasses(d),[m],f);var w=f.sizeMultiplier/d.sizeMultiplier;m.height*=w,m.depth*=w}return m}else throw new v("Got group of unknown type: '"+l.type+"'")};function Ei(I,l){var f=vn(["base"],I,l),d=vn(["strut"]);return d.style.height=f.height+f.depth+"em",d.style.verticalAlign=-f.depth+"em",f.children.unshift(d),f}function Oi(I,l){var f=null;I.length===1&&I[0].type==="tag"&&(f=I[0].tag,I=I[0].body);for(var d=Kr(I,l,!0),m=[],w=[],L=0;L<d.length;L++)if(w.push(d[L]),d[L].hasClass("mbin")||d[L].hasClass("mrel")||d[L].hasClass("allowbreak")){for(var X=!1;L<d.length-1&&d[L+1].hasClass("mspace")&&!d[L+1].hasClass("newline");)L++,w.push(d[L]),d[L].hasClass("nobreak")&&(X=!0);X||(m.push(Ei(w,l)),w=[])}else d[L].hasClass("newline")&&(w.pop(),w.length>0&&(m.push(Ei(w,l)),w=[]),m.push(d[L]));w.length>0&&m.push(Ei(w,l));var le;f&&(le=Ei(Kr(f,l,!0)),le.classes=["tag"],m.push(le));var Se=vn(["katex-html"],m);if(Se.setAttribute("aria-hidden","true"),le){var We=le.children[0];We.style.height=Se.height+Se.depth+"em",We.style.verticalAlign=-Se.depth+"em"}return Se}function wi(I){return new Wt(I)}var pr=function(){function I(f,d){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=f,this.attributes={},this.children=d||[]}var l=I.prototype;return l.setAttribute=function(d,m){this.attributes[d]=m},l.getAttribute=function(d){return this.attributes[d]},l.toNode=function(){var d=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var m in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,m)&&d.setAttribute(m,this.attributes[m]);for(var w=0;w<this.children.length;w++)d.appendChild(this.children[w].toNode());return d},l.toMarkup=function(){var d="<"+this.type;for(var m in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,m)&&(d+=" "+m+'="',d+=U.escape(this.attributes[m]),d+='"');d+=">";for(var w=0;w<this.children.length;w++)d+=this.children[w].toMarkup();return d+="</"+this.type+">",d},l.toText=function(){return this.children.map(function(d){return d.toText()}).join("")},I}(),ui=function(){function I(f){this.text=void 0,this.text=f}var l=I.prototype;return l.toNode=function(){return document.createTextNode(this.text)},l.toMarkup=function(){return U.escape(this.toText())},l.toText=function(){return this.text},I}(),ns=function(){function I(f){this.width=void 0,this.character=void 0,this.width=f,f>=.05555&&f<=.05556?this.character="\u200A":f>=.1666&&f<=.1667?this.character="\u2009":f>=.2222&&f<=.2223?this.character="\u2005":f>=.2777&&f<=.2778?this.character="\u2005\u200A":f>=-.05556&&f<=-.05555?this.character="\u200A\u2063":f>=-.1667&&f<=-.1666?this.character="\u2009\u2063":f>=-.2223&&f<=-.2222?this.character="\u205F\u2063":f>=-.2778&&f<=-.2777?this.character="\u2005\u2063":this.character=null}var l=I.prototype;return l.toNode=function(){if(this.character)return document.createTextNode(this.character);var d=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return d.setAttribute("width",this.width+"em"),d},l.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},l.toText=function(){return this.character?this.character:" "},I}(),kt={MathNode:pr,TextNode:ui,SpaceNode:ns,newDocumentFragment:wi},yn=function(l,f,d){return ct[f][l]&&ct[f][l].replace&&l.charCodeAt(0)!==55349&&!(Dt.hasOwnProperty(l)&&d&&(d.fontFamily&&d.fontFamily.substr(4,2)==="tt"||d.font&&d.font.substr(4,2)==="tt"))&&(l=ct[f][l].replace),new kt.TextNode(l)},Mi=function(l){return l.length===1?l[0]:new kt.MathNode("mrow",l)},Si=function(l,f){if(f.fontFamily==="texttt")return"monospace";if(f.fontFamily==="textsf")return f.fontShape==="textit"&&f.fontWeight==="textbf"?"sans-serif-bold-italic":f.fontShape==="textit"?"sans-serif-italic":f.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(f.fontShape==="textit"&&f.fontWeight==="textbf")return"bold-italic";if(f.fontShape==="textit")return"italic";if(f.fontWeight==="textbf")return"bold";var d=f.font;if(!d||d==="mathnormal")return null;var m=l.mode;if(d==="mathit")return"italic";if(d==="boldsymbol")return"bold-italic";if(d==="mathbf")return"bold";if(d==="mathbb")return"double-struck";if(d==="mathfrak")return"fraktur";if(d==="mathscr"||d==="mathcal")return"script";if(d==="mathsf")return"sans-serif";if(d==="mathtt")return"monospace";var w=l.text;if(U.contains(["\\imath","\\jmath"],w))return null;ct[m][w]&&ct[m][w].replace&&(w=ct[m][w].replace);var L=st.fontMap[d].fontName;return Ve(w,L,m)?st.fontMap[d].variant:null},ln=function(l,f,d){if(l.length===1){var m=kr(l[0],f);return d&&m instanceof pr&&m.type==="mo"&&(m.setAttribute("lspace","0em"),m.setAttribute("rspace","0em")),[m]}for(var w=[],L,X=0;X<l.length;X++){var le=kr(l[X],f);if(le instanceof pr&&L instanceof pr){if(le.type==="mtext"&&L.type==="mtext"&&le.getAttribute("mathvariant")===L.getAttribute("mathvariant")){var Se;(Se=L.children).push.apply(Se,le.children);continue}else if(le.type==="mn"&&L.type==="mn"){var We;(We=L.children).push.apply(We,le.children);continue}else if(le.type==="mi"&&le.children.length===1&&L.type==="mn"){var rt=le.children[0];if(rt instanceof ui&&rt.text==="."){var lt;(lt=L.children).push.apply(lt,le.children);continue}}else if(L.type==="mi"&&L.children.length===1){var xt=L.children[0];if(xt instanceof ui&&xt.text==="\u0338"&&(le.type==="mo"||le.type==="mi"||le.type==="mn")){var wt=le.children[0];wt instanceof ui&&wt.text.length>0&&(wt.text=wt.text.slice(0,1)+"\u0338"+wt.text.slice(1),w.pop())}}}w.push(le),L=le}return w},rn=function(l,f,d){return Mi(ln(l,f,d))},kr=function(l,f){if(!l)return new kt.MathNode("mrow");if(Vn[l.type]){var d=Vn[l.type](l,f);return d}else throw new v("Got group of unknown type: '"+l.type+"'")};function Dn(I,l,f,d){var m=ln(I,f),w;m.length===1&&m[0]instanceof pr&&U.contains(["mrow","mtable"],m[0].type)?w=m[0]:w=new kt.MathNode("mrow",m);var L=new kt.MathNode("annotation",[new kt.TextNode(l)]);L.setAttribute("encoding","application/x-tex");var X=new kt.MathNode("semantics",[w,L]),le=new kt.MathNode("math",[X]);le.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var Se=d?"katex":"katex-mathml";return st.makeSpan([Se],[le])}var ei=function(l){return new On({style:l.displayMode?S.DISPLAY:S.TEXT,maxSize:l.maxSize,minRuleThickness:l.minRuleThickness})},ci=function(l,f){if(f.displayMode){var d=["katex-display"];f.leqno&&d.push("leqno"),f.fleqn&&d.push("fleqn"),l=st.makeSpan(d,[l])}return l},hi=function(l,f,d){var m=ei(d),w;if(d.output==="mathml")return Dn(l,f,m,!0);if(d.output==="html"){var L=Oi(l,m);w=st.makeSpan(["katex"],[L])}else{var X=Dn(l,f,m,!1),le=Oi(l,m);w=st.makeSpan(["katex"],[X,le])}return ci(w,d)},ti=function(l,f,d){var m=ei(d),w=Oi(l,m),L=st.makeSpan(["katex"],[w]);return ci(L,d)},xr=hi,fn={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB"},Fi=function(l){var f=new kt.MathNode("mo",[new kt.TextNode(fn[l.substr(1)])]);return f.setAttribute("stretchy","true"),f},Ai={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Bi=function(l){return l.type==="ordgroup"?l.body.length:1},Ni=function(l,f){function d(){var le=4e5,Se=l.label.substr(1);if(U.contains(["widehat","widecheck","widetilde","utilde"],Se)){var We=l,rt=Bi(We.base),lt,xt,wt;if(rt>5)Se==="widehat"||Se==="widecheck"?(lt=420,le=2364,wt=.42,xt=Se+"4"):(lt=312,le=2340,wt=.34,xt="tilde4");else{var Me=[1,1,2,2,3,3][rt];Se==="widehat"||Se==="widecheck"?(le=[0,1062,2364,2364,2364][Me],lt=[0,239,300,360,420][Me],wt=[0,.24,.3,.3,.36,.42][Me],xt=Se+Me):(le=[0,600,1033,2339,2340][Me],lt=[0,260,286,306,312][Me],wt=[0,.26,.286,.3,.306,.34][Me],xt="tilde"+Me)}var Kt=new j(xt),ir=new ee([Kt],{width:"100%",height:wt+"em",viewBox:"0 0 "+le+" "+lt,preserveAspectRatio:"none"});return{span:st.makeSvgSpan([],[ir],f),minWidth:0,height:wt}}else{var cr=[],ar=Ai[Se],jr=ar[0],Ur=ar[1],Qr=ar[2],Jr=Qr/1e3,sn=jr.length,un,dn;if(sn===1){var Nr=ar[3];un=["hide-tail"],dn=[Nr]}else if(sn===2)un=["halfarrow-left","halfarrow-right"],dn=["xMinYMin","xMaxYMin"];else if(sn===3)un=["brace-left","brace-center","brace-right"],dn=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
`+sn+" children.");for(var Tn=0;Tn<sn;Tn++){var pn=new j(jr[Tn]),Zn=new ee([pn],{width:"400em",height:Jr+"em",viewBox:"0 0 "+le+" "+Qr,preserveAspectRatio:dn[Tn]+" slice"}),bn=st.makeSvgSpan([un[Tn]],[Zn],f);if(sn===1)return{span:bn,minWidth:Ur,height:Jr};bn.style.height=Jr+"em",cr.push(bn)}return{span:st.makeSpan(["stretchy"],cr,f),minWidth:Ur,height:Jr}}}var m=d(),w=m.span,L=m.minWidth,X=m.height;return w.height=X,w.style.height=X+"em",L>0&&(w.style.minWidth=L+"em"),w},jt=function(l,f,d,m){var w,L=l.height+l.depth+2*d;if(/fbox|color/.test(f)){if(w=st.makeSpan(["stretchy",f],[],m),f==="fbox"){var X=m.color&&m.getColor();X&&(w.style.borderColor=X)}}else{var le=[];/^[bx]cancel$/.test(f)&&le.push(new W({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(f)&&le.push(new W({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var Se=new ee(le,{width:"100%",height:L+"em"});w=st.makeSvgSpan([],[Se],m)}return w.height=L,w.style.height=L+"em",w},qt={encloseSpan:jt,mathMLnode:Fi,svgSpan:Ni},Gr=function(l,f){var d,m,w=Fr(l,"supsub"),L;w?(m=tr(w.base,"accent"),d=m.base,w.base=d,L=Pe(yr(w,f)),w.base=m):(m=tr(l,"accent"),d=m.base);var X=yr(d,f.havingCrampedStyle()),le=m.isShifty&&U.isCharacterBox(d),Se=0;if(le){var We=U.getBaseElem(d),rt=yr(We,f.havingCrampedStyle());Se=ke(rt).skew}var lt=Math.min(X.height,f.fontMetrics().xHeight),xt;if(m.isStretchy)xt=qt.svgSpan(m,f),xt=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:X},{type:"elem",elem:xt,wrapperClasses:["svg-align"],wrapperStyle:Se>0?{width:"calc(100% - "+2*Se+"em)",marginLeft:2*Se+"em"}:void 0}]},f);else{var wt,Me;m.label==="\\vec"?(wt=st.staticSvg("vec",f),Me=st.svgData.vec[1]):(wt=st.makeOrd({mode:m.mode,text:m.label},f,"textord"),wt=ke(wt),wt.italic=0,Me=wt.width),xt=st.makeSpan(["accent-body"],[wt]);var Kt=m.label==="\\textcircled";Kt&&(xt.classes.push("accent-full"),lt=X.height);var ir=Se;Kt||(ir-=Me/2),xt.style.left=ir+"em",m.label==="\\textcircled"&&(xt.style.top=".2em"),xt=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:X},{type:"kern",size:-lt},{type:"elem",elem:xt}]},f)}var cr=st.makeSpan(["mord","accent"],[xt],f);return L?(L.children[0]=cr,L.height=Math.max(cr.height,L.height),L.classes[0]="mord",L):cr},nn=function(l,f){var d=l.isStretchy?qt.mathMLnode(l.label):new kt.MathNode("mo",[yn(l.label,l.mode)]),m=new kt.MathNode("mover",[kr(l.base,f),d]);return m.setAttribute("accent","true"),m},Vr=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(I){return"\\"+I}).join("|"));Gt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(l,f){var d=f[0],m=!Vr.test(l.funcName),w=!m||l.funcName==="\\widehat"||l.funcName==="\\widetilde"||l.funcName==="\\widecheck";return{type:"accent",mode:l.parser.mode,label:l.funcName,isStretchy:m,isShifty:w,base:d}},htmlBuilder:Gr,mathmlBuilder:nn}),Gt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(l,f){var d=f[0];return{type:"accent",mode:l.parser.mode,label:l.funcName,isStretchy:!1,isShifty:!0,base:d}},htmlBuilder:Gr,mathmlBuilder:nn}),Gt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0];return{type:"accentUnder",mode:d.mode,label:m,base:w}},htmlBuilder:function(l,f){var d=yr(l.base,f),m=qt.svgSpan(l,f),w=l.label==="\\utilde"?.12:0,L=st.makeVList({positionType:"bottom",positionData:m.height+w,children:[{type:"elem",elem:m,wrapperClasses:["svg-align"]},{type:"kern",size:w},{type:"elem",elem:d}]},f);return st.makeSpan(["mord","accentunder"],[L],f)},mathmlBuilder:function(l,f){var d=qt.mathMLnode(l.label),m=new kt.MathNode("munder",[kr(l.base,f),d]);return m.setAttribute("accentunder","true"),m}});var $n=function(l){var f=new kt.MathNode("mpadded",l?[l]:[]);return f.setAttribute("width","+0.6em"),f.setAttribute("lspace","0.3em"),f};Gt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],props:{numArgs:1,numOptionalArgs:1},handler:function(l,f,d){var m=l.parser,w=l.funcName;return{type:"xArrow",mode:m.mode,label:w,body:f[0],below:d[0]}},htmlBuilder:function(l,f){var d=f.style,m=f.havingStyle(d.sup()),w=st.wrapFragment(yr(l.body,m,f),f);w.classes.push("x-arrow-pad");var L;l.below&&(m=f.havingStyle(d.sub()),L=st.wrapFragment(yr(l.below,m,f),f),L.classes.push("x-arrow-pad"));var X=qt.svgSpan(l,f),le=-f.fontMetrics().axisHeight+.5*X.height,Se=-f.fontMetrics().axisHeight-.5*X.height-.111;(w.depth>.25||l.label==="\\xleftequilibrium")&&(Se-=w.depth);var We;if(L){var rt=-f.fontMetrics().axisHeight+L.height+.5*X.height+.111;We=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:w,shift:Se},{type:"elem",elem:X,shift:le},{type:"elem",elem:L,shift:rt}]},f)}else We=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:w,shift:Se},{type:"elem",elem:X,shift:le}]},f);return We.children[0].children[0].children[1].classes.push("svg-align"),st.makeSpan(["mrel","x-arrow"],[We],f)},mathmlBuilder:function(l,f){var d=qt.mathMLnode(l.label),m;if(l.body){var w=$n(kr(l.body,f));if(l.below){var L=$n(kr(l.below,f));m=new kt.MathNode("munderover",[d,L,w])}else m=new kt.MathNode("mover",[d,w])}else if(l.below){var X=$n(kr(l.below,f));m=new kt.MathNode("munder",[d,X])}else m=$n(),m=new kt.MathNode("mover",[d,m]);return m}}),Gt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){for(var d=l.parser,m=tr(f[0],"ordgroup"),w=m.body,L="",X=0;X<w.length;X++){var le=tr(w[X],"textord");L+=le.text}var Se=parseInt(L);if(isNaN(Se))throw new v("\\@char has non-numeric argument "+L);return{type:"textord",mode:d.mode,text:String.fromCharCode(Se)}}});var ri=function(l,f){var d=Kr(l.body,f.withColor(l.color),!1);return st.makeFragment(d)},is=function(l,f){var d=ln(l.body,f.withColor(l.color)),m=new kt.MathNode("mstyle",d);return m.setAttribute("mathcolor",l.color),m};Gt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(l,f){var d=l.parser,m=tr(f[0],"color-token").color,w=f[1];return{type:"color",mode:d.mode,color:m,body:tn(w)}},htmlBuilder:ri,mathmlBuilder:is}),Gt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(l,f){var d=l.parser,m=l.breakOnTokenText,w=tr(f[0],"color-token").color;d.gullet.macros.set("\\current@color",w);var L=d.parseExpression(!0,m);return{type:"color",mode:d.mode,color:w,body:L}},htmlBuilder:ri,mathmlBuilder:is}),Gt({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(l,f,d){var m=l.parser,w=l.funcName,L=d[0],X=w==="\\cr",le=!1;return X||(m.settings.displayMode&&m.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?le=!1:le=!0),{type:"cr",mode:m.mode,newLine:le,newRow:X,size:L&&tr(L,"size").value}},htmlBuilder:function(l,f){if(l.newRow)throw new v("\\cr valid only within a tabular/array environment");var d=st.makeSpan(["mspace"],[],f);return l.newLine&&(d.classes.push("newline"),l.size&&(d.style.marginTop=vr(l.size,f)+"em")),d},mathmlBuilder:function(l,f){var d=new kt.MathNode("mspace");return l.newLine&&(d.setAttribute("linebreak","newline"),l.size&&d.setAttribute("height",vr(l.size,f)+"em")),d}});var Yn=function(l,f,d){var m=ct.math[l]&&ct.math[l].replace,w=Ve(m||l,f,d);if(!w)throw new Error("Unsupported symbol "+l+" and font size "+f+".");return w},ms=function(l,f,d,m){var w=d.havingBaseStyle(f),L=st.makeSpan(m.concat(w.sizingClasses(d)),[l],d),X=w.sizeMultiplier/d.sizeMultiplier;return L.height*=X,L.depth*=X,L.maxFontSize=w.sizeMultiplier,L},ma=function(l,f,d){var m=f.havingBaseStyle(d),w=(1-f.sizeMultiplier/m.sizeMultiplier)*f.fontMetrics().axisHeight;l.classes.push("delimcenter"),l.style.top=w+"em",l.height-=w,l.depth+=w},Us=function(l,f,d,m,w,L){var X=st.makeSymbol(l,"Main-Regular",w,m),le=ms(X,f,m,L);return d&&ma(le,m,f),le},uo=function(l,f,d,m){return st.makeSymbol(l,"Size"+f+"-Regular",d,m)},qn=function(l,f,d,m,w,L){var X=uo(l,f,w,m),le=ms(st.makeSpan(["delimsizing","size"+f],[X],m),S.TEXT,m,L);return d&&ma(le,m,S.TEXT),le},fi=function(l,f,d){var m;f==="Size1-Regular"?m="delim-size1":m="delim-size4";var w=st.makeSpan(["delimsizinginner",m],[st.makeSpan([],[st.makeSymbol(l,f,d)])]);return{type:"elem",elem:w}},ss={type:"kern",size:-.005},$s=function(l,f,d,m,w,L){var X,le,Se,We;X=Se=We=l,le=null;var rt="Size1-Regular";l==="\\uparrow"?Se=We="\u23D0":l==="\\Uparrow"?Se=We="\u2016":l==="\\downarrow"?X=Se="\u23D0":l==="\\Downarrow"?X=Se="\u2016":l==="\\updownarrow"?(X="\\uparrow",Se="\u23D0",We="\\downarrow"):l==="\\Updownarrow"?(X="\\Uparrow",Se="\u2016",We="\\Downarrow"):l==="["||l==="\\lbrack"?(X="\u23A1",Se="\u23A2",We="\u23A3",rt="Size4-Regular"):l==="]"||l==="\\rbrack"?(X="\u23A4",Se="\u23A5",We="\u23A6",rt="Size4-Regular"):l==="\\lfloor"||l==="\u230A"?(Se=X="\u23A2",We="\u23A3",rt="Size4-Regular"):l==="\\lceil"||l==="\u2308"?(X="\u23A1",Se=We="\u23A2",rt="Size4-Regular"):l==="\\rfloor"||l==="\u230B"?(Se=X="\u23A5",We="\u23A6",rt="Size4-Regular"):l==="\\rceil"||l==="\u2309"?(X="\u23A4",Se=We="\u23A5",rt="Size4-Regular"):l==="("||l==="\\lparen"?(X="\u239B",Se="\u239C",We="\u239D",rt="Size4-Regular"):l===")"||l==="\\rparen"?(X="\u239E",Se="\u239F",We="\u23A0",rt="Size4-Regular"):l==="\\{"||l==="\\lbrace"?(X="\u23A7",le="\u23A8",We="\u23A9",Se="\u23AA",rt="Size4-Regular"):l==="\\}"||l==="\\rbrace"?(X="\u23AB",le="\u23AC",We="\u23AD",Se="\u23AA",rt="Size4-Regular"):l==="\\lgroup"||l==="\u27EE"?(X="\u23A7",We="\u23A9",Se="\u23AA",rt="Size4-Regular"):l==="\\rgroup"||l==="\u27EF"?(X="\u23AB",We="\u23AD",Se="\u23AA",rt="Size4-Regular"):l==="\\lmoustache"||l==="\u23B0"?(X="\u23A7",We="\u23AD",Se="\u23AA",rt="Size4-Regular"):(l==="\\rmoustache"||l==="\u23B1")&&(X="\u23AB",We="\u23A9",Se="\u23AA",rt="Size4-Regular");var lt=Yn(X,rt,w),xt=lt.height+lt.depth,wt=Yn(Se,rt,w),Me=wt.height+wt.depth,Kt=Yn(We,rt,w),ir=Kt.height+Kt.depth,cr=0,ar=1;if(le!==null){var jr=Yn(le,rt,w);cr=jr.height+jr.depth,ar=2}var Ur=xt+ir+cr,Qr=Math.max(0,Math.ceil((f-Ur)/(ar*Me))),Jr=Ur+Qr*ar*Me,sn=m.fontMetrics().axisHeight;d&&(sn*=m.sizeMultiplier);var un=Jr/2-sn,dn=(Qr+1)*.005-Me,Nr=[];if(Nr.push(fi(We,rt,w)),le===null)for(var Tn=0;Tn<Qr;Tn++)Nr.push(ss),Nr.push(fi(Se,rt,w));else{for(var pn=0;pn<Qr;pn++)Nr.push(ss),Nr.push(fi(Se,rt,w));Nr.push({type:"kern",size:dn}),Nr.push(fi(Se,rt,w)),Nr.push(ss),Nr.push(fi(le,rt,w));for(var Zn=0;Zn<Qr;Zn++)Nr.push(ss),Nr.push(fi(Se,rt,w))}Nr.push({type:"kern",size:dn}),Nr.push(fi(Se,rt,w)),Nr.push(ss),Nr.push(fi(X,rt,w));var bn=m.havingBaseStyle(S.TEXT),mi=st.makeVList({positionType:"bottom",positionData:un,children:Nr},bn);return ms(st.makeSpan(["delimsizing","mult"],[mi],bn),S.TEXT,m,L)},gs=80,_s=.08,vs=function(l,f,d,m,w){var L=Vt(l,m,d),X=new j(l,L),le=new ee([X],{width:"400em",height:f+"em",viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});return st.makeSvgSpan(["hide-tail"],[le],w)},co=function(l,f){var d=f.havingBaseSizing(),m=ba("\\surd",l*d.sizeMultiplier,ya,d),w=d.sizeMultiplier,L=Math.max(0,f.minRuleThickness-f.fontMetrics().sqrtRuleThickness),X,le=0,Se=0,We=0,rt;return m.type==="small"?(We=1e3+1e3*L+gs,l<1?w=1:l<1.4&&(w=.7),le=(1+L+_s)/w,Se=(1+L)/w,X=vs("sqrtMain",le,We,L,f),X.style.minWidth="0.853em",rt=.833/w):m.type==="large"?(We=(1e3+gs)*zn[m.size],Se=(zn[m.size]+L)/w,le=(zn[m.size]+L+_s)/w,X=vs("sqrtSize"+m.size,le,We,L,f),X.style.minWidth="1.02em",rt=1/w):(le=l+L+_s,Se=l+L,We=Math.floor(1e3*l+L)+gs,X=vs("sqrtTall",le,We,L,f),X.style.minWidth="0.742em",rt=1.056),X.height=Se,X.style.height=le+"em",{span:X,advanceWidth:rt,ruleWidth:(f.fontMetrics().sqrtRuleThickness+L)*w}},ys=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],ga=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],zs=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zn=[0,1.2,1.8,2.4,3],_a=function(l,f,d,m,w){if(l==="<"||l==="\\lt"||l==="\u27E8"?l="\\langle":(l===">"||l==="\\gt"||l==="\u27E9")&&(l="\\rangle"),U.contains(ys,l)||U.contains(zs,l))return qn(l,f,!1,d,m,w);if(U.contains(ga,l))return $s(l,zn[f],!1,d,m,w);throw new v("Illegal delimiter: '"+l+"'")},Gs=[{type:"small",style:S.SCRIPTSCRIPT},{type:"small",style:S.SCRIPT},{type:"small",style:S.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],va=[{type:"small",style:S.SCRIPTSCRIPT},{type:"small",style:S.SCRIPT},{type:"small",style:S.TEXT},{type:"stack"}],ya=[{type:"small",style:S.SCRIPTSCRIPT},{type:"small",style:S.SCRIPT},{type:"small",style:S.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ho=function(l){if(l.type==="small")return"Main-Regular";if(l.type==="large")return"Size"+l.size+"-Regular";if(l.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+l.type+"' here.")},ba=function(l,f,d,m){for(var w=Math.min(2,3-m.style.size),L=w;L<d.length&&d[L].type!=="stack";L++){var X=Yn(l,ho(d[L]),"math"),le=X.height+X.depth;if(d[L].type==="small"){var Se=m.havingBaseStyle(d[L].style);le*=Se.sizeMultiplier}if(le>f)return d[L]}return d[d.length-1]},xa=function(l,f,d,m,w,L){l==="<"||l==="\\lt"||l==="\u27E8"?l="\\langle":(l===">"||l==="\\gt"||l==="\u27E9")&&(l="\\rangle");var X;U.contains(zs,l)?X=Gs:U.contains(ys,l)?X=ya:X=va;var le=ba(l,f,X,m);return le.type==="small"?Us(l,le.style,d,m,w,L):le.type==="large"?qn(l,le.size,d,m,w,L):$s(l,f,d,m,w,L)},Ea=function(l,f,d,m,w,L){var X=m.fontMetrics().axisHeight*m.sizeMultiplier,le=901,Se=5/m.fontMetrics().ptPerEm,We=Math.max(f-X,d+X),rt=Math.max(We/500*le,2*We-Se);return xa(l,rt,!0,m,w,L)},di={sqrtImage:co,sizedDelim:_a,customSizedDelim:xa,leftRightDelim:Ea},bs={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},wa=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function xs(I,l){var f=Sn(I);if(f&&U.contains(wa,f.text))return f;throw new v("Invalid delimiter: '"+(f?f.text:JSON.stringify(I))+"' after '"+l.funcName+"'",I)}Gt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(l,f){var d=xs(f[0],l);return{type:"delimsizing",mode:l.parser.mode,size:bs[l.funcName].size,mclass:bs[l.funcName].mclass,delim:d.text}},htmlBuilder:function(l,f){return l.delim==="."?st.makeSpan([l.mclass]):di.sizedDelim(l.delim,l.size,f,l.mode,[l.mclass])},mathmlBuilder:function(l){var f=[];l.delim!=="."&&f.push(yn(l.delim,l.mode));var d=new kt.MathNode("mo",f);return l.mclass==="mopen"||l.mclass==="mclose"?d.setAttribute("fence","true"):d.setAttribute("fence","false"),d}});function js(I){if(!I.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Gt({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(l,f){var d=l.parser.gullet.macros.get("\\current@color");if(d&&typeof d!="string")throw new v("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:l.parser.mode,delim:xs(f[0],l).text,color:d}}}),Gt({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(l,f){var d=xs(f[0],l),m=l.parser;++m.leftrightDepth;var w=m.parseExpression(!1);--m.leftrightDepth,m.expect("\\right",!1);var L=tr(m.parseFunction(),"leftright-right");return{type:"leftright",mode:m.mode,body:w,left:d.text,right:L.delim,rightColor:L.color}},htmlBuilder:function(l,f){js(l);for(var d=Kr(l.body,f,!0,["mopen","mclose"]),m=0,w=0,L=!1,X=0;X<d.length;X++)d[X].isMiddle?L=!0:(m=Math.max(d[X].height,m),w=Math.max(d[X].depth,w));m*=f.sizeMultiplier,w*=f.sizeMultiplier;var le;if(l.left==="."?le=wn(f,["mopen"]):le=di.leftRightDelim(l.left,m,w,f,l.mode,["mopen"]),d.unshift(le),L)for(var Se=1;Se<d.length;Se++){var We=d[Se],rt=We.isMiddle;rt&&(d[Se]=di.leftRightDelim(rt.delim,m,w,rt.options,l.mode,[]))}var lt;if(l.right===".")lt=wn(f,["mclose"]);else{var xt=l.rightColor?f.withColor(l.rightColor):f;lt=di.leftRightDelim(l.right,m,w,xt,l.mode,["mclose"])}return d.push(lt),st.makeSpan(["minner"],d,f)},mathmlBuilder:function(l,f){js(l);var d=ln(l.body,f);if(l.left!=="."){var m=new kt.MathNode("mo",[yn(l.left,l.mode)]);m.setAttribute("fence","true"),d.unshift(m)}if(l.right!=="."){var w=new kt.MathNode("mo",[yn(l.right,l.mode)]);w.setAttribute("fence","true"),l.rightColor&&w.setAttribute("mathcolor",l.rightColor),d.push(w)}return Mi(d)}}),Gt({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(l,f){var d=xs(f[0],l);if(!l.parser.leftrightDepth)throw new v("\\middle without preceding \\left",d);return{type:"middle",mode:l.parser.mode,delim:d.text}},htmlBuilder:function(l,f){var d;if(l.delim===".")d=wn(f,[]);else{d=di.sizedDelim(l.delim,1,f,l.mode,[]);var m={delim:l.delim,options:f};d.isMiddle=m}return d},mathmlBuilder:function(l,f){var d=l.delim==="\\vert"||l.delim==="|"?yn("|","text"):yn(l.delim,l.mode),m=new kt.MathNode("mo",[d]);return m.setAttribute("fence","true"),m.setAttribute("lspace","0.05em"),m.setAttribute("rspace","0.05em"),m}});var Es=function(l,f){var d=st.wrapFragment(yr(l.body,f),f),m=l.label.substr(1),w=f.sizeMultiplier,L,X=0,le=U.isCharacterBox(l.body);if(m==="sout")L=st.makeSpan(["stretchy","sout"]),L.height=f.fontMetrics().defaultRuleThickness/w,X=-.5*f.fontMetrics().xHeight;else{/cancel/.test(m)?le||d.classes.push("cancel-pad"):d.classes.push("boxpad");var Se=0,We=0;/box/.test(m)?(We=Math.max(f.fontMetrics().fboxrule,f.minRuleThickness),Se=f.fontMetrics().fboxsep+(m==="colorbox"?0:We)):Se=le?.2:0,L=qt.encloseSpan(d,m,Se,f),/fbox|boxed|fcolorbox/.test(m)&&(L.style.borderStyle="solid",L.style.borderWidth=We+"em"),X=d.depth+Se,l.backgroundColor&&(L.style.backgroundColor=l.backgroundColor,l.borderColor&&(L.style.borderColor=l.borderColor))}var rt;return l.backgroundColor?rt=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:L,shift:X},{type:"elem",elem:d,shift:0}]},f):rt=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:0},{type:"elem",elem:L,shift:X,wrapperClasses:/cancel/.test(m)?["svg-align"]:[]}]},f),/cancel/.test(m)&&(rt.height=d.height,rt.depth=d.depth),/cancel/.test(m)&&!le?st.makeSpan(["mord","cancel-lap"],[rt],f):st.makeSpan(["mord"],[rt],f)},ws=function(l,f){var d=0,m=new kt.MathNode(l.label.indexOf("colorbox")>-1?"mpadded":"menclose",[kr(l.body,f)]);switch(l.label){case"\\cancel":m.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":m.setAttribute("notation","downdiagonalstrike");break;case"\\sout":m.setAttribute("notation","horizontalstrike");break;case"\\fbox":m.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(d=f.fontMetrics().fboxsep*f.fontMetrics().ptPerEm,m.setAttribute("width","+"+2*d+"pt"),m.setAttribute("height","+"+2*d+"pt"),m.setAttribute("lspace",d+"pt"),m.setAttribute("voffset",d+"pt"),l.label==="\\fcolorbox"){var w=Math.max(f.fontMetrics().fboxrule,f.minRuleThickness);m.setAttribute("style","border: "+w+"em solid "+String(l.borderColor))}break;case"\\xcancel":m.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return l.backgroundColor&&m.setAttribute("mathbackground",l.backgroundColor),m};Gt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(l,f,d){var m=l.parser,w=l.funcName,L=tr(f[0],"color-token").color,X=f[1];return{type:"enclose",mode:m.mode,label:w,backgroundColor:L,body:X}},htmlBuilder:Es,mathmlBuilder:ws}),Gt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(l,f,d){var m=l.parser,w=l.funcName,L=tr(f[0],"color-token").color,X=tr(f[1],"color-token").color,le=f[2];return{type:"enclose",mode:m.mode,label:w,backgroundColor:X,borderColor:L,body:le}},htmlBuilder:Es,mathmlBuilder:ws}),Gt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"enclose",mode:d.mode,label:"\\fbox",body:f[0]}}}),Gt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(l,f,d){var m=l.parser,w=l.funcName,L=f[0];return{type:"enclose",mode:m.mode,label:w,body:L}},htmlBuilder:Es,mathmlBuilder:ws});var Vi={};function Ti(I){for(var l=I.type,f=I.names,d=I.props,m=I.handler,w=I.htmlBuilder,L=I.mathmlBuilder,X={type:l,numArgs:d.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:m},le=0;le<f.length;++le)Vi[f[le]]=X;w&&(li[l]=w),L&&(Vn[l]=L)}function Hs(I){var l=[];I.consumeSpaces();for(var f=I.fetch().text;f==="\\hline"||f==="\\hdashline";)I.consume(),l.push(f==="\\hdashline"),I.consumeSpaces(),f=I.fetch().text;return l}function Di(I,l,f){var d=l.hskipBeforeAndAfter,m=l.addJot,w=l.cols,L=l.arraystretch,X=l.colSeparationType;if(I.gullet.beginGroup(),I.gullet.macros.set("\\\\","\\cr"),!L){var le=I.gullet.expandMacroAsText("\\arraystretch");if(le==null)L=1;else if(L=parseFloat(le),!L||L<0)throw new v("Invalid \\arraystretch: "+le)}I.gullet.beginGroup();var Se=[],We=[Se],rt=[],lt=[];for(lt.push(Hs(I));;){var xt=I.parseExpression(!1,"\\cr");I.gullet.endGroup(),I.gullet.beginGroup(),xt={type:"ordgroup",mode:I.mode,body:xt},f&&(xt={type:"styling",mode:I.mode,style:f,body:[xt]}),Se.push(xt);var wt=I.fetch().text;if(wt==="&")I.consume();else if(wt==="\\end"){Se.length===1&&xt.type==="styling"&&xt.body[0].body.length===0&&We.pop(),lt.length<We.length+1&<.push([]);break}else if(wt==="\\cr"){var Me=tr(I.parseFunction(),"cr");rt.push(Me.size),lt.push(Hs(I)),Se=[],We.push(Se)}else throw new v("Expected & or \\\\ or \\cr or \\end",I.nextToken)}return I.gullet.endGroup(),I.gullet.endGroup(),{type:"array",mode:I.mode,addJot:m,arraystretch:L,body:We,cols:w,rowGaps:rt,hskipBeforeAndAfter:d,hLinesBeforeRow:lt,colSeparationType:X}}function Ks(I){return I.substr(0,1)==="d"?"display":"text"}var pi=function(l,f){var d,m,w=l.body.length,L=l.hLinesBeforeRow,X=0,le=new Array(w),Se=[],We=Math.max(f.fontMetrics().arrayRuleWidth,f.minRuleThickness),rt=1/f.fontMetrics().ptPerEm,lt=5*rt;if(l.colSeparationType&&l.colSeparationType==="small"){var xt=f.havingStyle(S.SCRIPT).sizeMultiplier;lt=.2778*(xt/f.sizeMultiplier)}var wt=12*rt,Me=3*rt,Kt=l.arraystretch*wt,ir=.7*Kt,cr=.3*Kt,ar=0;function jr(Qa){for(var Ji=0;Ji<Qa.length;++Ji)Ji>0&&(ar+=.25),Se.push({pos:ar,isDashed:Qa[Ji]})}for(jr(L[0]),d=0;d<l.body.length;++d){var Ur=l.body[d],Qr=ir,Jr=cr;X<Ur.length&&(X=Ur.length);var sn=new Array(Ur.length);for(m=0;m<Ur.length;++m){var un=yr(Ur[m],f);Jr<un.depth&&(Jr=un.depth),Qr<un.height&&(Qr=un.height),sn[m]=un}var dn=l.rowGaps[d],Nr=0;dn&&(Nr=vr(dn,f),Nr>0&&(Nr+=cr,Jr<Nr&&(Jr=Nr),Nr=0)),l.addJot&&(Jr+=Me),sn.height=Qr,sn.depth=Jr,ar+=Qr,sn.pos=ar,ar+=Jr+Nr,le[d]=sn,jr(L[d+1])}var Tn=ar/2+f.fontMetrics().axisHeight,pn=l.cols||[],Zn=[],bn,mi;for(m=0,mi=0;m<X||mi<pn.length;++m,++mi){for(var gi=pn[mi]||{},Za=!0;gi.type==="separator";){if(Za||(bn=st.makeSpan(["arraycolsep"],[]),bn.style.width=f.fontMetrics().doubleRuleSep+"em",Zn.push(bn)),gi.separator==="|"||gi.separator===":"){var Xa=gi.separator==="|"?"solid":"dashed",kn=st.makeSpan(["vertical-separator"],[],f);kn.style.height=ar+"em",kn.style.borderRightWidth=We+"em",kn.style.borderRightStyle=Xa,kn.style.margin="0 -"+We/2+"em",kn.style.verticalAlign=-(ar-Tn)+"em",Zn.push(kn)}else throw new v("Invalid separator type: "+gi.separator);mi++,gi=pn[mi]||{},Za=!1}if(!(m>=X)){var _i=void 0;(m>0||l.hskipBeforeAndAfter)&&(_i=U.deflt(gi.pregap,lt),_i!==0&&(bn=st.makeSpan(["arraycolsep"],[]),bn.style.width=_i+"em",Zn.push(bn)));var $i=[];for(d=0;d<w;++d){var Is=le[d],Qi=Is[m];if(Qi){var hs=Is.pos-Tn;Qi.depth=Is.depth,Qi.height=Is.height,$i.push({type:"elem",elem:Qi,shift:hs})}}$i=st.makeVList({positionType:"individualShift",children:$i},f),$i=st.makeSpan(["col-align-"+(gi.align||"c")],[$i]),Zn.push($i),(m<X-1||l.hskipBeforeAndAfter)&&(_i=U.deflt(gi.postgap,lt),_i!==0&&(bn=st.makeSpan(["arraycolsep"],[]),bn.style.width=_i+"em",Zn.push(bn)))}}if(le=st.makeSpan(["mtable"],Zn),Se.length>0){for(var To=st.makeLineSpan("hline",f,We),Do=st.makeLineSpan("hdashline",f,We),Ps=[{type:"elem",elem:le,shift:0}];Se.length>0;){var la=Se.pop(),ua=la.pos-Tn;la.isDashed?Ps.push({type:"elem",elem:Do,shift:ua}):Ps.push({type:"elem",elem:To,shift:ua})}le=st.makeVList({positionType:"individualShift",children:Ps},f)}return st.makeSpan(["mord"],[le],f)},Ss={c:"center ",l:"left ",r:"right "},ki=function(l,f){var d=new kt.MathNode("mtable",l.body.map(function(ar){return new kt.MathNode("mtr",ar.map(function(jr){return new kt.MathNode("mtd",[kr(jr,f)])}))})),m=l.arraystretch===.5?.1:.16+l.arraystretch-1+(l.addJot?.09:0);d.setAttribute("rowspacing",m+"em");var w="",L="";if(l.cols){var X=l.cols,le="",Se=!1,We=0,rt=X.length;X[0].type==="separator"&&(w+="top ",We=1),X[X.length-1].type==="separator"&&(w+="bottom ",rt-=1);for(var lt=We;lt<rt;lt++)X[lt].type==="align"?(L+=Ss[X[lt].align],Se&&(le+="none "),Se=!0):X[lt].type==="separator"&&Se&&(le+=X[lt].separator==="|"?"solid ":"dashed ",Se=!1);d.setAttribute("columnalign",L.trim()),/[sd]/.test(le)&&d.setAttribute("columnlines",le.trim())}if(l.colSeparationType==="align"){for(var xt=l.cols||[],wt="",Me=1;Me<xt.length;Me++)wt+=Me%2?"0em ":"1em ";d.setAttribute("columnspacing",wt.trim())}else l.colSeparationType==="alignat"?d.setAttribute("columnspacing","0em"):l.colSeparationType==="small"?d.setAttribute("columnspacing","0.2778em"):d.setAttribute("columnspacing","1em");var Kt="",ir=l.hLinesBeforeRow;w+=ir[0].length>0?"left ":"",w+=ir[ir.length-1].length>0?"right ":"";for(var cr=1;cr<ir.length-1;cr++)Kt+=ir[cr].length===0?"none ":ir[cr][0]?"dashed ":"solid ";return/[sd]/.test(Kt)&&d.setAttribute("rowlines",Kt.trim()),w!==""&&(d=new kt.MathNode("menclose",[d]),d.setAttribute("notation",w.trim())),l.arraystretch&&l.arraystretch<1&&(d=new kt.MathNode("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},yt=function(l,f){var d=[],m=Di(l.parser,{cols:d,addJot:!0},"display"),w,L=0,X={type:"ordgroup",mode:l.mode,body:[]},le=Fr(f[0],"ordgroup");if(le){for(var Se="",We=0;We<le.body.length;We++){var rt=tr(le.body[We],"textord");Se+=rt.text}w=Number(Se),L=w*2}var lt=!L;m.body.forEach(function(Kt){for(var ir=1;ir<Kt.length;ir+=2){var cr=tr(Kt[ir],"styling"),ar=tr(cr.body[0],"ordgroup");ar.body.unshift(X)}if(lt)L<Kt.length&&(L=Kt.length);else{var jr=Kt.length/2;if(w<jr)throw new v("Too many math in a row: "+("expected "+w+", but got "+jr),Kt[0])}});for(var xt=0;xt<L;++xt){var wt="r",Me=0;xt%2===1?wt="l":xt>0&<&&(Me=1),d[xt]={type:"align",align:wt,pregap:Me,postgap:0}}return m.colSeparationType=lt?"align":"alignat",m};Ti({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(l,f){var d=Sn(f[0]),m=d?[f[0]]:tr(f[0],"ordgroup").body,w=m.map(function(X){var le=Kn(X),Se=le.text;if("lcr".indexOf(Se)!==-1)return{type:"align",align:Se};if(Se==="|")return{type:"separator",separator:"|"};if(Se===":")return{type:"separator",separator:":"};throw new v("Unknown column alignment: "+Se,X)}),L={cols:w,hskipBeforeAndAfter:!0};return Di(l.parser,L,Ks(l.envName))},htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(l){var f={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[l.envName],d={hskipBeforeAndAfter:!1},m=Di(l.parser,d,Ks(l.envName));return f?{type:"leftright",mode:l.mode,body:[m],left:f[0],right:f[1],rightColor:void 0}:m},htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(l){var f={arraystretch:.5},d=Di(l.parser,f,"script");return d.colSeparationType="small",d},htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["subarray"],props:{numArgs:1},handler:function(l,f){var d=Sn(f[0]),m=d?[f[0]]:tr(f[0],"ordgroup").body,w=m.map(function(X){var le=Kn(X),Se=le.text;if("lc".indexOf(Se)!==-1)return{type:"align",align:Se};throw new v("Unknown column alignment: "+Se,X)});if(w.length>1)throw new v("{subarray} can contain only one column");var L={cols:w,hskipBeforeAndAfter:!1,arraystretch:.5};if(L=Di(l.parser,L,"script"),L.body[0].length>1)throw new v("{subarray} can contain only one column");return L},htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(l){var f={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},d=Di(l.parser,f,Ks(l.envName));return{type:"leftright",mode:l.mode,body:[d],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["aligned"],props:{numArgs:0},handler:yt,htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["gathered"],props:{numArgs:0},handler:function(l){var f={cols:[{type:"align",align:"c"}],addJot:!0};return Di(l.parser,f,"display")},htmlBuilder:pi,mathmlBuilder:ki}),Ti({type:"array",names:["alignedat"],props:{numArgs:1},handler:yt,htmlBuilder:pi,mathmlBuilder:ki}),Gt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(l,f){throw new v(l.funcName+" valid only within array environment")}});var Vs=Vi,Ws=Vs;Gt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0];if(w.type!=="ordgroup")throw new v("Invalid environment name",w);for(var L="",X=0;X<w.body.length;++X)L+=tr(w.body[X],"textord").text;if(m==="\\begin"){if(!Ws.hasOwnProperty(L))throw new v("No such environment: "+L,w);var le=Ws[L],Se=d.parseArguments("\\begin{"+L+"}",le),We=Se.args,rt=Se.optArgs,lt={mode:d.mode,envName:L,parser:d},xt=le.handler(lt,We,rt);d.expect("\\end",!1);var wt=d.nextToken,Me=tr(d.parseFunction(),"environment");if(Me.name!==L)throw new v("Mismatch: \\begin{"+L+"} matched by \\end{"+Me.name+"}",wt);return xt}return{type:"environment",mode:d.mode,name:L,nameGroup:w}}});var Sa=st.makeSpan;function Aa(I,l){var f=Kr(I.body,l,!0);return Sa([I.mclass],f,l)}function As(I,l){var f,d=ln(I.body,l);return I.mclass==="minner"?kt.newDocumentFragment(d):(I.mclass==="mord"?I.isCharacterBox?(f=d[0],f.type="mi"):f=new kt.MathNode("mi",d):(I.isCharacterBox?(f=d[0],f.type="mo"):f=new kt.MathNode("mo",d),I.mclass==="mbin"?(f.attributes.lspace="0.22em",f.attributes.rspace="0.22em"):I.mclass==="mpunct"?(f.attributes.lspace="0em",f.attributes.rspace="0.17em"):(I.mclass==="mopen"||I.mclass==="mclose")&&(f.attributes.lspace="0em",f.attributes.rspace="0em")),f)}Gt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0];return{type:"mclass",mode:d.mode,mclass:"m"+m.substr(5),body:tn(w),isCharacterBox:U.isCharacterBox(w)}},htmlBuilder:Aa,mathmlBuilder:As});var Ts=function(l){var f=l.type==="ordgroup"&&l.body.length?l.body[0]:l;return f.type==="atom"&&(f.family==="bin"||f.family==="rel")?"m"+f.family:"mord"};Gt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(l,f){var d=l.parser;return{type:"mclass",mode:d.mode,mclass:Ts(f[0]),body:[f[1]],isCharacterBox:U.isCharacterBox(f[1])}}}),Gt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[1],L=f[0],X;m!=="\\stackrel"?X=Ts(w):X="mrel";var le={type:"op",mode:w.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:m!=="\\stackrel",body:tn(w)},Se={type:"supsub",mode:L.mode,base:le,sup:m==="\\underset"?null:L,sub:m==="\\underset"?L:null};return{type:"mclass",mode:d.mode,mclass:X,body:[Se],isCharacterBox:U.isCharacterBox(Se)}},htmlBuilder:Aa,mathmlBuilder:As});var Ta=function(l,f){var d=l.font,m=f.withFont(d);return yr(l.body,m)},Da=function(l,f){var d=l.font,m=f.withFont(d);return kr(l.body,m)},Ds={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Gt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0],L=m;return L in Ds&&(L=Ds[L]),{type:"font",mode:d.mode,font:L.slice(1),body:w}},htmlBuilder:Ta,mathmlBuilder:Da}),Gt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(l,f){var d=l.parser,m=f[0],w=U.isCharacterBox(m);return{type:"mclass",mode:d.mode,mclass:Ts(m),body:[{type:"font",mode:d.mode,font:"boldsymbol",body:m}],isCharacterBox:w}}}),Gt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.parser,m=l.funcName,w=l.breakOnTokenText,L=d.mode,X=d.parseExpression(!0,w),le="math"+m.slice(1);return{type:"font",mode:L,font:le,body:{type:"ordgroup",mode:d.mode,body:X}}},htmlBuilder:Ta,mathmlBuilder:Da});var Wi=function(l,f){var d=f;return l==="display"?d=d.id>=S.SCRIPT.id?d.text():S.DISPLAY:l==="text"&&d.size===S.DISPLAY.size?d=S.TEXT:l==="script"?d=S.SCRIPT:l==="scriptscript"&&(d=S.SCRIPTSCRIPT),d},Ci=function(l,f){var d=Wi(l.size,f.style),m=d.fracNum(),w=d.fracDen(),L;L=f.havingStyle(m);var X=yr(l.numer,L,f);if(l.continued){var le=8.5/f.fontMetrics().ptPerEm,Se=3.5/f.fontMetrics().ptPerEm;X.height=X.height<le?le:X.height,X.depth=X.depth<Se?Se:X.depth}L=f.havingStyle(w);var We=yr(l.denom,L,f),rt,lt,xt;l.hasBarLine?(l.barSize?(lt=vr(l.barSize,f),rt=st.makeLineSpan("frac-line",f,lt)):rt=st.makeLineSpan("frac-line",f),lt=rt.height,xt=rt.height):(rt=null,lt=0,xt=f.fontMetrics().defaultRuleThickness);var wt,Me,Kt;d.size===S.DISPLAY.size||l.size==="display"?(wt=f.fontMetrics().num1,lt>0?Me=3*xt:Me=7*xt,Kt=f.fontMetrics().denom1):(lt>0?(wt=f.fontMetrics().num2,Me=xt):(wt=f.fontMetrics().num3,Me=3*xt),Kt=f.fontMetrics().denom2);var ir;if(rt){var ar=f.fontMetrics().axisHeight;wt-X.depth-(ar+.5*lt)<Me&&(wt+=Me-(wt-X.depth-(ar+.5*lt))),ar-.5*lt-(We.height-Kt)<Me&&(Kt+=Me-(ar-.5*lt-(We.height-Kt)));var jr=-(ar-.5*lt);ir=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:We,shift:Kt},{type:"elem",elem:rt,shift:jr},{type:"elem",elem:X,shift:-wt}]},f)}else{var cr=wt-X.depth-(We.height-Kt);cr<Me&&(wt+=.5*(Me-cr),Kt+=.5*(Me-cr)),ir=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:We,shift:Kt},{type:"elem",elem:X,shift:-wt}]},f)}L=f.havingStyle(d),ir.height*=L.sizeMultiplier/f.sizeMultiplier,ir.depth*=L.sizeMultiplier/f.sizeMultiplier;var Ur;d.size===S.DISPLAY.size?Ur=f.fontMetrics().delim1:Ur=f.fontMetrics().delim2;var Qr,Jr;return l.leftDelim==null?Qr=wn(f,["mopen"]):Qr=di.customSizedDelim(l.leftDelim,Ur,!0,f.havingStyle(d),l.mode,["mopen"]),l.continued?Jr=st.makeSpan([]):l.rightDelim==null?Jr=wn(f,["mclose"]):Jr=di.customSizedDelim(l.rightDelim,Ur,!0,f.havingStyle(d),l.mode,["mclose"]),st.makeSpan(["mord"].concat(L.sizingClasses(f)),[Qr,st.makeSpan(["mfrac"],[ir]),Jr],f)},Ys=function(l,f){var d=new kt.MathNode("mfrac",[kr(l.numer,f),kr(l.denom,f)]);if(!l.hasBarLine)d.setAttribute("linethickness","0px");else if(l.barSize){var m=vr(l.barSize,f);d.setAttribute("linethickness",m+"em")}var w=Wi(l.size,f.style);if(w.size!==f.style.size){d=new kt.MathNode("mstyle",[d]);var L=w.size===S.DISPLAY.size?"true":"false";d.setAttribute("displaystyle",L),d.setAttribute("scriptlevel","0")}if(l.leftDelim!=null||l.rightDelim!=null){var X=[];if(l.leftDelim!=null){var le=new kt.MathNode("mo",[new kt.TextNode(l.leftDelim.replace("\\",""))]);le.setAttribute("fence","true"),X.push(le)}if(X.push(d),l.rightDelim!=null){var Se=new kt.MathNode("mo",[new kt.TextNode(l.rightDelim.replace("\\",""))]);Se.setAttribute("fence","true"),X.push(Se)}return Mi(X)}return d};Gt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0],L=f[1],X,le=null,Se=null,We="auto";switch(m){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":X=!0;break;case"\\\\atopfrac":X=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":X=!1,le="(",Se=")";break;case"\\\\bracefrac":X=!1,le="\\{",Se="\\}";break;case"\\\\brackfrac":X=!1,le="[",Se="]";break;default:throw new Error("Unrecognized genfrac command")}switch(m){case"\\cfrac":case"\\dfrac":case"\\dbinom":We="display";break;case"\\tfrac":case"\\tbinom":We="text";break}return{type:"genfrac",mode:d.mode,continued:m==="\\cfrac",numer:w,denom:L,hasBarLine:X,leftDelim:le,rightDelim:Se,size:We,barSize:null}},htmlBuilder:Ci,mathmlBuilder:Ys}),Gt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(l){var f=l.parser,d=l.funcName,m=l.token,w;switch(d){case"\\over":w="\\frac";break;case"\\choose":w="\\binom";break;case"\\atop":w="\\\\atopfrac";break;case"\\brace":w="\\\\bracefrac";break;case"\\brack":w="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:f.mode,replaceWith:w,token:m}}});var ka=["display","text","script","scriptscript"],Ca=function(l){var f=null;return l.length>0&&(f=l,f=f==="."?null:f),f};Gt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(l,f){var d=l.parser,m=f[4],w=f[5],L=Fr(f[0],"atom");L&&(L=Br(f[0],"open"));var X=L?Ca(L.text):null,le=Fr(f[1],"atom");le&&(le=Br(f[1],"close"));var Se=le?Ca(le.text):null,We=tr(f[2],"size"),rt,lt=null;We.isBlank?rt=!0:(lt=We.value,rt=lt.number>0);var xt="auto",wt=Fr(f[3],"ordgroup");if(wt){if(wt.body.length>0){var Me=tr(wt.body[0],"textord");xt=ka[Number(Me.text)]}}else wt=tr(f[3],"textord"),xt=ka[Number(wt.text)];return{type:"genfrac",mode:d.mode,numer:m,denom:w,continued:!1,hasBarLine:rt,barSize:lt,leftDelim:X,rightDelim:Se,size:xt}},htmlBuilder:Ci,mathmlBuilder:Ys}),Gt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(l,f){var d=l.parser,m=l.funcName,w=l.token;return{type:"infix",mode:d.mode,replaceWith:"\\\\abovefrac",size:tr(f[0],"size").value,token:w}}}),Gt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0],L=K(tr(f[1],"infix").size),X=f[2],le=L.number>0;return{type:"genfrac",mode:d.mode,numer:w,denom:X,continued:!1,hasBarLine:le,barSize:L,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Ci,mathmlBuilder:Ys});var La=function(l,f){var d=f.style,m,w,L=Fr(l,"supsub");L?(m=L.sup?yr(L.sup,f.havingStyle(d.sup()),f):yr(L.sub,f.havingStyle(d.sub()),f),w=tr(L.base,"horizBrace")):w=tr(l,"horizBrace");var X=yr(w.base,f.havingBaseStyle(S.DISPLAY)),le=qt.svgSpan(w,f),Se;if(w.isOver?(Se=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:X},{type:"kern",size:.1},{type:"elem",elem:le}]},f),Se.children[0].children[0].children[1].classes.push("svg-align")):(Se=st.makeVList({positionType:"bottom",positionData:X.depth+.1+le.height,children:[{type:"elem",elem:le},{type:"kern",size:.1},{type:"elem",elem:X}]},f),Se.children[0].children[0].children[0].classes.push("svg-align")),m){var We=st.makeSpan(["mord",w.isOver?"mover":"munder"],[Se],f);w.isOver?Se=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:We},{type:"kern",size:.2},{type:"elem",elem:m}]},f):Se=st.makeVList({positionType:"bottom",positionData:We.depth+.2+m.height+m.depth,children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:We}]},f)}return st.makeSpan(["mord",w.isOver?"mover":"munder"],[Se],f)},Ra=function(l,f){var d=qt.mathMLnode(l.label);return new kt.MathNode(l.isOver?"mover":"munder",[kr(l.base,f),d])};Gt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(l,f){var d=l.parser,m=l.funcName;return{type:"horizBrace",mode:d.mode,label:m,isOver:/^\\over/.test(m),base:f[0]}},htmlBuilder:La,mathmlBuilder:Ra}),Gt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(l,f){var d=l.parser,m=f[1],w=tr(f[0],"url").url;return d.settings.isTrusted({command:"\\href",url:w})?{type:"href",mode:d.mode,href:w,body:tn(m)}:d.formatUnsupportedCmd("\\href")},htmlBuilder:function(l,f){var d=Kr(l.body,f,!1);return st.makeAnchor(l.href,[],d,f)},mathmlBuilder:function(l,f){var d=rn(l.body,f);return d instanceof pr||(d=new pr("mrow",[d])),d.setAttribute("href",l.href),d}}),Gt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(l,f){var d=l.parser,m=tr(f[0],"url").url;if(!d.settings.isTrusted({command:"\\url",url:m}))return d.formatUnsupportedCmd("\\url");for(var w=[],L=0;L<m.length;L++){var X=m[L];X==="~"&&(X="\\textasciitilde"),w.push({type:"textord",mode:"text",text:X})}var le={type:"text",mode:d.mode,font:"\\texttt",body:w};return{type:"href",mode:d.mode,href:m,body:tn(le)}}}),Gt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"htmlmathml",mode:d.mode,html:tn(f[0]),mathml:tn(f[1])}},htmlBuilder:function(l,f){var d=Kr(l.html,f,!1);return st.makeFragment(d)},mathmlBuilder:function(l,f){return rn(l.mathml,f)}});var as=function(l){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(l))return{number:+l,unit:"bp"};var f=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(l);if(!f)throw new v("Invalid size: '"+l+"' in \\includegraphics");var d={number:+(f[1]+f[2]),unit:f[3]};if(!Hr(d))throw new v("Invalid unit: '"+d.unit+"' in \\includegraphics.");return d};Gt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(l,f,d){var m=l.parser,w={number:0,unit:"em"},L={number:.9,unit:"em"},X={number:0,unit:"em"},le="";if(d[0])for(var Se=tr(d[0],"raw").string,We=Se.split(","),rt=0;rt<We.length;rt++){var lt=We[rt].split("=");if(lt.length===2){var xt=lt[1].trim();switch(lt[0].trim()){case"alt":le=xt;break;case"width":w=as(xt);break;case"height":L=as(xt);break;case"totalheight":X=as(xt);break;default:throw new v("Invalid key: '"+lt[0]+"' in \\includegraphics.")}}}var wt=tr(f[0],"url").url;return le===""&&(le=wt,le=le.replace(/^.*[\\/]/,""),le=le.substring(0,le.lastIndexOf("."))),m.settings.isTrusted({command:"\\includegraphics",url:wt})?{type:"includegraphics",mode:m.mode,alt:le,width:w,height:L,totalheight:X,src:wt}:m.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(l,f){var d=vr(l.height,f),m=0;l.totalheight.number>0&&(m=vr(l.totalheight,f)-d,m=Number(m.toFixed(2)));var w=0;l.width.number>0&&(w=vr(l.width,f));var L={height:d+m+"em"};w>0&&(L.width=w+"em"),m>0&&(L.verticalAlign=-m+"em");var X=new Fe(l.src,l.alt,L);return X.height=d,X.depth=m,X},mathmlBuilder:function(l,f){var d=new kt.MathNode("mglyph",[]);d.setAttribute("alt",l.alt);var m=vr(l.height,f),w=0;if(l.totalheight.number>0&&(w=vr(l.totalheight,f)-m,w=w.toFixed(2),d.setAttribute("valign","-"+w+"em")),d.setAttribute("height",m+w+"em"),l.width.number>0){var L=vr(l.width,f);d.setAttribute("width",L+"em")}return d.setAttribute("src",l.src),d}}),Gt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(l,f){var d=l.parser,m=l.funcName,w=tr(f[0],"size");if(d.settings.strict){var L=m[1]==="m",X=w.value.unit==="mu";L?(X||d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+m+" supports only mu units, "+("not "+w.value.unit+" units")),d.mode!=="math"&&d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+m+" works only in math mode")):X&&d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+m+" doesn't support mu units")}return{type:"kern",mode:d.mode,dimension:w.value}},htmlBuilder:function(l,f){return st.makeGlue(l.dimension,f)},mathmlBuilder:function(l,f){var d=vr(l.dimension,f);return new kt.SpaceNode(d)}}),Gt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0];return{type:"lap",mode:d.mode,alignment:m.slice(5),body:w}},htmlBuilder:function(l,f){var d;l.alignment==="clap"?(d=st.makeSpan([],[yr(l.body,f)]),d=st.makeSpan(["inner"],[d],f)):d=st.makeSpan(["inner"],[yr(l.body,f)]);var m=st.makeSpan(["fix"],[]),w=st.makeSpan([l.alignment],[d,m],f),L=st.makeSpan(["strut"]);return L.style.height=w.height+w.depth+"em",L.style.verticalAlign=-w.depth+"em",w.children.unshift(L),w=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:w}]},f),st.makeSpan(["mord"],[w],f)},mathmlBuilder:function(l,f){var d=new kt.MathNode("mpadded",[kr(l.body,f)]);if(l.alignment!=="rlap"){var m=l.alignment==="llap"?"-1":"-0.5";d.setAttribute("lspace",m+"width")}return d.setAttribute("width","0px"),d}}),Gt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(l,f){var d=l.funcName,m=l.parser,w=m.mode;m.switchMode("math");var L=d==="\\("?"\\)":"$",X=m.parseExpression(!1,L);return m.expect(L),m.switchMode(w),{type:"styling",mode:m.mode,style:"text",body:X}}}),Gt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(l,f){throw new v("Mismatched "+l.funcName)}});var os=function(l,f){switch(f.style.size){case S.DISPLAY.size:return l.display;case S.TEXT.size:return l.text;case S.SCRIPT.size:return l.script;case S.SCRIPTSCRIPT.size:return l.scriptscript;default:return l.text}};Gt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(l,f){var d=l.parser;return{type:"mathchoice",mode:d.mode,display:tn(f[0]),text:tn(f[1]),script:tn(f[2]),scriptscript:tn(f[3])}},htmlBuilder:function(l,f){var d=os(l,f),m=Kr(d,f,!1);return st.makeFragment(m)},mathmlBuilder:function(l,f){var d=os(l,f);return rn(d,f)}});var Yi=function(l,f,d,m,w,L,X){l=st.makeSpan([],[l]);var le,Se;if(f){var We=yr(f,m.havingStyle(w.sup()),m);Se={elem:We,kern:Math.max(m.fontMetrics().bigOpSpacing1,m.fontMetrics().bigOpSpacing3-We.depth)}}if(d){var rt=yr(d,m.havingStyle(w.sub()),m);le={elem:rt,kern:Math.max(m.fontMetrics().bigOpSpacing2,m.fontMetrics().bigOpSpacing4-rt.height)}}var lt;if(Se&&le){var xt=m.fontMetrics().bigOpSpacing5+le.elem.height+le.elem.depth+le.kern+l.depth+X;lt=st.makeVList({positionType:"bottom",positionData:xt,children:[{type:"kern",size:m.fontMetrics().bigOpSpacing5},{type:"elem",elem:le.elem,marginLeft:-L+"em"},{type:"kern",size:le.kern},{type:"elem",elem:l},{type:"kern",size:Se.kern},{type:"elem",elem:Se.elem,marginLeft:L+"em"},{type:"kern",size:m.fontMetrics().bigOpSpacing5}]},m)}else if(le){var wt=l.height-X;lt=st.makeVList({positionType:"top",positionData:wt,children:[{type:"kern",size:m.fontMetrics().bigOpSpacing5},{type:"elem",elem:le.elem,marginLeft:-L+"em"},{type:"kern",size:le.kern},{type:"elem",elem:l}]},m)}else if(Se){var Me=l.depth+X;lt=st.makeVList({positionType:"bottom",positionData:Me,children:[{type:"elem",elem:l},{type:"kern",size:Se.kern},{type:"elem",elem:Se.elem,marginLeft:L+"em"},{type:"kern",size:m.fontMetrics().bigOpSpacing5}]},m)}else return l;return st.makeSpan(["mop","op-limits"],[lt],m)},Ia=["\\smallint"],Ui=function(l,f){var d,m,w=!1,L,X=Fr(l,"supsub");X?(d=X.sup,m=X.sub,L=tr(X.base,"op"),w=!0):L=tr(l,"op");var le=f.style,Se=!1;le.size===S.DISPLAY.size&&L.symbol&&!U.contains(Ia,L.name)&&(Se=!0);var We;if(L.symbol){var rt=Se?"Size2-Regular":"Size1-Regular",lt="";if((L.name==="\\oiint"||L.name==="\\oiiint")&&(lt=L.name.substr(1),L.name=lt==="oiint"?"\\iint":"\\iiint"),We=st.makeSymbol(L.name,rt,"math",f,["mop","op-symbol",Se?"large-op":"small-op"]),lt.length>0){var xt=We.italic,wt=st.staticSvg(lt+"Size"+(Se?"2":"1"),f);We=st.makeVList({positionType:"individualShift",children:[{type:"elem",elem:We,shift:0},{type:"elem",elem:wt,shift:Se?.08:0}]},f),L.name="\\"+lt,We.classes.unshift("mop"),We.italic=xt}}else if(L.body){var Me=Kr(L.body,f,!0);Me.length===1&&Me[0]instanceof V?(We=Me[0],We.classes[0]="mop"):We=st.makeSpan(["mop"],st.tryCombineChars(Me),f)}else{for(var Kt=[],ir=1;ir<L.name.length;ir++)Kt.push(st.mathsym(L.name[ir],L.mode,f));We=st.makeSpan(["mop"],Kt,f)}var cr=0,ar=0;return(We instanceof V||L.name==="\\oiint"||L.name==="\\oiiint")&&!L.suppressBaseShift&&(cr=(We.height-We.depth)/2-f.fontMetrics().axisHeight,ar=We.italic),w?Yi(We,d,m,f,le,ar,cr):(cr&&(We.style.position="relative",We.style.top=cr+"em"),We)},qi=function(l,f){var d;if(l.symbol)d=new pr("mo",[yn(l.name,l.mode)]),U.contains(Ia,l.name)&&d.setAttribute("largeop","false");else if(l.body)d=new pr("mo",ln(l.body,f));else{d=new pr("mi",[new ui(l.name.slice(1))]);var m=new pr("mo",[yn("\u2061","text")]);l.parentIsSupSub?d=new pr("mo",[d,m]):d=wi([d,m])}return d},qs={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Gt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:function(l,f){var d=l.parser,m=l.funcName,w=m;return w.length===1&&(w=qs[w]),{type:"op",mode:d.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:w}},htmlBuilder:Ui,mathmlBuilder:qi}),Gt({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(l,f){var d=l.parser,m=f[0];return{type:"op",mode:d.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:tn(m)}},htmlBuilder:Ui,mathmlBuilder:qi});var fo={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Gt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName;return{type:"op",mode:f.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:d}},htmlBuilder:Ui,mathmlBuilder:qi}),Gt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName;return{type:"op",mode:f.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:d}},htmlBuilder:Ui,mathmlBuilder:qi}),Gt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName,m=d;return m.length===1&&(m=fo[m]),{type:"op",mode:f.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:m}},htmlBuilder:Ui,mathmlBuilder:qi});var ls=function(l,f){var d,m,w=!1,L,X=Fr(l,"supsub");X?(d=X.sup,m=X.sub,L=tr(X.base,"operatorname"),w=!0):L=tr(l,"operatorname");var le;if(L.body.length>0){for(var Se=L.body.map(function(xt){var wt=xt.text;return typeof wt=="string"?{type:"textord",mode:xt.mode,text:wt}:xt}),We=Kr(Se,f.withFont("mathrm"),!0),rt=0;rt<We.length;rt++){var lt=We[rt];lt instanceof V&&(lt.text=lt.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}le=st.makeSpan(["mop"],We,f)}else le=st.makeSpan(["mop"],[],f);return w?Yi(le,d,m,f,f.style,0,0):le},po=function(l,f){for(var d=ln(l.body,f.withFont("mathrm")),m=!0,w=0;w<d.length;w++){var L=d[w];if(!(L instanceof kt.SpaceNode))if(L instanceof kt.MathNode)switch(L.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var X=L.children[0];L.children.length===1&&X instanceof kt.TextNode?X.text=X.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):m=!1;break}default:m=!1}else m=!1}if(m){var le=d.map(function(rt){return rt.toText()}).join("");d=[new kt.TextNode(le)]}var Se=new kt.MathNode("mi",d);Se.setAttribute("mathvariant","normal");var We=new kt.MathNode("mo",[yn("\u2061","text")]);return l.parentIsSupSub?new kt.MathNode("mo",[Se,We]):kt.newDocumentFragment([Se,We])};Gt({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0];return{type:"operatorname",mode:d.mode,body:tn(w),alwaysHandleSupSub:m==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:ls,mathmlBuilder:po}),Bn({type:"ordgroup",htmlBuilder:function(l,f){return l.semisimple?st.makeFragment(Kr(l.body,f,!1)):st.makeSpan(["mord"],Kr(l.body,f,!0),f)},mathmlBuilder:function(l,f){return rn(l.body,f,!0)}}),Gt({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(l,f){var d=l.parser,m=f[0];return{type:"overline",mode:d.mode,body:m}},htmlBuilder:function(l,f){var d=yr(l.body,f.havingCrampedStyle()),m=st.makeLineSpan("overline-line",f),w=f.fontMetrics().defaultRuleThickness,L=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d},{type:"kern",size:3*w},{type:"elem",elem:m},{type:"kern",size:w}]},f);return st.makeSpan(["mord","overline"],[L],f)},mathmlBuilder:function(l,f){var d=new kt.MathNode("mo",[new kt.TextNode("\u203E")]);d.setAttribute("stretchy","true");var m=new kt.MathNode("mover",[kr(l.body,f),d]);return m.setAttribute("accent","true"),m}}),Gt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,m=f[0];return{type:"phantom",mode:d.mode,body:tn(m)}},htmlBuilder:function(l,f){var d=Kr(l.body,f.withPhantom(),!1);return st.makeFragment(d)},mathmlBuilder:function(l,f){var d=ln(l.body,f);return new kt.MathNode("mphantom",d)}}),Gt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,m=f[0];return{type:"hphantom",mode:d.mode,body:m}},htmlBuilder:function(l,f){var d=st.makeSpan([],[yr(l.body,f.withPhantom())]);if(d.height=0,d.depth=0,d.children)for(var m=0;m<d.children.length;m++)d.children[m].height=0,d.children[m].depth=0;return d=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d}]},f),st.makeSpan(["mord"],[d],f)},mathmlBuilder:function(l,f){var d=ln(tn(l.body),f),m=new kt.MathNode("mphantom",d),w=new kt.MathNode("mpadded",[m]);return w.setAttribute("height","0px"),w.setAttribute("depth","0px"),w}}),Gt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,m=f[0];return{type:"vphantom",mode:d.mode,body:m}},htmlBuilder:function(l,f){var d=st.makeSpan(["inner"],[yr(l.body,f.withPhantom())]),m=st.makeSpan(["fix"],[]);return st.makeSpan(["mord","rlap"],[d,m],f)},mathmlBuilder:function(l,f){var d=ln(tn(l.body),f),m=new kt.MathNode("mphantom",d),w=new kt.MathNode("mpadded",[m]);return w.setAttribute("width","0px"),w}}),Gt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(l,f){var d=l.parser,m=tr(f[0],"size").value,w=f[1];return{type:"raisebox",mode:d.mode,dy:m,body:w}},htmlBuilder:function(l,f){var d=yr(l.body,f),m=vr(l.dy,f);return st.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:d}]},f)},mathmlBuilder:function(l,f){var d=new kt.MathNode("mpadded",[kr(l.body,f)]),m=l.dy.number+l.dy.unit;return d.setAttribute("voffset",m),d}}),Gt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(l,f,d){var m=l.parser,w=d[0],L=tr(f[0],"size"),X=tr(f[1],"size");return{type:"rule",mode:m.mode,shift:w&&tr(w,"size").value,width:L.value,height:X.value}},htmlBuilder:function(l,f){var d=st.makeSpan(["mord","rule"],[],f),m=vr(l.width,f),w=vr(l.height,f),L=l.shift?vr(l.shift,f):0;return d.style.borderRightWidth=m+"em",d.style.borderTopWidth=w+"em",d.style.bottom=L+"em",d.width=m,d.height=w+L,d.depth=-L,d.maxFontSize=w*1.125*f.sizeMultiplier,d},mathmlBuilder:function(l,f){var d=vr(l.width,f),m=vr(l.height,f),w=l.shift?vr(l.shift,f):0,L=f.color&&f.getColor()||"black",X=new kt.MathNode("mspace");X.setAttribute("mathbackground",L),X.setAttribute("width",d+"em"),X.setAttribute("height",m+"em");var le=new kt.MathNode("mpadded",[X]);return w>=0?le.setAttribute("height","+"+w+"em"):(le.setAttribute("height",w+"em"),le.setAttribute("depth","+"+-w+"em")),le.setAttribute("voffset",w+"em"),le}});function Pa(I,l,f){for(var d=Kr(I,l,!1),m=l.sizeMultiplier/f.sizeMultiplier,w=0;w<d.length;w++){var L=d[w].classes.indexOf("sizing");L<0?Array.prototype.push.apply(d[w].classes,l.sizingClasses(f)):d[w].classes[L+1]==="reset-size"+l.size&&(d[w].classes[L+1]="reset-size"+f.size),d[w].height*=m,d[w].depth*=m}return st.makeFragment(d)}var Zs=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Oa=function(l,f){var d=f.havingSize(l.size);return Pa(l.body,d,f)};Gt({type:"sizing",names:Zs,props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.breakOnTokenText,m=l.funcName,w=l.parser,L=w.parseExpression(!1,d);return{type:"sizing",mode:w.mode,size:Zs.indexOf(m)+1,body:L}},htmlBuilder:Oa,mathmlBuilder:function(l,f){var d=f.havingSize(l.size),m=ln(l.body,d),w=new kt.MathNode("mstyle",m);return w.setAttribute("mathsize",d.sizeMultiplier+"em"),w}}),Gt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(l,f,d){var m=l.parser,w=!1,L=!1,X=d[0]&&tr(d[0],"ordgroup");if(X)for(var le="",Se=0;Se<X.body.length;++Se){var We=X.body[Se];if(le=We.text,le==="t")w=!0;else if(le==="b")L=!0;else{w=!1,L=!1;break}}else w=!0,L=!0;var rt=f[0];return{type:"smash",mode:m.mode,body:rt,smashHeight:w,smashDepth:L}},htmlBuilder:function(l,f){var d=st.makeSpan([],[yr(l.body,f)]);if(!l.smashHeight&&!l.smashDepth)return d;if(l.smashHeight&&(d.height=0,d.children))for(var m=0;m<d.children.length;m++)d.children[m].height=0;if(l.smashDepth&&(d.depth=0,d.children))for(var w=0;w<d.children.length;w++)d.children[w].depth=0;var L=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d}]},f);return st.makeSpan(["mord"],[L],f)},mathmlBuilder:function(l,f){var d=new kt.MathNode("mpadded",[kr(l.body,f)]);return l.smashHeight&&d.setAttribute("height","0px"),l.smashDepth&&d.setAttribute("depth","0px"),d}}),Gt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(l,f,d){var m=l.parser,w=d[0],L=f[0];return{type:"sqrt",mode:m.mode,body:L,index:w}},htmlBuilder:function(l,f){var d=yr(l.body,f.havingCrampedStyle());d.height===0&&(d.height=f.fontMetrics().xHeight),d=st.wrapFragment(d,f);var m=f.fontMetrics(),w=m.defaultRuleThickness,L=w;f.style.id<S.TEXT.id&&(L=f.fontMetrics().xHeight);var X=w+L/4,le=d.height+d.depth+X+w,Se=di.sqrtImage(le,f),We=Se.span,rt=Se.ruleWidth,lt=Se.advanceWidth,xt=We.height-rt;xt>d.height+d.depth+X&&(X=(X+xt-d.height-d.depth)/2);var wt=We.height-d.height-X-rt;d.style.paddingLeft=lt+"em";var Me=st.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d,wrapperClasses:["svg-align"]},{type:"kern",size:-(d.height+wt)},{type:"elem",elem:We},{type:"kern",size:rt}]},f);if(l.index){var Kt=f.havingStyle(S.SCRIPTSCRIPT),ir=yr(l.index,Kt,f),cr=.6*(Me.height-Me.depth),ar=st.makeVList({positionType:"shift",positionData:-cr,children:[{type:"elem",elem:ir}]},f),jr=st.makeSpan(["root"],[ar]);return st.makeSpan(["mord","sqrt"],[jr,Me],f)}else return st.makeSpan(["mord","sqrt"],[Me],f)},mathmlBuilder:function(l,f){var d=l.body,m=l.index;return m?new kt.MathNode("mroot",[kr(d,f),kr(m,f)]):new kt.MathNode("msqrt",[kr(d,f)])}});var Ma={display:S.DISPLAY,text:S.TEXT,script:S.SCRIPT,scriptscript:S.SCRIPTSCRIPT};Gt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.breakOnTokenText,m=l.funcName,w=l.parser,L=w.parseExpression(!0,d),X=m.slice(1,m.length-5);return{type:"styling",mode:w.mode,style:X,body:L}},htmlBuilder:function(l,f){var d=Ma[l.style],m=f.havingStyle(d).withFont("");return Pa(l.body,m,f)},mathmlBuilder:function(l,f){var d=Ma[l.style],m=f.havingStyle(d),w=ln(l.body,m),L=new kt.MathNode("mstyle",w),X={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},le=X[l.style];return L.setAttribute("scriptlevel",le[0]),L.setAttribute("displaystyle",le[1]),L}});var Fa=function(l,f){var d=l.base;if(d)if(d.type==="op"){var m=d.limits&&(f.style.size===S.DISPLAY.size||d.alwaysHandleSupSub);return m?Ui:null}else if(d.type==="operatorname"){var w=d.alwaysHandleSupSub&&(f.style.size===S.DISPLAY.size||d.limits);return w?ls:null}else{if(d.type==="accent")return U.isCharacterBox(d.base)?Gr:null;if(d.type==="horizBrace"){var L=!l.sub;return L===d.isOver?La:null}else return null}else return null};Bn({type:"supsub",htmlBuilder:function(l,f){var d=Fa(l,f);if(d)return d(l,f);var m=l.base,w=l.sup,L=l.sub,X=yr(m,f),le,Se,We=f.fontMetrics(),rt=0,lt=0,xt=m&&U.isCharacterBox(m);if(w){var wt=f.havingStyle(f.style.sup());le=yr(w,wt,f),xt||(rt=X.height-wt.fontMetrics().supDrop*wt.sizeMultiplier/f.sizeMultiplier)}if(L){var Me=f.havingStyle(f.style.sub());Se=yr(L,Me,f),xt||(lt=X.depth+Me.fontMetrics().subDrop*Me.sizeMultiplier/f.sizeMultiplier)}var Kt;f.style===S.DISPLAY?Kt=We.sup1:f.style.cramped?Kt=We.sup3:Kt=We.sup2;var ir=f.sizeMultiplier,cr=.5/We.ptPerEm/ir+"em",ar=null;if(Se){var jr=l.base&&l.base.type==="op"&&l.base.name&&(l.base.name==="\\oiint"||l.base.name==="\\oiiint");(X instanceof V||jr)&&(ar=-X.italic+"em")}var Ur;if(le&&Se){rt=Math.max(rt,Kt,le.depth+.25*We.xHeight),lt=Math.max(lt,We.sub2);var Qr=We.defaultRuleThickness,Jr=4*Qr;if(rt-le.depth-(Se.height-lt)<Jr){lt=Jr-(rt-le.depth)+Se.height;var sn=.8*We.xHeight-(rt-le.depth);sn>0&&(rt+=sn,lt-=sn)}var un=[{type:"elem",elem:Se,shift:lt,marginRight:cr,marginLeft:ar},{type:"elem",elem:le,shift:-rt,marginRight:cr}];Ur=st.makeVList({positionType:"individualShift",children:un},f)}else if(Se){lt=Math.max(lt,We.sub1,Se.height-.8*We.xHeight);var dn=[{type:"elem",elem:Se,marginLeft:ar,marginRight:cr}];Ur=st.makeVList({positionType:"shift",positionData:lt,children:dn},f)}else if(le)rt=Math.max(rt,Kt,le.depth+.25*We.xHeight),Ur=st.makeVList({positionType:"shift",positionData:-rt,children:[{type:"elem",elem:le,marginRight:cr}]},f);else throw new Error("supsub must have either sup or sub.");var Nr=Un(X,"right")||"mord";return st.makeSpan([Nr],[X,st.makeSpan(["msupsub"],[Ur])],f)},mathmlBuilder:function(l,f){var d=!1,m,w,L=Fr(l.base,"horizBrace");L&&(w=!!l.sup,w===L.isOver&&(d=!0,m=L.isOver)),l.base&&(l.base.type==="op"||l.base.type==="operatorname")&&(l.base.parentIsSupSub=!0);var X=[kr(l.base,f)];l.sub&&X.push(kr(l.sub,f)),l.sup&&X.push(kr(l.sup,f));var le;if(d)le=m?"mover":"munder";else if(l.sub)if(l.sup){var rt=l.base;rt&&rt.type==="op"&&rt.limits&&f.style===S.DISPLAY||rt&&rt.type==="operatorname"&&rt.alwaysHandleSupSub&&(f.style===S.DISPLAY||rt.limits)?le="munderover":le="msubsup"}else{var We=l.base;We&&We.type==="op"&&We.limits&&(f.style===S.DISPLAY||We.alwaysHandleSupSub)||We&&We.type==="operatorname"&&We.alwaysHandleSupSub&&(We.limits||f.style===S.DISPLAY)?le="munder":le="msub"}else{var Se=l.base;Se&&Se.type==="op"&&Se.limits&&(f.style===S.DISPLAY||Se.alwaysHandleSupSub)||Se&&Se.type==="operatorname"&&Se.alwaysHandleSupSub&&(Se.limits||f.style===S.DISPLAY)?le="mover":le="msup"}var lt=new kt.MathNode(le,X);return lt}}),Bn({type:"atom",htmlBuilder:function(l,f){return st.mathsym(l.text,l.mode,f,["m"+l.family])},mathmlBuilder:function(l,f){var d=new kt.MathNode("mo",[yn(l.text,l.mode)]);if(l.family==="bin"){var m=Si(l,f);m==="bold-italic"&&d.setAttribute("mathvariant",m)}else l.family==="punct"?d.setAttribute("separator","true"):(l.family==="open"||l.family==="close")&&d.setAttribute("stretchy","false");return d}});var Ba={mi:"italic",mn:"normal",mtext:"normal"};Bn({type:"mathord",htmlBuilder:function(l,f){return st.makeOrd(l,f,"mathord")},mathmlBuilder:function(l,f){var d=new kt.MathNode("mi",[yn(l.text,l.mode,f)]),m=Si(l,f)||"italic";return m!==Ba[d.type]&&d.setAttribute("mathvariant",m),d}}),Bn({type:"textord",htmlBuilder:function(l,f){return st.makeOrd(l,f,"textord")},mathmlBuilder:function(l,f){var d=yn(l.text,l.mode,f),m=Si(l,f)||"normal",w;return l.mode==="text"?w=new kt.MathNode("mtext",[d]):/[0-9]/.test(l.text)?w=new kt.MathNode("mn",[d]):l.text==="\\prime"?w=new kt.MathNode("mo",[d]):w=new kt.MathNode("mi",[d]),m!==Ba[w.type]&&w.setAttribute("mathvariant",m),w}});var Xs={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Qs={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Bn({type:"spacing",htmlBuilder:function(l,f){if(Qs.hasOwnProperty(l.text)){var d=Qs[l.text].className||"";if(l.mode==="text"){var m=st.makeOrd(l,f,"textord");return m.classes.push(d),m}else return st.makeSpan(["mspace",d],[st.mathsym(l.text,l.mode,f)],f)}else{if(Xs.hasOwnProperty(l.text))return st.makeSpan(["mspace",Xs[l.text]],[],f);throw new v('Unknown type of space "'+l.text+'"')}},mathmlBuilder:function(l,f){var d;if(Qs.hasOwnProperty(l.text))d=new kt.MathNode("mtext",[new kt.TextNode("\xA0")]);else{if(Xs.hasOwnProperty(l.text))return new kt.MathNode("mspace");throw new v('Unknown type of space "'+l.text+'"')}return d}});var Na=function(){var l=new kt.MathNode("mtd",[]);return l.setAttribute("width","50%"),l};Bn({type:"tag",mathmlBuilder:function(l,f){var d=new kt.MathNode("mtable",[new kt.MathNode("mtr",[Na(),new kt.MathNode("mtd",[rn(l.body,f)]),Na(),new kt.MathNode("mtd",[rn(l.tag,f)])])]);return d.setAttribute("width","100%"),d}});var Ua={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Js={"\\textbf":"textbf","\\textmd":"textmd"},mo={"\\textit":"textit","\\textup":"textup"},$a=function(l,f){var d=l.font;return d?Ua[d]?f.withTextFontFamily(Ua[d]):Js[d]?f.withTextFontWeight(Js[d]):f.withTextFontShape(mo[d]):f};Gt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(l,f){var d=l.parser,m=l.funcName,w=f[0];return{type:"text",mode:d.mode,body:tn(w),font:m}},htmlBuilder:function(l,f){var d=$a(l,f),m=Kr(l.body,d,!0);return st.makeSpan(["mord","text"],st.tryCombineChars(m),d)},mathmlBuilder:function(l,f){var d=$a(l,f);return rn(l.body,d)}}),Gt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"underline",mode:d.mode,body:f[0]}},htmlBuilder:function(l,f){var d=yr(l.body,f),m=st.makeLineSpan("underline-line",f),w=f.fontMetrics().defaultRuleThickness,L=st.makeVList({positionType:"top",positionData:d.height,children:[{type:"kern",size:w},{type:"elem",elem:m},{type:"kern",size:3*w},{type:"elem",elem:d}]},f);return st.makeSpan(["mord","underline"],[L],f)},mathmlBuilder:function(l,f){var d=new kt.MathNode("mo",[new kt.TextNode("\u203E")]);d.setAttribute("stretchy","true");var m=new kt.MathNode("munder",[kr(l.body,f),d]);return m.setAttribute("accentunder","true"),m}}),Gt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(l,f,d){throw new v("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(l,f){for(var d=za(l),m=[],w=f.havingStyle(f.style.text()),L=0;L<d.length;L++){var X=d[L];X==="~"&&(X="\\textasciitilde"),m.push(st.makeSymbol(X,"Typewriter-Regular",l.mode,w,["mord","texttt"]))}return st.makeSpan(["mord","text"].concat(w.sizingClasses(f)),st.tryCombineChars(m),w)},mathmlBuilder:function(l,f){var d=new kt.TextNode(za(l)),m=new kt.MathNode("mtext",[d]);return m.setAttribute("mathvariant","monospace"),m}});var za=function(l){return l.body.replace(/ /g,l.star?"\u2423":"\xA0")},ea=Hi,us=ea,ta=`[ \r
|
|
]`,Ga="\\\\[a-zA-Z@]+",go="\\\\[^\uD800-\uDFFF]",_o=""+Ga+ta+"*",vo=new RegExp("^("+Ga+")"+ta+"*$"),Zi="[\u0300-\u036F]",yo=new RegExp(Zi+"+$"),ja="("+ta+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(Zi+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Zi+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+_o)+("|"+go+")"),ra=function(){function I(f,d){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=f,this.settings=d,this.tokenRegex=new RegExp(ja,"g"),this.catcodes={"%":14}}var l=I.prototype;return l.setCatcode=function(d,m){this.catcodes[d]=m},l.lex=function(){var d=this.input,m=this.tokenRegex.lastIndex;if(m===d.length)return new ge("EOF",new Ze(this,m,m));var w=this.tokenRegex.exec(d);if(w===null||w.index!==m)throw new v("Unexpected character: '"+d[m]+"'",new ge(d[m],new Ze(this,m,m+1)));var L=w[2]||" ";if(this.catcodes[L]===14){var X=d.indexOf(`
|
|
`,this.tokenRegex.lastIndex);return X===-1?(this.tokenRegex.lastIndex=d.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=X+1,this.lex()}var le=L.match(vo);return le&&(L=le[1]),new ge(L,new Ze(this,m,this.tokenRegex.lastIndex))},I}(),bo=function(){function I(f,d){f===void 0&&(f={}),d===void 0&&(d={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=d,this.builtins=f,this.undefStack=[]}var l=I.prototype;return l.beginGroup=function(){this.undefStack.push({})},l.endGroup=function(){if(this.undefStack.length===0)throw new v("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var d=this.undefStack.pop();for(var m in d)d.hasOwnProperty(m)&&(d[m]===void 0?delete this.current[m]:this.current[m]=d[m])},l.has=function(d){return this.current.hasOwnProperty(d)||this.builtins.hasOwnProperty(d)},l.get=function(d){return this.current.hasOwnProperty(d)?this.current[d]:this.builtins[d]},l.set=function(d,m,w){if(w===void 0&&(w=!1),w){for(var L=0;L<this.undefStack.length;L++)delete this.undefStack[L][d];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][d]=m)}else{var X=this.undefStack[this.undefStack.length-1];X&&!X.hasOwnProperty(d)&&(X[d]=this.current[d])}this.current[d]=m},I}(),ks={},In=ks;function pe(I,l){ks[I]=l}pe("\\@firstoftwo",function(I){var l=I.consumeArgs(2);return{tokens:l[0],numArgs:0}}),pe("\\@secondoftwo",function(I){var l=I.consumeArgs(2);return{tokens:l[1],numArgs:0}}),pe("\\@ifnextchar",function(I){var l=I.consumeArgs(3),f=I.future();return l[0].length===1&&l[0][0].text===f.text?{tokens:l[1],numArgs:0}:{tokens:l[2],numArgs:0}}),pe("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),pe("\\TextOrMath",function(I){var l=I.consumeArgs(2);return I.mode==="text"?{tokens:l[0],numArgs:0}:{tokens:l[1],numArgs:0}});var Cs={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};pe("\\char",function(I){var l=I.popToken(),f,d="";if(l.text==="'")f=8,l=I.popToken();else if(l.text==='"')f=16,l=I.popToken();else if(l.text==="`")if(l=I.popToken(),l.text[0]==="\\")d=l.text.charCodeAt(1);else{if(l.text==="EOF")throw new v("\\char` missing argument");d=l.text.charCodeAt(0)}else f=10;if(f){if(d=Cs[l.text],d==null||d>=f)throw new v("Invalid base-"+f+" digit "+l.text);for(var m;(m=Cs[I.future().text])!=null&&m<f;)d*=f,d+=m,I.popToken()}return"\\@char{"+d+"}"});var na=function(l,f){var d=l.consumeArgs(1)[0];if(d.length!==1)throw new v("\\gdef's first argument must be a macro name");var m=d[0].text,w=0;for(d=l.consumeArgs(1)[0];d.length===1&&d[0].text==="#";){if(d=l.consumeArgs(1)[0],d.length!==1)throw new v('Invalid argument number length "'+d.length+'"');if(!/^[1-9]$/.test(d[0].text))throw new v('Invalid argument number "'+d[0].text+'"');if(w++,parseInt(d[0].text)!==w)throw new v('Argument number "'+d[0].text+'" out of order');d=l.consumeArgs(1)[0]}return l.macros.set(m,{tokens:d,numArgs:w},f),""};pe("\\gdef",function(I){return na(I,!0)}),pe("\\def",function(I){return na(I,!1)}),pe("\\global",function(I){var l=I.consumeArgs(1)[0];if(l.length!==1)throw new v("Invalid command after \\global");var f=l[0].text;if(f==="\\def")return na(I,!0);throw new v("Invalid command '"+f+"' after \\global")});var Xi=function(l,f,d){var m=l.consumeArgs(1)[0];if(m.length!==1)throw new v("\\newcommand's first argument must be a macro name");var w=m[0].text,L=l.isDefined(w);if(L&&!f)throw new v("\\newcommand{"+w+"} attempting to redefine "+(w+"; use \\renewcommand"));if(!L&&!d)throw new v("\\renewcommand{"+w+"} when command "+w+" does not yet exist; use \\newcommand");var X=0;if(m=l.consumeArgs(1)[0],m.length===1&&m[0].text==="["){for(var le="",Se=l.expandNextToken();Se.text!=="]"&&Se.text!=="EOF";)le+=Se.text,Se=l.expandNextToken();if(!le.match(/^\s*[0-9]+\s*$/))throw new v("Invalid number of arguments: "+le);X=parseInt(le),m=l.consumeArgs(1)[0]}return l.macros.set(w,{tokens:m,numArgs:X}),""};pe("\\newcommand",function(I){return Xi(I,!1,!0)}),pe("\\renewcommand",function(I){return Xi(I,!0,!1)}),pe("\\providecommand",function(I){return Xi(I,!0,!0)}),pe("\\bgroup","{"),pe("\\egroup","}"),pe("\\lq","`"),pe("\\rq","'"),pe("\\aa","\\r a"),pe("\\AA","\\r A"),pe("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),pe("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),pe("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),pe("\u212C","\\mathscr{B}"),pe("\u2130","\\mathscr{E}"),pe("\u2131","\\mathscr{F}"),pe("\u210B","\\mathscr{H}"),pe("\u2110","\\mathscr{I}"),pe("\u2112","\\mathscr{L}"),pe("\u2133","\\mathscr{M}"),pe("\u211B","\\mathscr{R}"),pe("\u212D","\\mathfrak{C}"),pe("\u210C","\\mathfrak{H}"),pe("\u2128","\\mathfrak{Z}"),pe("\\Bbbk","\\Bbb{k}"),pe("\xB7","\\cdotp"),pe("\\llap","\\mathllap{\\textrm{#1}}"),pe("\\rlap","\\mathrlap{\\textrm{#1}}"),pe("\\clap","\\mathclap{\\textrm{#1}}"),pe("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),pe("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),pe("\\ne","\\neq"),pe("\u2260","\\neq"),pe("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),pe("\u2209","\\notin"),pe("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),pe("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),pe("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),pe("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),pe("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),pe("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),pe("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),pe("\u27C2","\\perp"),pe("\u203C","\\mathclose{!\\mkern-0.8mu!}"),pe("\u220C","\\notni"),pe("\u231C","\\ulcorner"),pe("\u231D","\\urcorner"),pe("\u231E","\\llcorner"),pe("\u231F","\\lrcorner"),pe("\xA9","\\copyright"),pe("\xAE","\\textregistered"),pe("\uFE0F","\\textregistered"),pe("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),pe("\u22EE","\\vdots"),pe("\\varGamma","\\mathit{\\Gamma}"),pe("\\varDelta","\\mathit{\\Delta}"),pe("\\varTheta","\\mathit{\\Theta}"),pe("\\varLambda","\\mathit{\\Lambda}"),pe("\\varXi","\\mathit{\\Xi}"),pe("\\varPi","\\mathit{\\Pi}"),pe("\\varSigma","\\mathit{\\Sigma}"),pe("\\varUpsilon","\\mathit{\\Upsilon}"),pe("\\varPhi","\\mathit{\\Phi}"),pe("\\varPsi","\\mathit{\\Psi}"),pe("\\varOmega","\\mathit{\\Omega}"),pe("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),pe("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),pe("\\boxed","\\fbox{$\\displaystyle{#1}$}"),pe("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),pe("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),pe("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Ha={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};pe("\\dots",function(I){var l="\\dotso",f=I.expandAfterFuture().text;return f in Ha?l=Ha[f]:(f.substr(0,4)==="\\not"||f in ct.math&&U.contains(["bin","rel"],ct.math[f].group))&&(l="\\dotsb"),l});var ia={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};pe("\\dotso",function(I){var l=I.future().text;return l in ia?"\\ldots\\,":"\\ldots"}),pe("\\dotsc",function(I){var l=I.future().text;return l in ia&&l!==","?"\\ldots\\,":"\\ldots"}),pe("\\cdots",function(I){var l=I.future().text;return l in ia?"\\@cdots\\,":"\\@cdots"}),pe("\\dotsb","\\cdots"),pe("\\dotsm","\\cdots"),pe("\\dotsi","\\!\\cdots"),pe("\\dotsx","\\ldots\\,"),pe("\\DOTSI","\\relax"),pe("\\DOTSB","\\relax"),pe("\\DOTSX","\\relax"),pe("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),pe("\\,","\\tmspace+{3mu}{.1667em}"),pe("\\thinspace","\\,"),pe("\\>","\\mskip{4mu}"),pe("\\:","\\tmspace+{4mu}{.2222em}"),pe("\\medspace","\\:"),pe("\\;","\\tmspace+{5mu}{.2777em}"),pe("\\thickspace","\\;"),pe("\\!","\\tmspace-{3mu}{.1667em}"),pe("\\negthinspace","\\!"),pe("\\negmedspace","\\tmspace-{4mu}{.2222em}"),pe("\\negthickspace","\\tmspace-{5mu}{.277em}"),pe("\\enspace","\\kern.5em "),pe("\\enskip","\\hskip.5em\\relax"),pe("\\quad","\\hskip1em\\relax"),pe("\\qquad","\\hskip2em\\relax"),pe("\\tag","\\@ifstar\\tag@literal\\tag@paren"),pe("\\tag@paren","\\tag@literal{({#1})}"),pe("\\tag@literal",function(I){if(I.macros.get("\\df@tag"))throw new v("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),pe("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),pe("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),pe("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),pe("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),pe("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),pe("\\\\","\\newline"),pe("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Ka=Be["Main-Regular"][84][1]-.7*Be["Main-Regular"][65][1]+"em";pe("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Ka+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),pe("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Ka+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),pe("\\hspace","\\@ifstar\\@hspacer\\@hspace"),pe("\\@hspace","\\hskip #1\\relax"),pe("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),pe("\\ordinarycolon",":"),pe("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),pe("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),pe("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),pe("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),pe("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),pe("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),pe("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),pe("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),pe("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),pe("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),pe("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),pe("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),pe("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),pe("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),pe("\u2237","\\dblcolon"),pe("\u2239","\\eqcolon"),pe("\u2254","\\coloneqq"),pe("\u2255","\\eqqcolon"),pe("\u2A74","\\Coloneqq"),pe("\\ratio","\\vcentcolon"),pe("\\coloncolon","\\dblcolon"),pe("\\colonequals","\\coloneqq"),pe("\\coloncolonequals","\\Coloneqq"),pe("\\equalscolon","\\eqqcolon"),pe("\\equalscoloncolon","\\Eqqcolon"),pe("\\colonminus","\\coloneq"),pe("\\coloncolonminus","\\Coloneq"),pe("\\minuscolon","\\eqcolon"),pe("\\minuscoloncolon","\\Eqcolon"),pe("\\coloncolonapprox","\\Colonapprox"),pe("\\coloncolonsim","\\Colonsim"),pe("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),pe("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),pe("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),pe("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),pe("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),pe("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),pe("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),pe("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),pe("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),pe("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),pe("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),pe("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),pe("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),pe("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),pe("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),pe("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),pe("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),pe("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),pe("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),pe("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),pe("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),pe("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),pe("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),pe("\u27E6","\\llbracket"),pe("\u27E7","\\rrbracket"),pe("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),pe("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),pe("\u2983","\\lBrace"),pe("\u2984","\\rBrace"),pe("\\darr","\\downarrow"),pe("\\dArr","\\Downarrow"),pe("\\Darr","\\Downarrow"),pe("\\lang","\\langle"),pe("\\rang","\\rangle"),pe("\\uarr","\\uparrow"),pe("\\uArr","\\Uparrow"),pe("\\Uarr","\\Uparrow"),pe("\\N","\\mathbb{N}"),pe("\\R","\\mathbb{R}"),pe("\\Z","\\mathbb{Z}"),pe("\\alef","\\aleph"),pe("\\alefsym","\\aleph"),pe("\\Alpha","\\mathrm{A}"),pe("\\Beta","\\mathrm{B}"),pe("\\bull","\\bullet"),pe("\\Chi","\\mathrm{X}"),pe("\\clubs","\\clubsuit"),pe("\\cnums","\\mathbb{C}"),pe("\\Complex","\\mathbb{C}"),pe("\\Dagger","\\ddagger"),pe("\\diamonds","\\diamondsuit"),pe("\\empty","\\emptyset"),pe("\\Epsilon","\\mathrm{E}"),pe("\\Eta","\\mathrm{H}"),pe("\\exist","\\exists"),pe("\\harr","\\leftrightarrow"),pe("\\hArr","\\Leftrightarrow"),pe("\\Harr","\\Leftrightarrow"),pe("\\hearts","\\heartsuit"),pe("\\image","\\Im"),pe("\\infin","\\infty"),pe("\\Iota","\\mathrm{I}"),pe("\\isin","\\in"),pe("\\Kappa","\\mathrm{K}"),pe("\\larr","\\leftarrow"),pe("\\lArr","\\Leftarrow"),pe("\\Larr","\\Leftarrow"),pe("\\lrarr","\\leftrightarrow"),pe("\\lrArr","\\Leftrightarrow"),pe("\\Lrarr","\\Leftrightarrow"),pe("\\Mu","\\mathrm{M}"),pe("\\natnums","\\mathbb{N}"),pe("\\Nu","\\mathrm{N}"),pe("\\Omicron","\\mathrm{O}"),pe("\\plusmn","\\pm"),pe("\\rarr","\\rightarrow"),pe("\\rArr","\\Rightarrow"),pe("\\Rarr","\\Rightarrow"),pe("\\real","\\Re"),pe("\\reals","\\mathbb{R}"),pe("\\Reals","\\mathbb{R}"),pe("\\Rho","\\mathrm{P}"),pe("\\sdot","\\cdot"),pe("\\sect","\\S"),pe("\\spades","\\spadesuit"),pe("\\sub","\\subset"),pe("\\sube","\\subseteq"),pe("\\supe","\\supseteq"),pe("\\Tau","\\mathrm{T}"),pe("\\thetasym","\\vartheta"),pe("\\weierp","\\wp"),pe("\\Zeta","\\mathrm{Z}"),pe("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),pe("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),pe("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),pe("\\blue","\\textcolor{##6495ed}{#1}"),pe("\\orange","\\textcolor{##ffa500}{#1}"),pe("\\pink","\\textcolor{##ff00af}{#1}"),pe("\\red","\\textcolor{##df0030}{#1}"),pe("\\green","\\textcolor{##28ae7b}{#1}"),pe("\\gray","\\textcolor{gray}{#1}"),pe("\\purple","\\textcolor{##9d38bd}{#1}"),pe("\\blueA","\\textcolor{##ccfaff}{#1}"),pe("\\blueB","\\textcolor{##80f6ff}{#1}"),pe("\\blueC","\\textcolor{##63d9ea}{#1}"),pe("\\blueD","\\textcolor{##11accd}{#1}"),pe("\\blueE","\\textcolor{##0c7f99}{#1}"),pe("\\tealA","\\textcolor{##94fff5}{#1}"),pe("\\tealB","\\textcolor{##26edd5}{#1}"),pe("\\tealC","\\textcolor{##01d1c1}{#1}"),pe("\\tealD","\\textcolor{##01a995}{#1}"),pe("\\tealE","\\textcolor{##208170}{#1}"),pe("\\greenA","\\textcolor{##b6ffb0}{#1}"),pe("\\greenB","\\textcolor{##8af281}{#1}"),pe("\\greenC","\\textcolor{##74cf70}{#1}"),pe("\\greenD","\\textcolor{##1fab54}{#1}"),pe("\\greenE","\\textcolor{##0d923f}{#1}"),pe("\\goldA","\\textcolor{##ffd0a9}{#1}"),pe("\\goldB","\\textcolor{##ffbb71}{#1}"),pe("\\goldC","\\textcolor{##ff9c39}{#1}"),pe("\\goldD","\\textcolor{##e07d10}{#1}"),pe("\\goldE","\\textcolor{##a75a05}{#1}"),pe("\\redA","\\textcolor{##fca9a9}{#1}"),pe("\\redB","\\textcolor{##ff8482}{#1}"),pe("\\redC","\\textcolor{##f9685d}{#1}"),pe("\\redD","\\textcolor{##e84d39}{#1}"),pe("\\redE","\\textcolor{##bc2612}{#1}"),pe("\\maroonA","\\textcolor{##ffbde0}{#1}"),pe("\\maroonB","\\textcolor{##ff92c6}{#1}"),pe("\\maroonC","\\textcolor{##ed5fa6}{#1}"),pe("\\maroonD","\\textcolor{##ca337c}{#1}"),pe("\\maroonE","\\textcolor{##9e034e}{#1}"),pe("\\purpleA","\\textcolor{##ddd7ff}{#1}"),pe("\\purpleB","\\textcolor{##c6b9fc}{#1}"),pe("\\purpleC","\\textcolor{##aa87ff}{#1}"),pe("\\purpleD","\\textcolor{##7854ab}{#1}"),pe("\\purpleE","\\textcolor{##543b78}{#1}"),pe("\\mintA","\\textcolor{##f5f9e8}{#1}"),pe("\\mintB","\\textcolor{##edf2df}{#1}"),pe("\\mintC","\\textcolor{##e0e5cc}{#1}"),pe("\\grayA","\\textcolor{##f6f7f7}{#1}"),pe("\\grayB","\\textcolor{##f0f1f2}{#1}"),pe("\\grayC","\\textcolor{##e3e5e6}{#1}"),pe("\\grayD","\\textcolor{##d6d8da}{#1}"),pe("\\grayE","\\textcolor{##babec2}{#1}"),pe("\\grayF","\\textcolor{##888d93}{#1}"),pe("\\grayG","\\textcolor{##626569}{#1}"),pe("\\grayH","\\textcolor{##3b3e40}{#1}"),pe("\\grayI","\\textcolor{##21242c}{#1}"),pe("\\kaBlue","\\textcolor{##314453}{#1}"),pe("\\kaGreen","\\textcolor{##71B307}{#1}");var Va={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Wa=function(){function I(f,d,m){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=d,this.expansionCount=0,this.feed(f),this.macros=new bo(In,d.macros),this.mode=m,this.stack=[]}var l=I.prototype;return l.feed=function(d){this.lexer=new ra(d,this.settings)},l.switchMode=function(d){this.mode=d},l.beginGroup=function(){this.macros.beginGroup()},l.endGroup=function(){this.macros.endGroup()},l.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},l.popToken=function(){return this.future(),this.stack.pop()},l.pushToken=function(d){this.stack.push(d)},l.pushTokens=function(d){var m;(m=this.stack).push.apply(m,d)},l.consumeSpaces=function(){for(;;){var d=this.future();if(d.text===" ")this.stack.pop();else break}},l.consumeArgs=function(d){for(var m=[],w=0;w<d;++w){this.consumeSpaces();var L=this.popToken();if(L.text==="{"){for(var X=[],le=1;le!==0;){var Se=this.popToken();if(X.push(Se),Se.text==="{")++le;else if(Se.text==="}")--le;else if(Se.text==="EOF")throw new v("End of input in macro argument",L)}X.pop(),X.reverse(),m[w]=X}else{if(L.text==="EOF")throw new v("End of input expecting macro argument");m[w]=[L]}}return m},l.expandOnce=function(){var d=this.popToken(),m=d.text,w=this._getExpansion(m);if(w==null)return this.pushToken(d),d;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new v("Too many expansions: infinite loop or need to increase maxExpand setting");var L=w.tokens;if(w.numArgs){var X=this.consumeArgs(w.numArgs);L=L.slice();for(var le=L.length-1;le>=0;--le){var Se=L[le];if(Se.text==="#"){if(le===0)throw new v("Incomplete placeholder at end of macro body",Se);if(Se=L[--le],Se.text==="#")L.splice(le+1,1);else if(/^[1-9]$/.test(Se.text)){var We;(We=L).splice.apply(We,[le,2].concat(X[+Se.text-1]))}else throw new v("Not a valid argument number",Se)}}}return this.pushTokens(L),L},l.expandAfterFuture=function(){return this.expandOnce(),this.future()},l.expandNextToken=function(){for(;;){var d=this.expandOnce();if(d instanceof ge)if(d.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},l.expandMacro=function(d){if(this.macros.get(d)){var m=[],w=this.stack.length;for(this.pushToken(new ge(d));this.stack.length>w;){var L=this.expandOnce();L instanceof ge&&m.push(this.stack.pop())}return m}},l.expandMacroAsText=function(d){var m=this.expandMacro(d);return m&&m.map(function(w){return w.text}).join("")},l._getExpansion=function(d){var m=this.macros.get(d);if(m==null)return m;var w=typeof m=="function"?m(this):m;if(typeof w=="string"){var L=0;if(w.indexOf("#")!==-1)for(var X=w.replace(/##/g,"");X.indexOf("#"+(L+1))!==-1;)++L;for(var le=new ra(w,this.settings),Se=[],We=le.lex();We.text!=="EOF";)Se.push(We),We=le.lex();Se.reverse();var rt={tokens:Se,numArgs:L};return rt}return w},l.isDefined=function(d){return this.macros.has(d)||us.hasOwnProperty(d)||ct.math.hasOwnProperty(d)||ct.text.hasOwnProperty(d)||Va.hasOwnProperty(d)},I}(),sa={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"}},Ls={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u010F:"d\u030C",\u1E0B:"d\u0307",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u013A:"l\u0301",\u013E:"l\u030C",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u010E:"D\u030C",\u1E0A:"D\u0307",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0139:"L\u0301",\u013D:"L\u030C",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u0164:"T\u030C",\u1E6A:"T\u0307",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},cs=function(){function I(f,d){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Wa(f,d,this.mode),this.settings=d,this.leftrightDepth=0}var l=I.prototype;return l.expect=function(d,m){if(m===void 0&&(m=!0),this.fetch().text!==d)throw new v("Expected '"+d+"', got '"+this.fetch().text+"'",this.fetch());m&&this.consume()},l.consume=function(){this.nextToken=null},l.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},l.switchMode=function(d){this.mode=d,this.gullet.switchMode(d)},l.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var d=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),d},l.parseExpression=function(d,m){for(var w=[];;){this.mode==="math"&&this.consumeSpaces();var L=this.fetch();if(I.endOfExpression.indexOf(L.text)!==-1||m&&L.text===m||d&&us[L.text]&&us[L.text].infix)break;var X=this.parseAtom(m);if(!X)break;w.push(X)}return this.mode==="text"&&this.formLigatures(w),this.handleInfixNodes(w)},l.handleInfixNodes=function(d){for(var m=-1,w,L=0;L<d.length;L++){var X=Fr(d[L],"infix");if(X){if(m!==-1)throw new v("only one infix operator per group",X.token);m=L,w=X.replaceWith}}if(m!==-1&&w){var le,Se,We=d.slice(0,m),rt=d.slice(m+1);We.length===1&&We[0].type==="ordgroup"?le=We[0]:le={type:"ordgroup",mode:this.mode,body:We},rt.length===1&&rt[0].type==="ordgroup"?Se=rt[0]:Se={type:"ordgroup",mode:this.mode,body:rt};var lt;return w==="\\\\abovefrac"?lt=this.callFunction(w,[le,d[m],Se],[]):lt=this.callFunction(w,[le,Se],[]),[lt]}else return d},l.handleSupSubscript=function(d){var m=this.fetch(),w=m.text;this.consume();var L=this.parseGroup(d,!1,I.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!L)throw new v("Expected group after '"+w+"'",m);return L},l.formatUnsupportedCmd=function(d){for(var m=[],w=0;w<d.length;w++)m.push({type:"textord",mode:"text",text:d[w]});var L={type:"text",mode:this.mode,body:m},X={type:"color",mode:this.mode,color:this.settings.errorColor,body:[L]};return X},l.parseAtom=function(d){var m=this.parseGroup("atom",!1,null,d);if(this.mode==="text")return m;for(var w,L;;){this.consumeSpaces();var X=this.fetch();if(X.text==="\\limits"||X.text==="\\nolimits"){var le=Fr(m,"op");if(le){var Se=X.text==="\\limits";le.limits=Se,le.alwaysHandleSupSub=!0}else if(le=Fr(m,"operatorname"),le&&le.alwaysHandleSupSub){var We=X.text==="\\limits";le.limits=We}else throw new v("Limit controls must follow a math operator",X);this.consume()}else if(X.text==="^"){if(w)throw new v("Double superscript",X);w=this.handleSupSubscript("superscript")}else if(X.text==="_"){if(L)throw new v("Double subscript",X);L=this.handleSupSubscript("subscript")}else if(X.text==="'"){if(w)throw new v("Double superscript",X);var rt={type:"textord",mode:this.mode,text:"\\prime"},lt=[rt];for(this.consume();this.fetch().text==="'";)lt.push(rt),this.consume();this.fetch().text==="^"&<.push(this.handleSupSubscript("superscript")),w={type:"ordgroup",mode:this.mode,body:lt}}else break}return w||L?{type:"supsub",mode:this.mode,base:m,sup:w,sub:L}:m},l.parseFunction=function(d,m,w){var L=this.fetch(),X=L.text,le=us[X];if(!le)return null;if(this.consume(),w!=null&&le.greediness<=w)throw new v("Got function '"+X+"' with no arguments"+(m?" as "+m:""),L);if(this.mode==="text"&&!le.allowedInText)throw new v("Can't use function '"+X+"' in text mode",L);if(this.mode==="math"&&le.allowedInMath===!1)throw new v("Can't use function '"+X+"' in math mode",L);var Se=this.parseArguments(X,le),We=Se.args,rt=Se.optArgs;return this.callFunction(X,We,rt,L,d)},l.callFunction=function(d,m,w,L,X){var le={funcName:d,parser:this,token:L,breakOnTokenText:X},Se=us[d];if(Se&&Se.handler)return Se.handler(le,m,w);throw new v("No function handler for "+d)},l.parseArguments=function(d,m){var w=m.numArgs+m.numOptionalArgs;if(w===0)return{args:[],optArgs:[]};for(var L=m.greediness,X=[],le=[],Se=0;Se<w;Se++){var We=m.argTypes&&m.argTypes[Se],rt=Se<m.numOptionalArgs,lt=Se>0&&!rt||Se===0&&!rt&&this.mode==="math",xt=this.parseGroupOfType("argument to '"+d+"'",We,rt,L,lt);if(!xt){if(rt){le.push(null);continue}throw new v("Expected group after '"+d+"'",this.fetch())}(rt?le:X).push(xt)}return{args:X,optArgs:le}},l.parseGroupOfType=function(d,m,w,L,X){switch(m){case"color":return X&&this.consumeSpaces(),this.parseColorGroup(w);case"size":return X&&this.consumeSpaces(),this.parseSizeGroup(w);case"url":return this.parseUrlGroup(w,X);case"math":case"text":return this.parseGroup(d,w,L,void 0,m,X);case"hbox":{var le=this.parseGroup(d,w,L,void 0,"text",X);if(!le)return le;var Se={type:"styling",mode:le.mode,body:[le],style:"text"};return Se}case"raw":{if(X&&this.consumeSpaces(),w&&this.fetch().text==="{")return null;var We=this.parseStringGroup("raw",w,!0);if(We)return{type:"raw",mode:"text",string:We.text};throw new v("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(d,w,L,void 0,void 0,X);default:throw new v("Unknown group type as "+d,this.fetch())}},l.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},l.parseStringGroup=function(d,m,w){var L=m?"[":"{",X=m?"]":"}",le=this.fetch();if(le.text!==L){if(m)return null;if(w&&le.text!=="EOF"&&/[^{}[\]]/.test(le.text))return this.consume(),le}var Se=this.mode;this.mode="text",this.expect(L);for(var We="",rt=this.fetch(),lt=0,xt=rt,wt;(wt=this.fetch()).text!==X||w&<>0;){switch(wt.text){case"EOF":throw new v("Unexpected end of input in "+d,rt.range(xt,We));case L:lt++;break;case X:lt--;break}xt=wt,We+=xt.text,this.consume()}return this.expect(X),this.mode=Se,rt.range(xt,We)},l.parseRegexGroup=function(d,m){var w=this.mode;this.mode="text";for(var L=this.fetch(),X=L,le="",Se;(Se=this.fetch()).text!=="EOF"&&d.test(le+Se.text);)X=Se,le+=X.text,this.consume();if(le==="")throw new v("Invalid "+m+": '"+L.text+"'",L);return this.mode=w,L.range(X,le)},l.parseColorGroup=function(d){var m=this.parseStringGroup("color",d);if(!m)return null;var w=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(m.text);if(!w)throw new v("Invalid color: '"+m.text+"'",m);var L=w[0];return/^[0-9a-f]{6}$/i.test(L)&&(L="#"+L),{type:"color-token",mode:this.mode,color:L}},l.parseSizeGroup=function(d){var m,w=!1;if(!d&&this.fetch().text!=="{"?m=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):m=this.parseStringGroup("size",d),!m)return null;!d&&m.text.length===0&&(m.text="0pt",w=!0);var L=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(m.text);if(!L)throw new v("Invalid size: '"+m.text+"'",m);var X={number:+(L[1]+L[2]),unit:L[3]};if(!Hr(X))throw new v("Invalid unit: '"+X.unit+"'",m);return{type:"size",mode:this.mode,value:X,isBlank:w}},l.parseUrlGroup=function(d,m){this.gullet.lexer.setCatcode("%",13);var w=this.parseStringGroup("url",d,!0);if(this.gullet.lexer.setCatcode("%",14),!w)return null;var L=w.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:L}},l.parseGroup=function(d,m,w,L,X,le){var Se=this.mode;X&&this.switchMode(X),le&&this.consumeSpaces();var We=this.fetch(),rt=We.text,lt;if(m?rt==="[":rt==="{"||rt==="\\begingroup"){this.consume();var xt=I.endOfGroup[rt];this.gullet.beginGroup();var wt=this.parseExpression(!1,xt),Me=this.fetch();this.expect(xt),this.gullet.endGroup(),lt={type:"ordgroup",mode:this.mode,loc:Ze.range(We,Me),body:wt,semisimple:rt==="\\begingroup"||void 0}}else if(m)lt=null;else if(lt=this.parseFunction(L,d,w)||this.parseSymbol(),lt==null&&rt[0]==="\\"&&!Va.hasOwnProperty(rt)){if(this.settings.throwOnError)throw new v("Undefined control sequence: "+rt,We);lt=this.formatUnsupportedCmd(rt),this.consume()}return X&&this.switchMode(Se),lt},l.formLigatures=function(d){for(var m=d.length-1,w=0;w<m;++w){var L=d[w],X=L.text;X==="-"&&d[w+1].text==="-"&&(w+1<m&&d[w+2].text==="-"?(d.splice(w,3,{type:"textord",mode:"text",loc:Ze.range(L,d[w+2]),text:"---"}),m-=2):(d.splice(w,2,{type:"textord",mode:"text",loc:Ze.range(L,d[w+1]),text:"--"}),m-=1)),(X==="'"||X==="`")&&d[w+1].text===X&&(d.splice(w,2,{type:"textord",mode:"text",loc:Ze.range(L,d[w+1]),text:X+X}),m-=1)}},l.parseSymbol=function(){var d=this.fetch(),m=d.text;if(/^\\verb[^a-zA-Z]/.test(m)){this.consume();var w=m.slice(5),L=w.charAt(0)==="*";if(L&&(w=w.slice(1)),w.length<2||w.charAt(0)!==w.slice(-1))throw new v(`\\verb assertion failed --
|
|
please report what input caused this bug`);return w=w.slice(1,-1),{type:"verb",mode:"text",body:w,star:L}}Ls.hasOwnProperty(m[0])&&!ct[this.mode][m[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+m[0]+'" used in math mode',d),m=Ls[m[0]]+m.substr(1));var X=yo.exec(m);X&&(m=m.substring(0,X.index),m==="i"?m="\u0131":m==="j"&&(m="\u0237"));var le;if(ct[this.mode][m]){this.settings.strict&&this.mode==="math"&&_n.indexOf(m)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+m[0]+'" used in math mode',d);var Se=ct[this.mode][m].group,We=Ze.range(d),rt;if(bt.hasOwnProperty(Se)){var lt=Se;rt={type:"atom",mode:this.mode,family:lt,loc:We,text:m}}else rt={type:Se,mode:this.mode,loc:We,text:m};le=rt}else if(m.charCodeAt(0)>=128)this.settings.strict&&(qe(m.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+m[0]+'" used in math mode',d):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+m[0]+'"'+(" ("+m.charCodeAt(0)+")"),d)),le={type:"textord",mode:"text",loc:Ze.range(d),text:m};else return null;if(this.consume(),X)for(var xt=0;xt<X[0].length;xt++){var wt=X[0][xt];if(!sa[wt])throw new v("Unknown accent ' "+wt+"'",d);var Me=sa[wt][this.mode];if(!Me)throw new v("Accent "+wt+" unsupported in "+this.mode+" mode",d);le={type:"accent",mode:this.mode,loc:Ze.range(d),label:Me,isStretchy:!1,isShifty:!0,base:le}}return le},I}();cs.endOfExpression=["}","\\endgroup","\\end","\\right","&"],cs.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},cs.SUPSUB_GREEDINESS=1;var xo=function(l,f){if(!(typeof l=="string"||l instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var d=new cs(l,f);delete d.gullet.macros.current["\\df@tag"];var m=d.parse();if(d.gullet.macros.get("\\df@tag")){if(!f.displayMode)throw new v("\\tag works only in display equations");d.gullet.feed("\\df@tag"),m=[{type:"tag",mode:"text",body:m,tag:d.parse()}]}return m},Rs=xo,Ya=function(l,f,d){f.textContent="";var m=oa(l,d).toNode();f.appendChild(m)};typeof document!="undefined"&&document.compatMode!=="CSS1Compat"&&(typeof console!="undefined"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Ya=function(){throw new v("KaTeX doesn't work in quirks mode.")});var qa=function(l,f){var d=oa(l,f).toMarkup();return d},Eo=function(l,f){var d=new M(f);return Rs(l,d)},aa=function(l,f,d){if(d.throwOnError||!(l instanceof v))throw l;var m=st.makeSpan(["katex-error"],[new V(f)]);return m.setAttribute("title",l.toString()),m.setAttribute("style","color:"+d.errorColor),m},oa=function(l,f){var d=new M(f);try{var m=Rs(l,d);return hi(m,l,d)}catch(w){return aa(w,l,d)}},wo=function(l,f){var d=new M(f);try{var m=Rs(l,d);return ti(m,l,d)}catch(w){return aa(w,l,d)}},So={version:"0.11.1",render:Ya,renderToString:qa,ParseError:v,__parse:Eo,__renderToDomTree:oa,__renderToHTMLTree:wo,__setFontMetrics:Ye,__defineSymbol:_,__defineMacro:pe,__domTree:{Span:se,Anchor:Ne,SymbolNode:V,SvgNode:ee,PathNode:j,LineNode:W}},Ao=ie.default=So}]).default})},32834:function($t){(function(dt,ie){$t.exports=ie()})(this,function(){"use strict";function dt(Ee,Ae){for(var je=0;je<Ae.length;je++){var B=Ae[je];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(Ee,B.key,B)}}function ie(Ee,Ae,je){return Ae&&dt(Ee.prototype,Ae),je&&dt(Ee,je),Ee}function F(Ee,Ae){if(Ee){if(typeof Ee=="string")return Le(Ee,Ae);var je=Object.prototype.toString.call(Ee).slice(8,-1);if(je==="Object"&&Ee.constructor&&(je=Ee.constructor.name),je==="Map"||je==="Set")return Array.from(Ee);if(je==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(je))return Le(Ee,Ae)}}function Le(Ee,Ae){(Ae==null||Ae>Ee.length)&&(Ae=Ee.length);for(var je=0,B=new Array(Ae);je<Ae;je++)B[je]=Ee[je];return B}function Ze(Ee,Ae){var je=typeof Symbol!="undefined"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(je)return(je=je.call(Ee)).next.bind(je);if(Array.isArray(Ee)||(je=F(Ee))||Ae&&Ee&&typeof Ee.length=="number"){je&&(Ee=je);var B=0;return function(){return B>=Ee.length?{done:!0}:{done:!1,value:Ee[B++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ge={exports:{}};function ne(){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 v(Ee){ge.exports.defaults=Ee}ge.exports={defaults:ne(),getDefaults:ne,changeDefaults:v};var we=/[&<>"']/,fe=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,he=/[<>"']|&(?!#?\w+;)/g,$={"&":"&","<":"<",">":">",'"':""","'":"'"},b=function(Ae){return $[Ae]};function k(Ee,Ae){if(Ae){if(we.test(Ee))return Ee.replace(fe,b)}else if(u.test(Ee))return Ee.replace(he,b);return Ee}var A=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(Ee){return Ee.replace(A,function(Ae,je){return je=je.toLowerCase(),je==="colon"?":":je.charAt(0)==="#"?je.charAt(1)==="x"?String.fromCharCode(parseInt(je.substring(2),16)):String.fromCharCode(+je.substring(1)):""})}var K=/(^|[^\[])\^/g;function Z(Ee,Ae){Ee=Ee.source||Ee,Ae=Ae||"";var je={replace:function(q,oe){return oe=oe.source||oe,oe=oe.replace(K,"$1"),Ee=Ee.replace(q,oe),je},getRegex:function(){return new RegExp(Ee,Ae)}};return je}var U=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function J(Ee,Ae,je){if(Ee){var B;try{B=decodeURIComponent(C(je)).replace(U,"").toLowerCase()}catch(q){return null}if(B.indexOf("javascript:")===0||B.indexOf("vbscript:")===0||B.indexOf("data:")===0)return null}Ae&&!M.test(je)&&(je=ye(Ae,je));try{je=encodeURI(je).replace(/%25/g,"%")}catch(q){return null}return je}var de={},ue=/^[^:]+:\/*[^/]*$/,be=/^([^:]+:)[\s\S]*$/,Ie=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ye(Ee,Ae){de[" "+Ee]||(ue.test(Ee)?de[" "+Ee]=Ee+"/":de[" "+Ee]=He(Ee,"/",!0)),Ee=de[" "+Ee];var je=Ee.indexOf(":")===-1;return Ae.substring(0,2)==="//"?je?Ae:Ee.replace(be,"$1")+Ae:Ae.charAt(0)==="/"?je?Ae:Ee.replace(Ie,"$1")+Ae:Ee+Ae}var xe={exec:function(){}};function $e(Ee){for(var Ae=1,je,B;Ae<arguments.length;Ae++){je=arguments[Ae];for(B in je)Object.prototype.hasOwnProperty.call(je,B)&&(Ee[B]=je[B])}return Ee}function Oe(Ee,Ae){var je=Ee.replace(/\|/g,function(oe,Te,P){for(var vt=!1,me=Te;--me>=0&&P[me]==="\\";)vt=!vt;return vt?"|":" |"}),B=je.split(/ \|/),q=0;if(B.length>Ae)B.splice(Ae);else for(;B.length<Ae;)B.push("");for(;q<B.length;q++)B[q]=B[q].trim().replace(/\\\|/g,"|");return B}function He(Ee,Ae,je){var B=Ee.length;if(B===0)return"";for(var q=0;q<B;){var oe=Ee.charAt(B-q-1);if(oe===Ae&&!je)q++;else if(oe!==Ae&&je)q++;else break}return Ee.substr(0,B-q)}function Q(Ee,Ae){if(Ee.indexOf(Ae[1])===-1)return-1;for(var je=Ee.length,B=0,q=0;q<je;q++)if(Ee[q]==="\\")q++;else if(Ee[q]===Ae[0])B++;else if(Ee[q]===Ae[1]&&(B--,B<0))return q;return-1}function G(Ee){Ee&&Ee.sanitize&&!Ee.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 Y(Ee,Ae){if(Ae<1)return"";for(var je="";Ae>1;)Ae&1&&(je+=Ee),Ae>>=1,Ee+=Ee;return je+Ee}var te={escape:k,unescape:C,edit:Z,cleanUrl:J,resolveUrl:ye,noopTest:xe,merge:$e,splitCells:Oe,rtrim:He,findClosingBracket:Q,checkSanitizeDeprecation:G,repeatString:Y},ve=ge.exports.defaults,ae=te.rtrim,S=te.splitCells,E=te.escape,z=te.findClosingBracket;function ce(Ee,Ae,je){var B=Ae.href,q=Ae.title?E(Ae.title):null,oe=Ee[1].replace(/\\([\[\]])/g,"$1");return Ee[0].charAt(0)!=="!"?{type:"link",raw:je,href:B,title:q,text:oe}:{type:"image",raw:je,href:B,title:q,text:E(oe)}}function qe(Ee,Ae){var je=Ee.match(/^(\s+)(?:```)/);if(je===null)return Ae;var B=je[1];return Ae.split(`
|
|
`).map(function(q){var oe=q.match(/^\s+/);if(oe===null)return q;var Te=oe[0];return Te.length>=B.length?q.slice(B.length):q}).join(`
|
|
`)}var Xe=function(){function Ee(je){this.options=je||ve}var Ae=Ee.prototype;return Ae.space=function(B){var q=this.rules.block.newline.exec(B);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
|
|
`}},Ae.code=function(B){var q=this.rules.block.code.exec(B);if(q){var oe=q[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?oe:ae(oe,`
|
|
`)}}},Ae.fences=function(B){var q=this.rules.block.fences.exec(B);if(q){var oe=q[0],Te=qe(oe,q[3]||"");return{type:"code",raw:oe,lang:q[2]?q[2].trim():q[2],text:Te}}},Ae.heading=function(B){var q=this.rules.block.heading.exec(B);if(q){var oe=q[2].trim();if(/#$/.test(oe)){var Te=ae(oe,"#");(this.options.pedantic||!Te||/ $/.test(Te))&&(oe=Te.trim())}return{type:"heading",raw:q[0],depth:q[1].length,text:oe}}},Ae.nptable=function(B){var q=this.rules.block.nptable.exec(B);if(q){var oe={type:"table",header:S(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
|
|
`):[],raw:q[0]};if(oe.header.length===oe.align.length){var Te=oe.align.length,P;for(P=0;P<Te;P++)/^ *-+: *$/.test(oe.align[P])?oe.align[P]="right":/^ *:-+: *$/.test(oe.align[P])?oe.align[P]="center":/^ *:-+ *$/.test(oe.align[P])?oe.align[P]="left":oe.align[P]=null;for(Te=oe.cells.length,P=0;P<Te;P++)oe.cells[P]=S(oe.cells[P],oe.header.length);return oe}}},Ae.hr=function(B){var q=this.rules.block.hr.exec(B);if(q)return{type:"hr",raw:q[0]}},Ae.blockquote=function(B){var q=this.rules.block.blockquote.exec(B);if(q){var oe=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:oe}}},Ae.list=function(B){var q=this.rules.block.list.exec(B);if(q){var oe=q[0],Te=q[2],P=Te.length>1,vt={type:"list",raw:oe,ordered:P,start:P?+Te.slice(0,-1):"",loose:!1,items:[]},me=q[0].match(this.rules.block.item),Dt=!1,Mt,zt,Ar,Qt,Bt,Sr,Tr,Yr,qr,It=me.length;Ar=this.rules.block.listItemStart.exec(me[0]);for(var Jt=0;Jt<It;Jt++){if(Mt=me[Jt],oe=Mt,this.options.pedantic||(qr=Mt.match(new RegExp("\\n\\s*\\n {0,"+(Ar[0].length-1)+"}\\S")),qr&&(Bt=Mt.length-qr.index+me.slice(Jt+1).join(`
|
|
`).length,vt.raw=vt.raw.substring(0,vt.raw.length-Bt),Mt=Mt.substring(0,qr.index),oe=Mt,It=Jt+1)),Jt!==It-1){if(Qt=this.rules.block.listItemStart.exec(me[Jt+1]),this.options.pedantic?Qt[1].length>Ar[1].length:Qt[1].length>=Ar[0].length||Qt[1].length>3){me.splice(Jt,2,me[Jt]+(!this.options.pedantic&&Qt[1].length<Ar[0].length&&!me[Jt].match(/\n$/)?"":`
|
|
`)+me[Jt+1]),Jt--,It--;continue}else(!this.options.pedantic||this.options.smartLists?Qt[2][Qt[2].length-1]!==Te[Te.length-1]:P===(Qt[2].length===1))&&(Bt=me.slice(Jt+1).join(`
|
|
`).length,vt.raw=vt.raw.substring(0,vt.raw.length-Bt),Jt=It-1);Ar=Qt}zt=Mt.length,Mt=Mt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Mt.indexOf(`
|
|
`)&&(zt-=Mt.length,Mt=this.options.pedantic?Mt.replace(/^ {1,4}/gm,""):Mt.replace(new RegExp("^ {1,"+zt+"}","gm"),"")),Mt=ae(Mt,`
|
|
`),Jt!==It-1&&(oe=oe+`
|
|
`),Sr=Dt||/\n\n(?!\s*$)/.test(oe),Jt!==It-1&&(Dt=oe.slice(-2)===`
|
|
|
|
`,Sr||(Sr=Dt)),Sr&&(vt.loose=!0),this.options.gfm&&(Tr=/^\[[ xX]\] /.test(Mt),Yr=void 0,Tr&&(Yr=Mt[1]!==" ",Mt=Mt.replace(/^\[[ xX]\] +/,""))),vt.items.push({type:"list_item",raw:oe,task:Tr,checked:Yr,loose:Sr,text:Mt})}return vt}},Ae.html=function(B){var q=this.rules.block.html.exec(B);if(q)return{type:this.options.sanitize?"paragraph":"html",raw:q[0],pre:!this.options.sanitizer&&(q[1]==="pre"||q[1]==="script"||q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):E(q[0]):q[0]}},Ae.def=function(B){var q=this.rules.block.def.exec(B);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var oe=q[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:oe,raw:q[0],href:q[2],title:q[3]}}},Ae.table=function(B){var q=this.rules.block.table.exec(B);if(q){var oe={type:"table",header:S(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
|
|
`):[]};if(oe.header.length===oe.align.length){oe.raw=q[0];var Te=oe.align.length,P;for(P=0;P<Te;P++)/^ *-+: *$/.test(oe.align[P])?oe.align[P]="right":/^ *:-+: *$/.test(oe.align[P])?oe.align[P]="center":/^ *:-+ *$/.test(oe.align[P])?oe.align[P]="left":oe.align[P]=null;for(Te=oe.cells.length,P=0;P<Te;P++)oe.cells[P]=S(oe.cells[P].replace(/^ *\| *| *\| *$/g,""),oe.header.length);return oe}}},Ae.lheading=function(B){var q=this.rules.block.lheading.exec(B);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},Ae.paragraph=function(B){var q=this.rules.block.paragraph.exec(B);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
|
|
`?q[1].slice(0,-1):q[1]}},Ae.text=function(B){var q=this.rules.block.text.exec(B);if(q)return{type:"text",raw:q[0],text:q[0]}},Ae.escape=function(B){var q=this.rules.inline.escape.exec(B);if(q)return{type:"escape",raw:q[0],text:E(q[1])}},Ae.tag=function(B,q,oe){var Te=this.rules.inline.tag.exec(B);if(Te)return!q&&/^<a /i.test(Te[0])?q=!0:q&&/^<\/a>/i.test(Te[0])&&(q=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(Te[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Te[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:Te[0],inLink:q,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):E(Te[0]):Te[0]}},Ae.link=function(B){var q=this.rules.inline.link.exec(B);if(q){var oe=q[2].trim();if(!this.options.pedantic&&/^</.test(oe)){if(!/>$/.test(oe))return;var Te=ae(oe.slice(0,-1),"\\");if((oe.length-Te.length)%2===0)return}else{var P=z(q[2],"()");if(P>-1){var vt=q[0].indexOf("!")===0?5:4,me=vt+q[1].length+P;q[2]=q[2].substring(0,P),q[0]=q[0].substring(0,me).trim(),q[3]=""}}var Dt=q[2],Mt="";if(this.options.pedantic){var zt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Dt);zt&&(Dt=zt[1],Mt=zt[3])}else Mt=q[3]?q[3].slice(1,-1):"";return Dt=Dt.trim(),/^</.test(Dt)&&(this.options.pedantic&&!/>$/.test(oe)?Dt=Dt.slice(1):Dt=Dt.slice(1,-1)),ce(q,{href:Dt&&Dt.replace(this.rules.inline._escapes,"$1"),title:Mt&&Mt.replace(this.rules.inline._escapes,"$1")},q[0])}},Ae.reflink=function(B,q){var oe;if((oe=this.rules.inline.reflink.exec(B))||(oe=this.rules.inline.nolink.exec(B))){var Te=(oe[2]||oe[1]).replace(/\s+/g," ");if(Te=q[Te.toLowerCase()],!Te||!Te.href){var P=oe[0].charAt(0);return{type:"text",raw:P,text:P}}return ce(oe,Te,oe[0])}},Ae.emStrong=function(B,q,oe){oe===void 0&&(oe="");var Te=this.rules.inline.emStrong.lDelim.exec(B);if(Te&&!(Te[3]&&oe.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 P=Te[1]||Te[2]||"";if(!P||P&&(oe===""||this.rules.inline.punctuation.exec(oe))){var vt=Te[0].length-1,me,Dt,Mt=vt,zt=0,Ar=Te[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Ar.lastIndex=0,q=q.slice(-1*B.length+vt);(Te=Ar.exec(q))!=null;)if(me=Te[1]||Te[2]||Te[3]||Te[4]||Te[5]||Te[6],!!me){if(Dt=me.length,Te[3]||Te[4]){Mt+=Dt;continue}else if((Te[5]||Te[6])&&vt%3&&!((vt+Dt)%3)){zt+=Dt;continue}if(Mt-=Dt,!(Mt>0))return Dt=Math.min(Dt,Dt+Mt+zt),Math.min(vt,Dt)%2?{type:"em",raw:B.slice(0,vt+Te.index+Dt+1),text:B.slice(1,vt+Te.index+Dt)}:{type:"strong",raw:B.slice(0,vt+Te.index+Dt+1),text:B.slice(2,vt+Te.index+Dt-1)}}}}},Ae.codespan=function(B){var q=this.rules.inline.code.exec(B);if(q){var oe=q[2].replace(/\n/g," "),Te=/[^ ]/.test(oe),P=/^ /.test(oe)&&/ $/.test(oe);return Te&&P&&(oe=oe.substring(1,oe.length-1)),oe=E(oe,!0),{type:"codespan",raw:q[0],text:oe}}},Ae.br=function(B){var q=this.rules.inline.br.exec(B);if(q)return{type:"br",raw:q[0]}},Ae.del=function(B){var q=this.rules.inline.del.exec(B);if(q)return{type:"del",raw:q[0],text:q[2]}},Ae.autolink=function(B,q){var oe=this.rules.inline.autolink.exec(B);if(oe){var Te,P;return oe[2]==="@"?(Te=E(this.options.mangle?q(oe[1]):oe[1]),P="mailto:"+Te):(Te=E(oe[1]),P=Te),{type:"link",raw:oe[0],text:Te,href:P,tokens:[{type:"text",raw:Te,text:Te}]}}},Ae.url=function(B,q){var oe;if(oe=this.rules.inline.url.exec(B)){var Te,P;if(oe[2]==="@")Te=E(this.options.mangle?q(oe[0]):oe[0]),P="mailto:"+Te;else{var vt;do vt=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(vt!==oe[0]);Te=E(oe[0]),oe[1]==="www."?P="http://"+Te:P=Te}return{type:"link",raw:oe[0],text:Te,href:P,tokens:[{type:"text",raw:Te,text:Te}]}}},Ae.inlineText=function(B,q,oe){var Te=this.rules.inline.text.exec(B);if(Te){var P;return q?P=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):E(Te[0]):Te[0]:P=E(this.options.smartypants?oe(Te[0]):Te[0]),{type:"text",raw:Te[0],text:P}}},Ee}(),tt=te.noopTest,gt=te.edit,Rt=te.merge,ht={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:tt,table:tt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};ht._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ht._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ht.def=gt(ht.def).replace("label",ht._label).replace("title",ht._title).getRegex(),ht.bullet=/(?:[*+-]|\d{1,9}[.)])/,ht.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ht.item=gt(ht.item,"gm").replace(/bull/g,ht.bullet).getRegex(),ht.listItemStart=gt(/^( *)(bull) */).replace("bull",ht.bullet).getRegex(),ht.list=gt(ht.list).replace(/bull/g,ht.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ht.def.source+")").getRegex(),ht._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",ht._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ht.html=gt(ht.html,"i").replace("comment",ht._comment).replace("tag",ht._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ht.paragraph=gt(ht._paragraph).replace("hr",ht.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",ht._tag).getRegex(),ht.blockquote=gt(ht.blockquote).replace("paragraph",ht.paragraph).getRegex(),ht.normal=Rt({},ht),ht.gfm=Rt({},ht.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*|$)"}),ht.gfm.nptable=gt(ht.gfm.nptable).replace("hr",ht.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",ht._tag).getRegex(),ht.gfm.table=gt(ht.gfm.table).replace("hr",ht.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",ht._tag).getRegex(),ht.pedantic=Rt({},ht.normal,{html:gt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ht._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:tt,paragraph:gt(ht.normal._paragraph).replace("hr",ht.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ht.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var at={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tt,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:tt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};at._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",at.punctuation=gt(at.punctuation).replace(/punctuation/g,at._punctuation).getRegex(),at.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,at.escapedEmSt=/\\\*|\\_/g,at._comment=gt(ht._comment).replace("(?:-->|$)","-->").getRegex(),at.emStrong.lDelim=gt(at.emStrong.lDelim).replace(/punct/g,at._punctuation).getRegex(),at.emStrong.rDelimAst=gt(at.emStrong.rDelimAst,"g").replace(/punct/g,at._punctuation).getRegex(),at.emStrong.rDelimUnd=gt(at.emStrong.rDelimUnd,"g").replace(/punct/g,at._punctuation).getRegex(),at._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,at._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,at._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])?)+(?![-_])/,at.autolink=gt(at.autolink).replace("scheme",at._scheme).replace("email",at._email).getRegex(),at._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,at.tag=gt(at.tag).replace("comment",at._comment).replace("attribute",at._attribute).getRegex(),at._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,at._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,at._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,at.link=gt(at.link).replace("label",at._label).replace("href",at._href).replace("title",at._title).getRegex(),at.reflink=gt(at.reflink).replace("label",at._label).getRegex(),at.reflinkSearch=gt(at.reflinkSearch,"g").replace("reflink",at.reflink).replace("nolink",at.nolink).getRegex(),at.normal=Rt({},at),at.pedantic=Rt({},at.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:gt(/^!?\[(label)\]\((.*?)\)/).replace("label",at._label).getRegex(),reflink:gt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",at._label).getRegex()}),at.gfm=Rt({},at.normal,{escape:gt(at.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),at.gfm.url=gt(at.gfm.url,"i").replace("email",at.gfm._extended_email).getRegex(),at.breaks=Rt({},at.gfm,{br:gt(at.br).replace("{2,}","*").getRegex(),text:gt(at.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ct={block:ht,inline:at},Vt=Xe,St=ge.exports.defaults,Wt=Ct.block,Nt=Ct.inline,Ot=te.repeatString;function ze(Ee){return Ee.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 Ke(Ee){var Ae="",je,B,q=Ee.length;for(je=0;je<q;je++)B=Ee.charCodeAt(je),Math.random()>.5&&(B="x"+B.toString(16)),Ae+="&#"+B+";";return Ae}var se=function(){function Ee(je){this.tokens=[],this.tokens.links=Object.create(null),this.options=je||St,this.options.tokenizer=this.options.tokenizer||new Vt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var B={block:Wt.normal,inline:Nt.normal};this.options.pedantic?(B.block=Wt.pedantic,B.inline=Nt.pedantic):this.options.gfm&&(B.block=Wt.gfm,this.options.breaks?B.inline=Nt.breaks:B.inline=Nt.gfm),this.tokenizer.rules=B}Ee.lex=function(B,q){var oe=new Ee(q);return oe.lex(B)},Ee.lexInline=function(B,q){var oe=new Ee(q);return oe.inlineTokens(B)};var Ae=Ee.prototype;return Ae.lex=function(B){return B=B.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(B,this.tokens,!0),this.inline(this.tokens),this.tokens},Ae.blockTokens=function(B,q,oe){q===void 0&&(q=[]),oe===void 0&&(oe=!0),this.options.pedantic&&(B=B.replace(/^ +$/gm,""));for(var Te,P,vt,me;B;){if(Te=this.tokenizer.space(B)){B=B.substring(Te.raw.length),Te.type&&q.push(Te);continue}if(Te=this.tokenizer.code(B)){B=B.substring(Te.raw.length),me=q[q.length-1],me&&me.type==="paragraph"?(me.raw+=`
|
|
`+Te.raw,me.text+=`
|
|
`+Te.text):q.push(Te);continue}if(Te=this.tokenizer.fences(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(Te=this.tokenizer.heading(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(Te=this.tokenizer.nptable(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(Te=this.tokenizer.hr(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(Te=this.tokenizer.blockquote(B)){B=B.substring(Te.raw.length),Te.tokens=this.blockTokens(Te.text,[],oe),q.push(Te);continue}if(Te=this.tokenizer.list(B)){for(B=B.substring(Te.raw.length),vt=Te.items.length,P=0;P<vt;P++)Te.items[P].tokens=this.blockTokens(Te.items[P].text,[],!1);q.push(Te);continue}if(Te=this.tokenizer.html(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(oe&&(Te=this.tokenizer.def(B))){B=B.substring(Te.raw.length),this.tokens.links[Te.tag]||(this.tokens.links[Te.tag]={href:Te.href,title:Te.title});continue}if(Te=this.tokenizer.table(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(Te=this.tokenizer.lheading(B)){B=B.substring(Te.raw.length),q.push(Te);continue}if(oe&&(Te=this.tokenizer.paragraph(B))){B=B.substring(Te.raw.length),q.push(Te);continue}if(Te=this.tokenizer.text(B)){B=B.substring(Te.raw.length),me=q[q.length-1],me&&me.type==="text"?(me.raw+=`
|
|
`+Te.raw,me.text+=`
|
|
`+Te.text):q.push(Te);continue}if(B){var Dt="Infinite loop on byte: "+B.charCodeAt(0);if(this.options.silent){console.error(Dt);break}else throw new Error(Dt)}}return q},Ae.inline=function(B){var q,oe,Te,P,vt,me,Dt=B.length;for(q=0;q<Dt;q++)switch(me=B[q],me.type){case"paragraph":case"text":case"heading":{me.tokens=[],this.inlineTokens(me.text,me.tokens);break}case"table":{for(me.tokens={header:[],cells:[]},P=me.header.length,oe=0;oe<P;oe++)me.tokens.header[oe]=[],this.inlineTokens(me.header[oe],me.tokens.header[oe]);for(P=me.cells.length,oe=0;oe<P;oe++)for(vt=me.cells[oe],me.tokens.cells[oe]=[],Te=0;Te<vt.length;Te++)me.tokens.cells[oe][Te]=[],this.inlineTokens(vt[Te],me.tokens.cells[oe][Te]);break}case"blockquote":{this.inline(me.tokens);break}case"list":{for(P=me.items.length,oe=0;oe<P;oe++)this.inline(me.items[oe].tokens);break}}return B},Ae.inlineTokens=function(B,q,oe,Te){q===void 0&&(q=[]),oe===void 0&&(oe=!1),Te===void 0&&(Te=!1);var P,vt,me=B,Dt,Mt,zt;if(this.tokens.links){var Ar=Object.keys(this.tokens.links);if(Ar.length>0)for(;(Dt=this.tokenizer.rules.inline.reflinkSearch.exec(me))!=null;)Ar.includes(Dt[0].slice(Dt[0].lastIndexOf("[")+1,-1))&&(me=me.slice(0,Dt.index)+"["+Ot("a",Dt[0].length-2)+"]"+me.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Dt=this.tokenizer.rules.inline.blockSkip.exec(me))!=null;)me=me.slice(0,Dt.index)+"["+Ot("a",Dt[0].length-2)+"]"+me.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Dt=this.tokenizer.rules.inline.escapedEmSt.exec(me))!=null;)me=me.slice(0,Dt.index)+"++"+me.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;B;){if(Mt||(zt=""),Mt=!1,P=this.tokenizer.escape(B)){B=B.substring(P.raw.length),q.push(P);continue}if(P=this.tokenizer.tag(B,oe,Te)){B=B.substring(P.raw.length),oe=P.inLink,Te=P.inRawBlock;var Qt=q[q.length-1];Qt&&P.type==="text"&&Qt.type==="text"?(Qt.raw+=P.raw,Qt.text+=P.text):q.push(P);continue}if(P=this.tokenizer.link(B)){B=B.substring(P.raw.length),P.type==="link"&&(P.tokens=this.inlineTokens(P.text,[],!0,Te)),q.push(P);continue}if(P=this.tokenizer.reflink(B,this.tokens.links)){B=B.substring(P.raw.length);var Bt=q[q.length-1];P.type==="link"?(P.tokens=this.inlineTokens(P.text,[],!0,Te),q.push(P)):Bt&&P.type==="text"&&Bt.type==="text"?(Bt.raw+=P.raw,Bt.text+=P.text):q.push(P);continue}if(P=this.tokenizer.emStrong(B,me,zt)){B=B.substring(P.raw.length),P.tokens=this.inlineTokens(P.text,[],oe,Te),q.push(P);continue}if(P=this.tokenizer.codespan(B)){B=B.substring(P.raw.length),q.push(P);continue}if(P=this.tokenizer.br(B)){B=B.substring(P.raw.length),q.push(P);continue}if(P=this.tokenizer.del(B)){B=B.substring(P.raw.length),P.tokens=this.inlineTokens(P.text,[],oe,Te),q.push(P);continue}if(P=this.tokenizer.autolink(B,Ke)){B=B.substring(P.raw.length),q.push(P);continue}if(!oe&&(P=this.tokenizer.url(B,Ke))){B=B.substring(P.raw.length),q.push(P);continue}if(P=this.tokenizer.inlineText(B,Te,ze)){B=B.substring(P.raw.length),P.raw.slice(-1)!=="_"&&(zt=P.raw.slice(-1)),Mt=!0,vt=q[q.length-1],vt&&vt.type==="text"?(vt.raw+=P.raw,vt.text+=P.text):q.push(P);continue}if(B){var Sr="Infinite loop on byte: "+B.charCodeAt(0);if(this.options.silent){console.error(Sr);break}else throw new Error(Sr)}}return q},ie(Ee,null,[{key:"rules",get:function(){return{block:Wt,inline:Nt}}}]),Ee}(),Ne=ge.exports.defaults,Fe=te.cleanUrl,R=te.escape,V=function(){function Ee(je){this.options=je||Ne}var Ae=Ee.prototype;return Ae.code=function(B,q,oe){var Te=(q||"").match(/\S*/)[0];if(this.options.highlight){var P=this.options.highlight(B,Te);P!=null&&P!==B&&(oe=!0,B=P)}return B=B.replace(/\n$/,"")+`
|
|
`,Te?'<pre><code class="'+this.options.langPrefix+R(Te,!0)+'">'+(oe?B:R(B,!0))+`</code></pre>
|
|
`:"<pre><code>"+(oe?B:R(B,!0))+`</code></pre>
|
|
`},Ae.blockquote=function(B){return`<blockquote>
|
|
`+B+`</blockquote>
|
|
`},Ae.html=function(B){return B},Ae.heading=function(B,q,oe,Te){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+Te.slug(oe)+'">'+B+"</h"+q+`>
|
|
`:"<h"+q+">"+B+"</h"+q+`>
|
|
`},Ae.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Ae.list=function(B,q,oe){var Te=q?"ol":"ul",P=q&&oe!==1?' start="'+oe+'"':"";return"<"+Te+P+`>
|
|
`+B+"</"+Te+`>
|
|
`},Ae.listitem=function(B){return"<li>"+B+`</li>
|
|
`},Ae.checkbox=function(B){return"<input "+(B?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ae.paragraph=function(B){return"<p>"+B+`</p>
|
|
`},Ae.table=function(B,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
|
|
<thead>
|
|
`+B+`</thead>
|
|
`+q+`</table>
|
|
`},Ae.tablerow=function(B){return`<tr>
|
|
`+B+`</tr>
|
|
`},Ae.tablecell=function(B,q){var oe=q.header?"th":"td",Te=q.align?"<"+oe+' align="'+q.align+'">':"<"+oe+">";return Te+B+"</"+oe+`>
|
|
`},Ae.strong=function(B){return"<strong>"+B+"</strong>"},Ae.em=function(B){return"<em>"+B+"</em>"},Ae.codespan=function(B){return"<code>"+B+"</code>"},Ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ae.del=function(B){return"<del>"+B+"</del>"},Ae.link=function(B,q,oe){if(B=Fe(this.options.sanitize,this.options.baseUrl,B),B===null)return oe;var Te='<a href="'+R(B)+'"';return q&&(Te+=' title="'+q+'"'),Te+=">"+oe+"</a>",Te},Ae.image=function(B,q,oe){if(B=Fe(this.options.sanitize,this.options.baseUrl,B),B===null)return oe;var Te='<img src="'+B+'" alt="'+oe+'"';return q&&(Te+=' title="'+q+'"'),Te+=this.options.xhtml?"/>":">",Te},Ae.text=function(B){return B},Ee}(),ee=function(){function Ee(){}var Ae=Ee.prototype;return Ae.strong=function(B){return B},Ae.em=function(B){return B},Ae.codespan=function(B){return B},Ae.del=function(B){return B},Ae.html=function(B){return B},Ae.text=function(B){return B},Ae.link=function(B,q,oe){return""+oe},Ae.image=function(B,q,oe){return""+oe},Ae.br=function(){return""},Ee}(),j=function(){function Ee(){this.seen={}}var Ae=Ee.prototype;return Ae.serialize=function(B){return B.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Ae.getNextSafeSlug=function(B,q){var oe=B,Te=0;if(this.seen.hasOwnProperty(oe)){Te=this.seen[B];do Te++,oe=B+"-"+Te;while(this.seen.hasOwnProperty(oe))}return q||(this.seen[B]=Te,this.seen[oe]=0),oe},Ae.slug=function(B,q){q===void 0&&(q={});var oe=this.serialize(B);return this.getNextSafeSlug(oe,q.dryrun)},Ee}(),W=V,ke=ee,Pe=j,Be=ge.exports.defaults,Ce=te.unescape,De=function(){function Ee(je){this.options=je||Be,this.options.renderer=this.options.renderer||new W,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ke,this.slugger=new Pe}Ee.parse=function(B,q){var oe=new Ee(q);return oe.parse(B)},Ee.parseInline=function(B,q){var oe=new Ee(q);return oe.parseInline(B)};var Ae=Ee.prototype;return Ae.parse=function(B,q){q===void 0&&(q=!0);var oe="",Te,P,vt,me,Dt,Mt,zt,Ar,Qt,Bt,Sr,Tr,Yr,qr,It,Jt,mr,Zr,Lr=B.length;for(Te=0;Te<Lr;Te++)switch(Bt=B[Te],Bt.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline(Bt.tokens),Bt.depth,Ce(this.parseInline(Bt.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code(Bt.text,Bt.lang,Bt.escaped);continue}case"table":{for(Ar="",zt="",me=Bt.header.length,P=0;P<me;P++)zt+=this.renderer.tablecell(this.parseInline(Bt.tokens.header[P]),{header:!0,align:Bt.align[P]});for(Ar+=this.renderer.tablerow(zt),Qt="",me=Bt.cells.length,P=0;P<me;P++){for(Mt=Bt.tokens.cells[P],zt="",Dt=Mt.length,vt=0;vt<Dt;vt++)zt+=this.renderer.tablecell(this.parseInline(Mt[vt]),{header:!1,align:Bt.align[vt]});Qt+=this.renderer.tablerow(zt)}oe+=this.renderer.table(Ar,Qt);continue}case"blockquote":{Qt=this.parse(Bt.tokens),oe+=this.renderer.blockquote(Qt);continue}case"list":{for(Sr=Bt.ordered,Tr=Bt.start,Yr=Bt.loose,me=Bt.items.length,Qt="",P=0;P<me;P++)It=Bt.items[P],Jt=It.checked,mr=It.task,qr="",It.task&&(Zr=this.renderer.checkbox(Jt),Yr?It.tokens.length>0&&It.tokens[0].type==="text"?(It.tokens[0].text=Zr+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=Zr+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:Zr}):qr+=Zr),qr+=this.parse(It.tokens,Yr),Qt+=this.renderer.listitem(qr,mr,Jt);oe+=this.renderer.list(Qt,Sr,Tr);continue}case"html":{oe+=this.renderer.html(Bt.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Bt.tokens));continue}case"text":{for(Qt=Bt.tokens?this.parseInline(Bt.tokens):Bt.text;Te+1<Lr&&B[Te+1].type==="text";)Bt=B[++Te],Qt+=`
|
|
`+(Bt.tokens?this.parseInline(Bt.tokens):Bt.text);oe+=q?this.renderer.paragraph(Qt):Qt;continue}default:{var _n='Token with "'+Bt.type+'" type was not found.';if(this.options.silent){console.error(_n);return}else throw new Error(_n)}}return oe},Ae.parseInline=function(B,q){q=q||this.renderer;var oe="",Te,P,vt=B.length;for(Te=0;Te<vt;Te++)switch(P=B[Te],P.type){case"escape":{oe+=q.text(P.text);break}case"html":{oe+=q.html(P.text);break}case"link":{oe+=q.link(P.href,P.title,this.parseInline(P.tokens,q));break}case"image":{oe+=q.image(P.href,P.title,P.text);break}case"strong":{oe+=q.strong(this.parseInline(P.tokens,q));break}case"em":{oe+=q.em(this.parseInline(P.tokens,q));break}case"codespan":{oe+=q.codespan(P.text);break}case"br":{oe+=q.br();break}case"del":{oe+=q.del(this.parseInline(P.tokens,q));break}case"text":{oe+=q.text(P.text);break}default:{var me='Token with "'+P.type+'" type was not found.';if(this.options.silent){console.error(me);return}else throw new Error(me)}}return oe},Ee}(),Ye=se,Ve=De,it=Xe,ut=V,bt=ee,pt=j,mt=te.merge,ct=te.checkSanitizeDeprecation,_=te.escape,y=ge.exports.getDefaults,Ge=ge.exports.changeDefaults,O=ge.exports.defaults;function re(Ee,Ae,je){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");if(typeof Ae=="function"&&(je=Ae,Ae=null),Ae=mt({},re.defaults,Ae||{}),ct(Ae),je){var B=Ae.highlight,q;try{q=Ye.lex(Ee,Ae)}catch(vt){return je(vt)}var oe=function(me){var Dt;if(!me)try{Ae.walkTokens&&re.walkTokens(q,Ae.walkTokens),Dt=Ve.parse(q,Ae)}catch(Mt){me=Mt}return Ae.highlight=B,me?je(me):je(null,Dt)};if(!B||B.length<3||(delete Ae.highlight,!q.length))return oe();var Te=0;re.walkTokens(q,function(vt){vt.type==="code"&&(Te++,setTimeout(function(){B(vt.text,vt.lang,function(me,Dt){if(me)return oe(me);Dt!=null&&Dt!==vt.text&&(vt.text=Dt,vt.escaped=!0),Te--,Te===0&&oe()})},0))}),Te===0&&oe();return}try{var P=Ye.lex(Ee,Ae);return Ae.walkTokens&&re.walkTokens(P,Ae.walkTokens),Ve.parse(P,Ae)}catch(vt){if(vt.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Ae.silent)return"<p>An error occurred:</p><pre>"+_(vt.message+"",!0)+"</pre>";throw vt}}re.options=re.setOptions=function(Ee){return mt(re.defaults,Ee),Ge(re.defaults),re},re.getDefaults=y,re.defaults=O,re.use=function(Ee){var Ae=mt({},Ee);if(Ee.renderer&&function(){var B=re.defaults.renderer||new ut,q=function(P){var vt=B[P];B[P]=function(){for(var me=arguments.length,Dt=new Array(me),Mt=0;Mt<me;Mt++)Dt[Mt]=arguments[Mt];var zt=Ee.renderer[P].apply(B,Dt);return zt===!1&&(zt=vt.apply(B,Dt)),zt}};for(var oe in Ee.renderer)q(oe);Ae.renderer=B}(),Ee.tokenizer&&function(){var B=re.defaults.tokenizer||new it,q=function(P){var vt=B[P];B[P]=function(){for(var me=arguments.length,Dt=new Array(me),Mt=0;Mt<me;Mt++)Dt[Mt]=arguments[Mt];var zt=Ee.tokenizer[P].apply(B,Dt);return zt===!1&&(zt=vt.apply(B,Dt)),zt}};for(var oe in Ee.tokenizer)q(oe);Ae.tokenizer=B}(),Ee.walkTokens){var je=re.defaults.walkTokens;Ae.walkTokens=function(B){Ee.walkTokens(B),je&&je(B)}}re.setOptions(Ae)},re.walkTokens=function(Ee,Ae){for(var je=Ze(Ee),B;!(B=je()).done;){var q=B.value;switch(Ae(q),q.type){case"table":{for(var oe=Ze(q.tokens.header),Te;!(Te=oe()).done;){var P=Te.value;re.walkTokens(P,Ae)}for(var vt=Ze(q.tokens.cells),me;!(me=vt()).done;)for(var Dt=me.value,Mt=Ze(Dt),zt;!(zt=Mt()).done;){var Ar=zt.value;re.walkTokens(Ar,Ae)}break}case"list":{re.walkTokens(q.items,Ae);break}default:q.tokens&&re.walkTokens(q.tokens,Ae)}}},re.parseInline=function(Ee,Ae){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");Ae=mt({},re.defaults,Ae||{}),ct(Ae);try{var je=Ye.lexInline(Ee,Ae);return Ae.walkTokens&&re.walkTokens(je,Ae.walkTokens),Ve.parseInline(je,Ae)}catch(B){if(B.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Ae.silent)return"<p>An error occurred:</p><pre>"+_(B.message+"",!0)+"</pre>";throw B}},re.Parser=Ve,re.parser=Ve.parse,re.Renderer=ut,re.TextRenderer=bt,re.Lexer=Ye,re.lexer=Ye.lex,re.Tokenizer=it,re.Slugger=pt,re.parse=re;var Et=re;return Et})},11690:function($t){const dt=/[&<>"']/,ie=/[&<>"']/g,F=/[<>"']|&(?!#?\w+;)/,Le=/[<>"']|&(?!#?\w+;)/g,Ze={"&":"&","<":"<",">":">",'"':""","'":"'"},ge=ye=>Ze[ye];function ne(ye,xe){if(xe){if(dt.test(ye))return ye.replace(ie,ge)}else if(F.test(ye))return ye.replace(Le,ge);return ye}const v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function we(ye){return ye.replace(v,(xe,$e)=>($e=$e.toLowerCase(),$e==="colon"?":":$e.charAt(0)==="#"?$e.charAt(1)==="x"?String.fromCharCode(parseInt($e.substring(2),16)):String.fromCharCode(+$e.substring(1)):""))}const fe=/(^|[^\[])\^/g;function u(ye,xe){ye=ye.source||ye,xe=xe||"";const $e={replace:(Oe,He)=>(He=He.source||He,He=He.replace(fe,"$1"),ye=ye.replace(Oe,He),$e),getRegex:()=>new RegExp(ye,xe)};return $e}const he=/[^\w:]/g,$=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(ye,xe,$e){if(ye){let Oe;try{Oe=decodeURIComponent(we($e)).replace(he,"").toLowerCase()}catch(He){return null}if(Oe.indexOf("javascript:")===0||Oe.indexOf("vbscript:")===0||Oe.indexOf("data:")===0)return null}xe&&!$.test($e)&&($e=Z(xe,$e));try{$e=encodeURI($e).replace(/%25/g,"%")}catch(Oe){return null}return $e}const k={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Z(ye,xe){k[" "+ye]||(A.test(ye)?k[" "+ye]=ye+"/":k[" "+ye]=de(ye,"/",!0)),ye=k[" "+ye];const $e=ye.indexOf(":")===-1;return xe.substring(0,2)==="//"?$e?xe:ye.replace(C,"$1")+xe:xe.charAt(0)==="/"?$e?xe:ye.replace(K,"$1")+xe:ye+xe}const U={exec:function(){}};function M(ye){let xe=1,$e,Oe;for(;xe<arguments.length;xe++){$e=arguments[xe];for(Oe in $e)Object.prototype.hasOwnProperty.call($e,Oe)&&(ye[Oe]=$e[Oe])}return ye}function J(ye,xe){const $e=ye.replace(/\|/g,(Q,G,Y)=>{let te=!1,ve=G;for(;--ve>=0&&Y[ve]==="\\";)te=!te;return te?"|":" |"}),Oe=$e.split(/ \|/);let He=0;if(Oe.length>xe)Oe.splice(xe);else for(;Oe.length<xe;)Oe.push("");for(;He<Oe.length;He++)Oe[He]=Oe[He].trim().replace(/\\\|/g,"|");return Oe}function de(ye,xe,$e){const Oe=ye.length;if(Oe===0)return"";let He=0;for(;He<Oe;){const Q=ye.charAt(Oe-He-1);if(Q===xe&&!$e)He++;else if(Q!==xe&&$e)He++;else break}return ye.substr(0,Oe-He)}function ue(ye,xe){if(ye.indexOf(xe[1])===-1)return-1;const $e=ye.length;let Oe=0,He=0;for(;He<$e;He++)if(ye[He]==="\\")He++;else if(ye[He]===xe[0])Oe++;else if(ye[He]===xe[1]&&(Oe--,Oe<0))return He;return-1}function be(ye){ye&&ye.sanitize&&!ye.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 Ie(ye,xe){if(xe<1)return"";let $e="";for(;xe>1;)xe&1&&($e+=ye),xe>>=1,ye+=ye;return $e+ye}$t.exports={escape:ne,unescape:we,edit:u,cleanUrl:b,resolveUrl:Z,noopTest:U,merge:M,splitCells:J,rtrim:de,findClosingBracket:ue,checkSanitizeDeprecation:be,repeatString:Ie}},75918:function($t,dt,ie){"use strict";ie.d(dt,{Wi:function(){return v},Z0:function(){return we},aU:function(){return ne},eZ:function(){return u},wY:function(){return fe}});var F=ie(4348),Le=ie(69323),Ze=ie(13268),ge=function(he,$,b,k){function A(C){return C instanceof b?C:new b(function(K){K(C)})}return new(b||(b=Promise))(function(C,K){function Z(J){try{M(k.next(J))}catch(de){K(de)}}function U(J){try{M(k.throw(J))}catch(de){K(de)}}function M(J){J.done?C(J.value):A(J.value).then(Z,U)}M((k=k.apply(he,$||[])).next())})};class ne extends Le.JT{constructor($,b="",k="",A=!0,C){super(),this._onDidChange=this._register(new F.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=$,this._label=b,this._cssClass=k,this._enabled=A,this._actionCallback=C}get id(){return this._id}get label(){return this._label}set label($){this._setLabel($)}_setLabel($){this._label!==$&&(this._label=$,this._onDidChange.fire({label:$}))}get tooltip(){return this._tooltip||""}set tooltip($){this._setTooltip($)}_setTooltip($){this._tooltip!==$&&(this._tooltip=$,this._onDidChange.fire({tooltip:$}))}get class(){return this._cssClass}set class($){this._setClass($)}_setClass($){this._cssClass!==$&&(this._cssClass=$,this._onDidChange.fire({class:$}))}get enabled(){return this._enabled}set enabled($){this._setEnabled($)}_setEnabled($){this._enabled!==$&&(this._enabled=$,this._onDidChange.fire({enabled:$}))}get checked(){return this._checked}set checked($){this._setChecked($)}_setChecked($){this._checked!==$&&(this._checked=$,this._onDidChange.fire({checked:$}))}run($,b){return ge(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback($))})}}class v extends Le.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new F.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new F.Q5),this.onDidRun=this._onDidRun.event}run($,b){return ge(this,void 0,void 0,function*(){if(!$.enabled)return;this._onBeforeRun.fire({action:$});let k;try{yield this.runAction($,b)}catch(A){k=A}this._onDidRun.fire({action:$,error:k})})}runAction($,b){return ge(this,void 0,void 0,function*(){yield $.run(b)})}}class we extends ne{constructor($){super(we.ID,$,$?"separator text":"separator"),this.checked=!1,this.enabled=!1}}we.ID="vs.actions.separator";class fe{constructor($,b,k,A){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=$,this.label=b,this.class=A,this._actions=k}get actions(){return this._actions}dispose(){}run(){return ge(this,void 0,void 0,function*(){})}}class u extends ne{constructor(){super(u.ID,Ze.N("submenu.empty","(empty)"),void 0,!1)}}u.ID="vs.actions.empty"},76068:function($t,dt,ie){"use strict";ie.d(dt,{ok:function(){return F}});function F(Le,Ze){if(!Le)throw new Error(Ze?`Assertion failed (${Ze})`:"Assertion Failed")}},52615:function($t,dt,ie){"use strict";ie.d(dt,{CM:function(){return ne},JL:function(){return v},dT:function(){return fe},fK:function(){return ge},lA:function(){return we}});var F=ie(4348);class Le{constructor(){this._icons=new Map,this._onDidRegister=new F.Q5}add(he){const $=this._icons.get(he.id);$?he.description?$.description=he.description:console.error(`Duplicate registration of codicon ${he.id}`):(this._icons.set(he.id,he),this._onDidRegister.fire(he))}get(he){return this._icons.get(he)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Ze=new Le,ge=Ze;function ne(u,he){return new we(u,he)}function v(u){return u?u.replace(/\$\((.*?)\)/g,(he,$)=>` ${$} `).trim():""}class we{constructor(he,$,b){this.id=he,this.definition=$,this.description=b,Ze.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var fe;(function(u){u.iconNameSegment="[A-Za-z0-9]+",u.iconNameExpression="[A-Za-z0-9\\-]+",u.iconModifierExpression="~[A-Za-z]+";const he=new RegExp(`^(${u.iconNameExpression})(${u.iconModifierExpression})?$`);function $(A){if(A instanceof we)return["codicon","codicon-"+A.id];const C=he.exec(A.id);if(!C)return $(we.error);let[,K,Z]=C;const U=["codicon","codicon-"+K];return Z&&U.push("codicon-modifier-"+Z.substr(1)),U}u.asClassNameArray=$;function b(A){return $(A).join(" ")}u.asClassName=b;function k(A){return"."+$(A).join(".")}u.asCSSSelector=k})(fe||(fe={})),function(u){u.add=new u("add",{fontCharacter:"\\ea60"}),u.plus=new u("plus",u.add.definition),u.gistNew=new u("gist-new",u.add.definition),u.repoCreate=new u("repo-create",u.add.definition),u.lightbulb=new u("lightbulb",{fontCharacter:"\\ea61"}),u.lightBulb=new u("light-bulb",{fontCharacter:"\\ea61"}),u.repo=new u("repo",{fontCharacter:"\\ea62"}),u.repoDelete=new u("repo-delete",{fontCharacter:"\\ea62"}),u.gistFork=new u("gist-fork",{fontCharacter:"\\ea63"}),u.repoForked=new u("repo-forked",{fontCharacter:"\\ea63"}),u.gitPullRequest=new u("git-pull-request",{fontCharacter:"\\ea64"}),u.gitPullRequestAbandoned=new u("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),u.recordKeys=new u("record-keys",{fontCharacter:"\\ea65"}),u.keyboard=new u("keyboard",{fontCharacter:"\\ea65"}),u.tag=new u("tag",{fontCharacter:"\\ea66"}),u.tagAdd=new u("tag-add",{fontCharacter:"\\ea66"}),u.tagRemove=new u("tag-remove",{fontCharacter:"\\ea66"}),u.person=new u("person",{fontCharacter:"\\ea67"}),u.personFollow=new u("person-follow",{fontCharacter:"\\ea67"}),u.personOutline=new u("person-outline",{fontCharacter:"\\ea67"}),u.personFilled=new u("person-filled",{fontCharacter:"\\ea67"}),u.gitBranch=new u("git-branch",{fontCharacter:"\\ea68"}),u.gitBranchCreate=new u("git-branch-create",{fontCharacter:"\\ea68"}),u.gitBranchDelete=new u("git-branch-delete",{fontCharacter:"\\ea68"}),u.sourceControl=new u("source-control",{fontCharacter:"\\ea68"}),u.mirror=new u("mirror",{fontCharacter:"\\ea69"}),u.mirrorPublic=new u("mirror-public",{fontCharacter:"\\ea69"}),u.star=new u("star",{fontCharacter:"\\ea6a"}),u.starAdd=new u("star-add",{fontCharacter:"\\ea6a"}),u.starDelete=new u("star-delete",{fontCharacter:"\\ea6a"}),u.starEmpty=new u("star-empty",{fontCharacter:"\\ea6a"}),u.comment=new u("comment",{fontCharacter:"\\ea6b"}),u.commentAdd=new u("comment-add",{fontCharacter:"\\ea6b"}),u.alert=new u("alert",{fontCharacter:"\\ea6c"}),u.warning=new u("warning",{fontCharacter:"\\ea6c"}),u.search=new u("search",{fontCharacter:"\\ea6d"}),u.searchSave=new u("search-save",{fontCharacter:"\\ea6d"}),u.logOut=new u("log-out",{fontCharacter:"\\ea6e"}),u.signOut=new u("sign-out",{fontCharacter:"\\ea6e"}),u.logIn=new u("log-in",{fontCharacter:"\\ea6f"}),u.signIn=new u("sign-in",{fontCharacter:"\\ea6f"}),u.eye=new u("eye",{fontCharacter:"\\ea70"}),u.eyeUnwatch=new u("eye-unwatch",{fontCharacter:"\\ea70"}),u.eyeWatch=new u("eye-watch",{fontCharacter:"\\ea70"}),u.circleFilled=new u("circle-filled",{fontCharacter:"\\ea71"}),u.primitiveDot=new u("primitive-dot",{fontCharacter:"\\ea71"}),u.closeDirty=new u("close-dirty",{fontCharacter:"\\ea71"}),u.debugBreakpoint=new u("debug-breakpoint",{fontCharacter:"\\ea71"}),u.debugBreakpointDisabled=new u("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),u.debugHint=new u("debug-hint",{fontCharacter:"\\ea71"}),u.primitiveSquare=new u("primitive-square",{fontCharacter:"\\ea72"}),u.edit=new u("edit",{fontCharacter:"\\ea73"}),u.pencil=new u("pencil",{fontCharacter:"\\ea73"}),u.info=new u("info",{fontCharacter:"\\ea74"}),u.issueOpened=new u("issue-opened",{fontCharacter:"\\ea74"}),u.gistPrivate=new u("gist-private",{fontCharacter:"\\ea75"}),u.gitForkPrivate=new u("git-fork-private",{fontCharacter:"\\ea75"}),u.lock=new u("lock",{fontCharacter:"\\ea75"}),u.mirrorPrivate=new u("mirror-private",{fontCharacter:"\\ea75"}),u.close=new u("close",{fontCharacter:"\\ea76"}),u.removeClose=new u("remove-close",{fontCharacter:"\\ea76"}),u.x=new u("x",{fontCharacter:"\\ea76"}),u.repoSync=new u("repo-sync",{fontCharacter:"\\ea77"}),u.sync=new u("sync",{fontCharacter:"\\ea77"}),u.clone=new u("clone",{fontCharacter:"\\ea78"}),u.desktopDownload=new u("desktop-download",{fontCharacter:"\\ea78"}),u.beaker=new u("beaker",{fontCharacter:"\\ea79"}),u.microscope=new u("microscope",{fontCharacter:"\\ea79"}),u.vm=new u("vm",{fontCharacter:"\\ea7a"}),u.deviceDesktop=new u("device-desktop",{fontCharacter:"\\ea7a"}),u.file=new u("file",{fontCharacter:"\\ea7b"}),u.fileText=new u("file-text",{fontCharacter:"\\ea7b"}),u.more=new u("more",{fontCharacter:"\\ea7c"}),u.ellipsis=new u("ellipsis",{fontCharacter:"\\ea7c"}),u.kebabHorizontal=new u("kebab-horizontal",{fontCharacter:"\\ea7c"}),u.mailReply=new u("mail-reply",{fontCharacter:"\\ea7d"}),u.reply=new u("reply",{fontCharacter:"\\ea7d"}),u.organization=new u("organization",{fontCharacter:"\\ea7e"}),u.organizationFilled=new u("organization-filled",{fontCharacter:"\\ea7e"}),u.organizationOutline=new u("organization-outline",{fontCharacter:"\\ea7e"}),u.newFile=new u("new-file",{fontCharacter:"\\ea7f"}),u.fileAdd=new u("file-add",{fontCharacter:"\\ea7f"}),u.newFolder=new u("new-folder",{fontCharacter:"\\ea80"}),u.fileDirectoryCreate=new u("file-directory-create",{fontCharacter:"\\ea80"}),u.trash=new u("trash",{fontCharacter:"\\ea81"}),u.trashcan=new u("trashcan",{fontCharacter:"\\ea81"}),u.history=new u("history",{fontCharacter:"\\ea82"}),u.clock=new u("clock",{fontCharacter:"\\ea82"}),u.folder=new u("folder",{fontCharacter:"\\ea83"}),u.fileDirectory=new u("file-directory",{fontCharacter:"\\ea83"}),u.symbolFolder=new u("symbol-folder",{fontCharacter:"\\ea83"}),u.logoGithub=new u("logo-github",{fontCharacter:"\\ea84"}),u.markGithub=new u("mark-github",{fontCharacter:"\\ea84"}),u.github=new u("github",{fontCharacter:"\\ea84"}),u.terminal=new u("terminal",{fontCharacter:"\\ea85"}),u.console=new u("console",{fontCharacter:"\\ea85"}),u.repl=new u("repl",{fontCharacter:"\\ea85"}),u.zap=new u("zap",{fontCharacter:"\\ea86"}),u.symbolEvent=new u("symbol-event",{fontCharacter:"\\ea86"}),u.error=new u("error",{fontCharacter:"\\ea87"}),u.stop=new u("stop",{fontCharacter:"\\ea87"}),u.variable=new u("variable",{fontCharacter:"\\ea88"}),u.symbolVariable=new u("symbol-variable",{fontCharacter:"\\ea88"}),u.array=new u("array",{fontCharacter:"\\ea8a"}),u.symbolArray=new u("symbol-array",{fontCharacter:"\\ea8a"}),u.symbolModule=new u("symbol-module",{fontCharacter:"\\ea8b"}),u.symbolPackage=new u("symbol-package",{fontCharacter:"\\ea8b"}),u.symbolNamespace=new u("symbol-namespace",{fontCharacter:"\\ea8b"}),u.symbolObject=new u("symbol-object",{fontCharacter:"\\ea8b"}),u.symbolMethod=new u("symbol-method",{fontCharacter:"\\ea8c"}),u.symbolFunction=new u("symbol-function",{fontCharacter:"\\ea8c"}),u.symbolConstructor=new u("symbol-constructor",{fontCharacter:"\\ea8c"}),u.symbolBoolean=new u("symbol-boolean",{fontCharacter:"\\ea8f"}),u.symbolNull=new u("symbol-null",{fontCharacter:"\\ea8f"}),u.symbolNumeric=new u("symbol-numeric",{fontCharacter:"\\ea90"}),u.symbolNumber=new u("symbol-number",{fontCharacter:"\\ea90"}),u.symbolStructure=new u("symbol-structure",{fontCharacter:"\\ea91"}),u.symbolStruct=new u("symbol-struct",{fontCharacter:"\\ea91"}),u.symbolParameter=new u("symbol-parameter",{fontCharacter:"\\ea92"}),u.symbolTypeParameter=new u("symbol-type-parameter",{fontCharacter:"\\ea92"}),u.symbolKey=new u("symbol-key",{fontCharacter:"\\ea93"}),u.symbolText=new u("symbol-text",{fontCharacter:"\\ea93"}),u.symbolReference=new u("symbol-reference",{fontCharacter:"\\ea94"}),u.goToFile=new u("go-to-file",{fontCharacter:"\\ea94"}),u.symbolEnum=new u("symbol-enum",{fontCharacter:"\\ea95"}),u.symbolValue=new u("symbol-value",{fontCharacter:"\\ea95"}),u.symbolRuler=new u("symbol-ruler",{fontCharacter:"\\ea96"}),u.symbolUnit=new u("symbol-unit",{fontCharacter:"\\ea96"}),u.activateBreakpoints=new u("activate-breakpoints",{fontCharacter:"\\ea97"}),u.archive=new u("archive",{fontCharacter:"\\ea98"}),u.arrowBoth=new u("arrow-both",{fontCharacter:"\\ea99"}),u.arrowDown=new u("arrow-down",{fontCharacter:"\\ea9a"}),u.arrowLeft=new u("arrow-left",{fontCharacter:"\\ea9b"}),u.arrowRight=new u("arrow-right",{fontCharacter:"\\ea9c"}),u.arrowSmallDown=new u("arrow-small-down",{fontCharacter:"\\ea9d"}),u.arrowSmallLeft=new u("arrow-small-left",{fontCharacter:"\\ea9e"}),u.arrowSmallRight=new u("arrow-small-right",{fontCharacter:"\\ea9f"}),u.arrowSmallUp=new u("arrow-small-up",{fontCharacter:"\\eaa0"}),u.arrowUp=new u("arrow-up",{fontCharacter:"\\eaa1"}),u.bell=new u("bell",{fontCharacter:"\\eaa2"}),u.bold=new u("bold",{fontCharacter:"\\eaa3"}),u.book=new u("book",{fontCharacter:"\\eaa4"}),u.bookmark=new u("bookmark",{fontCharacter:"\\eaa5"}),u.debugBreakpointConditionalUnverified=new u("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),u.debugBreakpointConditional=new u("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),u.debugBreakpointConditionalDisabled=new u("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),u.debugBreakpointDataUnverified=new u("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),u.debugBreakpointData=new u("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),u.debugBreakpointDataDisabled=new u("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),u.debugBreakpointLogUnverified=new u("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),u.debugBreakpointLog=new u("debug-breakpoint-log",{fontCharacter:"\\eaab"}),u.debugBreakpointLogDisabled=new u("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),u.briefcase=new u("briefcase",{fontCharacter:"\\eaac"}),u.broadcast=new u("broadcast",{fontCharacter:"\\eaad"}),u.browser=new u("browser",{fontCharacter:"\\eaae"}),u.bug=new u("bug",{fontCharacter:"\\eaaf"}),u.calendar=new u("calendar",{fontCharacter:"\\eab0"}),u.caseSensitive=new u("case-sensitive",{fontCharacter:"\\eab1"}),u.check=new u("check",{fontCharacter:"\\eab2"}),u.checklist=new u("checklist",{fontCharacter:"\\eab3"}),u.chevronDown=new u("chevron-down",{fontCharacter:"\\eab4"}),u.dropDownButton=new u("drop-down-button",u.chevronDown.definition),u.chevronLeft=new u("chevron-left",{fontCharacter:"\\eab5"}),u.chevronRight=new u("chevron-right",{fontCharacter:"\\eab6"}),u.chevronUp=new u("chevron-up",{fontCharacter:"\\eab7"}),u.chromeClose=new u("chrome-close",{fontCharacter:"\\eab8"}),u.chromeMaximize=new u("chrome-maximize",{fontCharacter:"\\eab9"}),u.chromeMinimize=new u("chrome-minimize",{fontCharacter:"\\eaba"}),u.chromeRestore=new u("chrome-restore",{fontCharacter:"\\eabb"}),u.circleOutline=new u("circle-outline",{fontCharacter:"\\eabc"}),u.debugBreakpointUnverified=new u("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),u.circleSlash=new u("circle-slash",{fontCharacter:"\\eabd"}),u.circuitBoard=new u("circuit-board",{fontCharacter:"\\eabe"}),u.clearAll=new u("clear-all",{fontCharacter:"\\eabf"}),u.clippy=new u("clippy",{fontCharacter:"\\eac0"}),u.closeAll=new u("close-all",{fontCharacter:"\\eac1"}),u.cloudDownload=new u("cloud-download",{fontCharacter:"\\eac2"}),u.cloudUpload=new u("cloud-upload",{fontCharacter:"\\eac3"}),u.code=new u("code",{fontCharacter:"\\eac4"}),u.collapseAll=new u("collapse-all",{fontCharacter:"\\eac5"}),u.colorMode=new u("color-mode",{fontCharacter:"\\eac6"}),u.commentDiscussion=new u("comment-discussion",{fontCharacter:"\\eac7"}),u.compareChanges=new u("compare-changes",{fontCharacter:"\\eafd"}),u.creditCard=new u("credit-card",{fontCharacter:"\\eac9"}),u.dash=new u("dash",{fontCharacter:"\\eacc"}),u.dashboard=new u("dashboard",{fontCharacter:"\\eacd"}),u.database=new u("database",{fontCharacter:"\\eace"}),u.debugContinue=new u("debug-continue",{fontCharacter:"\\eacf"}),u.debugDisconnect=new u("debug-disconnect",{fontCharacter:"\\ead0"}),u.debugPause=new u("debug-pause",{fontCharacter:"\\ead1"}),u.debugRestart=new u("debug-restart",{fontCharacter:"\\ead2"}),u.debugStart=new u("debug-start",{fontCharacter:"\\ead3"}),u.debugStepInto=new u("debug-step-into",{fontCharacter:"\\ead4"}),u.debugStepOut=new u("debug-step-out",{fontCharacter:"\\ead5"}),u.debugStepOver=new u("debug-step-over",{fontCharacter:"\\ead6"}),u.debugStop=new u("debug-stop",{fontCharacter:"\\ead7"}),u.debug=new u("debug",{fontCharacter:"\\ead8"}),u.deviceCameraVideo=new u("device-camera-video",{fontCharacter:"\\ead9"}),u.deviceCamera=new u("device-camera",{fontCharacter:"\\eada"}),u.deviceMobile=new u("device-mobile",{fontCharacter:"\\eadb"}),u.diffAdded=new u("diff-added",{fontCharacter:"\\eadc"}),u.diffIgnored=new u("diff-ignored",{fontCharacter:"\\eadd"}),u.diffModified=new u("diff-modified",{fontCharacter:"\\eade"}),u.diffRemoved=new u("diff-removed",{fontCharacter:"\\eadf"}),u.diffRenamed=new u("diff-renamed",{fontCharacter:"\\eae0"}),u.diff=new u("diff",{fontCharacter:"\\eae1"}),u.discard=new u("discard",{fontCharacter:"\\eae2"}),u.editorLayout=new u("editor-layout",{fontCharacter:"\\eae3"}),u.emptyWindow=new u("empty-window",{fontCharacter:"\\eae4"}),u.exclude=new u("exclude",{fontCharacter:"\\eae5"}),u.extensions=new u("extensions",{fontCharacter:"\\eae6"}),u.eyeClosed=new u("eye-closed",{fontCharacter:"\\eae7"}),u.fileBinary=new u("file-binary",{fontCharacter:"\\eae8"}),u.fileCode=new u("file-code",{fontCharacter:"\\eae9"}),u.fileMedia=new u("file-media",{fontCharacter:"\\eaea"}),u.filePdf=new u("file-pdf",{fontCharacter:"\\eaeb"}),u.fileSubmodule=new u("file-submodule",{fontCharacter:"\\eaec"}),u.fileSymlinkDirectory=new u("file-symlink-directory",{fontCharacter:"\\eaed"}),u.fileSymlinkFile=new u("file-symlink-file",{fontCharacter:"\\eaee"}),u.fileZip=new u("file-zip",{fontCharacter:"\\eaef"}),u.files=new u("files",{fontCharacter:"\\eaf0"}),u.filter=new u("filter",{fontCharacter:"\\eaf1"}),u.flame=new u("flame",{fontCharacter:"\\eaf2"}),u.foldDown=new u("fold-down",{fontCharacter:"\\eaf3"}),u.foldUp=new u("fold-up",{fontCharacter:"\\eaf4"}),u.fold=new u("fold",{fontCharacter:"\\eaf5"}),u.folderActive=new u("folder-active",{fontCharacter:"\\eaf6"}),u.folderOpened=new u("folder-opened",{fontCharacter:"\\eaf7"}),u.gear=new u("gear",{fontCharacter:"\\eaf8"}),u.gift=new u("gift",{fontCharacter:"\\eaf9"}),u.gistSecret=new u("gist-secret",{fontCharacter:"\\eafa"}),u.gist=new u("gist",{fontCharacter:"\\eafb"}),u.gitCommit=new u("git-commit",{fontCharacter:"\\eafc"}),u.gitCompare=new u("git-compare",{fontCharacter:"\\eafd"}),u.gitMerge=new u("git-merge",{fontCharacter:"\\eafe"}),u.githubAction=new u("github-action",{fontCharacter:"\\eaff"}),u.githubAlt=new u("github-alt",{fontCharacter:"\\eb00"}),u.globe=new u("globe",{fontCharacter:"\\eb01"}),u.grabber=new u("grabber",{fontCharacter:"\\eb02"}),u.graph=new u("graph",{fontCharacter:"\\eb03"}),u.gripper=new u("gripper",{fontCharacter:"\\eb04"}),u.heart=new u("heart",{fontCharacter:"\\eb05"}),u.home=new u("home",{fontCharacter:"\\eb06"}),u.horizontalRule=new u("horizontal-rule",{fontCharacter:"\\eb07"}),u.hubot=new u("hubot",{fontCharacter:"\\eb08"}),u.inbox=new u("inbox",{fontCharacter:"\\eb09"}),u.issueClosed=new u("issue-closed",{fontCharacter:"\\eba4"}),u.issueReopened=new u("issue-reopened",{fontCharacter:"\\eb0b"}),u.issues=new u("issues",{fontCharacter:"\\eb0c"}),u.italic=new u("italic",{fontCharacter:"\\eb0d"}),u.jersey=new u("jersey",{fontCharacter:"\\eb0e"}),u.json=new u("json",{fontCharacter:"\\eb0f"}),u.kebabVertical=new u("kebab-vertical",{fontCharacter:"\\eb10"}),u.key=new u("key",{fontCharacter:"\\eb11"}),u.law=new u("law",{fontCharacter:"\\eb12"}),u.lightbulbAutofix=new u("lightbulb-autofix",{fontCharacter:"\\eb13"}),u.linkExternal=new u("link-external",{fontCharacter:"\\eb14"}),u.link=new u("link",{fontCharacter:"\\eb15"}),u.listOrdered=new u("list-ordered",{fontCharacter:"\\eb16"}),u.listUnordered=new u("list-unordered",{fontCharacter:"\\eb17"}),u.liveShare=new u("live-share",{fontCharacter:"\\eb18"}),u.loading=new u("loading",{fontCharacter:"\\eb19"}),u.location=new u("location",{fontCharacter:"\\eb1a"}),u.mailRead=new u("mail-read",{fontCharacter:"\\eb1b"}),u.mail=new u("mail",{fontCharacter:"\\eb1c"}),u.markdown=new u("markdown",{fontCharacter:"\\eb1d"}),u.megaphone=new u("megaphone",{fontCharacter:"\\eb1e"}),u.mention=new u("mention",{fontCharacter:"\\eb1f"}),u.milestone=new u("milestone",{fontCharacter:"\\eb20"}),u.mortarBoard=new u("mortar-board",{fontCharacter:"\\eb21"}),u.move=new u("move",{fontCharacter:"\\eb22"}),u.multipleWindows=new u("multiple-windows",{fontCharacter:"\\eb23"}),u.mute=new u("mute",{fontCharacter:"\\eb24"}),u.noNewline=new u("no-newline",{fontCharacter:"\\eb25"}),u.note=new u("note",{fontCharacter:"\\eb26"}),u.octoface=new u("octoface",{fontCharacter:"\\eb27"}),u.openPreview=new u("open-preview",{fontCharacter:"\\eb28"}),u.package_=new u("package",{fontCharacter:"\\eb29"}),u.paintcan=new u("paintcan",{fontCharacter:"\\eb2a"}),u.pin=new u("pin",{fontCharacter:"\\eb2b"}),u.play=new u("play",{fontCharacter:"\\eb2c"}),u.run=new u("run",{fontCharacter:"\\eb2c"}),u.plug=new u("plug",{fontCharacter:"\\eb2d"}),u.preserveCase=new u("preserve-case",{fontCharacter:"\\eb2e"}),u.preview=new u("preview",{fontCharacter:"\\eb2f"}),u.project=new u("project",{fontCharacter:"\\eb30"}),u.pulse=new u("pulse",{fontCharacter:"\\eb31"}),u.question=new u("question",{fontCharacter:"\\eb32"}),u.quote=new u("quote",{fontCharacter:"\\eb33"}),u.radioTower=new u("radio-tower",{fontCharacter:"\\eb34"}),u.reactions=new u("reactions",{fontCharacter:"\\eb35"}),u.references=new u("references",{fontCharacter:"\\eb36"}),u.refresh=new u("refresh",{fontCharacter:"\\eb37"}),u.regex=new u("regex",{fontCharacter:"\\eb38"}),u.remoteExplorer=new u("remote-explorer",{fontCharacter:"\\eb39"}),u.remote=new u("remote",{fontCharacter:"\\eb3a"}),u.remove=new u("remove",{fontCharacter:"\\eb3b"}),u.replaceAll=new u("replace-all",{fontCharacter:"\\eb3c"}),u.replace=new u("replace",{fontCharacter:"\\eb3d"}),u.repoClone=new u("repo-clone",{fontCharacter:"\\eb3e"}),u.repoForcePush=new u("repo-force-push",{fontCharacter:"\\eb3f"}),u.repoPull=new u("repo-pull",{fontCharacter:"\\eb40"}),u.repoPush=new u("repo-push",{fontCharacter:"\\eb41"}),u.report=new u("report",{fontCharacter:"\\eb42"}),u.requestChanges=new u("request-changes",{fontCharacter:"\\eb43"}),u.rocket=new u("rocket",{fontCharacter:"\\eb44"}),u.rootFolderOpened=new u("root-folder-opened",{fontCharacter:"\\eb45"}),u.rootFolder=new u("root-folder",{fontCharacter:"\\eb46"}),u.rss=new u("rss",{fontCharacter:"\\eb47"}),u.ruby=new u("ruby",{fontCharacter:"\\eb48"}),u.saveAll=new u("save-all",{fontCharacter:"\\eb49"}),u.saveAs=new u("save-as",{fontCharacter:"\\eb4a"}),u.save=new u("save",{fontCharacter:"\\eb4b"}),u.screenFull=new u("screen-full",{fontCharacter:"\\eb4c"}),u.screenNormal=new u("screen-normal",{fontCharacter:"\\eb4d"}),u.searchStop=new u("search-stop",{fontCharacter:"\\eb4e"}),u.server=new u("server",{fontCharacter:"\\eb50"}),u.settingsGear=new u("settings-gear",{fontCharacter:"\\eb51"}),u.settings=new u("settings",{fontCharacter:"\\eb52"}),u.shield=new u("shield",{fontCharacter:"\\eb53"}),u.smiley=new u("smiley",{fontCharacter:"\\eb54"}),u.sortPrecedence=new u("sort-precedence",{fontCharacter:"\\eb55"}),u.splitHorizontal=new u("split-horizontal",{fontCharacter:"\\eb56"}),u.splitVertical=new u("split-vertical",{fontCharacter:"\\eb57"}),u.squirrel=new u("squirrel",{fontCharacter:"\\eb58"}),u.starFull=new u("star-full",{fontCharacter:"\\eb59"}),u.starHalf=new u("star-half",{fontCharacter:"\\eb5a"}),u.symbolClass=new u("symbol-class",{fontCharacter:"\\eb5b"}),u.symbolColor=new u("symbol-color",{fontCharacter:"\\eb5c"}),u.symbolConstant=new u("symbol-constant",{fontCharacter:"\\eb5d"}),u.symbolEnumMember=new u("symbol-enum-member",{fontCharacter:"\\eb5e"}),u.symbolField=new u("symbol-field",{fontCharacter:"\\eb5f"}),u.symbolFile=new u("symbol-file",{fontCharacter:"\\eb60"}),u.symbolInterface=new u("symbol-interface",{fontCharacter:"\\eb61"}),u.symbolKeyword=new u("symbol-keyword",{fontCharacter:"\\eb62"}),u.symbolMisc=new u("symbol-misc",{fontCharacter:"\\eb63"}),u.symbolOperator=new u("symbol-operator",{fontCharacter:"\\eb64"}),u.symbolProperty=new u("symbol-property",{fontCharacter:"\\eb65"}),u.wrench=new u("wrench",{fontCharacter:"\\eb65"}),u.wrenchSubaction=new u("wrench-subaction",{fontCharacter:"\\eb65"}),u.symbolSnippet=new u("symbol-snippet",{fontCharacter:"\\eb66"}),u.tasklist=new u("tasklist",{fontCharacter:"\\eb67"}),u.telescope=new u("telescope",{fontCharacter:"\\eb68"}),u.textSize=new u("text-size",{fontCharacter:"\\eb69"}),u.threeBars=new u("three-bars",{fontCharacter:"\\eb6a"}),u.thumbsdown=new u("thumbsdown",{fontCharacter:"\\eb6b"}),u.thumbsup=new u("thumbsup",{fontCharacter:"\\eb6c"}),u.tools=new u("tools",{fontCharacter:"\\eb6d"}),u.triangleDown=new u("triangle-down",{fontCharacter:"\\eb6e"}),u.triangleLeft=new u("triangle-left",{fontCharacter:"\\eb6f"}),u.triangleRight=new u("triangle-right",{fontCharacter:"\\eb70"}),u.triangleUp=new u("triangle-up",{fontCharacter:"\\eb71"}),u.twitter=new u("twitter",{fontCharacter:"\\eb72"}),u.unfold=new u("unfold",{fontCharacter:"\\eb73"}),u.unlock=new u("unlock",{fontCharacter:"\\eb74"}),u.unmute=new u("unmute",{fontCharacter:"\\eb75"}),u.unverified=new u("unverified",{fontCharacter:"\\eb76"}),u.verified=new u("verified",{fontCharacter:"\\eb77"}),u.versions=new u("versions",{fontCharacter:"\\eb78"}),u.vmActive=new u("vm-active",{fontCharacter:"\\eb79"}),u.vmOutline=new u("vm-outline",{fontCharacter:"\\eb7a"}),u.vmRunning=new u("vm-running",{fontCharacter:"\\eb7b"}),u.watch=new u("watch",{fontCharacter:"\\eb7c"}),u.whitespace=new u("whitespace",{fontCharacter:"\\eb7d"}),u.wholeWord=new u("whole-word",{fontCharacter:"\\eb7e"}),u.window=new u("window",{fontCharacter:"\\eb7f"}),u.wordWrap=new u("word-wrap",{fontCharacter:"\\eb80"}),u.zoomIn=new u("zoom-in",{fontCharacter:"\\eb81"}),u.zoomOut=new u("zoom-out",{fontCharacter:"\\eb82"}),u.listFilter=new u("list-filter",{fontCharacter:"\\eb83"}),u.listFlat=new u("list-flat",{fontCharacter:"\\eb84"}),u.listSelection=new u("list-selection",{fontCharacter:"\\eb85"}),u.selection=new u("selection",{fontCharacter:"\\eb85"}),u.listTree=new u("list-tree",{fontCharacter:"\\eb86"}),u.debugBreakpointFunctionUnverified=new u("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),u.debugBreakpointFunction=new u("debug-breakpoint-function",{fontCharacter:"\\eb88"}),u.debugBreakpointFunctionDisabled=new u("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),u.debugStackframeActive=new u("debug-stackframe-active",{fontCharacter:"\\eb89"}),u.debugStackframeDot=new u("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),u.debugStackframe=new u("debug-stackframe",{fontCharacter:"\\eb8b"}),u.debugStackframeFocused=new u("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),u.debugBreakpointUnsupported=new u("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),u.symbolString=new u("symbol-string",{fontCharacter:"\\eb8d"}),u.debugReverseContinue=new u("debug-reverse-continue",{fontCharacter:"\\eb8e"}),u.debugStepBack=new u("debug-step-back",{fontCharacter:"\\eb8f"}),u.debugRestartFrame=new u("debug-restart-frame",{fontCharacter:"\\eb90"}),u.callIncoming=new u("call-incoming",{fontCharacter:"\\eb92"}),u.callOutgoing=new u("call-outgoing",{fontCharacter:"\\eb93"}),u.menu=new u("menu",{fontCharacter:"\\eb94"}),u.expandAll=new u("expand-all",{fontCharacter:"\\eb95"}),u.feedback=new u("feedback",{fontCharacter:"\\eb96"}),u.groupByRefType=new u("group-by-ref-type",{fontCharacter:"\\eb97"}),u.ungroupByRefType=new u("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),u.account=new u("account",{fontCharacter:"\\eb99"}),u.bellDot=new u("bell-dot",{fontCharacter:"\\eb9a"}),u.debugConsole=new u("debug-console",{fontCharacter:"\\eb9b"}),u.library=new u("library",{fontCharacter:"\\eb9c"}),u.output=new u("output",{fontCharacter:"\\eb9d"}),u.runAll=new u("run-all",{fontCharacter:"\\eb9e"}),u.syncIgnored=new u("sync-ignored",{fontCharacter:"\\eb9f"}),u.pinned=new u("pinned",{fontCharacter:"\\eba0"}),u.githubInverted=new u("github-inverted",{fontCharacter:"\\eba1"}),u.debugAlt=new u("debug-alt",{fontCharacter:"\\eb91"}),u.serverProcess=new u("server-process",{fontCharacter:"\\eba2"}),u.serverEnvironment=new u("server-environment",{fontCharacter:"\\eba3"}),u.pass=new u("pass",{fontCharacter:"\\eba4"}),u.stopCircle=new u("stop-circle",{fontCharacter:"\\eba5"}),u.playCircle=new u("play-circle",{fontCharacter:"\\eba6"}),u.record=new u("record",{fontCharacter:"\\eba7"}),u.debugAltSmall=new u("debug-alt-small",{fontCharacter:"\\eba8"}),u.vmConnect=new u("vm-connect",{fontCharacter:"\\eba9"}),u.cloud=new u("cloud",{fontCharacter:"\\ebaa"}),u.merge=new u("merge",{fontCharacter:"\\ebab"}),u.exportIcon=new u("export",{fontCharacter:"\\ebac"}),u.graphLeft=new u("graph-left",{fontCharacter:"\\ebad"}),u.magnet=new u("magnet",{fontCharacter:"\\ebae"}),u.notebook=new u("notebook",{fontCharacter:"\\ebaf"}),u.redo=new u("redo",{fontCharacter:"\\ebb0"}),u.checkAll=new u("check-all",{fontCharacter:"\\ebb1"}),u.pinnedDirty=new u("pinned-dirty",{fontCharacter:"\\ebb2"}),u.passFilled=new u("pass-filled",{fontCharacter:"\\ebb3"}),u.circleLargeFilled=new u("circle-large-filled",{fontCharacter:"\\ebb4"}),u.circleLargeOutline=new u("circle-large-outline",{fontCharacter:"\\ebb5"}),u.combine=new u("combine",{fontCharacter:"\\ebb6"}),u.gather=new u("gather",{fontCharacter:"\\ebb6"}),u.table=new u("table",{fontCharacter:"\\ebb7"}),u.variableGroup=new u("variable-group",{fontCharacter:"\\ebb8"}),u.typeHierarchy=new u("type-hierarchy",{fontCharacter:"\\ebb9"}),u.typeHierarchySub=new u("type-hierarchy-sub",{fontCharacter:"\\ebba"}),u.typeHierarchySuper=new u("type-hierarchy-super",{fontCharacter:"\\ebbb"}),u.gitPullRequestCreate=new u("git-pull-request-create",{fontCharacter:"\\ebbc"}),u.runAbove=new u("run-above",{fontCharacter:"\\ebbd"}),u.runBelow=new u("run-below",{fontCharacter:"\\ebbe"}),u.notebookTemplate=new u("notebook-template",{fontCharacter:"\\ebbf"}),u.debugRerun=new u("debug-rerun",{fontCharacter:"\\ebc0"}),u.workspaceTrusted=new u("workspace-trusted",{fontCharacter:"\\ebc1"}),u.workspaceUntrusted=new u("workspace-untrusted",{fontCharacter:"\\ebc2"}),u.workspaceUnspecified=new u("workspace-unspecified",{fontCharacter:"\\ebc3"}),u.terminalCmd=new u("terminal-cmd",{fontCharacter:"\\ebc4"}),u.terminalDebian=new u("terminal-debian",{fontCharacter:"\\ebc5"}),u.terminalLinux=new u("terminal-linux",{fontCharacter:"\\ebc6"}),u.terminalPowershell=new u("terminal-powershell",{fontCharacter:"\\ebc7"}),u.terminalTmux=new u("terminal-tmux",{fontCharacter:"\\ebc8"}),u.terminalUbuntu=new u("terminal-ubuntu",{fontCharacter:"\\ebc9"}),u.terminalBash=new u("terminal-bash",{fontCharacter:"\\ebca"}),u.arrowSwap=new u("arrow-swap",{fontCharacter:"\\ebcb"}),u.copy=new u("copy",{fontCharacter:"\\ebcc"}),u.personAdd=new u("person-add",{fontCharacter:"\\ebcd"}),u.filterFilled=new u("filter-filled",{fontCharacter:"\\ebce"}),u.wand=new u("wand",{fontCharacter:"\\ebcf"}),u.debugLineByLine=new u("debug-line-by-line",{fontCharacter:"\\ebd0"}),u.inspect=new u("inspect",{fontCharacter:"\\ebd1"}),u.layers=new u("layers",{fontCharacter:"\\ebd2"}),u.layersDot=new u("layers-dot",{fontCharacter:"\\ebd3"}),u.layersActive=new u("layers-active",{fontCharacter:"\\ebd4"}),u.compass=new u("compass",{fontCharacter:"\\ebd5"}),u.compassDot=new u("compass-dot",{fontCharacter:"\\ebd6"}),u.compassActive=new u("compass-active",{fontCharacter:"\\ebd7"}),u.azure=new u("azure",{fontCharacter:"\\ebd8"}),u.issueDraft=new u("issue-draft",{fontCharacter:"\\ebd9"}),u.gitPullRequestClosed=new u("git-pull-request-closed",{fontCharacter:"\\ebda"}),u.gitPullRequestDraft=new u("git-pull-request-draft",{fontCharacter:"\\ebdb"}),u.debugAll=new u("debug-all",{fontCharacter:"\\ebdc"}),u.debugCoverage=new u("debug-coverage",{fontCharacter:"\\ebdd"}),u.runErrors=new u("run-errors",{fontCharacter:"\\ebde"}),u.folderLibrary=new u("folder-library",{fontCharacter:"\\ebdf"}),u.debugContinueSmall=new u("debug-continue-small",{fontCharacter:"\\ebe0"}),u.beakerStop=new u("beaker-stop",{fontCharacter:"\\ebe1"}),u.graphLine=new u("graph-line",{fontCharacter:"\\ebe2"}),u.graphScatter=new u("graph-scatter",{fontCharacter:"\\ebe3"}),u.pieChart=new u("pie-chart",{fontCharacter:"\\ebe4"}),u.bracket=new u("bracket",u.json.definition),u.bracketDot=new u("bracket-dot",{fontCharacter:"\\ebe5"}),u.bracketError=new u("bracket-error",{fontCharacter:"\\ebe6"}),u.lockSmall=new u("lock-small",{fontCharacter:"\\ebe7"}),u.azureDevops=new u("azure-devops",{fontCharacter:"\\ebe8"}),u.verifiedFilled=new u("verified-filled",{fontCharacter:"\\ebe9"})}(we||(we={}))},79881:function($t,dt,ie){"use strict";ie.d(dt,{B8:function(){return $},Cp:function(){return ge},F0:function(){return fe},L6:function(){return he},VV:function(){return we},b1:function(){return u},dL:function(){return Ze},ri:function(){return ne}});class F{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(k){setTimeout(()=>{throw k.stack?new Error(k.message+`
|
|
|
|
`+k.stack):k},0)}}emit(k){this.listeners.forEach(A=>{A(k)})}onUnexpectedError(k){this.unexpectedErrorHandler(k),this.emit(k)}onUnexpectedExternalError(k){this.unexpectedErrorHandler(k)}}const Le=new F;function Ze(b){we(b)||Le.onUnexpectedError(b)}function ge(b){we(b)||Le.onUnexpectedExternalError(b)}function ne(b){if(b instanceof Error){let{name:k,message:A}=b;const C=b.stacktrace||b.stack;return{$isError:!0,name:k,message:A,stack:C}}return b}const v="Canceled";function we(b){return b instanceof Error&&b.name===v&&b.message===v}function fe(){const b=new Error(v);return b.name=b.message,b}function u(b){return b?new Error(`Illegal argument: ${b}`):new Error("Illegal argument")}function he(b){return b?new Error(`Illegal state: ${b}`):new Error("Illegal state")}class $ extends Error{constructor(k){super("NotSupported"),k&&(this.message=k)}}},4348:function($t,dt,ie){"use strict";ie.d(dt,{D0:function(){return $},E7:function(){return b},K3:function(){return he},Q5:function(){return u},ZD:function(){return k},ju:function(){return ne}});var F=ie(79881),Le=ie(69323),Ze=ie(34502),ge=ie(95830),ne;(function(A){A.None=()=>Le.JT.None;function C(Y){return(te,ve=null,ae)=>{let S=!1,E;return E=Y(z=>{if(!S)return E?E.dispose():S=!0,te.call(ve,z)},null,ae),S&&E.dispose(),E}}A.once=C;function K(Y,te){return ue((ve,ae=null,S)=>Y(E=>ve.call(ae,te(E)),null,S))}A.map=K;function Z(Y,te){return ue((ve,ae=null,S)=>Y(E=>{te(E),ve.call(ae,E)},null,S))}A.forEach=Z;function U(Y,te){return ue((ve,ae=null,S)=>Y(E=>te(E)&&ve.call(ae,E),null,S))}A.filter=U;function M(Y){return Y}A.signal=M;function J(...Y){return(te,ve=null,ae)=>(0,Le.F8)(...Y.map(S=>S(E=>te.call(ve,E),null,ae)))}A.any=J;function de(Y,te,ve){let ae=ve;return K(Y,S=>(ae=te(ae,S),ae))}A.reduce=de;function ue(Y){let te;const ve=new u({onFirstListenerAdd(){te=Y(ve.fire,ve)},onLastListenerRemove(){te.dispose()}});return ve.event}function be(Y,te,ve=100,ae=!1,S){let E,z,ce,qe=0;const Xe=new u({leakWarningThreshold:S,onFirstListenerAdd(){E=Y(tt=>{qe++,z=te(z,tt),ae&&!ce&&(Xe.fire(z),z=void 0),clearTimeout(ce),ce=setTimeout(()=>{const gt=z;z=void 0,ce=void 0,(!ae||qe>1)&&Xe.fire(gt),qe=0},ve)})},onLastListenerRemove(){E.dispose()}});return Xe.event}A.debounce=be;function Ie(Y,te=(ve,ae)=>ve===ae){let ve=!0,ae;return U(Y,S=>{const E=ve||!te(S,ae);return ve=!1,ae=S,E})}A.latch=Ie;function ye(Y,te){return[A.filter(Y,te),A.filter(Y,ve=>!te(ve))]}A.split=ye;function xe(Y,te=!1,ve=[]){let ae=ve.slice(),S=Y(ce=>{ae?ae.push(ce):z.fire(ce)});const E=()=>{ae&&ae.forEach(ce=>z.fire(ce)),ae=null},z=new u({onFirstListenerAdd(){S||(S=Y(ce=>z.fire(ce)))},onFirstListenerDidAdd(){ae&&(te?setTimeout(E):E())},onLastListenerRemove(){S&&S.dispose(),S=null}});return z.event}A.buffer=xe;class $e{constructor(te){this.event=te}map(te){return new $e(K(this.event,te))}forEach(te){return new $e(Z(this.event,te))}filter(te){return new $e(U(this.event,te))}reduce(te,ve){return new $e(de(this.event,te,ve))}latch(){return new $e(Ie(this.event))}debounce(te,ve=100,ae=!1,S){return new $e(be(this.event,te,ve,ae,S))}on(te,ve,ae){return this.event(te,ve,ae)}once(te,ve,ae){return C(this.event)(te,ve,ae)}}function Oe(Y){return new $e(Y)}A.chain=Oe;function He(Y,te,ve=ae=>ae){const ae=(...ce)=>z.fire(ve(...ce)),S=()=>Y.on(te,ae),E=()=>Y.removeListener(te,ae),z=new u({onFirstListenerAdd:S,onLastListenerRemove:E});return z.event}A.fromNodeEventEmitter=He;function Q(Y,te,ve=ae=>ae){const ae=(...ce)=>z.fire(ve(...ce)),S=()=>Y.addEventListener(te,ae),E=()=>Y.removeEventListener(te,ae),z=new u({onFirstListenerAdd:S,onLastListenerRemove:E});return z.event}A.fromDOMEventEmitter=Q;function G(Y){return new Promise(te=>C(Y)(te))}A.toPromise=G})(ne||(ne={}));class v{constructor(C){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${C}_${v._idPool++}`}start(C){this._stopWatch=new ge.G(!0),this._listenerCount=C}stop(){if(this._stopWatch){const C=this._stopWatch.elapsed();this._elapsedOverall+=C,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${C.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}v._idPool=0;let we=-1;class fe{constructor(C,K=Math.random().toString(18).slice(2,5)){this.customThreshold=C,this.name=K,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(C){let K=we;if(typeof this.customThreshold=="number"&&(K=this.customThreshold),K<=0||C<K)return;this._stacks||(this._stacks=new Map);const Z=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),U=this._stacks.get(Z)||0;if(this._stacks.set(Z,U+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=K*.5;let M,J=0;for(const[de,ue]of this._stacks)(!M||J<ue)&&(M=de,J=ue);console.warn(`[${this.name}] potential listener LEAK detected, having ${C} listeners already. MOST frequent listener (${J}):`),console.warn(M)}return()=>{const M=this._stacks.get(Z)||0;this._stacks.set(Z,M-1)}}}class u{constructor(C){var K;this._disposed=!1,this._options=C,this._leakageMon=we>0?new fe(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((K=this._options)===null||K===void 0)&&K._profName?new v(this._options._profName):void 0}get event(){return this._event||(this._event=(C,K,Z)=>{var U;this._listeners||(this._listeners=new Ze.S);const M=this._listeners.isEmpty();M&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const J=this._listeners.push(K?[C,K]:C);M&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,C,K);const de=(U=this._leakageMon)===null||U===void 0?void 0:U.check(this._listeners.size),ue=(0,Le.OF)(()=>{de&&de(),this._disposed||(J(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return Z instanceof Le.SL?Z.add(ue):Array.isArray(Z)&&Z.push(ue),ue}),this._event}fire(C){var K,Z;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ze.S);for(let U of this._listeners)this._deliveryQueue.push([U,C]);for((K=this._perfMon)===null||K===void 0||K.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[U,M]=this._deliveryQueue.shift();try{typeof U=="function"?U.call(void 0,M):U[0].call(U[1],M)}catch(J){(0,F.dL)(J)}}(Z=this._perfMon)===null||Z===void 0||Z.stop()}}dispose(){var C,K,Z,U,M;this._disposed||(this._disposed=!0,(C=this._listeners)===null||C===void 0||C.clear(),(K=this._deliveryQueue)===null||K===void 0||K.clear(),(U=(Z=this._options)===null||Z===void 0?void 0:Z.onLastListenerRemove)===null||U===void 0||U.call(Z),(M=this._leakageMon)===null||M===void 0||M.dispose())}}class he extends u{constructor(C){super(C),this._isPaused=0,this._eventQueue=new Ze.S,this._mergeFn=C==null?void 0:C.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const C=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(C))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(C){this._listeners&&(this._isPaused!==0?this._eventQueue.push(C):super.fire(C))}}class $ extends he{constructor(C){var K;super(C),this._delay=(K=C.delay)!==null&&K!==void 0?K:100}fire(C){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(C)}}class b{constructor(){this.buffers=[]}wrapEvent(C){return(K,Z,U)=>C(M=>{const J=this.buffers[this.buffers.length-1];J?J.push(()=>K.call(Z,M)):K.call(Z,M)},void 0,U)}bufferEvents(C){const K=[];this.buffers.push(K);const Z=C();return this.buffers.pop(),K.forEach(U=>U()),Z}}class k{constructor(){this.listening=!1,this.inputEvent=ne.None,this.inputEventListener=Le.JT.None,this.emitter=new u({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(C){this.inputEvent=C,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=C(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function($t,dt,ie){"use strict";ie.d(dt,{I:function(){return F}});function F(Le){const Ze=this;let ge=!1,ne;return function(){return ge||(ge=!0,ne=Le.apply(Ze,arguments)),ne}}},88226:function($t,dt,ie){"use strict";ie.d(dt,{$:function(){return F}});var F;(function(Le){function Ze(J){return J&&typeof J=="object"&&typeof J[Symbol.iterator]=="function"}Le.is=Ze;const ge=Object.freeze([]);function ne(){return ge}Le.empty=ne;function*v(J){yield J}Le.single=v;function we(J){return J||ge}Le.from=we;function fe(J){return!J||J[Symbol.iterator]().next().done===!0}Le.isEmpty=fe;function u(J){return J[Symbol.iterator]().next().value}Le.first=u;function he(J,de){for(const ue of J)if(de(ue))return!0;return!1}Le.some=he;function $(J,de){for(const ue of J)if(de(ue))return ue}Le.find=$;function*b(J,de){for(const ue of J)de(ue)&&(yield ue)}Le.filter=b;function*k(J,de){let ue=0;for(const be of J)yield de(be,ue++)}Le.map=k;function*A(...J){for(const de of J)for(const ue of de)yield ue}Le.concat=A;function*C(J){for(const de of J)for(const ue of de)yield ue}Le.concatNested=C;function K(J,de,ue){let be=ue;for(const Ie of J)be=de(be,Ie);return be}Le.reduce=K;function*Z(J,de,ue=J.length){for(de<0&&(de+=J.length),ue<0?ue+=J.length:ue>J.length&&(ue=J.length);de<ue;de++)yield J[de]}Le.slice=Z;function U(J,de=Number.POSITIVE_INFINITY){const ue=[];if(de===0)return[ue,J];const be=J[Symbol.iterator]();for(let Ie=0;Ie<de;Ie++){const ye=be.next();if(ye.done)return[ue,Le.empty()];ue.push(ye.value)}return[ue,{[Symbol.iterator](){return be}}]}Le.consume=U;function M(J,de,ue=(be,Ie)=>be===Ie){const be=J[Symbol.iterator](),Ie=de[Symbol.iterator]();for(;;){const ye=be.next(),xe=Ie.next();if(ye.done!==xe.done)return!1;if(ye.done)return!0;if(!ue(ye.value,xe.value))return!1}}Le.equals=M})(F||(F={}))},69323:function($t,dt,ie){"use strict";ie.d(dt,{B9:function(){return k},F8:function(){return A},JT:function(){return Z},Jz:function(){return M},OF:function(){return C},SL:function(){return K},Wf:function(){return b},XK:function(){return U},dk:function(){return he}});var F=ie(17845),Le=ie(88226);const Ze=!1;let ge=null;function ne(J){ge=J}if(Ze){const J="__is_disposable_tracked__";ne(new class{trackDisposable(de){const ue=new Error("Potentially leaked disposable").stack;setTimeout(()=>{de[J]||console.log(ue)},3e3)}setParent(de,ue){if(de&&de!==Z.None)try{de[J]=!0}catch(be){}}markAsDisposed(de){if(de&&de!==Z.None)try{de[J]=!0}catch(ue){}}markAsSingleton(de){}})}function v(J){return ge==null||ge.trackDisposable(J),J}function we(J){ge==null||ge.markAsDisposed(J)}function fe(J,de){ge==null||ge.setParent(J,de)}function u(J,de){if(ge)for(const ue of J)ge.setParent(ue,de)}function he(J){return ge==null||ge.markAsSingleton(J),J}class $ extends Error{constructor(de){super(`Encountered errors while disposing of store. Errors: [${de.join(", ")}]`),this.errors=de}}function b(J){return typeof J.dispose=="function"&&J.dispose.length===0}function k(J){if(Le.$.is(J)){let de=[];for(const ue of J)if(ue)try{ue.dispose()}catch(be){de.push(be)}if(de.length===1)throw de[0];if(de.length>1)throw new $(de);return Array.isArray(J)?[]:J}else if(J)return J.dispose(),J}function A(...J){const de=C(()=>k(J));return u(J,de),de}function C(J){const de=v({dispose:(0,F.I)(()=>{we(de),J()})});return de}class K{constructor(){this._toDispose=new Set,this._isDisposed=!1,v(this)}dispose(){this._isDisposed||(we(this),this._isDisposed=!0,this.clear())}clear(){try{k(this._toDispose.values())}finally{this._toDispose.clear()}}add(de){if(!de)return de;if(de===this)throw new Error("Cannot register a disposable on itself!");return fe(de,this),this._isDisposed?K.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(de),de}}K.DISABLE_DISPOSED_WARNING=!1;class Z{constructor(){this._store=new K,v(this),fe(this._store,this)}dispose(){we(this),this._store.dispose()}_register(de){if(de===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(de)}}Z.None=Object.freeze({dispose(){}});class U{constructor(){this._isDisposed=!1,v(this)}get value(){return this._isDisposed?void 0:this._value}set value(de){var ue;this._isDisposed||de===this._value||((ue=this._value)===null||ue===void 0||ue.dispose(),de&&fe(de,this),this._value=de)}clear(){this.value=void 0}dispose(){var de;this._isDisposed=!0,we(this),(de=this._value)===null||de===void 0||de.dispose(),this._value=void 0}clearAndLeak(){const de=this._value;return this._value=void 0,de&&fe(de,null),de}}class M{constructor(de){this.object=de}dispose(){}}},34502:function($t,dt,ie){"use strict";ie.d(dt,{S:function(){return Le}});class F{constructor(ge){this.element=ge,this.next=F.Undefined,this.prev=F.Undefined}}F.Undefined=new F(void 0);class Le{constructor(){this._first=F.Undefined,this._last=F.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===F.Undefined}clear(){let ge=this._first;for(;ge!==F.Undefined;){const ne=ge.next;ge.prev=F.Undefined,ge.next=F.Undefined,ge=ne}this._first=F.Undefined,this._last=F.Undefined,this._size=0}unshift(ge){return this._insert(ge,!1)}push(ge){return this._insert(ge,!0)}_insert(ge,ne){const v=new F(ge);if(this._first===F.Undefined)this._first=v,this._last=v;else if(ne){const fe=this._last;this._last=v,v.prev=fe,fe.next=v}else{const fe=this._first;this._first=v,v.next=fe,fe.prev=v}this._size+=1;let we=!1;return()=>{we||(we=!0,this._remove(v))}}shift(){if(this._first!==F.Undefined){const ge=this._first.element;return this._remove(this._first),ge}}pop(){if(this._last!==F.Undefined){const ge=this._last.element;return this._remove(this._last),ge}}_remove(ge){if(ge.prev!==F.Undefined&&ge.next!==F.Undefined){const ne=ge.prev;ne.next=ge.next,ge.next.prev=ne}else ge.prev===F.Undefined&&ge.next===F.Undefined?(this._first=F.Undefined,this._last=F.Undefined):ge.next===F.Undefined?(this._last=this._last.prev,this._last.next=F.Undefined):ge.prev===F.Undefined&&(this._first=this._first.next,this._first.prev=F.Undefined);this._size-=1}*[Symbol.iterator](){let ge=this._first;for(;ge!==F.Undefined;)yield ge.element,ge=ge.next}}},23345:function($t,dt,ie){"use strict";ie.d(dt,{$L:function(){return be},ED:function(){return M},IJ:function(){return de},OS:function(){return $e},WE:function(){return ye},dz:function(){return J},gn:function(){return Ie},li:function(){return C},r:function(){return Q},tY:function(){return ue},xS:function(){return xe}});var F=ie(97671),Le;const Ze="en";let ge=!1,ne=!1,v=!1,we=!1,fe=!1,u=!1,he=!1,$,b=null,k=null,A;const C=typeof self=="object"?self:typeof ie.g=="object"?ie.g:{};let K;typeof C.vscode!="undefined"&&typeof C.vscode.process!="undefined"?K=C.vscode.process:typeof F!="undefined"&&(K=F);const Z=typeof((Le=K==null?void 0:K.versions)===null||Le===void 0?void 0:Le.electron)=="string"&&K.type==="renderer";if(typeof navigator=="object"&&!Z)A=navigator.userAgent,ge=A.indexOf("Windows")>=0,ne=A.indexOf("Macintosh")>=0,he=(A.indexOf("Macintosh")>=0||A.indexOf("iPad")>=0||A.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,v=A.indexOf("Linux")>=0,u=!0,$=navigator.language,b=$;else if(typeof K=="object"){ge=K.platform==="win32",ne=K.platform==="darwin",v=K.platform==="linux",we=v&&!!K.env.SNAP&&!!K.env.SNAP_REVISION,$=Ze,b=Ze;const G=K.env.VSCODE_NLS_CONFIG;if(G)try{const Y=JSON.parse(G),te=Y.availableLanguages["*"];$=Y.locale,b=te||Ze,k=Y._translationsConfigFile}catch(Y){}fe=!0}else console.error("Unable to resolve platform.");let U=0;ne?U=1:ge?U=3:v&&(U=2);const M=ge,J=ne,de=v,ue=fe,be=u,Ie=he,ye=A,xe=function(){if(C.setImmediate)return C.setImmediate.bind(C);if(typeof C.postMessage=="function"&&!C.importScripts){let te=[];C.addEventListener("message",ae=>{if(ae.data&&ae.data.vscodeSetImmediateId)for(let S=0,E=te.length;S<E;S++){const z=te[S];if(z.id===ae.data.vscodeSetImmediateId){te.splice(S,1),z.callback();return}}});let ve=0;return ae=>{const S=++ve;te.push({id:S,callback:ae}),C.postMessage({vscodeSetImmediateId:S},"*")}}if(typeof(K==null?void 0:K.nextTick)=="function")return K.nextTick.bind(K);const Y=Promise.resolve();return te=>Y.then(te)}(),$e=ne||he?2:ge?1:3;let Oe=!0,He=!1;function Q(){if(!He){He=!0;const G=new Uint8Array(2);G[0]=1,G[1]=2,Oe=new Uint16Array(G.buffer)[0]===513}return Oe}},95830:function($t,dt,ie){"use strict";ie.d(dt,{G:function(){return Ze}});var F=ie(23345);const Le=F.li.performance&&typeof F.li.performance.now=="function";class Ze{constructor(ne){this._highResolution=Le&&ne,this._startTime=this._now(),this._stopTime=-1}static create(ne=!0){return new Ze(ne)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?F.li.performance.now():Date.now()}}},82983:function($t,dt,ie){"use strict";ie.d(dt,{$i:function(){return qe},C8:function(){return ht},GF:function(){return $},HO:function(){return ve},IO:function(){return b},K7:function(){return Rt},Kw:function(){return Vt},LC:function(){return C},Mh:function(){return xe},P1:function(){return $e},PJ:function(){return St},Qe:function(){return Xe},R1:function(){return he},RP:function(){return z},S6:function(){return Wt},TT:function(){return M},Ut:function(){return S},V8:function(){return K},WU:function(){return Ze},YK:function(){return He},YU:function(){return ge},ZG:function(){return Oe},ZH:function(){return G},ab:function(){return tt},c1:function(){return at},df:function(){return be},ec:function(){return ne},fi:function(){return Nt},fy:function(){return v},j3:function(){return we},j_:function(){return de},m5:function(){return F},mK:function(){return ue},mr:function(){return k},oH:function(){return Ke},oL:function(){return fe},ok:function(){return ye},ow:function(){return Z},qq:function(){return Ie},qu:function(){return U},rL:function(){return Q},uS:function(){return Ct},un:function(){return u},uq:function(){return A},vH:function(){return te},xe:function(){return gt},zY:function(){return J}});function F(R){return!R||typeof R!="string"?!0:R.trim().length===0}const Le=/{(\d+)}/g;function Ze(R,...V){return V.length===0?R:R.replace(Le,function(ee,j){const W=parseInt(j,10);return isNaN(W)||W<0||W>=V.length?ee:V[W]})}function ge(R){return R.replace(/[<>&]/g,function(V){switch(V){case"<":return"<";case">":return">";case"&":return"&";default:return V}})}function ne(R){return R.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function v(R,V=" "){const ee=we(R,V);return fe(ee,V)}function we(R,V){if(!R||!V)return R;const ee=V.length;if(ee===0||R.length===0)return R;let j=0;for(;R.indexOf(V,j)===j;)j=j+ee;return R.substring(j)}function fe(R,V){if(!R||!V)return R;const ee=V.length,j=R.length;if(ee===0||j===0)return R;let W=j,ke=-1;for(;ke=R.lastIndexOf(V,W-1),!(ke===-1||ke+ee!==W);){if(ke===0)return"";W=ke}return R.substring(0,W)}function u(R){return R.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function he(R){return R.replace(/\*/g,"")}function $(R,V,ee={}){if(!R)throw new Error("Cannot create regex from empty string");V||(R=ne(R)),ee.wholeWord&&(/\B/.test(R.charAt(0))||(R="\\b"+R),/\B/.test(R.charAt(R.length-1))||(R=R+"\\b"));let j="";return ee.global&&(j+="g"),ee.matchCase||(j+="i"),ee.multiline&&(j+="m"),ee.unicode&&(j+="u"),new RegExp(R,j)}function b(R){return R.source==="^"||R.source==="^$"||R.source==="$"||R.source==="^\\s*$"?!1:!!(R.exec("")&&R.lastIndex===0)}function k(R){return(R.global?"g":"")+(R.ignoreCase?"i":"")+(R.multiline?"m":"")+(R.unicode?"u":"")}function A(R){return R.split(/\r\n|\r|\n/)}function C(R){for(let V=0,ee=R.length;V<ee;V++){const j=R.charCodeAt(V);if(j!==32&&j!==9)return V}return-1}function K(R,V=0,ee=R.length){for(let j=V;j<ee;j++){const W=R.charCodeAt(j);if(W!==32&&W!==9)return R.substring(V,j)}return R.substring(V,ee)}function Z(R,V=R.length-1){for(let ee=V;ee>=0;ee--){const j=R.charCodeAt(ee);if(j!==32&&j!==9)return ee}return-1}function U(R,V){return R<V?-1:R>V?1:0}function M(R,V,ee=0,j=R.length,W=0,ke=V.length){for(;ee<j&&W<ke;ee++,W++){let Ce=R.charCodeAt(ee),De=V.charCodeAt(W);if(Ce<De)return-1;if(Ce>De)return 1}const Pe=j-ee,Be=ke-W;return Pe<Be?-1:Pe>Be?1:0}function J(R,V){return de(R,V,0,R.length,0,V.length)}function de(R,V,ee=0,j=R.length,W=0,ke=V.length){for(;ee<j&&W<ke;ee++,W++){let Ce=R.charCodeAt(ee),De=V.charCodeAt(W);if(Ce===De)continue;if(Ce>=128||De>=128)return M(R.toLowerCase(),V.toLowerCase(),ee,j,W,ke);ue(Ce)&&(Ce-=32),ue(De)&&(De-=32);const Ye=Ce-De;if(Ye!==0)return Ye}const Pe=j-ee,Be=ke-W;return Pe<Be?-1:Pe>Be?1:0}function ue(R){return R>=97&&R<=122}function be(R){return R>=65&&R<=90}function Ie(R,V){return R.length===V.length&&de(R,V)===0}function ye(R,V){const ee=V.length;return V.length>R.length?!1:de(R,V,0,ee)===0}function xe(R,V){let ee,j=Math.min(R.length,V.length);for(ee=0;ee<j;ee++)if(R.charCodeAt(ee)!==V.charCodeAt(ee))return ee;return j}function $e(R,V){let ee,j=Math.min(R.length,V.length);const W=R.length-1,ke=V.length-1;for(ee=0;ee<j;ee++)if(R.charCodeAt(W-ee)!==V.charCodeAt(ke-ee))return ee;return j}function Oe(R){return 55296<=R&&R<=56319}function He(R){return 56320<=R&&R<=57343}function Q(R,V){return(R-55296<<10)+(V-56320)+65536}function G(R,V,ee){const j=R.charCodeAt(ee);if(Oe(j)&&ee+1<V){const W=R.charCodeAt(ee+1);if(He(W))return Q(j,W)}return j}function Y(R,V){const ee=R.charCodeAt(V-1);if(He(ee)&&V>1){const j=R.charCodeAt(V-2);if(Oe(j))return Q(j,ee)}return ee}function te(R,V){const ee=Ot.getInstance(),j=V,W=R.length,ke=G(R,W,V);V+=ke>=65536?2:1;let Pe=ee.getGraphemeBreakType(ke);for(;V<W;){const Be=G(R,W,V),Ce=ee.getGraphemeBreakType(Be);if(Nt(Pe,Ce))break;V+=Be>=65536?2:1,Pe=Ce}return V-j}function ve(R,V){const ee=Ot.getInstance(),j=V,W=Y(R,V);V-=W>=65536?2:1;let ke=ee.getGraphemeBreakType(W);for(;V>0;){const Pe=Y(R,V),Be=ee.getGraphemeBreakType(Pe);if(Nt(Be,ke))break;V-=Pe>=65536?2:1,ke=Be}return j-V}const ae=/(?:[\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 S(R){return ae.test(R)}const E=/(?:[\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 z(R){return E.test(R)}const ce=/^[\t\n\r\x20-\x7E]*$/;function qe(R){return ce.test(R)}const Xe=/[\u2028\u2029]/;function tt(R){return Xe.test(R)}function gt(R){for(let V=0,ee=R.length;V<ee;V++)if(Rt(R.charCodeAt(V)))return!0;return!1}function Rt(R){return R=+R,R>=11904&&R<=55215||R>=63744&&R<=64255||R>=65281&&R<=65374}function ht(R){return R>=127462&&R<=127487||R===8986||R===8987||R===9200||R===9203||R>=9728&&R<=10175||R===11088||R===11093||R>=127744&&R<=128591||R>=128640&&R<=128764||R>=128992&&R<=129003||R>=129280&&R<=129535||R>=129648&&R<=129750}const at="\uFEFF";function Ct(R){return!!(R&&R.length>0&&R.charCodeAt(0)===65279)}function Vt(R,V=!1){return R?(V&&(R=R.replace(/\\./g,"")),R.toLowerCase()!==R):!1}function St(R){return R=R%(2*26),R<26?String.fromCharCode(97+R):String.fromCharCode(65+R-26)}function Wt(R){return Ot.getInstance().getGraphemeBreakType(R)}function Nt(R,V){return R===0?V!==5&&V!==7:R===2&&V===3?!1:R===4||R===2||R===3||V===4||V===2||V===3?!0:!(R===8&&(V===8||V===9||V===11||V===12)||(R===11||R===9)&&(V===9||V===10)||(R===12||R===10)&&V===10||V===5||V===13||V===7||R===1||R===13&&V===14||R===6&&V===6)}class Ot{constructor(){this._data=ze()}static getInstance(){return Ot._INSTANCE||(Ot._INSTANCE=new Ot),Ot._INSTANCE}getGraphemeBreakType(V){if(V<32)return V===10?3:V===13?2:4;if(V<127)return 0;const ee=this._data,j=ee.length/3;let W=1;for(;W<=j;)if(V<ee[3*W])W=2*W;else if(V>ee[3*W+1])W=2*W+1;else return ee[3*W+2];return 0}}Ot._INSTANCE=null;function ze(){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 Ke(R,V){if(R===0)return 0;const ee=se(R,V);if(ee!==void 0)return ee;const j=Y(V,R);return R-=Ne(j),R}function se(R,V){let ee=Y(V,R);for(R-=Ne(ee);Fe(ee)||ee===65039||ee===8419;){if(R===0)return;ee=Y(V,R),R-=Ne(ee)}if(ht(ee)){if(R>=0){const j=Y(V,R);j===8205&&(R-=Ne(j))}return R}}function Ne(R){return R>=65536?2:1}function Fe(R){return 127995<=R&&R<=127999}},72999:function($t,dt,ie){"use strict";ie.d(dt,{$E:function(){return C},$K:function(){return we},D8:function(){return b},HD:function(){return Le},IU:function(){return K},Jp:function(){return fe},Kn:function(){return Ze},cW:function(){return he},f6:function(){return Z},hj:function(){return ge},jn:function(){return ne},kJ:function(){return F},mf:function(){return $},o8:function(){return v},p_:function(){return u},vE:function(){return U}});function F(M){return Array.isArray(M)}function Le(M){return typeof M=="string"}function Ze(M){return typeof M=="object"&&M!==null&&!Array.isArray(M)&&!(M instanceof RegExp)&&!(M instanceof Date)}function ge(M){return typeof M=="number"&&!isNaN(M)}function ne(M){return M===!0||M===!1}function v(M){return typeof M=="undefined"}function we(M){return!fe(M)}function fe(M){return v(M)||M===null}function u(M,J){if(!M)throw new Error(J?`Unexpected type, expected '${J}'`:"Unexpected type")}function he(M){if(fe(M))throw new Error("Assertion Failed: argument is undefined or null");return M}function $(M){return typeof M=="function"}function b(M,J){const de=Math.min(M.length,J.length);for(let ue=0;ue<de;ue++)k(M[ue],J[ue])}function k(M,J){if(Le(J)){if(typeof M!==J)throw new Error(`argument does not match constraint: typeof ${J}`)}else if($(J)){try{if(M instanceof J)return}catch(de){}if(!fe(M)&&M.constructor===J||J.length===1&&J.call(void 0,M)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function A(M){let J=[],de=Object.getPrototypeOf(M);for(;Object.prototype!==de;)J=J.concat(Object.getOwnPropertyNames(de)),de=Object.getPrototypeOf(de);return J}function C(M){const J=[];for(const de of A(M))typeof M[de]=="function"&&J.push(de);return J}function K(M,J){const de=be=>function(){const Ie=Array.prototype.slice.call(arguments,0);return J(be,Ie)};let ue={};for(const be of M)ue[be]=de(be);return ue}function Z(M){return M===null?void 0:M}function U(M,J="Unreachable"){throw new Error(J)}},13268:function($t,dt,ie){"use strict";ie.d(dt,{N:function(){return Le}});function F(Ze,ge){let ne;return ge.length===0?ne=Ze:ne=Ze.replace(/\{(\d+)\}/g,function(v,we){const fe=we[0];return typeof ge[fe]!="undefined"?ge[fe]:v}),ne}function Le(Ze,ge,...ne){return F(ge,ne)}},96236:function($t,dt,ie){"use strict";ie.d(dt,{BH:function(){return K},NZ:function(){return Z},U8:function(){return U},co:function(){return C},eH:function(){return A},vr:function(){return k}});var F=ie(75918),Le=ie(52615),Ze=ie(4348),ge=ie(88226),ne=ie(69323),v=ie(34502),we=ie(35884),fe=ie(90689),u=ie(16925),he=ie(49055),$=function(M,J,de,ue){var be=arguments.length,Ie=be<3?J:ue===null?ue=Object.getOwnPropertyDescriptor(J,de):ue,ye;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ie=Reflect.decorate(M,J,de,ue);else for(var xe=M.length-1;xe>=0;xe--)(ye=M[xe])&&(Ie=(be<3?ye(Ie):be>3?ye(J,de,Ie):ye(J,de))||Ie);return be>3&&Ie&&Object.defineProperty(J,de,Ie),Ie},b=function(M,J){return function(de,ue){J(de,ue,M)}};function k(M){return M.command!==void 0}class A{constructor(J){this.id=A._idPool++,this._debugName=J}}A._idPool=0,A.CommandPalette=new A("CommandPalette"),A.EditorContext=new A("EditorContext"),A.SimpleEditorContext=new A("SimpleEditorContext"),A.EditorContextCopy=new A("EditorContextCopy"),A.EditorContextPeek=new A("EditorContextPeek"),A.MenubarEditMenu=new A("MenubarEditMenu"),A.MenubarCopy=new A("MenubarCopy"),A.MenubarGoMenu=new A("MenubarGoMenu"),A.MenubarSelectionMenu=new A("MenubarSelectionMenu"),A.InlineCompletionsActions=new A("InlineCompletionsActions");const C=(0,u.yh)("menuService"),K=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ze.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:M=>M===A.CommandPalette}}addCommand(M){return this.addCommands(ge.$.single(M))}addCommands(M){for(const J of M)this._commands.set(J.id,J);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,ne.OF)(()=>{let J=!1;for(const de of M)J=this._commands.delete(de.id)||J;J&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(M){return this._commands.get(M)}getCommands(){const M=new Map;return this._commands.forEach((J,de)=>M.set(de,J)),M}appendMenuItem(M,J){return this.appendMenuItems(ge.$.single({id:M,item:J}))}appendMenuItems(M){const J=new Set,de=new v.S;for(const{id:ue,item:be}of M){let Ie=this._menuItems.get(ue);Ie||(Ie=new v.S,this._menuItems.set(ue,Ie)),de.push(Ie.push(be)),J.add(ue)}return this._onDidChangeMenu.fire(J),(0,ne.OF)(()=>{if(de.size>0){for(let ue of de)ue();this._onDidChangeMenu.fire(J),de.clear()}})}getMenuItems(M){let J;return this._menuItems.has(M)?J=[...this._menuItems.get(M)]:J=[],M===A.CommandPalette&&this._appendImplicitItems(J),J}_appendImplicitItems(M){const J=new Set;for(const de of M)k(de)&&(J.add(de.command.id),de.alt&&J.add(de.alt.id));this._commands.forEach((de,ue)=>{J.has(ue)||M.push({command:de})})}};class Z extends F.wY{constructor(J,de,ue,be){super(`submenuitem.${J.submenu.id}`,typeof J.title=="string"?J.title:J.title.value,[],"submenu"),this.item=J,this._menuService=de,this._contextKeyService=ue,this._options=be}get actions(){const J=[],de=this._menuService.createMenu(this.item.submenu,this._contextKeyService),ue=de.getActions(this._options);de.dispose();for(const[,be]of ue)be.length>0&&(J.push(...be),J.push(new F.Z0));return J.length&&J.pop(),J}}let U=class ql{constructor(J,de,ue,be,Ie){var ye,xe;if(this._commandService=Ie,this.id=J.id,this.label=ue!=null&&ue.renderShortTitle&&J.shortTitle?typeof J.shortTitle=="string"?J.shortTitle:J.shortTitle.value:typeof J.title=="string"?J.title:J.title.value,this.tooltip=(xe=typeof J.tooltip=="string"?J.tooltip:(ye=J.tooltip)===null||ye===void 0?void 0:ye.value)!==null&&xe!==void 0?xe:"",this.enabled=!J.precondition||be.contextMatchesRules(J.precondition),this.checked=void 0,J.toggled){const $e=J.toggled.condition?J.toggled:{condition:J.toggled};this.checked=be.contextMatchesRules($e.condition),this.checked&&$e.tooltip&&(this.tooltip=typeof $e.tooltip=="string"?$e.tooltip:$e.tooltip.value),$e.title&&(this.label=typeof $e.title=="string"?$e.title:$e.title.value)}this.item=J,this.alt=de?new ql(de,void 0,ue,be,Ie):void 0,this._options=ue,he.kS.isThemeIcon(J.icon)&&(this.class=Le.dT.asClassName(J.icon))}dispose(){}run(...J){var de,ue;let be=[];return!((de=this._options)===null||de===void 0)&&de.arg&&(be=[...be,this._options.arg]),!((ue=this._options)===null||ue===void 0)&&ue.shouldForwardArgs&&(be=[...be,...J]),this._commandService.executeCommand(this.id,...be)}};U=$([b(3,fe.i6),b(4,we.H)],U)},35884:function($t,dt,ie){"use strict";ie.d(dt,{H:function(){return we},P:function(){return fe}});var F=ie(4348),Le=ie(88226),Ze=ie(69323),ge=ie(34502),ne=ie(72999),v=ie(16925);const we=(0,v.yh)("commandService"),fe=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new F.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(u,he){if(!u)throw new Error("invalid command");if(typeof u=="string"){if(!he)throw new Error("invalid command");return this.registerCommand({id:u,handler:he})}if(u.description){const C=[];for(let Z of u.description.args)C.push(Z.constraint);const K=u.handler;u.handler=function(Z,...U){return(0,ne.D8)(U,C),K(Z,...U)}}const{id:$}=u;let b=this._commands.get($);b||(b=new ge.S,this._commands.set($,b));let k=b.unshift(u),A=(0,Ze.OF)(()=>{k();const C=this._commands.get($);C!=null&&C.isEmpty()&&this._commands.delete($)});return this._onDidRegisterCommand.fire($),A}registerCommandAlias(u,he){return fe.registerCommand(u,($,...b)=>$.get(we).executeCommand(he,...b))}getCommand(u){const he=this._commands.get(u);if(!(!he||he.isEmpty()))return Le.$.first(he)}getCommands(){const u=new Map;for(const he of this._commands.keys()){const $=this.getCommand(he);$&&u.set(he,$)}return u}};fe.registerCommand("noop",()=>{})},90689:function($t,dt,ie){"use strict";ie.d(dt,{Ao:function(){return we},Eq:function(){return Q},Fb:function(){return fe},K8:function(){return te},i6:function(){return He},uy:function(){return Oe}});var F=ie(23345),Le=ie(82983),Ze=ie(16925);let ge=F.WE||"";const ne=new Map;ne.set("false",!1),ne.set("true",!0),ne.set("isMac",F.dz),ne.set("isLinux",F.IJ),ne.set("isWindows",F.ED),ne.set("isWeb",F.$L),ne.set("isMacNative",F.dz&&!F.$L),ne.set("isEdge",ge.indexOf("Edg/")>=0),ne.set("isFirefox",ge.indexOf("Firefox")>=0),ne.set("isChrome",ge.indexOf("Chrome")>=0),ne.set("isSafari",ge.indexOf("Safari")>=0);const v=Object.prototype.hasOwnProperty;class we{static has(S){return b.create(S)}static equals(S,E){return k.create(S,E)}static regex(S,E){return be.create(S,E)}static not(S){return Z.create(S)}static and(...S){return xe.create(S,null)}static or(...S){return $e.create(S,null,!0)}static deserialize(S,E=!1){if(S)return this._deserializeOrExpression(S,E)}static _deserializeOrExpression(S,E){let z=S.split("||");return $e.create(z.map(ce=>this._deserializeAndExpression(ce,E)),null,!0)}static _deserializeAndExpression(S,E){let z=S.split("&&");return xe.create(z.map(ce=>this._deserializeOne(ce,E)),null)}static _deserializeOne(S,E){if(S=S.trim(),S.indexOf("!=")>=0){let z=S.split("!=");return K.create(z[0].trim(),this._deserializeValue(z[1],E))}if(S.indexOf("==")>=0){let z=S.split("==");return k.create(z[0].trim(),this._deserializeValue(z[1],E))}if(S.indexOf("=~")>=0){let z=S.split("=~");return be.create(z[0].trim(),this._deserializeRegexValue(z[1],E))}if(S.indexOf(" in ")>=0){let z=S.split(" in ");return A.create(z[0].trim(),z[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const z=S.split(">=");return J.create(z[0].trim(),z[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const z=S.split(">");return M.create(z[0].trim(),z[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const z=S.split("<=");return ue.create(z[0].trim(),z[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const z=S.split("<");return de.create(z[0].trim(),z[1].trim())}return/^\!\s*/.test(S)?Z.create(S.substr(1).trim()):b.create(S)}static _deserializeValue(S,E){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let z=/^'([^']*)'$/.exec(S);return z?z[1].trim():S}static _deserializeRegexValue(S,E){if((0,Le.m5)(S)){if(E)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let z=S.indexOf("/"),ce=S.lastIndexOf("/");if(z===ce||z<0){if(E)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let qe=S.slice(z+1,ce),Xe=S[ce+1]==="i"?"i":"";try{return new RegExp(qe,Xe)}catch(tt){if(E)throw new Error(`bad regexp-value '${S}', parse error: ${tt}`);return console.warn(`bad regexp-value '${S}', parse error: ${tt}`),null}}}function fe(ae,S){const E=ae?ae.substituteConstants():void 0,z=S?S.substituteConstants():void 0;return!E&&!z?!0:!E||!z?!1:E.equals(z)}function u(ae,S){return ae.cmp(S)}class he{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return $.INSTANCE}}he.INSTANCE=new he;class ${constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return he.INSTANCE}}$.INSTANCE=new $;class b{constructor(S,E){this.key=S,this.negated=E,this.type=2}static create(S,E=null){const z=ne.get(S);return typeof z=="boolean"?z?$.INSTANCE:he.INSTANCE:new b(S,E)}cmp(S){return S.type!==this.type?this.type-S.type:G(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=ne.get(this.key);return typeof S=="boolean"?S?$.INSTANCE:he.INSTANCE:this}evaluate(S){return!!S.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Z.create(this.key,this)),this.negated}}class k{constructor(S,E,z){this.key=S,this.value=E,this.negated=z,this.type=4}static create(S,E,z=null){if(typeof E=="boolean")return E?b.create(S,z):Z.create(S,z);const ce=ne.get(S);return typeof ce=="boolean"?E===(ce?"true":"false")?$.INSTANCE:he.INSTANCE:new k(S,E,z)}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=ne.get(this.key);if(typeof S=="boolean"){const E=S?"true":"false";return this.value===E?$.INSTANCE:he.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=K.create(this.key,this.value,this)),this.negated}}class A{constructor(S,E){this.key=S,this.valueKey=E,this.type=10,this.negated=null}static create(S,E){return new A(S,E)}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const E=S.getValue(this.valueKey),z=S.getValue(this.key);return Array.isArray(E)?E.indexOf(z)>=0:typeof z=="string"&&typeof E=="object"&&E!==null?v.call(E,z):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=C.create(this)),this.negated}}class C{constructor(S){this._actual=S,this.type=11}static create(S){return new C(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class K{constructor(S,E,z){this.key=S,this.value=E,this.negated=z,this.type=5}static create(S,E,z=null){if(typeof E=="boolean")return E?Z.create(S,z):b.create(S,z);const ce=ne.get(S);return typeof ce=="boolean"?E===(ce?"true":"false")?he.INSTANCE:$.INSTANCE:new K(S,E,z)}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=ne.get(this.key);if(typeof S=="boolean"){const E=S?"true":"false";return this.value===E?he.INSTANCE:$.INSTANCE}return this}evaluate(S){return S.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this.value,this)),this.negated}}class Z{constructor(S,E){this.key=S,this.negated=E,this.type=3}static create(S,E=null){const z=ne.get(S);return typeof z=="boolean"?z?he.INSTANCE:$.INSTANCE:new Z(S,E)}cmp(S){return S.type!==this.type?this.type-S.type:G(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=ne.get(this.key);return typeof S=="boolean"?S?he.INSTANCE:$.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this)),this.negated}}function U(ae,S){if(typeof ae=="string"){const E=parseFloat(ae);isNaN(E)||(ae=E)}return typeof ae=="string"||typeof ae=="number"?S(ae):he.INSTANCE}class M{constructor(S,E,z){this.key=S,this.value=E,this.negated=z,this.type=12}static create(S,E,z=null){return U(E,ce=>new M(S,ce,z))}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ue.create(this.key,this.value,this)),this.negated}}class J{constructor(S,E,z){this.key=S,this.value=E,this.negated=z,this.type=13}static create(S,E,z=null){return U(E,ce=>new J(S,ce,z))}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=de.create(this.key,this.value,this)),this.negated}}class de{constructor(S,E,z){this.key=S,this.value=E,this.negated=z,this.type=14}static create(S,E,z=null){return U(E,ce=>new de(S,ce,z))}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=J.create(this.key,this.value,this)),this.negated}}class ue{constructor(S,E,z){this.key=S,this.value=E,this.negated=z,this.type=15}static create(S,E,z=null){return U(E,ce=>new ue(S,ce,z))}cmp(S){return S.type!==this.type?this.type-S.type:Y(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.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 be{constructor(S,E){this.key=S,this.regexp=E,this.type=7,this.negated=null}static create(S,E){return new be(S,E)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const E=this.regexp?this.regexp.source:"",z=S.regexp?S.regexp.source:"";return E<z?-1:E>z?1:0}equals(S){if(S.type===this.type){const E=this.regexp?this.regexp.source:"",z=S.regexp?S.regexp.source:"";return this.key===S.key&&E===z}return!1}substituteConstants(){return this}evaluate(S){let E=S.getValue(this.key);return this.regexp?this.regexp.test(E):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Ie.create(this)),this.negated}}class Ie{constructor(S){this._actual=S,this.type=8}static create(S){return new Ie(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ye(ae){let S=null;for(let E=0,z=ae.length;E<z;E++){const ce=ae[E].substituteConstants();if(ae[E]!==ce&&S===null){S=[];for(let qe=0;qe<E;qe++)S[qe]=ae[qe]}S!==null&&(S[E]=ce)}return S===null?ae:S}class xe{constructor(S,E){this.expr=S,this.negated=E,this.type=6}static create(S,E){return xe._normalizeArr(S,E)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let E=0,z=this.expr.length;E<z;E++){const ce=u(this.expr[E],S.expr[E]);if(ce!==0)return ce}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let E=0,z=this.expr.length;E<z;E++)if(!this.expr[E].equals(S.expr[E]))return!1;return!0}return!1}substituteConstants(){const S=ye(this.expr);return S===this.expr?this:xe.create(S,this.negated)}evaluate(S){for(let E=0,z=this.expr.length;E<z;E++)if(!this.expr[E].evaluate(S))return!1;return!0}static _normalizeArr(S,E){const z=[];let ce=!1;for(const qe of S)if(qe){if(qe.type===1){ce=!0;continue}if(qe.type===0)return he.INSTANCE;if(qe.type===6){z.push(...qe.expr);continue}z.push(qe)}if(z.length===0&&ce)return $.INSTANCE;if(z.length!==0){if(z.length===1)return z[0];z.sort(u);for(let qe=1;qe<z.length;qe++)z[qe-1].equals(z[qe])&&(z.splice(qe,1),qe--);if(z.length===1)return z[0];for(;z.length>1;){const qe=z[z.length-1];if(qe.type!==9)break;z.pop();const Xe=z.pop(),tt=z.length===0,gt=$e.create(qe.expr.map(Rt=>xe.create([Rt,Xe],null)),null,tt);gt&&(z.push(gt),z.sort(u))}return z.length===1?z[0]:new xe(z,E)}}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let E of this.expr)S.push(...E.keys());return S}negate(){if(!this.negated){const S=[];for(let E of this.expr)S.push(E.negate());this.negated=$e.create(S,this,!0)}return this.negated}}class $e{constructor(S,E){this.expr=S,this.negated=E,this.type=9}static create(S,E,z){return $e._normalizeArr(S,E,z)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let E=0,z=this.expr.length;E<z;E++){const ce=u(this.expr[E],S.expr[E]);if(ce!==0)return ce}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let E=0,z=this.expr.length;E<z;E++)if(!this.expr[E].equals(S.expr[E]))return!1;return!0}return!1}substituteConstants(){const S=ye(this.expr);return S===this.expr?this:$e.create(S,this.negated,!1)}evaluate(S){for(let E=0,z=this.expr.length;E<z;E++)if(this.expr[E].evaluate(S))return!0;return!1}static _normalizeArr(S,E,z){let ce=[],qe=!1;if(S){for(let Xe=0,tt=S.length;Xe<tt;Xe++){const gt=S[Xe];if(gt){if(gt.type===0){qe=!0;continue}if(gt.type===1)return $.INSTANCE;if(gt.type===9){ce=ce.concat(gt.expr);continue}ce.push(gt)}}if(ce.length===0&&qe)return he.INSTANCE;ce.sort(u)}if(ce.length!==0){if(ce.length===1)return ce[0];for(let Xe=1;Xe<ce.length;Xe++)ce[Xe-1].equals(ce[Xe])&&(ce.splice(Xe,1),Xe--);if(ce.length===1)return ce[0];if(z){for(let Xe=0;Xe<ce.length;Xe++)for(let tt=Xe+1;tt<ce.length;tt++)te(ce[Xe],ce[tt])&&(ce.splice(tt,1),tt--);if(ce.length===1)return ce[0]}return new $e(ce,E)}}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let E of this.expr)S.push(...E.keys());return S}negate(){if(!this.negated){let S=[];for(let E of this.expr)S.push(E.negate());for(;S.length>1;){const E=S.shift(),z=S.shift(),ce=[];for(const Xe of ve(E))for(const tt of ve(z))ce.push(xe.create([Xe,tt],null));const qe=S.length===0;S.unshift($e.create(ce,null,qe))}this.negated=S[0]}return this.negated}}class Oe extends b{constructor(S,E,z){super(S,null),this._defaultValue=E,typeof z=="object"?Oe._info.push(Object.assign(Object.assign({},z),{key:S})):z!==!0&&Oe._info.push({key:S,description:z,type:E!=null?typeof E:void 0})}static all(){return Oe._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return k.create(this.key,S)}}Oe._info=[];const He=(0,Ze.yh)("contextKeyService"),Q="setContext";function G(ae,S){return ae<S?-1:ae>S?1:0}function Y(ae,S,E,z){return ae<E?-1:ae>E?1:S<z?-1:S>z?1:0}function te(ae,S){if(S.type===6&&ae.type!==9&&ae.type!==6){for(const ce of S.expr)if(ae.equals(ce))return!0}const E=ae.negate(),z=ve(E).concat(ve(S));z.sort(u);for(let ce=0;ce<z.length;ce++){const Xe=z[ce].negate();for(let tt=ce+1;tt<z.length;tt++){const gt=z[tt];if(Xe.equals(gt))return!0}}return!1}function ve(ae){return ae.type===9?ae.expr:[ae]}},16925:function($t,dt,ie){"use strict";ie.d(dt,{I8:function(){return F},TG:function(){return Le},jt:function(){return ne},yh:function(){return ge}});var F;(function(v){v.serviceIds=new Map,v.DI_TARGET="$di$target",v.DI_DEPENDENCIES="$di$dependencies";function we(fe){return fe[v.DI_DEPENDENCIES]||[]}v.getServiceDependencies=we})(F||(F={}));const Le=ge("instantiationService");function Ze(v,we,fe,u){we[F.DI_TARGET]===we?we[F.DI_DEPENDENCIES].push({id:v,index:fe,optional:u}):(we[F.DI_DEPENDENCIES]=[{id:v,index:fe,optional:u}],we[F.DI_TARGET]=we)}function ge(v){if(F.serviceIds.has(v))return F.serviceIds.get(v);const we=function(fe,u,he){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ze(we,fe,he,!1)};return we.toString=()=>v,F.serviceIds.set(v,we),we}function ne(v){return function(we,fe,u){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Ze(v,we,u,!0)}}},44650:function($t,dt,ie){"use strict";ie.d(dt,{B:function(){return ge}});var F=ie(76068),Le=ie(72999);class Ze{constructor(){this.data=new Map}add(v,we){F.ok(Le.HD(v)),F.ok(Le.Kn(we)),F.ok(!this.data.has(v),"There is already an extension with this id"),this.data.set(v,we)}as(v){return this.data.get(v)||null}}const ge=new Ze},66213:function($t,dt,ie){"use strict";ie.d(dt,{e:function(){return F}});var F;(function(Le){Le.DARK="dark",Le.LIGHT="light",Le.HIGH_CONTRAST="hc"})(F||(F={}))},49055:function($t,dt,ie){"use strict";ie.d(dt,{EN:function(){return u},IP:function(){return b},Ic:function(){return C},XE:function(){return we},bB:function(){return K},kS:function(){return he},m6:function(){return $}});var F=ie(52615),Le=ie(4348),Ze=ie(69323),ge=ie(16925),ne=ie(44650),v=ie(66213);const we=(0,ge.yh)("themeService");var fe;(function(Z){function U(M){return M&&typeof M=="object"&&typeof M.id=="string"}Z.isThemeColor=U})(fe||(fe={}));function u(Z){return{id:Z}}var he;(function(Z){function U(Ie){return Ie&&typeof Ie=="object"&&typeof Ie.id=="string"&&(typeof Ie.color=="undefined"||fe.isThemeColor(Ie.color))}Z.isThemeIcon=U;const M=new RegExp(`^\\$\\((${F.dT.iconNameExpression}(?:${F.dT.iconModifierExpression})?)\\)$`);function J(Ie){const ye=M.exec(Ie);if(!ye)return;let[,xe]=ye;return{id:xe}}Z.fromString=J;function de(Ie,ye){let xe=Ie.id;const $e=xe.lastIndexOf("~");return $e!==-1&&(xe=xe.substring(0,$e)),ye&&(xe=`${xe}~${ye}`),{id:xe}}Z.modify=de;function ue(Ie,ye){var xe,$e;return Ie.id===ye.id&&((xe=Ie.color)===null||xe===void 0?void 0:xe.id)===(($e=ye.color)===null||$e===void 0?void 0:$e.id)}Z.isEqual=ue;function be(Ie,ye){return{id:Ie.id,color:ye?u(ye):void 0}}Z.asThemeIcon=be,Z.asClassNameArray=F.dT.asClassNameArray,Z.asClassName=F.dT.asClassName,Z.asCSSSelector=F.dT.asCSSSelector})(he||(he={}));function $(Z){switch(Z){case v.e.DARK:return"vs-dark";case v.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const b={ThemingContribution:"base.contributions.theming"};class k{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Le.Q5}onColorThemeChange(U){return this.themingParticipants.push(U),this.onThemingParticipantAddedEmitter.fire(U),(0,Ze.OF)(()=>{const M=this.themingParticipants.indexOf(U);this.themingParticipants.splice(M,1)})}getThemingParticipants(){return this.themingParticipants}}let A=new k;ne.B.add(b.ThemingContribution,A);function C(Z){return A.onColorThemeChange(Z)}class K extends Ze.JT{constructor(U){super(),this.themeService=U,this.theme=U.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(M=>this.onThemeChange(M)))}onThemeChange(U){this.theme=U,this.updateStyles()}updateStyles(){}}},5630:function($t,dt,ie){"use strict";var F=ie(72308),Le=ie(77321),Ze=ie(49618),ge=ie(52487),ne=ie(74416),v=ie(92310),we=ie.n(v),fe=ie(18929),u=ie(59301),he=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],$=(0,u.forwardRef)(function(b,k){var A,C=b.prefixCls,K=C===void 0?"rc-checkbox":C,Z=b.className,U=b.style,M=b.checked,J=b.disabled,de=b.defaultChecked,ue=de===void 0?!1:de,be=b.type,Ie=be===void 0?"checkbox":be,ye=b.title,xe=b.onChange,$e=(0,ne.Z)(b,he),Oe=(0,u.useRef)(null),He=(0,fe.Z)(ue,{value:M}),Q=(0,ge.Z)(He,2),G=Q[0],Y=Q[1];(0,u.useImperativeHandle)(k,function(){return{focus:function(){var S;(S=Oe.current)===null||S===void 0||S.focus()},blur:function(){var S;(S=Oe.current)===null||S===void 0||S.blur()},input:Oe.current}});var te=we()(K,Z,(A={},(0,Ze.Z)(A,"".concat(K,"-checked"),G),(0,Ze.Z)(A,"".concat(K,"-disabled"),J),A)),ve=function(S){J||("checked"in b||Y(S.target.checked),xe==null||xe({target:(0,Le.Z)((0,Le.Z)({},b),{},{type:Ie,checked:S.target.checked}),stopPropagation:function(){S.stopPropagation()},preventDefault:function(){S.preventDefault()},nativeEvent:S.nativeEvent}))};return u.createElement("span",{className:te,title:ye,style:U},u.createElement("input",(0,F.Z)({},$e,{className:"".concat(K,"-input"),ref:Oe,onChange:ve,disabled:J,checked:!!G,type:Ie})),u.createElement("span",{className:"".concat(K,"-inner")}))});dt.Z=$},29301:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return Q}});var F=ie(72308),Le=ie(59301),Ze=ie(11592),ge=ie(48736),ne=ie(77321),v=ie(62853),we=ie(76846),fe=ie(8654),u=Le.createContext(null);function he(G){var Y=G.children,te=G.onBatchResize,ve=Le.useRef(0),ae=Le.useRef([]),S=Le.useContext(u),E=Le.useCallback(function(z,ce,qe){ve.current+=1;var Xe=ve.current;ae.current.push({size:z,element:ce,data:qe}),Promise.resolve().then(function(){Xe===ve.current&&(te==null||te(ae.current),ae.current=[])}),S==null||S(z,ce,qe)},[te,S]);return Le.createElement(u.Provider,{value:E},Y)}var $=ie(76374),b=new Map;function k(G){G.forEach(function(Y){var te,ve=Y.target;(te=b.get(ve))===null||te===void 0||te.forEach(function(ae){return ae(ve)})})}var A=new $.Z(k),C=null,K=null;function Z(G,Y){b.has(G)||(b.set(G,new Set),A.observe(G)),b.get(G).add(Y)}function U(G,Y){b.has(G)&&(b.get(G).delete(Y),b.get(G).size||(A.unobserve(G),b.delete(G)))}var M=ie(96949),J=ie(55090),de=ie(77205),ue=ie(38793),be=function(G){(0,de.Z)(te,G);var Y=(0,ue.Z)(te);function te(){return(0,M.Z)(this,te),Y.apply(this,arguments)}return(0,J.Z)(te,[{key:"render",value:function(){return this.props.children}}]),te}(Le.Component);function Ie(G,Y){var te=G.children,ve=G.disabled,ae=Le.useRef(null),S=Le.useRef(null),E=Le.useContext(u),z=typeof te=="function",ce=z?te(ae):te,qe=Le.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Xe=!z&&Le.isValidElement(ce)&&(0,fe.Yr)(ce),tt=Xe?(0,fe.C4)(ce):null,gt=(0,fe.x1)(tt,ae),Rt=function(){var Vt;return(0,we.ZP)(ae.current)||(ae.current&&(0,v.Z)(ae.current)==="object"?(0,we.ZP)((Vt=ae.current)===null||Vt===void 0?void 0:Vt.nativeElement):null)||(0,we.ZP)(S.current)};Le.useImperativeHandle(Y,function(){return Rt()});var ht=Le.useRef(G);ht.current=G;var at=Le.useCallback(function(Ct){var Vt=ht.current,St=Vt.onResize,Wt=Vt.data,Nt=Ct.getBoundingClientRect(),Ot=Nt.width,ze=Nt.height,Ke=Ct.offsetWidth,se=Ct.offsetHeight,Ne=Math.floor(Ot),Fe=Math.floor(ze);if(qe.current.width!==Ne||qe.current.height!==Fe||qe.current.offsetWidth!==Ke||qe.current.offsetHeight!==se){var R={width:Ne,height:Fe,offsetWidth:Ke,offsetHeight:se};qe.current=R;var V=Ke===Math.round(Ot)?Ot:Ke,ee=se===Math.round(ze)?ze:se,j=(0,ne.Z)((0,ne.Z)({},R),{},{offsetWidth:V,offsetHeight:ee});E==null||E(j,Ct,Wt),St&&Promise.resolve().then(function(){St(j,Ct)})}},[]);return Le.useEffect(function(){var Ct=Rt();return Ct&&!ve&&Z(Ct,at),function(){return U(Ct,at)}},[ae.current,ve]),Le.createElement(be,{ref:S},Xe?Le.cloneElement(ce,{ref:gt}):ce)}var ye=Le.forwardRef(Ie),xe=ye,$e="rc-observer-key";function Oe(G,Y){var te=G.children,ve=typeof te=="function"?[te]:(0,Ze.Z)(te);return ve.map(function(ae,S){var E=(ae==null?void 0:ae.key)||"".concat($e,"-").concat(S);return Le.createElement(xe,(0,F.Z)({},G,{key:E,ref:S===0?Y:void 0}),ae)})}var He=Le.forwardRef(Oe);He.Collection=he;var Q=He},55477:function($t,dt,ie){"use strict";ie.d(dt,{G:function(){return k},Z:function(){return Z}});var F=ie(72308),Le=ie(77321),Ze=ie(74416),ge=ie(35593),ne=ie(59301),v={shiftX:64,adjustY:1},we={adjustX:1,shiftY:!0},fe=[0,0],u={left:{points:["cr","cl"],overflow:we,offset:[-4,0],targetOffset:fe},right:{points:["cl","cr"],overflow:we,offset:[4,0],targetOffset:fe},top:{points:["bc","tc"],overflow:v,offset:[0,-4],targetOffset:fe},bottom:{points:["tc","bc"],overflow:v,offset:[0,4],targetOffset:fe},topLeft:{points:["bl","tl"],overflow:v,offset:[0,-4],targetOffset:fe},leftTop:{points:["tr","tl"],overflow:we,offset:[-4,0],targetOffset:fe},topRight:{points:["br","tr"],overflow:v,offset:[0,-4],targetOffset:fe},rightTop:{points:["tl","tr"],overflow:we,offset:[4,0],targetOffset:fe},bottomRight:{points:["tr","br"],overflow:v,offset:[0,4],targetOffset:fe},rightBottom:{points:["bl","br"],overflow:we,offset:[4,0],targetOffset:fe},bottomLeft:{points:["tl","bl"],overflow:v,offset:[0,4],targetOffset:fe},leftBottom:{points:["br","bl"],overflow:we,offset:[-4,0],targetOffset:fe}},he=null,$=ie(92310),b=ie.n($);function k(U){var M=U.children,J=U.prefixCls,de=U.id,ue=U.overlayInnerStyle,be=U.className,Ie=U.style;return ne.createElement("div",{className:b()("".concat(J,"-content"),be),style:Ie},ne.createElement("div",{className:"".concat(J,"-inner"),id:de,role:"tooltip",style:ue},typeof M=="function"?M():M))}var A=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],C=function(M,J){var de=M.overlayClassName,ue=M.trigger,be=ue===void 0?["hover"]:ue,Ie=M.mouseEnterDelay,ye=Ie===void 0?0:Ie,xe=M.mouseLeaveDelay,$e=xe===void 0?.1:xe,Oe=M.overlayStyle,He=M.prefixCls,Q=He===void 0?"rc-tooltip":He,G=M.children,Y=M.onVisibleChange,te=M.afterVisibleChange,ve=M.transitionName,ae=M.animation,S=M.motion,E=M.placement,z=E===void 0?"right":E,ce=M.align,qe=ce===void 0?{}:ce,Xe=M.destroyTooltipOnHide,tt=Xe===void 0?!1:Xe,gt=M.defaultVisible,Rt=M.getTooltipContainer,ht=M.overlayInnerStyle,at=M.arrowContent,Ct=M.overlay,Vt=M.id,St=M.showArrow,Wt=St===void 0?!0:St,Nt=(0,Ze.Z)(M,A),Ot=(0,ne.useRef)(null);(0,ne.useImperativeHandle)(J,function(){return Ot.current});var ze=(0,Le.Z)({},Nt);"visible"in M&&(ze.popupVisible=M.visible);var Ke=function(){return ne.createElement(k,{key:"content",prefixCls:Q,id:Vt,overlayInnerStyle:ht},Ct)};return ne.createElement(ge.Z,(0,F.Z)({popupClassName:de,prefixCls:Q,popup:Ke,action:be,builtinPlacements:u,popupPlacement:z,ref:Ot,popupAlign:qe,getPopupContainer:Rt,onPopupVisibleChange:Y,afterPopupVisibleChange:te,popupTransitionName:ve,popupAnimation:ae,popupMotion:S,defaultPopupVisible:gt,autoDestroy:tt,mouseLeaveDelay:$e,popupStyle:Oe,mouseEnterDelay:ye,arrow:Wt},ze),G)},K=(0,ne.forwardRef)(C),Z=K},49658:function($t,dt){"use strict";dt.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ie=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(ie)||/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(ie==null?void 0:ie.substr(0,4))}},83145:function($t,dt,ie){"use strict";Object.defineProperty(dt,"__esModule",{value:!0}),dt.CopyToClipboard=void 0;var F=Ze(ie(59301)),Le=Ze(ie(25769));function Ze(M){return M&&M.__esModule?M:{default:M}}function ge(M){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ge=function(de){return typeof de}:ge=function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},ge(M)}function ne(M,J){var de=Object.keys(M);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(M);J&&(ue=ue.filter(function(be){return Object.getOwnPropertyDescriptor(M,be).enumerable})),de.push.apply(de,ue)}return de}function v(M){for(var J=1;J<arguments.length;J++){var de=arguments[J]!=null?arguments[J]:{};J%2?ne(de,!0).forEach(function(ue){Z(M,ue,de[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(M,Object.getOwnPropertyDescriptors(de)):ne(de).forEach(function(ue){Object.defineProperty(M,ue,Object.getOwnPropertyDescriptor(de,ue))})}return M}function we(M,J){if(M==null)return{};var de=fe(M,J),ue,be;if(Object.getOwnPropertySymbols){var Ie=Object.getOwnPropertySymbols(M);for(be=0;be<Ie.length;be++)ue=Ie[be],!(J.indexOf(ue)>=0)&&Object.prototype.propertyIsEnumerable.call(M,ue)&&(de[ue]=M[ue])}return de}function fe(M,J){if(M==null)return{};var de={},ue=Object.keys(M),be,Ie;for(Ie=0;Ie<ue.length;Ie++)be=ue[Ie],!(J.indexOf(be)>=0)&&(de[be]=M[be]);return de}function u(M,J){if(!(M instanceof J))throw new TypeError("Cannot call a class as a function")}function he(M,J){for(var de=0;de<J.length;de++){var ue=J[de];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(M,ue.key,ue)}}function $(M,J,de){return J&&he(M.prototype,J),de&&he(M,de),M}function b(M,J){return J&&(ge(J)==="object"||typeof J=="function")?J:A(M)}function k(M){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)},k(M)}function A(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}function C(M,J){if(typeof J!="function"&&J!==null)throw new TypeError("Super expression must either be null or a function");M.prototype=Object.create(J&&J.prototype,{constructor:{value:M,writable:!0,configurable:!0}}),J&&K(M,J)}function K(M,J){return K=Object.setPrototypeOf||function(ue,be){return ue.__proto__=be,ue},K(M,J)}function Z(M,J,de){return J in M?Object.defineProperty(M,J,{value:de,enumerable:!0,configurable:!0,writable:!0}):M[J]=de,M}var U=function(M){C(J,M);function J(){var de,ue;u(this,J);for(var be=arguments.length,Ie=new Array(be),ye=0;ye<be;ye++)Ie[ye]=arguments[ye];return ue=b(this,(de=k(J)).call.apply(de,[this].concat(Ie))),Z(A(ue),"onClick",function(xe){var $e=ue.props,Oe=$e.text,He=$e.onCopy,Q=$e.children,G=$e.options,Y=F.default.Children.only(Q),te=(0,Le.default)(Oe,G);He&&He(Oe,te),Y&&Y.props&&typeof Y.props.onClick=="function"&&Y.props.onClick(xe)}),ue}return $(J,[{key:"render",value:function(){var ue=this.props,be=ue.text,Ie=ue.onCopy,ye=ue.options,xe=ue.children,$e=we(ue,["text","onCopy","options","children"]),Oe=F.default.Children.only(xe);return F.default.cloneElement(Oe,v({},$e,{onClick:this.onClick}))}}]),J}(F.default.PureComponent);dt.CopyToClipboard=U,Z(U,"defaultProps",{onCopy:void 0,options:void 0})},56102:function($t,dt,ie){"use strict";var F=ie(83145),Le=F.CopyToClipboard;Le.CopyToClipboard=Le,$t.exports=Le},76374:function($t,dt,ie){"use strict";var F=function(){if(typeof Map!="undefined")return Map;function Q(G,Y){var te=-1;return G.some(function(ve,ae){return ve[0]===Y?(te=ae,!0):!1}),te}return function(){function G(){this.__entries__=[]}return Object.defineProperty(G.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),G.prototype.get=function(Y){var te=Q(this.__entries__,Y),ve=this.__entries__[te];return ve&&ve[1]},G.prototype.set=function(Y,te){var ve=Q(this.__entries__,Y);~ve?this.__entries__[ve][1]=te:this.__entries__.push([Y,te])},G.prototype.delete=function(Y){var te=this.__entries__,ve=Q(te,Y);~ve&&te.splice(ve,1)},G.prototype.has=function(Y){return!!~Q(this.__entries__,Y)},G.prototype.clear=function(){this.__entries__.splice(0)},G.prototype.forEach=function(Y,te){te===void 0&&(te=null);for(var ve=0,ae=this.__entries__;ve<ae.length;ve++){var S=ae[ve];Y.call(te,S[1],S[0])}},G}()}(),Le=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Ze=function(){return typeof ie.g!="undefined"&&ie.g.Math===Math?ie.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ge=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ze):function(Q){return setTimeout(function(){return Q(Date.now())},1e3/60)}}(),ne=2;function v(Q,G){var Y=!1,te=!1,ve=0;function ae(){Y&&(Y=!1,Q()),te&&E()}function S(){ge(ae)}function E(){var z=Date.now();if(Y){if(z-ve<ne)return;te=!0}else Y=!0,te=!1,setTimeout(S,G);ve=z}return E}var we=20,fe=["top","right","bottom","left","width","height","size","weight"],u=typeof MutationObserver!="undefined",he=function(){function Q(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=v(this.refresh.bind(this),we)}return Q.prototype.addObserver=function(G){~this.observers_.indexOf(G)||this.observers_.push(G),this.connected_||this.connect_()},Q.prototype.removeObserver=function(G){var Y=this.observers_,te=Y.indexOf(G);~te&&Y.splice(te,1),!Y.length&&this.connected_&&this.disconnect_()},Q.prototype.refresh=function(){var G=this.updateObservers_();G&&this.refresh()},Q.prototype.updateObservers_=function(){var G=this.observers_.filter(function(Y){return Y.gatherActive(),Y.hasActive()});return G.forEach(function(Y){return Y.broadcastActive()}),G.length>0},Q.prototype.connect_=function(){!Le||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(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)},Q.prototype.disconnect_=function(){!Le||!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)},Q.prototype.onTransitionEnd_=function(G){var Y=G.propertyName,te=Y===void 0?"":Y,ve=fe.some(function(ae){return!!~te.indexOf(ae)});ve&&this.refresh()},Q.getInstance=function(){return this.instance_||(this.instance_=new Q),this.instance_},Q.instance_=null,Q}(),$=function(Q,G){for(var Y=0,te=Object.keys(G);Y<te.length;Y++){var ve=te[Y];Object.defineProperty(Q,ve,{value:G[ve],enumerable:!1,writable:!1,configurable:!0})}return Q},b=function(Q){var G=Q&&Q.ownerDocument&&Q.ownerDocument.defaultView;return G||Ze},k=be(0,0,0,0);function A(Q){return parseFloat(Q)||0}function C(Q){for(var G=[],Y=1;Y<arguments.length;Y++)G[Y-1]=arguments[Y];return G.reduce(function(te,ve){var ae=Q["border-"+ve+"-width"];return te+A(ae)},0)}function K(Q){for(var G=["top","right","bottom","left"],Y={},te=0,ve=G;te<ve.length;te++){var ae=ve[te],S=Q["padding-"+ae];Y[ae]=A(S)}return Y}function Z(Q){var G=Q.getBBox();return be(0,0,G.width,G.height)}function U(Q){var G=Q.clientWidth,Y=Q.clientHeight;if(!G&&!Y)return k;var te=b(Q).getComputedStyle(Q),ve=K(te),ae=ve.left+ve.right,S=ve.top+ve.bottom,E=A(te.width),z=A(te.height);if(te.boxSizing==="border-box"&&(Math.round(E+ae)!==G&&(E-=C(te,"left","right")+ae),Math.round(z+S)!==Y&&(z-=C(te,"top","bottom")+S)),!J(Q)){var ce=Math.round(E+ae)-G,qe=Math.round(z+S)-Y;Math.abs(ce)!==1&&(E-=ce),Math.abs(qe)!==1&&(z-=qe)}return be(ve.left,ve.top,E,z)}var M=function(){return typeof SVGGraphicsElement!="undefined"?function(Q){return Q instanceof b(Q).SVGGraphicsElement}:function(Q){return Q instanceof b(Q).SVGElement&&typeof Q.getBBox=="function"}}();function J(Q){return Q===b(Q).document.documentElement}function de(Q){return Le?M(Q)?Z(Q):U(Q):k}function ue(Q){var G=Q.x,Y=Q.y,te=Q.width,ve=Q.height,ae=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,S=Object.create(ae.prototype);return $(S,{x:G,y:Y,width:te,height:ve,top:Y,right:G+te,bottom:ve+Y,left:G}),S}function be(Q,G,Y,te){return{x:Q,y:G,width:Y,height:te}}var Ie=function(){function Q(G){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=be(0,0,0,0),this.target=G}return Q.prototype.isActive=function(){var G=de(this.target);return this.contentRect_=G,G.width!==this.broadcastWidth||G.height!==this.broadcastHeight},Q.prototype.broadcastRect=function(){var G=this.contentRect_;return this.broadcastWidth=G.width,this.broadcastHeight=G.height,G},Q}(),ye=function(){function Q(G,Y){var te=ue(Y);$(this,{target:G,contentRect:te})}return Q}(),xe=function(){function Q(G,Y,te){if(this.activeObservations_=[],this.observations_=new F,typeof G!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=G,this.controller_=Y,this.callbackCtx_=te}return Q.prototype.observe=function(G){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(G instanceof b(G).Element))throw new TypeError('parameter 1 is not of type "Element".');var Y=this.observations_;Y.has(G)||(Y.set(G,new Ie(G)),this.controller_.addObserver(this),this.controller_.refresh())}},Q.prototype.unobserve=function(G){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(G instanceof b(G).Element))throw new TypeError('parameter 1 is not of type "Element".');var Y=this.observations_;Y.has(G)&&(Y.delete(G),Y.size||this.controller_.removeObserver(this))}},Q.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Q.prototype.gatherActive=function(){var G=this;this.clearActive(),this.observations_.forEach(function(Y){Y.isActive()&&G.activeObservations_.push(Y)})},Q.prototype.broadcastActive=function(){if(this.hasActive()){var G=this.callbackCtx_,Y=this.activeObservations_.map(function(te){return new ye(te.target,te.broadcastRect())});this.callback_.call(G,Y,G),this.clearActive()}},Q.prototype.clearActive=function(){this.activeObservations_.splice(0)},Q.prototype.hasActive=function(){return this.activeObservations_.length>0},Q}(),$e=typeof WeakMap!="undefined"?new WeakMap:new F,Oe=function(){function Q(G){if(!(this instanceof Q))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var Y=he.getInstance(),te=new xe(G,Y,this);$e.set(this,te)}return Q}();["observe","unobserve","disconnect"].forEach(function(Q){Oe.prototype[Q]=function(){var G;return(G=$e.get(this))[Q].apply(G,arguments)}});var He=function(){return typeof Ze.ResizeObserver!="undefined"?Ze.ResizeObserver:Oe}();dt.Z=He},98040:function($t){$t.exports=function(){var dt=document.getSelection();if(!dt.rangeCount)return function(){};for(var ie=document.activeElement,F=[],Le=0;Le<dt.rangeCount;Le++)F.push(dt.getRangeAt(Le));switch(ie.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":ie.blur();break;default:ie=null;break}return dt.removeAllRanges(),function(){dt.type==="Caret"&&dt.removeAllRanges(),dt.rangeCount||F.forEach(function(Ze){dt.addRange(Ze)}),ie&&ie.focus()}}},1012:function($t,dt,ie){"use strict";ie.d(dt,{Z:function(){return b}});var F=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Le=new Uint8Array(16);function Ze(){if(!F)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return F(Le)}var ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ne(k){return typeof k=="string"&&ge.test(k)}for(var v=ne,we=[],fe=0;fe<256;++fe)we.push((fe+256).toString(16).substr(1));function u(k){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=(we[k[A+0]]+we[k[A+1]]+we[k[A+2]]+we[k[A+3]]+"-"+we[k[A+4]]+we[k[A+5]]+"-"+we[k[A+6]]+we[k[A+7]]+"-"+we[k[A+8]]+we[k[A+9]]+"-"+we[k[A+10]]+we[k[A+11]]+we[k[A+12]]+we[k[A+13]]+we[k[A+14]]+we[k[A+15]]).toLowerCase();if(!v(C))throw TypeError("Stringified UUID is invalid");return C}var he=u;function $(k,A,C){k=k||{};var K=k.random||(k.rng||Ze)();if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,A){C=C||0;for(var Z=0;Z<16;++Z)A[C+Z]=K[Z];return A}return he(K)}var b=$},93314:function($t){"use strict";$t.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=="},65157:function($t,dt,ie){"use strict";ie.d(dt,{ZP:function(){return ts}});const F=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Le=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Ze},Ze=Number.MAX_SAFE_INTEGER||9007199254740991;let ge=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}({}),ne=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}({}),v=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 we={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},fe={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class u{constructor(e,t=0,r=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_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*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 he{constructor(e,t,r,n=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_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new u(e),this.fast_=new u(t),this.defaultTTFB_=n,this.ttfb_=new u(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:i}=this;r.halfLife!==e&&(this.slow_=new u(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new u(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new u(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,n=e/1e3,i=r/n;this.fast_.sample(n,i),this.slow_.sample(n,i)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,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 $(a,e,t){return(e=K(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function b(){return b=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},b.apply(null,arguments)}function k(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),t.push.apply(t,r)}return t}function A(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?k(Object(t),!0).forEach(function(r){$(a,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(r){Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(t,r))})}return a}function C(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function K(a){var e=C(a,"string");return typeof e=="symbol"?e:e+""}class Z{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 r=`[${e}]:`;this.trace=U,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}}const U=function(){},M={trace:U,debug:U,log:U,warn:U,info:U,error:U};function J(){return b({},M)}function de(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):U}function ue(a,e,t){return e[a]?e[a].bind(e):de(a,t)}const be=J();function Ie(a,e,t){const r=J();if(typeof console=="object"&&a===!0||typeof a=="object"){const n=["debug","log","info","warn","error"];n.forEach(i=>{r[i]=ue(i,a,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.0`)}catch(i){return J()}n.forEach(i=>{be[i]=ue(i,a)})}else b(be,r);return r}const ye=be;function xe(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function $e(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function Oe(a,e){const t=Object.keys(a),r=Object.keys(e),n=t.length,i=r.length;return!n||!i||n===i&&!t.some(s=>r.indexOf(s)===-1)}function He(a,e=!1){if(typeof TextDecoder!="undefined"){const c=new TextDecoder("utf-8").decode(a);if(e){const p=c.indexOf("\0");return p!==-1?c.substring(0,p):c}return c.replace(/\0/g,"")}const t=a.length;let r,n,i,s="",o=0;for(;o<t;){if(r=a[o++],r===0&&e)return s;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(r);break;case 12:case 13:n=a[o++],s+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=a[o++],i=a[o++],s+=String.fromCharCode((r&15)<<12|(n&63)<<6|(i&63)<<0);break}}return s}const Q={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let r=a[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}};function G(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Y={exports:{}},te;function ve(){return te||(te=1,function(a,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(h,c,p){if(p=p||{},h=h.trim(),c=c.trim(),!c){if(!p.alwaysNormalize)return h;var g=o.parseURL(h);if(!g)throw new Error("Error trying to parse base URL.");return g.path=o.normalizePath(g.path),o.buildURLFromParts(g)}var x=o.parseURL(c);if(!x)throw new Error("Error trying to parse relative URL.");if(x.scheme)return p.alwaysNormalize?(x.path=o.normalizePath(x.path),o.buildURLFromParts(x)):c;var D=o.parseURL(h);if(!D)throw new Error("Error trying to parse base URL.");if(!D.netLoc&&D.path&&D.path[0]!=="/"){var T=n.exec(D.path);D.netLoc=T[1],D.path=T[2]}D.netLoc&&!D.path&&(D.path="/");var N={scheme:D.scheme,netLoc:x.netLoc,path:null,params:x.params,query:x.query,fragment:x.fragment};if(!x.netLoc&&(N.netLoc=D.netLoc,x.path[0]!=="/"))if(!x.path)N.path=D.path,x.params||(N.params=D.params,x.query||(N.query=D.query));else{var H=D.path,_e=H.substring(0,H.lastIndexOf("/")+1)+x.path;N.path=o.normalizePath(_e)}return N.path===null&&(N.path=p.alwaysNormalize?o.normalizePath(x.path):x.path),o.buildURLFromParts(N)},parseURL:function(h){var c=r.exec(h);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(h){for(h=h.split("").reverse().join("").replace(i,"");h.length!==(h=h.replace(s,"")).length;);return h.split("").reverse().join("")},buildURLFromParts:function(h){return h.scheme+h.netLoc+h.path+h.params+h.query+h.fragment}};a.exports=o})()}(Y)),Y.exports}var ae=ve();class S{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 E={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class z{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,gt(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let n;r.length===1?n=(t==null?void 0:t.byteRangeEndOffset)||0:n=parseInt(r[1]),this._byteRange=[n,parseInt(r[0])+n]}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={[E.AUDIO]:null,[E.VIDEO]:null,[E.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 S),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ae.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[E.AUDIO]=null,e[E.VIDEO]=null,e[E.AUDIOVIDEO]=null}}function ce(a){return a.sn!=="initSegment"}class qe extends z{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(F(e)&&F(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 r=Object.keys(this.levelkeys);if(r.length===1)return this._decryptdata=this.levelkeys[r[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=F(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),r=t.length;if(r>1||r===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!F(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return ce(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,r,n,i,s=!1){const{elementaryStreams:o}=this,h=o[e];if(!h){o[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:s};return}h.startPTS=Math.min(h.startPTS,t),h.endPTS=Math.max(h.endPTS,r),h.startDTS=Math.min(h.startDTS,n),h.endDTS=Math.max(h.endDTS,i)}}class Xe extends z{constructor(e,t,r,n,i){super(r),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=n;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.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 tt(a,e){const t=Object.getPrototypeOf(a);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||tt(t,e)}}function gt(a,e){const t=tt(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Rt=Math.pow(2,32)-1,ht=[].push,at={video:1,audio:2,id3:3,text:4};function Ct(a){return String.fromCharCode.apply(null,a)}function Vt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function St(a,e){const t=Nt(a,e);return t<0?4294967296+t:t}function Wt(a,e){let t=St(a,e);return t*=Math.pow(2,32),t+=St(a,e+4),t}function Nt(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Ot(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function ze(a){const e=a.byteLength;for(let t=0;t<e;){const r=St(a,t);if(r>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=r>1?t+r:e}return!1}function Ke(a,e){const t=[];if(!e.length)return t;const r=a.byteLength;for(let n=0;n<r;){const i=St(a,n),s=Ct(a.subarray(n+4,n+8)),o=i>1?n+i:r;if(s===e[0])if(e.length===1)t.push(a.subarray(n+8,o));else{const h=Ke(a.subarray(n+8,o),e.slice(1));h.length&&ht.apply(t,h)}n=o}return t}function se(a){const e=[],t=a[0];let r=8;const n=St(a,r);r+=4;let i=0,s=0;t===0?(i=St(a,r),s=St(a,r+4),r+=8):(i=Wt(a,r),s=Wt(a,r+8),r+=16),r+=2;let o=a.length+s;const h=Vt(a,r);r+=2;for(let c=0;c<h;c++){let p=r;const g=St(a,p);p+=4;const x=g&2147483647;if((g&2147483648)>>>31===1)return ye.warn("SIDX has hierarchical references (not supported)"),null;const T=St(a,p);p+=4,e.push({referenceSize:x,subsegmentDuration:T,info:{duration:T/n,start:o,end:o+x-1}}),o+=x,p+=4,r=p}return{earliestPresentationTime:i,timescale:n,version:t,referencesCount:h,references:e}}function Ne(a){const e=[],t=Ke(a,["moov","trak"]);for(let n=0;n<t.length;n++){const i=t[n],s=Ke(i,["tkhd"])[0];if(s){let o=s[0];const h=St(s,o===0?12:20),c=Ke(i,["mdia","mdhd"])[0];if(c){o=c[0];const p=St(c,o===0?12:20),g=Ke(i,["mdia","hdlr"])[0];if(g){const x=Ct(g.subarray(8,12)),D={soun:E.AUDIO,vide:E.VIDEO}[x],T=Ke(i,["mdia","minf","stbl","stsd"])[0],N=Fe(T);D?(e[h]={timescale:p,type:D,stsd:N},e[D]=A({timescale:p,id:h},N)):e[h]={timescale:p,type:x,stsd:N}}}}}return Ke(a,["moov","mvex","trex"]).forEach(n=>{const i=St(n,4),s=e[i];s&&(s.default={duration:St(n,12),flags:St(n,20)})}),e}function Fe(a){const e=a.subarray(8),t=e.subarray(86),r=Ct(e.subarray(4,8));let n=r,i;const s=r==="enca"||r==="encv";if(s){const c=Ke(e,[r])[0].subarray(r==="enca"?28:78);Ke(c,["sinf"]).forEach(g=>{const x=Ke(g,["schm"])[0];if(x){const D=Ct(x.subarray(4,8));if(D==="cbcs"||D==="cenc"){const T=Ke(g,["frma"])[0];T&&(n=Ct(T))}}})}const o=n;switch(n){case"avc1":case"avc2":case"avc3":case"avc4":{const h=Ke(t,["avcC"])[0];n+="."+ee(h[1])+ee(h[2])+ee(h[3]),i=R(o==="avc1"?"dva1":"dvav",t);break}case"mp4a":{const h=Ke(e,[r])[0],c=Ke(h.subarray(28),["esds"])[0];if(c&&c.length>7){let p=4;if(c[p++]!==3)break;p=V(c,p),p+=2;const g=c[p++];if(g&128&&(p+=2),g&64&&(p+=c[p++]),c[p++]!==4)break;p=V(c,p);const x=c[p++];if(x===64)n+="."+ee(x);else break;if(p+=12,c[p++]!==5)break;p=V(c,p);const D=c[p++];let T=(D&248)>>3;T===31&&(T+=1+((D&7)<<3)+((c[p]&224)>>5)),n+="."+T}break}case"hvc1":case"hev1":{const h=Ke(t,["hvcC"]);if(h){const c=h[0],p=c[1],g=["","A","B","C"][p>>6],x=p&31,D=St(c,2),T=(p&32)>>5?"H":"L",N=c[12],H=c.subarray(6,12);n+="."+g+x,n+="."+D.toString(16).toUpperCase(),n+="."+T+N;let _e="";for(let Ue=H.length;Ue--;){const Re=H[Ue];(Re||_e)&&(_e="."+Re.toString(16).toUpperCase()+_e)}n+=_e}i=R(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{n=R(n,t)||n;break}case"vp09":{const h=Ke(t,["vpcC"])[0],c=h[4],p=h[5],g=h[6]>>4&15;n+="."+j(c)+"."+j(p)+"."+j(g);break}case"av01":{const h=Ke(t,["av1C"])[0],c=h[1]>>>5,p=h[1]&31,g=h[2]>>>7?"H":"M",x=(h[2]&64)>>6,D=(h[2]&32)>>5,T=c===2&&x?D?12:10:x?10:8,N=(h[2]&16)>>4,H=(h[2]&8)>>3,_e=(h[2]&4)>>2,Ue=h[2]&3;n+="."+c+"."+j(p)+g+"."+j(T)+"."+N+"."+H+_e+Ue+"."+j(1)+"."+j(1)+"."+j(1)+"."+0,i=R("dav1",t);break}}return{codec:n,encrypted:s,supplemental:i}}function R(a,e){const t=Ke(e,["dvvC"]),r=t.length?t[0]:Ke(e,["dvcC"])[0];if(r){const n=r[2]>>1&127,i=r[2]<<5&32|r[3]>>3&31;return a+"."+j(n)+"."+j(i)}}function V(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 j(a){return(a<10?"0":"")+a}function W(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&Ke(a,["moov","trak"]).forEach(n=>{const s=Ke(n,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=Ke(s,["enca"]);const h=o.length>0;h||(o=Ke(s,["encv"])),o.forEach(c=>{const p=h?c.subarray(28):c.subarray(78);Ke(p,["sinf"]).forEach(x=>{const D=ke(x);if(D){const T=D.subarray(8,24);T.some(N=>N!==0)||(ye.log(`[eme] Patching keyId in 'enc${h?"a":"v"}>sinf>>tenc' box: ${Q.hexDump(T)} -> ${Q.hexDump(t)}`),D.set(t,8))}})})}),a}function ke(a){const e=Ke(a,["schm"])[0];if(e){const t=Ct(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Ke(a,["schi","tenc"])[0]}return null}function Pe(a,e){return Ke(e,["moof","traf"]).reduce((t,r)=>{const n=Ke(r,["tfdt"])[0],i=n[0],s=Ke(r,["tfhd"]).reduce((o,h)=>{const c=St(h,4),p=a[c];if(p){let g=St(n,4);if(i===1){if(g===Rt)return ye.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;g*=Rt+1,g+=St(n,8)}const x=p.timescale||9e4,D=g/x;if(F(D)&&(o===null||D<o))return D}return o},null);return s!==null&&F(s)&&(t===null||s<t)?s:t},null)}function Be(a,e){let t=0,r=0,n=0;const i=Ke(a,["moof","traf"]);for(let s=0;s<i.length;s++){const o=i[s],h=Ke(o,["tfhd"])[0],c=St(h,4),p=e[c];if(!p)continue;const g=p.default,x=St(h,0)|(g==null?void 0:g.flags);let D=g==null?void 0:g.duration;x&8&&(x&2?D=St(h,12):D=St(h,8));const T=p.timescale||9e4,N=Ke(o,["trun"]);for(let H=0;H<N.length;H++){if(t=Ce(N[H]),!t&&D){const _e=St(N[H],4);t=D*_e}p.type===E.VIDEO?r+=t/T:p.type===E.AUDIO&&(n+=t/T)}}if(r===0&&n===0){let s=1/0,o=0,h=0;const c=Ke(a,["sidx"]);for(let p=0;p<c.length;p++){const g=se(c[p]);if(g!=null&&g.references){s=Math.min(s,g.earliestPresentationTime/g.timescale);const x=g.references.reduce((D,T)=>D+T.info.duration||0,0);o=Math.max(o,x+g.earliestPresentationTime/g.timescale),h=o-s}}if(h&&F(h))return h}return r||n}function Ce(a){const e=St(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let r=0;const n=St(a,4);for(let i=0;i<n;i++){if(e&256){const s=St(a,t);r+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return r}function De(a,e,t){Ke(e,["moof","traf"]).forEach(r=>{Ke(r,["tfhd"]).forEach(n=>{const i=St(n,4),s=a[i];if(!s)return;const o=s.timescale||9e4;Ke(r,["tfdt"]).forEach(h=>{const c=h[0],p=t*o;if(p){let g=St(h,4);if(c===0)g-=p,g=Math.max(g,0),Ot(h,4,g);else{g*=Math.pow(2,32),g+=St(h,8),g-=p,g=Math.max(g,0);const x=Math.floor(g/(Rt+1)),D=Math.floor(g%(Rt+1));Ot(h,4,x),Ot(h,8,D)}}})})})}function Ye(a){const e={valid:null,remainder:null},t=Ke(a,["moof"]);if(t.length<2)return e.remainder=a,e;const r=t[t.length-1];return e.valid=a.slice(0,r.byteOffset-8),e.remainder=a.slice(r.byteOffset-8),e}function Ve(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function it(a,e){const t=[],r=e.samples,n=e.timescale,i=e.id;let s=!1;return Ke(r,["moof"]).map(h=>{const c=h.byteOffset-8;Ke(h,["traf"]).map(g=>{const x=Ke(g,["tfdt"]).map(D=>{const T=D[0];let N=St(D,4);return T===1&&(N*=Math.pow(2,32),N+=St(D,8)),N/n})[0];return x!==void 0&&(a=x),Ke(g,["tfhd"]).map(D=>{const T=St(D,4),N=St(D,0)&16777215,H=(N&1)!==0,_e=(N&2)!==0,Ue=(N&8)!==0;let Re=0;const Qe=(N&16)!==0;let Je=0;const ft=(N&32)!==0;let et=8;T===i&&(H&&(et+=8),_e&&(et+=4),Ue&&(Re=St(D,et),et+=4),Qe&&(Je=St(D,et),et+=4),ft&&(et+=4),e.type==="video"&&(s=ut(e.codec)),Ke(g,["trun"]).map(ot=>{const _t=ot[0],nt=St(ot,0)&16777215,At=(nt&1)!==0;let Pt=0;const br=(nt&4)!==0,rr=(nt&256)!==0;let Zt=0;const Ht=(nt&512)!==0;let Xt=0;const Yt=(nt&1024)!==0,Tt=(nt&2048)!==0;let Lt=0;const or=St(ot,4);let nr=8;At&&(Pt=St(ot,nr),nr+=4),br&&(nr+=4);let gr=Pt+c;for(let Cr=0;Cr<or;Cr++){if(rr?(Zt=St(ot,nr),nr+=4):Zt=Re,Ht?(Xt=St(ot,nr),nr+=4):Xt=Je,Yt&&(nr+=4),Tt&&(_t===0?Lt=St(ot,nr):Lt=Nt(ot,nr),nr+=4),e.type===E.VIDEO){let $r=0;for(;$r<Xt;){const Wr=St(r,gr);if(gr+=4,bt(s,r[gr])){const Pn=r.subarray(gr,gr+Wr);pt(Pn,s?2:1,a+Lt/n,t)}gr+=Wr,$r+=Wr+4}}a+=Zt/n}}))})})}),t}function ut(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function bt(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function pt(a,e,t,r){const n=mt(a);let i=0;i+=e;let s=0,o=0,h=0;for(;i<n.length;){s=0;do{if(i>=n.length)break;h=n[i++],s+=h}while(h===255);o=0;do{if(i>=n.length)break;h=n[i++],o+=h}while(h===255);const c=n.length-i;let p=i;if(o<c)i+=o;else if(o>c){ye.error(`Malformed SEI payload. ${o} is too small, only ${c} bytes left to parse.`);break}if(s===4){if(n[p++]===181){const x=Vt(n,p);if(p+=2,x===49){const D=St(n,p);if(p+=4,D===1195456820){const T=n[p++];if(T===3){const N=n[p++],H=31&N,_e=64&N,Ue=_e?2+H*3:0,Re=new Uint8Array(Ue);if(_e){Re[0]=N;for(let Qe=1;Qe<Ue;Qe++)Re[Qe]=n[p++]}r.push({type:T,payloadType:s,pts:t,bytes:Re})}}}}}else if(s===5&&o>16){const g=[];for(let T=0;T<16;T++){const N=n[p++].toString(16);g.push(N.length==1?"0"+N:N),(T===3||T===5||T===7||T===9)&&g.push("-")}const x=o-16,D=new Uint8Array(x);for(let T=0;T<x;T++)D[T]=n[p++];r.push({payloadType:s,pts:t,uuid:g.join(""),userData:He(D),userDataBytes:D})}}}function mt(a){const e=a.byteLength,t=[];let r=1;for(;r<e-2;)a[r]===0&&a[r+1]===0&&a[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return a;const n=e-t.length,i=new Uint8Array(n);let s=0;for(r=0;r<n;s++,r++)s===t[0]&&(s++,t.shift()),i[r]=a[s];return i}function ct(a){const e=a[0];let t="",r="",n=0,i=0,s=0,o=0,h=0,c=0;if(e===0){for(;Ct(a.subarray(c,c+1))!=="\0";)t+=Ct(a.subarray(c,c+1)),c+=1;for(t+=Ct(a.subarray(c,c+1)),c+=1;Ct(a.subarray(c,c+1))!=="\0";)r+=Ct(a.subarray(c,c+1)),c+=1;r+=Ct(a.subarray(c,c+1)),c+=1,n=St(a,12),i=St(a,16),o=St(a,20),h=St(a,24),c=28}else if(e===1){c+=4,n=St(a,c),c+=4;const g=St(a,c);c+=4;const x=St(a,c);for(c+=4,s=Wl(2,32)*g+x,Le(s)||(s=Number.MAX_SAFE_INTEGER,ye.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=St(a,c),c+=4,h=St(a,c),c+=4;Ct(a.subarray(c,c+1))!=="\0";)t+=Ct(a.subarray(c,c+1)),c+=1;for(t+=Ct(a.subarray(c,c+1)),c+=1;Ct(a.subarray(c,c+1))!=="\0";)r+=Ct(a.subarray(c,c+1)),c+=1;r+=Ct(a.subarray(c,c+1)),c+=1}const p=a.subarray(c,a.byteLength);return{schemeIdUri:t,value:r,timeScale:n,presentationTime:s,presentationTimeDelta:i,eventDuration:o,id:h,payload:p}}function _(a,...e){const t=e.length;let r=8,n=t;for(;n--;)r+=e[n].byteLength;const i=new Uint8Array(r);for(i[0]=r>>24&255,i[1]=r>>16&255,i[2]=r>>8&255,i[3]=r&255,i.set(a,4),n=0,r=8;n<t;n++)i.set(e[n],r),r+=e[n].byteLength;return i}function y(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let r,n;r=0,n=new Uint8Array;let i;r>0?(i=new Uint8Array(4),e.length>0&&new DataView(i.buffer).setUint32(0,e.length,!1)):i=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),_([112,115,115,104],new Uint8Array([r,0,0,0]),a,i,n,s,t||new Uint8Array)}function Ge(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let r=0;for(;r+32<t;){const n=new DataView(a,r),i=O(n);e.push(i),r+=i.size}}return e}function O(a){const e=a.getUint32(0),t=a.byteOffset,r=a.byteLength;if(r<e)return{offset:t,size:r};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const i=a.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:t,size:e};const s=a.buffer,o=Q.hexDump(new Uint8Array(s,t+12,16)),h=a.getUint32(28);let c=null,p=null;if(i===0){if(e-32<h||h<22)return{offset:t,size:e};p=new Uint8Array(s,t+32,h)}else if(i===1){if(!h||r<t+32+h*16+16)return{offset:t,size:e};c=[];for(let g=0;g<h;g++)c.push(new Uint8Array(s,t+32+g*16,16))}return{version:i,systemId:o,kids:c,data:p,offset:t,size:e}}const re=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Et={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 Ee(a,e){const t=Et[e];return!!t&&!!t[a.slice(0,4)]}function Ae(a,e,t=!0){return!a.split(",").some(r=>!je(r,e,t))}function je(a,e,t=!0){var r;const n=xe(t);return(r=n==null?void 0:n.isTypeSupported(B(a,e)))!=null?r:!1}function B(a,e){return`${e}/mp4;codecs=${a}`}function q(a){if(a){const e=a.substring(0,4);return Et.video[e]}return 2}function oe(a){const e=re();return a.split(",").reduce((t,r)=>{const i=e&&ut(r)?9:Et.video[r];return i?(i*2+t)/(t?3:2):(Et.audio[r]+t)/(t?2:1)},0)}const Te={};function P(a,e=!0){if(Te[a])return Te[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let n=0;n<t.length;n++){var r;if(je(t[n],"audio",e))return Te[a]=t[n],t[n];if(t[n]==="mp3"&&(r=xe(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return a}const vt=/flac|opus|mp4a\.40\.34/i;function me(a,e=!0){return a.replace(vt,t=>P(t.toLowerCase(),e))}function Dt(a,e){const t=[];if(a){const r=a.split(",");for(let n=0;n<r.length;n++)Ee(r[n],"video")||t.push(r[n])}return e&&t.push(e),t.join(",")}function Mt(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let r=t.length;r--;)if(t[r].substring(0,4)===a.substring(0,4))return t[r]}return t[0]}}return e||a}function zt(a){const e=a.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");if(r.length>2){let n=r.shift()+".";n+=parseInt(r.shift()).toString(16),n+=("000"+parseInt(r.shift()).toString(16)).slice(-4),e[t]=n}}return e.join(",")}function Ar(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return a}function Qt(a){const e=xe(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 Bt(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Sr={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Tr(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const Yr={};function qr(a,e,t,r,n,i){const s=a.audioCodec?a.audioGroups:null,o=i==null?void 0:i.audioCodec,h=i==null?void 0:i.channels,c=h?parseInt(h):o?1/0:2;let p=null;if(s!=null&&s.length)try{s.length===1&&s[0]?p=e.groups[s[0]].channels:p=s.reduce((g,x)=>{if(x){const D=e.groups[x];if(!D)throw new Error(`Audio track group ${x} not found`);Object.keys(D.channels).forEach(T=>{g[T]=(g[T]||0)+D.channels[T]})}return g},{2:0})}catch(g){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(r,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(n,8e6))||!!p&&F(c)&&Object.keys(p).some(g=>parseInt(g)>c)}function It(a,e,t){const r=a.videoCodec,n=a.audioCodec;if(!r&&!n||!t)return Promise.resolve(Sr);const i=[];if(r){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},o=a.videoRange;o!=="SDR"&&(s.transferFunction=o.toLowerCase());const h=r.split(","),c=navigator.userAgent;if(h.some(p=>ut(p))&&re())return Promise.resolve(Tr(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${c})`),i));i.push.apply(i,h.map(p=>({type:"media-source",video:A(A({},s),{},{contentType:B(Ar(p),"video")})})))}return n&&a.audioGroups&&a.audioGroups.forEach(s=>{var o;s&&((o=e.groups[s])==null||o.tracks.forEach(h=>{if(h.groupId===s){const c=h.channels||"",p=parseFloat(c);F(p)&&p>2&&i.push.apply(i,n.split(",").map(g=>({type:"media-source",audio:{contentType:B(g,"audio"),channels:""+p}})))}}))}),Promise.all(i.map(s=>{const o=Jt(s);return Yr[o]||(Yr[o]=t.decodingInfo(s))})).then(s=>({supported:!s.some(o=>!o.supported),configurations:i,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:i,decodingInfoResults:[],error:s}))}function Jt(a){const{audio:e,video:t}=a,r=t||e;if(r){const n=Bt(r.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${n}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${n}`}return""}const mr=["NONE","TYPE-0","TYPE-1",null];function Zr(a){return mr.indexOf(a)>-1}const Lr=["SDR","PQ","HLG"];function _n(a){return!!a&&Lr.indexOf(a)>-1}var _r={No:"",Yes:"YES",v2:"v2"};function xn(a){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=a,n=r<e/2;return e&&n?t?_r.v2:_r.Yes:_r.No}class cn{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}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 Ut{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(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.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 Ft(this._audioGroups,e)}hasSubtitleGroup(e){return Ft(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.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 Ft(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function sr(){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 Pr(a,e){let t=!1,r=[];if(a&&(t=a!=="SDR",r=[a]),e){r=e.allowedVideoRanges||Lr.slice(0);const n=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:n&&sr(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const Er=a=>{const e=new WeakSet;return(t,r)=>{if(a&&(r=a(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},fr=(a,e)=>JSON.stringify(a,Er(e));function On(a,e,t,r,n){const i=Object.keys(a),s=r==null?void 0:r.channels,o=r==null?void 0:r.audioCodec,h=n==null?void 0:n.videoCodec,c=s&&parseInt(s)===2;let p=!1,g=!1,x=1/0,D=1/0,T=1/0,N=1/0,H=0,_e=[];const{preferHDR:Ue,allowedVideoRanges:Re}=Pr(e,n);for(let ot=i.length;ot--;){const _t=a[i[ot]];p||(p=_t.channels[2]>0),x=Math.min(x,_t.minHeight),D=Math.min(D,_t.minFramerate),T=Math.min(T,_t.minBitrate),Re.filter(At=>_t.videoRanges[At]>0).length>0&&(g=!0)}x=F(x)?x:0,D=F(D)?D:0;const Qe=Math.max(1080,x),Je=Math.max(30,D);T=F(T)?T:t,t=Math.max(T,t),g||(e=void 0);const ft=i.length>1;return{codecSet:i.reduce((ot,_t)=>{const nt=a[_t];if(_t===ot)return ot;if(_e=g?Re.filter(At=>nt.videoRanges[At]>0):[],ft){if(nt.minBitrate>t)return Or(_t,`min bitrate of ${nt.minBitrate} > current estimate of ${t}`),ot;if(!nt.hasDefaultAudio)return Or(_t,"no renditions with default or auto-select sound found"),ot;if(o&&_t.indexOf(o.substring(0,4))%5!==0)return Or(_t,`audio codec preference "${o}" not found`),ot;if(s&&!c){if(!nt.channels[s])return Or(_t,`no renditions with ${s} channel sound found (channels options: ${Object.keys(nt.channels)})`),ot}else if((!o||c)&&p&&nt.channels[2]===0)return Or(_t,"no renditions with stereo sound found"),ot;if(nt.minHeight>Qe)return Or(_t,`min resolution of ${nt.minHeight} > maximum of ${Qe}`),ot;if(nt.minFramerate>Je)return Or(_t,`min framerate of ${nt.minFramerate} > maximum of ${Je}`),ot;if(!_e.some(At=>nt.videoRanges[At]>0))return Or(_t,`no variants with VIDEO-RANGE of ${fr(_e)} found`),ot;if(h&&_t.indexOf(h.substring(0,4))%5!==0)return Or(_t,`video codec preference "${h}" not found`),ot;if(nt.maxScore<H)return Or(_t,`max score of ${nt.maxScore} < selected max of ${H}`),ot}return ot&&(oe(_t)>=oe(ot)||nt.fragmentError>a[ot].fragmentError)?ot:(N=nt.minIndex,H=nt.maxScore,_t)},void 0),videoRanges:_e,preferHDR:Ue,minFramerate:D,minBitrate:T,minIndex:N}}function Or(a,e){ye.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Rr(a){return a.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const n=t.channels||"2";return r.channels[n]=(r.channels[n]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Hr(a,e,t,r){return a.slice(t,r+1).reduce((n,i,s)=>{if(!i.codecSet)return n;const o=i.audioGroups;let h=n[i.codecSet];h||(n[i.codecSet]=h={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),h.minBitrate=Math.min(h.minBitrate,i.bitrate);const c=Math.min(i.height,i.width);return h.minHeight=Math.min(h.minHeight,c),h.minFramerate=Math.min(h.minFramerate,i.frameRate),h.minIndex=Math.min(h.minIndex,s),h.maxScore=Math.max(h.maxScore,i.score),h.fragmentError+=i.fragmentError,h.videoRanges[i.videoRange]=(h.videoRanges[i.videoRange]||0)+1,o&&o.forEach(p=>{if(!p)return;const g=e.groups[p];g&&(h.hasDefaultAudio=h.hasDefaultAudio||e.hasDefaultAudio?g.hasDefault:g.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(g.channels).forEach(x=>{h.channels[x]=(h.channels[x]||0)+g.channels[x]}))}),n},{})}function vr(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:i}=a;return{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:i}}function Xr(a,e,t){if("attrs"in a){const r=e.indexOf(a);if(r!==-1)return r}for(let r=0;r<e.length;r++){const n=e[r];if(an(a,n,t))return r}return-1}function an(a,e,t){const{groupId:r,name:n,lang:i,assocLang:s,default:o}=a,h=a.forced;return(r===void 0||e.groupId===r)&&(n===void 0||e.name===n)&&(i===void 0||on(i,e.lang))&&(i===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(h===void 0||e.forced===h)&&(!("characteristics"in a)||hr(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function on(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function hr(a,e=""){const t=a.split(","),r=e.split(",");return t.length===r.length&&!t.some(n=>r.indexOf(n)===-1)}function lr(a,e){const{audioCodec:t,channels:r}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function Mr(a,e,t,r,n){const i=e[r],o=e.reduce((x,D,T)=>{const N=D.uri;return(x[N]||(x[N]=[])).push(T),x},{})[i.uri];o.length>1&&(r=Math.max.apply(Math,o));const h=i.videoRange,c=i.frameRate,p=i.codecSet.substring(0,4),g=zr(e,r,x=>{if(x.videoRange!==h||x.frameRate!==c||x.codecSet.substring(0,4)!==p)return!1;const D=x.audioGroups,T=t.filter(N=>!D||D.indexOf(N.groupId)!==-1);return Xr(a,T,n)>-1});return g>-1?g:zr(e,r,x=>{const D=x.audioGroups,T=t.filter(N=>!D||D.indexOf(N.groupId)!==-1);return Xr(a,T,n)>-1})}function zr(a,e,t){for(let r=e;r>-1;r--)if(t(a[r]))return r;for(let r=e+1;r<a.length;r++)if(t(a[r]))return r;return-1}function Dr(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class mn extends Z{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var r;const{fragCurrent:n,partCurrent:i,hls:s}=this,{autoLevelEnabled:o,media:h}=s;if(!n||!h)return;const c=performance.now(),p=i?i.stats:n.stats,g=i?i.duration:n.duration,x=c-p.loading.start,D=s.minAutoLevel,T=n.level,N=this._nextAutoLevel;if(p.aborted||p.loaded&&p.loaded===p.total||T<=D){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const H=N>-1&&N!==T,_e=!!t||H;if(!_e&&(h.paused||!h.playbackRate||!h.readyState))return;const Ue=s.mainForwardBufferInfo;if(!_e&&Ue===null)return;const Re=this.bwEstimator.getEstimateTTFB(),Qe=Math.abs(h.playbackRate);if(x<=Math.max(Re,1e3*(g/(Qe*2))))return;const Je=Ue?Ue.len/Qe:0,ft=p.loading.first?p.loading.first-p.loading.start:-1,et=p.loaded&&ft>-1,ot=this.getBwEstimate(),_t=s.levels,nt=_t[T],At=Math.max(p.loaded,Math.round(g*(n.bitrate||nt.averageBitrate)/8));let Pt=et?x-ft:x;Pt<1&&et&&(Pt=Math.min(x,p.loaded*8/ot));const br=et?p.loaded*1e3/Pt:0,rr=Re/1e3,Zt=br?(At-p.loaded)/br:At*8/ot+rr;if(Zt<=Je)return;const Ht=br?br*8:ot,Xt=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,Yt=this.hls.config.abrBandWidthUpFactor;let Tt=Number.POSITIVE_INFINITY,Lt;for(Lt=T-1;Lt>D;Lt--){const Cr=_t[Lt].maxBitrate,$r=!_t[Lt].details||Xt;if(Tt=this.getTimeToLoadFrag(rr,Ht,g*Cr,$r),Tt<Math.min(Je,g+rr))break}if(Tt>=Zt||Tt>g*10)return;et?this.bwEstimator.sample(x-Math.min(Re,ft),p.loaded):this.bwEstimator.sampleTTFB(x);const or=_t[Lt].maxBitrate;this.getBwEstimate()*Yt>or&&this.resetEstimator(or);const nr=this.findBestLevel(or,D,Lt,0,Je,1,1);nr>-1&&(Lt=nr),this.warn(`Fragment ${n.sn}${i?" part "+i.index:""} of level ${T} is loading too slowly;
|
|
Fragment duration: ${n.duration.toFixed(3)}
|
|
Time to underbuffer: ${Je.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Zt.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Tt.toFixed(3)} s
|
|
TTFB estimate: ${ft|0} ms
|
|
Current BW estimate: ${F(ot)?ot|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Lt} @ ${or|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Lt,this.clearTimer();const gr=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===Lt&&Lt>0){const Cr=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Lt>0?"and switching down":""}
|
|
Fragment duration: ${n.duration.toFixed(3)} s
|
|
Time to underbuffer: ${Cr.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,Lt>D){let $r=this.findBestLevel(this.hls.levels[D].bitrate,D,Lt,0,Cr,1,1);$r===-1&&($r=D),this.hls.nextLoadLevel=this.hls.nextAutoLevel=$r,this.resetEstimator(this.hls.levels[$r].bitrate)}}};H||Zt>Tt*2?gr():this.timer=self.setInterval(gr,Tt*1e3),s.trigger(v.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:i,stats:p})},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 he(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.FRAG_LOADING,this.onFragLoading,this),e.on(v.FRAG_LOADED,this.onFragLoaded,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this),e.on(v.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(v.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.FRAG_LOADING,this.onFragLoading,this),e.off(v.FRAG_LOADED,this.onFragLoaded,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this),e.off(v.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(v.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const r=t.frag;if(!this.ignoreFragment(r)){if(!r.bitrateTest){var n;this.fragCurrent=r,this.partCurrent=(n=t.part)!=null?n: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 ne.BUFFER_ADD_CODEC_ERROR:case ne.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case ne.FRAG_LOAD_TIMEOUT:{const r=t.frag,{fragCurrent:n,partCurrent:i}=this;if(r&&n&&r.sn===n.sn&&r.level===n.level){const s=performance.now(),o=i?i.stats:r.stats,h=s-o.loading.start,c=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&c>-1){const g=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(h-Math.min(g,c),o.loaded)}else this.bwEstimator.sampleTTFB(h)}break}}}getTimeToLoadFrag(e,t,r,n){const i=e+r/t,s=n?e+this.lastLevelLoadSec:0;return i+s}onLevelLoaded(e,t){const r=this.hls.config,{loading:n}=t.stats,i=n.end-n.first;F(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:r}){const n=r?r.stats:t.stats;if(t.type===fe.MAIN&&this.bwEstimator.sampleTTFB(n.loading.first-n.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const i=r?r.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+n.loaded,h=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:o,duration:h},s.realBitrate=Math.round(8*o/h)}if(t.bitrateTest){const i={stats:n,frag:t,part:r,id:t.type};this.onFragBuffered(v.FRAG_BUFFERED,i),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:n}=t,i=n!=null&&n.stats.loaded?n.stats:r.stats;if(i.aborted||this.ignoreFragment(r))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==fe.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,r=this.getBwEstimate(),n=this.hls.config.maxStarvationDelay,i=this.findBestLevel(r,t,e,0,n,1,1);if(i>-1)return i;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,r=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(e!==-1&&(!r||!n||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const i=r&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,i)&&s[e].loadError<=s[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this;if(r.levels.length<=1)return r.loadLevel;const{maxAutoLevel:n,config:i,minAutoLevel:s}=r,o=t?t.duration:e?e.duration:0,h=this.getBwEstimate(),c=this.getStarvationDelay();let p=i.abrBandWidthFactor,g=i.abrBandWidthUpFactor;if(c){const H=this.findBestLevel(h,s,n,c,0,p,g);if(H>=0)return this.rebufferNotice=-1,H}let x=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay;if(!c){const H=this.bitrateTestDelay;H&&(x=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-H,this.info(`bitrate test took ${Math.round(1e3*H)}ms, set first fragment max fetchDuration to ${Math.round(1e3*x)} ms`),p=g=1)}const D=this.findBestLevel(h,s,n,c,x,p,g);if(this.rebufferNotice!==D&&(this.rebufferNotice=D,this.info(`${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${D}`)),D>-1)return D;const T=r.levels[s],N=r.loadLevelObj;return N&&(T==null?void 0:T.bitrate)<N.bitrate?s:r.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const r=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,n=e.mainForwardBufferInfo;return(n?n.len:0)/r}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,r,n,i,s,o){var h;const c=n+i,p=this.lastLoadedFragLevel,g=p===-1?this.hls.firstLevel:p,{fragCurrent:x,partCurrent:D}=this,{levels:T,allAudioTracks:N,loadLevel:H,config:_e}=this.hls;if(T.length===1)return 0;const Ue=T[g],Re=!!((h=this.hls.latestLevelDetails)!=null&&h.live),Qe=H===-1||p===-1;let Je,ft="SDR",et=(Ue==null?void 0:Ue.frameRate)||0;const{audioPreference:ot,videoPreference:_t}=_e,nt=this.audioTracksByGroup||(this.audioTracksByGroup=Rr(N));let At=-1;if(Qe){if(this.firstSelection!==-1)return this.firstSelection;const Ht=this.codecTiers||(this.codecTiers=Hr(T,nt,t,r)),Xt=On(Ht,ft,e,ot,_t),{codecSet:Yt,videoRanges:Tt,minFramerate:Lt,minBitrate:or,minIndex:nr,preferHDR:gr}=Xt;At=nr,Je=Yt,ft=gr?Tt[Tt.length-1]:Tt[0],et=Lt,e=Math.max(e,or),this.log(`picked start tier ${fr(Xt)}`)}else Je=Ue==null?void 0:Ue.codecSet,ft=Ue==null?void 0:Ue.videoRange;const Pt=D?D.duration:x?x.duration:0,br=this.bwEstimator.getEstimateTTFB()/1e3,rr=[];for(let Ht=r;Ht>=t;Ht--){var Zt;const Xt=T[Ht],Yt=Ht>g;if(!Xt)continue;if(_e.useMediaCapabilities&&!Xt.supportedResult&&!Xt.supportedPromise){const $r=navigator.mediaCapabilities;typeof($r==null?void 0:$r.decodingInfo)=="function"&&(qr(Xt,nt,ft,et,e,ot)||ut(Xt.videoCodec))?(Xt.supportedPromise=It(Xt,nt,$r),Xt.supportedPromise.then(Wr=>{if(!this.hls)return;Xt.supportedResult=Wr;const Pn=this.hls.levels,jn=Pn.indexOf(Xt);Wr.error?this.warn(`MediaCapabilities decodingInfo error: "${Wr.error}" for level ${jn} ${fr(Wr)}`):Wr.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${jn} ${fr(Wr)}`),jn>-1&&Pn.length>1&&(this.log(`Removing unsupported level ${jn}`),this.hls.removeLevel(jn),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Xt.supportedResult=Sr}if((Je&&Xt.codecSet!==Je||ft&&Xt.videoRange!==ft||Yt&&et>Xt.frameRate||!Yt&&et>0&&et<Xt.frameRate||Xt.supportedResult&&!((Zt=Xt.supportedResult.decodingInfoResults)!=null&&Zt[0].smooth))&&(!Qe||Ht!==At)){rr.push(Ht);continue}const Tt=Xt.details,Lt=(D?Tt==null?void 0:Tt.partTarget:Tt==null?void 0:Tt.averagetargetduration)||Pt;let or;Yt?or=o*e:or=s*e;const nr=Pt&&n>=Pt*2&&i===0?Xt.averageBitrate:Xt.maxBitrate,gr=this.getTimeToLoadFrag(br,or,nr*Lt,Tt===void 0);if(or>=nr&&(Ht===p||Xt.loadError===0&&Xt.fragmentError===0)&&(gr<=br||!F(gr)||Re&&!this.bitrateTestDelay||gr<c)){const $r=this.forcedAutoLevel;return Ht!==H&&($r===-1||$r!==H)&&(rr.length&&this.trace(`Skipped level(s) ${rr.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${T[rr[0]].codecs}" ${T[rr[0]].videoRange}; not compatible with "${Je}" ${ft}`),this.info(`switch candidate:${g}->${Ht} adjustedbw(${Math.round(or)})-bitrate=${Math.round(or-nr)} ttfb:${br.toFixed(1)} avgDuration:${Lt.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${gr.toFixed(1)} firstSelection:${Qe} codecSet:${Xt.codecSet} videoRange:${Xt.videoRange} hls.loadLevel:${H}`)),Qe&&(this.firstSelection=Ht),Ht}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:r}=this.hls;return Math.min(Math.max(e,r),t)}}const si={search:function(a,e){let t=0,r=a.length-1,n=null,i=null;for(;t<=r;){n=(t+r)/2|0,i=a[n];const s=e(i);if(s>0)t=n+1;else if(s<0)r=n-1;else return i}return null}};function Mn(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!F(e))return null;const r=a[0].programDateTime;if(e<(r||0))return null;const n=a[a.length-1].endProgramDateTime;if(e>=(n||0))return null;t=t||0;for(let i=0;i<a.length;++i){const s=a[i];if(Fn(e,t,s))return s}return null}function ur(a,e,t=0,r=0,n=.005){let i=null;if(a){i=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),i&&a.level!==i.level&&i.end<=a.end&&(i=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(i=e[0]);if(i&&((!a||a.level===i.level)&&Ln(t,r,i)===0||wr(i,a,Math.min(n,r))))return i;const s=si.search(e,Ln.bind(null,t,r));return s&&(s!==a||!i)?s:i}function wr(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const r=e.tagList.reduce((n,i)=>(i[0]==="INF"&&(n+=parseFloat(i[1])),n),t);return a.start<=r}return!1}function Ln(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-r<=a?1:t.start-r>a&&t.start?-1:0}function Fn(a,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>a}function Hn(a,e){return si.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}function Ii(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){const r=t.start,n=t.end;let i=a.fragments;if(!t.relurl){const{fragmentHint:s}=a;s&&(i=i.concat(s))}return si.search(i,s=>s.cc<e||s.end<=r?1:s.cc>e||s.start>=n?-1:0)}return null}function Xn(a){switch(a.details){case ne.FRAG_LOAD_TIMEOUT:case ne.KEY_LOAD_TIMEOUT:case ne.LEVEL_LOAD_TIMEOUT:case ne.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function bi(a,e){const t=Xn(e);return a.default[`${t?"timeout":"error"}Retry`]}function gn(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function ai(a){return A(A({},a),{errorRetry:null,timeoutRetry:null})}function Qn(a,e,t,r){if(!a)return!1;const n=r==null?void 0:r.code,i=e<a.maxNumRetry&&(oi(n)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,r,i):i}function oi(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var en={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},st={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class tr extends Z{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(v.ERROR,this.onError,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(v.ERROR,this.onError,this),e.off(v.ERROR,this.onErrorOut,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.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)===fe.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const n=this.hls,i=t.context;switch(t.details){case ne.FRAG_LOAD_ERROR:case ne.FRAG_LOAD_TIMEOUT:case ne.KEY_LOAD_ERROR:case ne.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case ne.FRAG_PARSING_ERROR:if((r=t.frag)!=null&&r.gap){t.errorAction=Fr();return}case ne.FRAG_GAP:case ne.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=en.SendAlternateToPenaltyBox;return}case ne.LEVEL_EMPTY_ERROR:case ne.LEVEL_PARSING_ERROR:{var s,o;const c=t.parent===fe.MAIN?t.level:n.loadLevel;t.details===ne.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(o=s.levelDetails)!=null&&o.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case ne.LEVEL_LOAD_ERROR:case ne.LEVEL_LOAD_TIMEOUT:typeof(i==null?void 0:i.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case ne.AUDIO_TRACK_LOAD_ERROR:case ne.AUDIO_TRACK_LOAD_TIMEOUT:case ne.SUBTITLE_LOAD_ERROR:case ne.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const c=n.loadLevelObj;if(c&&(i.type===we.AUDIO_TRACK&&c.hasAudioGroup(i.groupId)||i.type===we.SUBTITLE_TRACK&&c.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=en.SendAlternateToPenaltyBox,t.errorAction.flags=st.MoveAllAlternatesMatchingHost;return}}return;case ne.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=n.loadLevelObj,p=c==null?void 0:c.attrs["HDCP-LEVEL"];p?t.errorAction={action:en.SendAlternateToPenaltyBox,flags:st.MoveAllAlternatesMatchingHDCP,hdcpLevel:p}:this.keySystemError(t)}return;case ne.BUFFER_ADD_CODEC_ERROR:case ne.REMUX_ALLOC_ERROR:case ne.BUFFER_APPEND_ERROR:if(!t.errorAction){var h;t.errorAction=this.getLevelSwitchAction(t,(h=t.level)!=null?h:n.loadLevel)}return;case ne.INTERNAL_EXCEPTION:case ne.BUFFER_APPENDING_ERROR:case ne.BUFFER_FULL_ERROR:case ne.LEVEL_SWITCH_ERROR:case ne.BUFFER_STALLED_ERROR:case ne.BUFFER_SEEK_OVER_HOLE:case ne.BUFFER_NUDGE_ON_STALL:t.errorAction=Fr();return}t.type===ge.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 r=this.hls,n=bi(r.config.playlistLoadPolicy,e),i=this.playlistError++;if(Qn(n,i,Xn(e),e.response))return{action:en.RetryRequest,flags:st.None,retryConfig:n,retryCount:i};const o=this.getLevelSwitchAction(e,t);return n&&(o.retryConfig=n,o.retryCount=i),o}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),n=t.levels[r],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,o=bi(e.details.startsWith("key")?s:i,e),h=t.levels.reduce((p,g)=>p+g.fragmentError,0);if(n&&(e.details!==ne.FRAG_GAP&&n.fragmentError++,Qn(o,h,Xn(e),e.response)))return{action:en.RetryRequest,flags:st.None,retryConfig:o,retryCount:h};const c=this.getLevelSwitchAction(e,r);return o&&(c.retryConfig=o,c.retryCount=h),c}getLevelSwitchAction(e,t){const r=this.hls;t==null&&(t=r.loadLevel);const n=this.hls.levels[t];if(n){var i,s;const c=e.details;n.loadError++,c===ne.BUFFER_APPEND_ERROR&&n.fragmentError++;let p=-1;const{levels:g,loadLevel:x,minAutoLevel:D,maxAutoLevel:T}=r;r.autoLevelEnabled||(r.loadLevel=-1);const N=(i=e.frag)==null?void 0:i.type,_e=(N===fe.AUDIO&&c===ne.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===ne.BUFFER_ADD_CODEC_ERROR||c===ne.BUFFER_APPEND_ERROR))&&g.some(({audioCodec:ft})=>n.audioCodec!==ft),Re=e.sourceBufferName==="video"&&(c===ne.BUFFER_ADD_CODEC_ERROR||c===ne.BUFFER_APPEND_ERROR)&&g.some(({codecSet:ft,audioCodec:et})=>n.codecSet!==ft&&n.audioCodec===et),{type:Qe,groupId:Je}=(s=e.context)!=null?s:{};for(let ft=g.length;ft--;){const et=(ft+x)%g.length;if(et!==x&&et>=D&&et<=T&&g[et].loadError===0){var o,h;const ot=g[et];if(c===ne.FRAG_GAP&&N===fe.MAIN&&e.frag){const _t=g[et].details;if(_t){const nt=ur(e.frag,_t.fragments,e.frag.start);if(nt!=null&&nt.gap)continue}}else{if(Qe===we.AUDIO_TRACK&&ot.hasAudioGroup(Je)||Qe===we.SUBTITLE_TRACK&&ot.hasSubtitleGroup(Je))continue;if(N===fe.AUDIO&&(o=n.audioGroups)!=null&&o.some(_t=>ot.hasAudioGroup(_t))||N===fe.SUBTITLE&&(h=n.subtitleGroups)!=null&&h.some(_t=>ot.hasSubtitleGroup(_t))||_e&&n.audioCodec===ot.audioCodec||!_e&&n.audioCodec!==ot.audioCodec||Re&&n.codecSet===ot.codecSet)continue}p=et;break}}if(p>-1&&r.loadLevel!==p)return e.levelRetry=!0,this.playlistError=0,{action:en.SendAlternateToPenaltyBox,flags:st.None,nextAutoLevel:p}}return{action:en.SendAlternateToPenaltyBox,flags:st.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case en.DoNothing:break;case en.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==ne.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case en.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:n,hdcpLevel:i,nextAutoLevel:s}=r;switch(n){case st.None:this.switchLevel(e,s);break;case st.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=mr[mr.indexOf(i)-1],r.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}r.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===ne.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const r=Bt(e.mimeType),n=this.hls.levels;for(let i=n.length;i--;)n[i][`${e.sourceBufferName}Codec`]===r&&this.hls.removeLevel(i)}}}function Fr(a){const e={action:en.DoNothing,flags:st.None};return a&&(e.resolved=!0),e}var Br={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class xi{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.BUFFER_APPENDED,this.onBufferAppended,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this),e.on(v.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.BUFFER_APPENDED,this.onBufferAppended,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this),e.off(v.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let n=r.length;n--;){const i=r[n];if(!i)break;const s=i.end;if(i.start<=e&&s!==null&&e<=s)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,r){const{fragments:n}=this,i=Object.keys(n);for(let s=i.length;s--;){const o=n[i[s]];if((o==null?void 0:o.body.type)===t&&(!r||o.buffered)){const h=o.body;if(h.start<=e&&e<=h.end)return h}}return null}detectEvictedFragments(e,t,r,n,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(n==null?void 0:n.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const h=this.fragments[o];if(!h||s>=h.body.sn)return;if(!h.buffered&&(!h.loaded||i)){h.body.type===r&&this.removeFragment(h.body);return}const c=h.range[e];if(c){if(c.time.length===0){this.removeFragment(h.body);return}c.time.some(p=>{const g=!this.isTimeBuffered(p.startPTS,p.endPTS,t);return g&&this.removeFragment(h.body),g})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,n=Sn(r),i=this.fragments[n];if(!i||i.buffered&&r.gap)return;const s=!r.relurl;Object.keys(t).forEach(o=>{const h=r.elementaryStreams[o];if(!h)return;const c=t[o],p=s||h.partial===!0;i.range[o]=this.getBufferedTimes(r,e.part,p,c)}),i.loaded=null,Object.keys(i.range).length?(i.buffered=!0,(i.body.endList=r.endList||i.body.endList)&&(this.endListFragments[i.body.type]=i),Kn(i)||this.removeParts(r.sn-1,r.type)):this.removeFragment(i.body)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=r.filter(n=>n.fragment.sn>=e))}fragBuffered(e,t){const r=Sn(e);let n=this.fragments[r];!n&&t&&(n=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),n&&(n.loaded=null,n.buffered=!0)}getBufferedTimes(e,t,r,n){const i={time:[],partial:r},s=e.start,o=e.end,h=e.minEndPTS||o,c=e.maxStartPTS||s;for(let p=0;p<n.length;p++){const g=n.start(p)-this.bufferPadding,x=n.end(p)+this.bufferPadding;if(c>=g&&h<=x){i.time.push({startPTS:Math.max(s,n.start(p)),endPTS:Math.min(o,n.end(p))});break}else if(s<x&&o>g){const D=Math.max(s,n.start(p)),T=Math.min(o,n.end(p));T>D&&(i.partial=!0,i.time.push({startPTS:D,endPTS:T}))}else if(o<=g)break}return i}getPartialFragment(e){let t=null,r,n,i,s=0;const{bufferPadding:o,fragments:h}=this;return Object.keys(h).forEach(c=>{const p=h[c];p&&Kn(p)&&(n=p.body.start-o,i=p.body.end+o,e>=n&&e<=i&&(r=Math.min(e-n,i-e),s<=r&&(t=p.body,s=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Kn(t))}getState(e){const t=Sn(e),r=this.fragments[t];return r?r.buffered?Kn(r)?Br.PARTIAL:Br.OK:Br.APPENDING:Br.NOT_LOADED}isTimeBuffered(e,t,r){let n,i;for(let s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const r=t.frag,n=t.part?null:t,i=Sn(r);this.fragments[i]={body:r,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:n,timeRanges:i,type:s}=t;if(r.sn==="initSegment")return;const o=r.type;if(n){let c=this.activePartLists[o];c||(this.activePartLists[o]=c=[]),c.push(n)}this.timeRanges=i;const h=i[s];this.detectEvictedFragments(s,h,o,n)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Sn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,r=Object.keys(t);if(!e)return r.length>0;for(let n=r.length;n--;){const i=t[r[n]];if((i==null?void 0:i.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,r,n,i){n&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const h=o.body;h.type!==r||n&&!h.gap||h.start<t&&h.end>e&&(o.buffered||i)&&this.removeFragment(h)})}removeFragment(e){const t=Sn(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const n=e.sn;this.activePartLists[e.type]=r.filter(i=>i.fragment.sn!==n)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const r=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;r&&r.forEach(n=>n.clearElementaryStreamInfo())}}function Kn(a){var e,t,r;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((r=a.range.audiovideo)==null?void 0:r.partial))}function Sn(a){return`${a.type}_${a.level}_${a.sn}`}var dr={cbc:0,ctr:1};class An{constructor(e,t,r){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=r}decrypt(e,t){switch(this.aesMode){case dr.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case dr.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 Rn(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class hn{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),r=new Uint32Array(4);for(let n=0;n<4;n++)r[n]=t.getUint32(n*4);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],s=r[2],o=r[3],h=this.invSubMix,c=h[0],p=h[1],g=h[2],x=h[3],D=new Uint32Array(256);let T=0,N=0,H=0;for(H=0;H<256;H++)H<128?D[H]=H<<1:D[H]=H<<1^283;for(H=0;H<256;H++){let _e=N^N<<1^N<<2^N<<3^N<<4;_e=_e>>>8^_e&255^99,e[T]=_e,t[_e]=T;const Ue=D[T],Re=D[Ue],Qe=D[Re];let Je=D[_e]*257^_e*16843008;n[T]=Je<<24|Je>>>8,i[T]=Je<<16|Je>>>16,s[T]=Je<<8|Je>>>24,o[T]=Je,Je=Qe*16843009^Re*65537^Ue*257^T*16843008,c[_e]=Je<<24|Je>>>8,p[_e]=Je<<16|Je>>>16,g[_e]=Je<<8|Je>>>24,x[_e]=Je,T?(T=Ue^D[D[D[Qe^Ue]]],N^=D[D[N]]):T=N=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,n=0;for(;n<t.length&&r;)r=t[n]===this.key[n],n++;if(r)return;this.key=t;const i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);const s=this.ksRows=(i+6+1)*4;let o,h;const c=this.keySchedule=new Uint32Array(s),p=this.invKeySchedule=new Uint32Array(s),g=this.sBox,x=this.rcon,D=this.invSubMix,T=D[0],N=D[1],H=D[2],_e=D[3];let Ue,Re;for(o=0;o<s;o++){if(o<i){Ue=c[o]=t[o];continue}Re=Ue,o%i===0?(Re=Re<<8|Re>>>24,Re=g[Re>>>24]<<24|g[Re>>>16&255]<<16|g[Re>>>8&255]<<8|g[Re&255],Re^=x[o/i|0]<<24):i>6&&o%i===4&&(Re=g[Re>>>24]<<24|g[Re>>>16&255]<<16|g[Re>>>8&255]<<8|g[Re&255]),c[o]=Ue=(c[o-i]^Re)>>>0}for(h=0;h<s;h++)o=s-h,h&3?Re=c[o]:Re=c[o-4],h<4||o<=4?p[h]=Re:p[h]=T[g[Re>>>24]]^N[g[Re>>>16&255]]^H[g[Re>>>8&255]]^_e[g[Re&255]],p[h]=p[h]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,r){const n=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,h=o[0],c=o[1],p=o[2],g=o[3],x=this.uint8ArrayToUint32Array_(r);let D=x[0],T=x[1],N=x[2],H=x[3];const _e=new Int32Array(e),Ue=new Int32Array(_e.length);let Re,Qe,Je,ft,et,ot,_t,nt,At,Pt,br,rr,Zt,Ht;const Xt=this.networkToHostOrderSwap;for(;t<_e.length;){for(At=Xt(_e[t]),Pt=Xt(_e[t+1]),br=Xt(_e[t+2]),rr=Xt(_e[t+3]),et=At^i[0],ot=rr^i[1],_t=br^i[2],nt=Pt^i[3],Zt=4,Ht=1;Ht<n;Ht++)Re=h[et>>>24]^c[ot>>16&255]^p[_t>>8&255]^g[nt&255]^i[Zt],Qe=h[ot>>>24]^c[_t>>16&255]^p[nt>>8&255]^g[et&255]^i[Zt+1],Je=h[_t>>>24]^c[nt>>16&255]^p[et>>8&255]^g[ot&255]^i[Zt+2],ft=h[nt>>>24]^c[et>>16&255]^p[ot>>8&255]^g[_t&255]^i[Zt+3],et=Re,ot=Qe,_t=Je,nt=ft,Zt=Zt+4;Re=s[et>>>24]<<24^s[ot>>16&255]<<16^s[_t>>8&255]<<8^s[nt&255]^i[Zt],Qe=s[ot>>>24]<<24^s[_t>>16&255]<<16^s[nt>>8&255]<<8^s[et&255]^i[Zt+1],Je=s[_t>>>24]<<24^s[nt>>16&255]<<16^s[et>>8&255]<<8^s[ot&255]^i[Zt+2],ft=s[nt>>>24]<<24^s[et>>16&255]<<16^s[ot>>8&255]<<8^s[_t&255]^i[Zt+3],Ue[t]=Xt(Re^D),Ue[t+1]=Xt(ft^T),Ue[t+2]=Xt(Je^N),Ue[t+3]=Xt(Qe^H),D=At,T=Pt,N=br,H=rr,t=t+4}return Ue.buffer}}class ji{constructor(e,t,r){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=r}expandKey(){const e=Hi(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Hi(a){switch(a){case dr.cbc:return"AES-CBC";case dr.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const li=16;class Vn{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(r){}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 r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Rn(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r,n){return this.useSoftware?new Promise((i,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,r,n);const h=this.flush();h?i(h.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,n)}softwareDecrypt(e,t,r,n){const{currentIV:i,currentResult:s,remainderData:o}=this;if(n!==dr.cbc||t.byteLength!==16)return ye.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Ve(o,e),this.remainderData=null);const h=this.getValidChunk(e);if(!h.length)return null;i&&(r=i);let c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new hn),c.expandKey(t);const p=s;return this.currentResult=c.decrypt(h.buffer,0,r),this.currentIV=h.slice(-16).buffer,p||null}webCryptoDecrypt(e,t,r,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,r,n));this.key=t,this.fastAesKey=new ji(this.subtle,t,n)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new An(this.subtle,new Uint8Array(r),n).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(ye.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,r,n)))}onWebCryptoError(e,t,r,n){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r,n);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%li;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(ye.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Gt=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 r=e.url;if(!r)return Promise.reject(new En({type:ge.NETWORK_ERROR,details:ne.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${r?"part list":"url"}`),networkDetails:null}));this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((o,h)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(T=>T[0]==="GAP")){h(vn(e));return}else e.gap=!1;const c=this.loader=i?new i(n):new s(n),p=tn(e);e.loader=c;const g=ai(n.fragLoadPolicy.default),x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Gt};e.stats=c.stats;const D={onSuccess:(T,N,H,_e)=>{this.resetLoader(e,c);let Ue=T.data;H.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Ue.slice(0,16)),Ue=Ue.slice(16)),o({frag:e,part:null,payload:Ue,networkDetails:_e})},onError:(T,N,H,_e)=>{this.resetLoader(e,c),h(new En({type:ge.NETWORK_ERROR,details:ne.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:A({url:r,data:void 0},T),error:new Error(`HTTP Error ${T.code} ${T.text}`),networkDetails:H,stats:_e}))},onAbort:(T,N,H)=>{this.resetLoader(e,c),h(new En({type:ge.NETWORK_ERROR,details:ne.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:H,stats:T}))},onTimeout:(T,N,H)=>{this.resetLoader(e,c),h(new En({type:ge.NETWORK_ERROR,details:ne.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${x.timeout}ms`),networkDetails:H,stats:T}))}};t&&(D.onProgress=(T,N,H,_e)=>t({frag:e,part:null,payload:H,networkDetails:_e})),c.load(p,x,D)})}loadPart(e,t,r){this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((o,h)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){h(vn(e,t));return}const c=this.loader=i?new i(n):new s(n),p=tn(e,t);e.loader=c;const g=ai(n.fragLoadPolicy.default),x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Gt};t.stats=c.stats,c.load(p,x,{onSuccess:(D,T,N,H)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const _e={frag:e,part:t,payload:D.data,networkDetails:H};r(_e),o(_e)},onError:(D,T,N,H)=>{this.resetLoader(e,c),h(new En({type:ge.NETWORK_ERROR,details:ne.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:A({url:p.url,data:void 0},D),error:new Error(`HTTP Error ${D.code} ${D.text}`),networkDetails:N,stats:H}))},onAbort:(D,T,N)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),h(new En({type:ge.NETWORK_ERROR,details:ne.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:N,stats:D}))},onTimeout:(D,T,N)=>{this.resetLoader(e,c),h(new En({type:ge.NETWORK_ERROR,details:ne.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${x.timeout}ms`),networkDetails:N,stats:D}))}})})}updateStatsFromPart(e,t){const r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){const h=Math.round(e.duration/t.duration),c=Math.min(Math.round(r.loaded/i),h),g=(h-c)*Math.round(r.loaded/c);r.total=r.loaded+g}else r.total=Math.max(r.loaded,r.total);const s=r.loading,o=n.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 tn(a,e=null){const t=e||a,r={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},n=t.byteRangeStartOffset,i=t.byteRangeEndOffset;if(F(n)&&F(i)){var s;let o=n,h=i;if(a.sn==="initSegment"&&Ki((s=a.decryptdata)==null?void 0:s.method)){const c=i-n;c%16&&(h=i+(16-c%16)),n!==0&&(r.resetIV=!0,o=n-16)}r.rangeStart=o,r.rangeEnd=h}return r}function vn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),r={type:ge.MEDIA_ERROR,details:ne.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(r.part=e),(e||a).stats.aborted=!0,new En(r)}function Ki(a){return a==="AES-128"||a==="AES-256"}class En extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Nn extends Z{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 Wn{constructor(e,t,r,n=0,i=-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=Kr(),this.buffering={audio:Kr(),video:Kr(),audiovideo:Kr()},this.level=e,this.sn=t,this.id=r,this.size=n,this.part=i,this.partial=s}}function Kr(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Jn={length:0,start:()=>0,end:()=>0};class er{static isBuffered(e,t){if(e){const r=er.getBuffered(e);for(let n=r.length;n--;)if(t>=r.start(n)&&t<=r.end(n))return!0}return!1}static bufferedRanges(e){if(e){const t=er.getBuffered(e);return er.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}static bufferInfo(e,t,r){if(e){const n=er.bufferedRanges(e);if(n.length)return er.bufferedInfo(n,t,r)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.length>1&&e.sort((p,g)=>p.start-g.start||g.end-p.end);let n=-1,i=[];if(r)for(let p=0;p<e.length;p++){t>=e[p].start&&t<=e[p].end&&(n=p);const g=i.length;if(g){const x=i[g-1].end;e[p].start-x<r?e[p].end>x&&(i[g-1].end=e[p].end):i.push(e[p])}else i.push(e[p])}else i=e;let s=0,o,h=t,c=t;for(let p=0;p<i.length;p++){const g=i[p].start,x=i[p].end;if(n===-1&&t>=g&&t<=x&&(n=p),t+r>=g&&t<x)h=g,c=x,s=c-t;else if(t+r<g){o=g;break}}return{len:s,start:h||0,end:c||0,nextStart:o,buffered:e,bufferedIndex:n}}static getBuffered(e){try{return e.buffered||Jn}catch(t){return ye.log("failed to get media.buffered",t),Jn}}}const Pi=/\{\$([a-zA-Z0-9-_]+)\}/g;function Un(a){return Pi.test(a)}function wn(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Pi,r=>{const n=r.substring(2,r.length-1),i=t==null?void 0:t[n];return i===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${n}"`)),r):i})}return e}function yr(a,e,t){let r=a.variableList;r||(a.variableList=r={});let n,i;if("QUERYPARAM"in e){n=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(n))i=s.get(n);else throw new Error(`"${n}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else n=e.NAME,i=e.VALUE;n in r?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${n}"`)):r[n]=i||""}function Ei(a,e,t){const r=e.IMPORT;if(t&&r in t){let n=a.variableList;n||(a.variableList=n={}),n[r]=t[r]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const Oi=/^(\d+)x(\d+)$/,wi=/(.+?)=(".*?"|.*?)(?:,|$)/g;class pr{constructor(e,t){typeof e=="string"&&(e=pr.parseAttrList(e,t)),b(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 r=new Uint8Array(t.length/2);for(let n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(n*2,n*2+2),16);return r}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 r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const r=this[e];return(r?r.split(/[ ,]+/):[]).reduce((n,i)=>(n[i.toLowerCase()]=!0,n),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Oi.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let r;const n={},i='"';for(wi.lastIndex=0;(r=wi.exec(e))!==null;){const s=r[1].trim();let o=r[2];const h=o.indexOf(i)===0&&o.lastIndexOf(i)===o.length-1;let c=!1;if(h)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":c=!0}if(t&&(h||c))o=wn(t,o);else if(!c&&!h)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":ye.warn(`${e}: attribute ${s} is missing quotes`)}n[s]=o}return n}}const ui="com.apple.hls.interstitial";function ns(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function kt(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class yn{constructor(e,t,r=0){var n;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=(n=t==null?void 0:t.tagOrder)!=null?n:r,t){const i=t.attr;for(const s in i)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==i[s]){ye.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=b(new pr({}),i,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 i=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);F(i.getTime())&&(this._endDate=i)}}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?(ye.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(F(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===ui}get isValid(){return!!this.id&&!this._badValueForSameId&&F(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 Mi=10;class Si{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,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?F(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Mi}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let r=e.length;r--;)if(e[r].index>t)return e[r].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 ln(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function rn(a){switch(a){case"AES-128":case"AES-256":return dr.cbc;case"AES-256-CTR":return dr.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function kr(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Dn(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function ei(a){const e=Dn(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function ci(a){const e=function(r,n,i){const s=r[n];r[n]=r[i],r[i]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function hi(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const r=e[1].split(";"),n=r[r.length-1].split(",");if(n.length===2){const i=n[0]==="base64",s=n[1];i?(r.splice(-1,1),t=kr(s)):t=ei(s)}}return t}const ti=typeof self!="undefined"?self:void 0;var xr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},fn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Fi(a){switch(a){case fn.FAIRPLAY:return xr.FAIRPLAY;case fn.PLAYREADY:return xr.PLAYREADY;case fn.WIDEVINE:return xr.WIDEVINE;case fn.CLEARKEY:return xr.CLEARKEY}}var Ai={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Bi(a){if(a===Ai.WIDEVINE)return xr.WIDEVINE;if(a===Ai.PLAYREADY)return xr.PLAYREADY;if(a===Ai.CENC||a===Ai.CLEARKEY)return xr.CLEARKEY}function Ni(a){switch(a){case xr.FAIRPLAY:return fn.FAIRPLAY;case xr.PLAYREADY:return fn.PLAYREADY;case xr.WIDEVINE:return fn.WIDEVINE;case xr.CLEARKEY:return fn.CLEARKEY}}function jt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,r=e?[xr.FAIRPLAY,xr.WIDEVINE,xr.PLAYREADY,xr.CLEARKEY].filter(n=>!!e[n]):[];return!r[xr.WIDEVINE]&&t&&r.push(xr.WIDEVINE),r}const qt=function(a){return ti!=null&&(a=ti.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Gr(a,e,t,r){let n;switch(a){case xr.FAIRPLAY:n=["cenc","sinf"];break;case xr.WIDEVINE:case xr.PLAYREADY:n=["cenc"];break;case xr.CLEARKEY:n=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return nn(n,e,t,r)}function nn(a,e,t,r){return[{initDataTypes:a,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map(i=>({contentType:`audio/mp4; codecs=${i}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:t.map(i=>({contentType:`video/mp4; codecs=${i}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}))}]}function Vr(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),r=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const h=kr(o).subarray(0,16);return ci(h),h}}return null}let $n={};class ri{static clearKeyUriToKeyIdMap(){$n={}}constructor(e,t,r,n=[1],i=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=r,this.keyFormatVersions=n,this.iv=i,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!ln(e)}isSupported(){if(this.method){if(ln(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case fn.FAIRPLAY:case fn.WIDEVINE:case fn.PLAYREADY:case fn.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(ln(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(ye.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const r=is(e);return new ri(this.method,this.uri,"identity",this.keyFormatVersions,r)}const t=hi(this.uri);if(t)switch(this.keyFormat){case fn.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case fn.PLAYREADY:{const r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=y(r,null,t),this.keyId=Vr(t);break}default:{let r=t.subarray(0,16);if(r.length!==16){const n=new Uint8Array(16);n.set(r,16-r.length),r=n}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){let r=$n[this.uri];if(!r){const n=Object.keys($n).length%Number.MAX_SAFE_INTEGER;r=new Uint8Array(16),new DataView(r.buffer,12,4).setUint32(0,n),$n[this.uri]=r}this.keyId=r}return this}}function is(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Yn=/#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,ms=/#EXT-X-MEDIA:(.*)/g,ma=/^#EXT(?:INF|-X-TARGETDURATION):/m,Us=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),uo=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 qn{static findGroup(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.id===t)return n}}static resolve(e,t){return ae.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return ma.test(e)}static parseMasterPlaylist(e,t){const r=Un(e),n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},i=[];Yn.lastIndex=0;let s;for(;(s=Yn.exec(e))!=null;)if(s[1]){var o;const c=new pr(s[1],n),p=wn(n,s[2]),g={attrs:c,bitrate:c.decimalInteger("BANDWIDTH")||c.decimalInteger("AVERAGE-BANDWIDTH"),name:c.NAME,url:qn.resolve(p,t)},x=c.decimalResolution("RESOLUTION");x&&(g.width=x.width,g.height=x.height),_s(c.CODECS,g);const D=c["SUPPLEMENTAL-CODECS"];D&&(g.supplemental={},_s(D,g.supplemental)),(o=g.unknownCodecs)!=null&&o.length||i.push(g),n.levels.push(g)}else if(s[3]){const c=s[3],p=s[4];switch(c){case"SESSION-DATA":{const g=new pr(p,n),x=g["DATA-ID"];x&&(n.sessionData===null&&(n.sessionData={}),n.sessionData[x]=g);break}case"SESSION-KEY":{const g=$s(p,t,n);g.encrypted&&g.isSupported()?(n.sessionKeys===null&&(n.sessionKeys=[]),n.sessionKeys.push(g)):ye.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${p}"`);break}case"DEFINE":{{const g=new pr(p,n);yr(n,g,t)}break}case"CONTENT-STEERING":{const g=new pr(p,n);n.contentSteering={uri:qn.resolve(g["SERVER-URI"],t),pathwayId:g["PATHWAY-ID"]||"."};break}case"START":{n.startTimeOffset=gs(p);break}}}const h=i.length>0&&i.length<n.levels.length;return n.levels=h?i:n.levels,n.levels.length===0&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(e,t,r){let n;const i={},s=r.levels,o={AUDIO:s.map(c=>({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:s.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let h=0;for(ms.lastIndex=0;(n=ms.exec(e))!==null;){const c=new pr(n[1],r),p=c.TYPE;if(p){const g=o[p],x=i[p]||[];i[p]=x;const D=c.LANGUAGE,T=c["ASSOC-LANGUAGE"],N=c.CHANNELS,H=c.CHARACTERISTICS,_e=c["INSTREAM-ID"],Ue={attrs:c,bitrate:0,id:h++,groupId:c["GROUP-ID"]||"",name:c.NAME||D||"",type:p,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:D,url:c.URI?qn.resolve(c.URI,t):""};if(T&&(Ue.assocLang=T),N&&(Ue.channels=N),H&&(Ue.characteristics=H),_e&&(Ue.instreamId=_e),g!=null&&g.length){const Re=qn.findGroup(g,Ue.groupId)||g[0];vs(Ue,Re,"audioCodec"),vs(Ue,Re,"textCodec")}x.push(Ue)}}return i}static parseLevelPlaylist(e,t,r,n,i,s){var o;const h={url:t},c=new Si(t),p=c.fragments,g=[];let x=null,D=0,T=0,N=0,H=0,_e=0,Ue=null,Re=new qe(n,h),Qe,Je,ft,et=-1,ot=!1,_t=null,nt;if(Us.lastIndex=0,c.m3u8=e,c.hasVariableRefs=Un(e),((o=Us.exec(e))==null?void 0:o[0])!=="#EXTM3U")return c.playlistParsingError=new Error("Missing format identifier #EXTM3U"),c;for(;(Qe=Us.exec(e))!==null;){ot&&(ot=!1,Re=new qe(n,h),Re.playlistOffset=N,Re.start=N,Re.sn=D,Re.cc=H,_e&&(Re.bitrate=_e),Re.level=r,x&&(Re.initSegment=x,x.rawProgramDateTime&&(Re.rawProgramDateTime=x.rawProgramDateTime,x.rawProgramDateTime=null),_t&&(Re.setByteRange(_t),_t=null)));const rr=Qe[1];if(rr){Re.duration=parseFloat(rr);const Zt=(" "+Qe[2]).slice(1);Re.title=Zt||null,Re.tagList.push(Zt?["INF",rr,Zt]:["INF",rr])}else if(Qe[3]){if(F(Re.duration)){Re.playlistOffset=N,Re.start=N,ft&&zs(Re,ft,c),Re.sn=D,Re.level=r,Re.cc=H,p.push(Re);const Zt=(" "+Qe[3]).slice(1);Re.relurl=wn(c,Zt),ys(Re,Ue,g),Ue=Re,N+=Re.duration,D++,T=0,ot=!0}}else{if(Qe=Qe[0].match(uo),!Qe){ye.warn("No matches on slow regex match for level playlist!");continue}for(Je=1;Je<Qe.length&&Qe[Je]===void 0;Je++);const Zt=(" "+Qe[Je]).slice(1),Ht=(" "+Qe[Je+1]).slice(1),Xt=Qe[Je+2]?(" "+Qe[Je+2]).slice(1):null;switch(Zt){case"BYTERANGE":Ue?Re.setByteRange(Ht,Ue):Re.setByteRange(Ht);break;case"PROGRAM-DATE-TIME":Re.rawProgramDateTime=Ht,Re.tagList.push(["PROGRAM-DATE-TIME",Ht]),et===-1&&(et=p.length);break;case"PLAYLIST-TYPE":c.type&&zn(c,Zt,Qe),c.type=Ht.toUpperCase();break;case"MEDIA-SEQUENCE":c.startSN!==0?zn(c,Zt,Qe):p.length>0&&_a(c,Zt,Qe),D=c.startSN=parseInt(Ht);break;case"SKIP":{c.skippedSegments&&zn(c,Zt,Qe);const Yt=new pr(Ht,c),Tt=Yt.decimalInteger("SKIPPED-SEGMENTS");if(F(Tt)){c.skippedSegments+=Tt;for(let or=Tt;or--;)p.push(null);D+=Tt}const Lt=Yt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Lt&&(c.recentlyRemovedDateranges=(c.recentlyRemovedDateranges||[]).concat(Lt.split(" ")));break}case"TARGETDURATION":c.targetduration!==0&&zn(c,Zt,Qe),c.targetduration=Math.max(parseInt(Ht),1);break;case"VERSION":c.version!==null&&zn(c,Zt,Qe),c.version=parseInt(Ht);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":c.live||zn(c,Zt,Qe),c.live=!1;break;case"#":(Ht||Xt)&&Re.tagList.push(Xt?[Ht,Xt]:[Ht]);break;case"DISCONTINUITY":H++,Re.tagList.push(["DIS"]);break;case"GAP":Re.gap=!0,Re.tagList.push([Zt]);break;case"BITRATE":Re.tagList.push([Zt,Ht]),_e=parseInt(Ht)*1e3,F(_e)?Re.bitrate=_e:_e=0;break;case"DATERANGE":{const Yt=new pr(Ht,c),Tt=new yn(Yt,c.dateRanges[Yt.ID],c.dateRangeTagCount);c.dateRangeTagCount++,Tt.isValid||c.skippedSegments?c.dateRanges[Tt.id]=Tt:ye.warn(`Ignoring invalid DATERANGE tag: "${Ht}"`),Re.tagList.push(["EXT-X-DATERANGE",Ht]);break}case"DEFINE":{{const Yt=new pr(Ht,c);"IMPORT"in Yt?Ei(c,Yt,s):yr(c,Yt,t)}break}case"DISCONTINUITY-SEQUENCE":c.startCC!==0?zn(c,Zt,Qe):p.length>0&&_a(c,Zt,Qe),c.startCC=H=parseInt(Ht);break;case"KEY":{const Yt=$s(Ht,t,c);if(Yt.isSupported()){if(Yt.method==="NONE"){ft=void 0;break}ft||(ft={}),ft[Yt.keyFormat]&&(ft=b({},ft)),ft[Yt.keyFormat]=Yt}else ye.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Ht}"`);break}case"START":c.startTimeOffset=gs(Ht);break;case"MAP":{const Yt=new pr(Ht,c);if(Re.duration){const Tt=new qe(n,h);ga(Tt,Yt,r,ft),x=Tt,Re.initSegment=x,x.rawProgramDateTime&&!Re.rawProgramDateTime&&(Re.rawProgramDateTime=x.rawProgramDateTime)}else{const Tt=Re.byteRangeEndOffset;if(Tt){const Lt=Re.byteRangeStartOffset;_t=`${Tt-Lt}@${Lt}`}else _t=null;ga(Re,Yt,r,ft),x=Re,ot=!0}x.cc=H;break}case"SERVER-CONTROL":{nt&&zn(c,Zt,Qe),nt=new pr(Ht),c.canBlockReload=nt.bool("CAN-BLOCK-RELOAD"),c.canSkipUntil=nt.optionalFloat("CAN-SKIP-UNTIL",0),c.canSkipDateRanges=c.canSkipUntil>0&&nt.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=nt.optionalFloat("PART-HOLD-BACK",0),c.holdBack=nt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{c.partTarget&&zn(c,Zt,Qe);const Yt=new pr(Ht);c.partTarget=Yt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Yt=c.partList;Yt||(Yt=c.partList=[]);const Tt=T>0?Yt[Yt.length-1]:void 0,Lt=T++,or=new pr(Ht,c),nr=new Xe(or,Re,h,Lt,Tt);Yt.push(nr),Re.duration+=nr.duration;break}case"PRELOAD-HINT":{const Yt=new pr(Ht,c);c.preloadHint=Yt;break}case"RENDITION-REPORT":{const Yt=new pr(Ht,c);c.renditionReports=c.renditionReports||[],c.renditionReports.push(Yt);break}default:ye.warn(`line parsed but not handled: ${Qe}`);break}}}Ue&&!Ue.relurl?(p.pop(),N-=Ue.duration,c.partList&&(c.fragmentHint=Ue)):c.partList&&(ys(Re,Ue,g),Re.cc=H,c.fragmentHint=Re,ft&&zs(Re,ft,c)),c.targetduration||(c.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const At=p.length,Pt=p[0],br=p[At-1];if(N+=c.skippedSegments*c.targetduration,N>0&&At&&br){c.averagetargetduration=N/At;const rr=br.sn;c.endSN=rr!=="initSegment"?rr:0,c.live||(br.endList=!0),Pt&&c.startCC===void 0&&(c.startCC=Pt.cc),et>0&&(co(p,et),Pt&&g.unshift(Pt))}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(N+=c.fragmentHint.duration),c.totalduration=N,g.length&&c.dateRangeTagCount&&Pt&&fi(g,c),c.endCC=H,c}}function fi(a,e){const t=a.length,r=a[t-1],n=e.live?1/0:e.totalduration,i=Object.keys(e.dateRanges);for(let s=i.length;s--;){const o=e.dateRanges[i[s]],h=o.startDate.getTime();o.tagAnchor=r.ref;for(let c=t;c--;){const p=ss(e,h,a,c,n);if(p!==-1){o.tagAnchor=e.fragments[p].ref;break}}}}function ss(a,e,t,r,n){const i=t[r];if(i){const o=i.programDateTime;if(e>=o||r===0){var s;const h=(((s=t[r+1])==null?void 0:s.start)||n)-i.start;if(e<=o+h*1e3){const c=t[r].sn-a.startSN,p=a.fragments;if(p.length>t.length){const x=(t[r+1]||p[p.length-1]).sn-a.startSN;for(let D=x;D>c;D--){const T=p[D].programDateTime;if(e>=T&&e<T+p[D].duration*1e3)return D}}return c}}}return-1}function $s(a,e,t){var r,n;const i=new pr(a,t),s=(r=i.METHOD)!=null?r:"",o=i.URI,h=i.hexadecimalInteger("IV"),c=i.KEYFORMATVERSIONS,p=(n=i.KEYFORMAT)!=null?n:"identity";o&&i.IV&&!h&&ye.error(`Invalid IV: ${i.IV}`);const g=o?qn.resolve(o,e):"",x=(c||"1").split("/").map(Number).filter(Number.isFinite);return new ri(s,g,p,x,h)}function gs(a){const t=new pr(a).decimalFloatingPoint("TIME-OFFSET");return F(t)?t:null}function _s(a,e){let t=(a||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const n=t.filter(i=>Ee(i,r));n.length&&(e[`${r}Codec`]=n.map(i=>i.split("/")[0]).join(","),t=t.filter(i=>n.indexOf(i)===-1))}),e.unknownCodecs=t}function vs(a,e,t){const r=e[t];r&&(a[t]=r)}function co(a,e){let t=a[e];for(let r=e;r--;){const n=a[r];if(!n)return;n.programDateTime=t.programDateTime-n.duration*1e3,t=n}}function ys(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function ga(a,e,t,r){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",r&&(a.levelkeys=r),a.initSegment=null}function zs(a,e,t){a.levelkeys=e;const{encryptedFragments:r}=t;(!r.length||r[r.length-1].levelkeys!==e)&&Object.keys(e).some(n=>e[n].isCommonEncryption)&&r.push(a)}function zn(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function _a(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Gs(a,e){const t=e.startPTS;if(F(t)){let r=0,n;e.sn>a.sn?(r=t-a.start,n=a):(r=a.start-t,n=e),n.duration!==r&&n.setDuration(r)}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 va(a,e,t,r,n,i){r-t<=0&&(ye.warn("Fragment should have a positive duration",e),r=t+e.duration,i=n+e.duration);let o=t,h=r;const c=e.startPTS,p=e.endPTS;if(F(c)){const H=Math.abs(c-t);F(e.deltaPTS)?e.deltaPTS=Math.max(H,e.deltaPTS):e.deltaPTS=H,o=Math.max(t,c),t=Math.min(t,c),n=Math.min(n,e.startDTS),h=Math.min(r,p),r=Math.max(r,p),i=Math.max(i,e.endDTS)}const g=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=o,e.startDTS=n,e.endPTS=r,e.minEndPTS=h,e.endDTS=i;const x=e.sn;if(!a||x<a.startSN||x>a.endSN)return 0;let D;const T=x-a.startSN,N=a.fragments;for(N[T]=e,D=T;D>0;D--)Gs(N[D],N[D-1]);for(D=T;D<N.length-1;D++)Gs(N[D],N[D+1]);return a.fragmentHint&&Gs(N[N.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,g}function ya(a,e){if(a===e)return;let t=null;const r=a.fragments;for(let h=r.length-1;h>=0;h--){const c=r[h].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let n;xa(a,e,(h,c,p,g)=>{if(e.skippedSegments&&c.cc!==h.cc){const x=h.cc-c.cc;for(let D=p;D<g.length;D++)g[D].cc+=x}F(h.startPTS)&&F(h.endPTS)&&(c.setStart(c.startPTS=h.startPTS),c.startDTS=h.startDTS,c.maxStartPTS=h.maxStartPTS,c.endPTS=h.endPTS,c.endDTS=h.endDTS,c.minEndPTS=h.minEndPTS,c.setDuration(h.endPTS-h.startPTS),c.duration&&(n=c),e.PTSKnown=e.alignedSliding=!0),h.hasStreams&&(c.elementaryStreams=h.elementaryStreams),c.loader=h.loader,h.hasStats&&(c.stats=h.stats),h.initSegment&&(c.initSegment=h.initSegment,t=h.initSegment)});const i=e.fragments,s=e.fragmentHint?i.concat(e.fragmentHint):i;if(t&&s.forEach(h=>{var c;h&&(!h.initSegment||h.initSegment.relurl===((c=t)==null?void 0:c.relurl))&&(h.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=i.some(h=>!h),e.deltaUpdateFailed){ye.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let h=e.skippedSegments;h--;)i.shift();e.startSN=i[0].sn}else{e.endCC=i[i.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=ho(a.dateRanges,e));const h=a.fragments.filter(c=>c.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let c=1;c<s.length;c++)s[c].programDateTime===null&&ys(s[c],s[c-1],h);fi(h,e)}ba(a.partList,e.partList,(h,c)=>{c.elementaryStreams=h.elementaryStreams,c.stats=h.stats}),n?va(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):di(a,e),i.length&&(e.totalduration=e.edge-i[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const h=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=h),e.driftEndTime=o,e.driftEnd=h}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function ho(a,e){const{dateRanges:t,recentlyRemovedDateranges:r}=e,n=b({},a);r&&r.forEach(o=>{delete n[o]});const s=Object.keys(n).length;return s&&Object.keys(t).forEach(o=>{const h=n[o],c=new yn(t[o].attr,h);c.isValid?(n[o]=c,h||(c.tagOrder+=s)):ye.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${fr(t[o].attr)}"`)}),n}function ba(a,e,t){if(a&&e){let r=0;for(let n=0,i=a.length;n<=i;n++){const s=a[n],o=e[n+r];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):r--}}}function xa(a,e,t){const r=e.skippedSegments,n=Math.max(a.startSN,e.startSN)-e.startSN,i=(a.fragmentHint?1:0)+(r?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,h=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=n;c<=i;c++){const p=h[s+c];let g=o[c];if(r&&!g&&p&&(g=e.fragments[c]=p),p&&g){if(t(p,g,c,o),p.url&&p.url!==g.url){e.playlistParsingError=Ea(`media sequence mismatch ${g.sn}:`,a,e,p,g);return}else if(p.cc!==g.cc){e.playlistParsingError=Ea(`discontinuity sequence mismatch (${p.cc}!=${g.cc})`,a,e,p,g);return}}}}function Ea(a,e,t,r,n){return new Error(`${a} ${n.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function di(a,e,t=!0){const r=e.startSN+e.skippedSegments-a.startSN,n=a.fragments,i=r>=0;let s=0;if(i&&r<n.length)s=n[r].start;else if(i&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(i&&t)s=a.fragmentStart+r*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;bs(e,s)}function bs(a,e){if(e){const t=a.fragments;for(let r=a.skippedSegments;r<t.length;r++)t[r].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function wa(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const r=a.fragments;if(r.length&&t*4>e){const i=r[r.length-1].duration*1e3;i<t&&(t=i)}}else t/=2;return Math.round(t)}function xs(a,e,t){if(!a)return null;let r=a.fragments[e-a.startSN];return r||(r=a.fragmentHint,r&&r.sn===e)?r:e<a.startSN&&t&&t.sn===e?t:null}function js(a,e,t){return a?Es(a.partList,e,t):null}function Es(a,e,t){if(a)for(let r=a.length;r--;){const n=a[r];if(n.index===t&&n.fragment.sn===e)return n}return null}function ws(a){a.forEach((e,t)=>{var r;(r=e.details)==null||r.fragments.forEach(n=>{n.level=t,n.initSegment&&(n.initSegment.level=t)})})}function Vi(a,e){for(let r=0,n=a.length;r<n;r++){var t;if(((t=a[r])==null?void 0:t.cc)===e)return a[r]}return null}function Ti(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function Hs(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Di(a,e){const t=e.fragments;for(let r=0,n=t.length;r<n;r++)Hs(t[r],a);e.fragmentHint&&Hs(e.fragmentHint,a),e.alignedSliding=!0}function Ks(a,e){a&&(pi(e,a),!e.alignedSliding&&a&&Ss(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&di(a,e,!1))}function pi(a,e){if(!Ti(e,a))return;const t=Math.min(e.endCC,a.endCC),r=Vi(e.fragments,t),n=Vi(a.fragments,t);if(!r||!n)return;ye.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const i=r.start-n.start;Di(i,a)}function Ss(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,r=e.fragments;if(!t.length||!r.length)return;let n,i;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(n=Vi(r,s),i=Vi(t,s)),(!n||!i)&&(n=r[Math.floor(r.length/2)],i=Vi(t,n.cc)||t[Math.floor(t.length/2)]);const o=n.programDateTime,h=i.programDateTime;if(!o||!h)return;const c=(h-o)/1e3-(i.start-n.start);Di(c,a)}const ki={toString:function(a){let e="";const t=a.length;for(let r=0;r<t;r++)e+=`[${a.start(r).toFixed(3)}-${a.end(r).toFixed(3)}]`;return e}},yt={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 Vs extends Nn{constructor(e,t,r,n,i){super(n,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=yt.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:h,mediaBuffer:c,state:p}=this,g=h?h.currentTime:0,x=er.bufferInfo(c||h,g,s.maxBufferHole);if(this.log(`media seeking to ${F(g)?g.toFixed(3):g}, state: ${p}`),this.state===yt.ENDED)this.resetLoadingState();else if(o){const D=s.maxFragLookUpTolerance,T=o.start-D,N=o.start+o.duration+D;if(!x.len||N<x.start||T>x.end){const H=g>N;(g<T||H)&&(H&&o.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(h){this.fragmentTracker.removeFragmentsInRange(g,1/0,this.playlistType,!0);const D=this.lastCurrentTime;if(g>D&&(this.lastCurrentTime=g),!this.loadingParts){const T=Math.max(x.end,g),N=this.shouldLoadParts(this.getLevelDetails(),T);N&&(this.log(`LL-Part loading ON after seeking to ${g.toFixed(2)} with buffer @${T.toFixed(2)}`),this.loadingParts=N)}}!this.hls.hasEnoughToStart&&!x.len&&(this.log(`setting startPosition to ${g} because of seek before start`),this.nextLoadPosition=this.startPosition=g),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new Bn(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Vn(e.config)}registerListeners(){const{hls:e}=this;e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===yt.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=yt.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 r=e.end||0,n=this.config.timelineOffset||0;if(r<=n)return!1;const i=e.nextStart;if(i&&i>n&&i<t.edge||this.media.currentTime<e.start)return!1;const o=t.partList;if(o!=null&&o.length){const c=o[o.length-1];return er.isBuffered(this.media,c.start+c.duration/2)}const h=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(h)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const r=this.media=this.mediaBuffer=t.media;r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),r.addEventListener("seeking",this.onMediaSeeking),r.addEventListener("ended",this.onMediaEnded);const n=this.config;this.levels&&n.autoStartLoad&&this.state===yt.STOPPED&&this.startLoad(n.startPosition)}onMediaDetaching(e,t){const r=!!t.transferMedia,n=this.media;if(n!==null){if(n.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!r&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,r){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=yt.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,r){this.startFragRequested=!0,this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){const n=i=>{const s=i.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${i.part?" part: "+i.part.index:""} of ${this.fragInfo(s,!1,i.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(i)};this._doFragLoad(e,t,r,n).then(i=>{if(!i)return;const s=this.state,o=i.frag;if(this.fragContextChanged(o)){(s===yt.FRAG_LOADING||!this.fragCurrent&&s===yt.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=yt.IDLE);return}"payload"in i&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(v.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===yt.STOPPED||this.state===yt.ERROR||(this.warn(`Frag error: ${(i==null?void 0:i.message)||i}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===Br.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),h=this.backtrackFragment;((h?e.sn-h.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&r.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===Br.PARTIAL&&r.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,r=null){if(!(e-t))return;const n={startOffset:e,endOffset:t,type:r};this.hls.trigger(v.BUFFER_FLUSHING,n)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(r=>{const n=r==null?void 0:r.frag;if(!n||this.fragContextChanged(n)||!this.levels)throw new Error("init load aborted");return r}).then(r=>{const{hls:n}=this,{frag:i,payload:s}=r,o=i.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&ln(o.method)){const h=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,rn(o.method)).catch(c=>{throw n.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:i}),c}).then(c=>{const p=self.performance.now();return n.trigger(v.FRAG_DECRYPTED,{frag:i,payload:c,stats:{tstart:h,tdecrypt:p}}),r.payload=c,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===yt.STOPPED||this.state===yt.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const r=e.frag.stats;this.state!==yt.STOPPED&&(this.state=yt.IDLE),e.frag.data=new Uint8Array(e.payload),r.parsing.start=r.buffering.start=self.performance.now(),r.parsing.end=r.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const r=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:${r?ki.toString(er.getBuffered(r)):"(detached)"})`),ce(e)){var n;if(e.type!==fe.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=yt.IDLE;return}}const i=(n=this.levels)==null?void 0:n[e.level];i!=null&&i.fragmentError&&(this.log(`Resetting level fragment error count of ${i.fragmentError} on frag buffered`),i.fragmentError=0)}this.state=yt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:n,partsLoaded:i}=e,s=!i||i.length===0||i.some(h=>!h),o=new Wn(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,n){var i;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;e.encrypted&&!((i=e.decryptdata)!=null&&i.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=yt.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(g=>{if(!this.fragContextChanged(g.frag))return this.hls.trigger(v.KEY_LOADED,g),this.state===yt.KEY_LOADING&&(this.state=yt.IDLE),g}),this.hls.trigger(v.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments);const h=this.fragPrevious;if(ce(e)&&(!h||e.sn!==h.sn)){const g=this.shouldLoadParts(t.details,e.end);g!==this.loadingParts&&(this.log(`LL-Part loading ${g?"ON":"OFF"} loading sn ${h==null?void 0:h.sn}->${e.sn}`),this.loadingParts=g)}if(r=Math.max(e.start,r||0),this.loadingParts&&ce(e)){const g=s.partList;if(g&&n){r>e.end&&s.fragmentHint&&(e=s.fragmentHint);const x=this.getNextPart(g,e,r);if(x>-1){const D=g[x];e=this.fragCurrent=D.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${D.index} (${x}/${g.length-1}) of ${this.fragInfo(e,!1,D)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=D.start+D.duration,this.state=yt.FRAG_LOADING;let T;return o?T=o.then(N=>!N||this.fragContextChanged(N.frag)?null:this.doFragPartsLoad(e,D,t,n)).catch(N=>this.handleFragLoadError(N)):T=this.doFragPartsLoad(e,D,t,n).catch(N=>this.handleFragLoadError(N)),this.hls.trigger(v.FRAG_LOADING,{frag:e,part:D,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):T}else if(!e.url||this.loadedEndOfParts(g,r))return Promise.resolve(null)}}if(ce(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(r.toFixed(3))}`),F(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=yt.FRAG_LOADING;const c=this.config.progressive;let p;return c&&o?p=o.then(g=>!g||this.fragContextChanged(g==null?void 0:g.frag)?null:this.fragmentLoader.load(e,n)).catch(g=>this.handleFragLoadError(g)):p=Promise.all([this.fragmentLoader.load(e,c?n:void 0),o]).then(([g])=>(!c&&g&&n&&n(g),g)).catch(g=>this.handleFragLoadError(g)),this.hls.trigger(v.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):p}doFragPartsLoad(e,t,r,n){return new Promise((i,s)=>{var o;const h=[],c=(o=r.details)==null?void 0:o.partList,p=g=>{this.fragmentLoader.loadPart(e,g,n).then(x=>{h[g.index]=x;const D=x.part;this.hls.trigger(v.FRAG_LOADED,x);const T=js(r.details,e.sn,g.index+1)||Es(c,e.sn,g.index+1);if(T)p(T);else return i({frag:e,part:D,partsLoaded:h})}).catch(s)};p(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===ne.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(v.ERROR,t)}else this.hls.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==yt.PARSING){!this.fragCurrent&&this.state!==yt.STOPPED&&this.state!==yt.ERROR&&(this.state=yt.IDLE);return}const{frag:r,part:n,level:i}=t,s=self.performance.now();r.stats.parsing.end=s,n&&(n.stats.parsing.end=s);const o=this.getLevelDetails(),c=o&&r.sn>o.endSN||this.shouldLoadParts(o,r.end);c!==this.loadingParts&&(this.log(`LL-Part loading ${c?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}`),this.loadingParts=c),this.updateLevelTiming(r,n,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var r;const i=e.partList[0],s=i.end+(((r=e.fragmentHint)==null?void 0:r.duration)||0);if(t>=s){var n;if((this.hls.hasEnoughToStart?((n=this.media)==null?void 0:n.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:n,sn:i,part:s}=e;if(!(t!=null&&t[n]))return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${n}. The current chunk will not be buffered.`),null;const o=t[n],h=o.details,c=s>-1?js(h,i,s):null,p=c?c.fragment:xs(h,i,r);return p?(r&&r!==p&&(p.stats=r.stats),{frag:p,part:c,level:o}):null}bufferFragmentData(e,t,r,n,i){var s;if(!e||this.state!==yt.PARSING)return;const{data1:o,data2:h}=e;let c=o;if(o&&h&&(c=Ve(o,h)),!((s=c)!=null&&s.length))return;const p={type:e.type,frag:t,part:r,chunkMeta:n,parent:t.type,data:c};if(this.hls.trigger(v.BUFFER_APPENDING,p),e.dropped&&e.independent&&!r){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!er.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,n=er.bufferInfo(t,r,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),o=Math.max(Math.min(e.start-s,n.end-s),r+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var r;const n=this.getLoadPosition();if(!F(n))return null;const s=this.lastCurrentTime>n||(r=this.media)!=null&&r.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,n,t,s)}getFwdBufferInfoAtPos(e,t,r,n){const i=er.bufferInfo(e,t,n);if(i.len===0&&i.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,r);if(s&&(i.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(i.nextStart,s.end)-t,n);return er.bufferInfo(e,t,o)}}return i}getMaxBufferLength(e){const{config:t}=this;let r;return e?r=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):r=t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const r=this.config,n=Math.max(Math.min(e-t,r.maxBufferLength),t),i=Math.max(e-t*3,r.maxMaxBufferLength/2,n);return i>=n?(r.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=fe.MAIN){var r;const n=(r=this.fragmentTracker)==null?void 0:r.getAppendedFrag(e,t);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const r=t.fragments,n=r.length;if(!n)return null;const{config:i}=this,s=r[0].start,o=i.lowLatencyMode&&!!t.partList;let h=null;if(t.live){const g=i.initialLiveManifestSize;if(n<g)return this.warn(`Not enough fragments to start playback (have: ${n}, need: ${g})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var c;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),h=this.getInitialLiveFragment(t,r);const x=this.hls.startPosition,D=this.hls.liveSyncPosition,T=h?(x!==-1&&x>=s?x:D)||h.start:e;this.log(`Setting startPosition to ${T} to match start frag at live edge. mainStart: ${x} liveSyncPosition: ${D} frag.start: ${(c=h)==null?void 0:c.start}`),this.startPosition=this.nextLoadPosition=T}}else e<=s&&(h=r[0]);if(!h){const g=this.loadingParts?t.partEnd:t.fragmentEnd;h=this.getFragmentAtPosition(e,g,t)}let p=this.filterReplacedPrimary(h,t);if(!p&&h){const g=h.sn-t.startSN;p=this.filterReplacedPrimary(r[g+1]||null,t)}return this.mapToInitFragWhenRequired(p)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===Br.OK||r===Br.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,n,i){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&r.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,n,0);if(o!==null&&r.len+o.len>=i){const h=s.sn;return this.loopSn!==h&&(this.log(`buffer full after gaps in "${n}" playlist starting at sn: ${h}`),this.loopSn=h),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Ws(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Ws(this.hls.config)&&e.type!==fe.SUBTITLE){const r=this.hls.interstitialsManager,n=r==null?void 0:r.bufferingItem;if(n){const s=n.event;if(s){if(s.appendInPlace||Math.abs(e.start-n.start)>1||n.start===0)return null}else if(e.end<=n.start&&(t==null?void 0:t.live)===!1||e.start>n.end&&n.nextEvent&&(n.nextEvent.appendInPlace||e.start-n.end>1))return null}const i=r==null?void 0:r.playerQueue;if(i)for(let s=i.length;s--;){const o=i[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,r){let n=-1,i=!1,s=!0;for(let o=0,h=e.length;o<h;o++){const c=e[o];if(s=s&&!c.independent,n>-1&&r<c.start)break;const p=c.loaded;p?n=-1:(i||c.independent||s)&&c.fragment===t&&(n=o),i=p}return n}loadedEndOfParts(e,t){const r=e[e.length-1];return r&&t>r.start&&r.loaded}getInitialLiveFragment(e,t){const r=this.fragPrevious;let n=null;if(r){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`),n=Mn(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){const i=r.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];r.cc===s.cc&&(n=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${n.sn}`))}n||(n=Hn(t,r.cc),n&&this.log(`Live playlist, switching playlist, load frag with same CC: ${n.sn}`))}}else{const i=this.hls.liveSyncPosition;i!==null&&(n=this.getFragmentAtPosition(i,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n}getFragmentAtPosition(e,t,r){const{config:n}=this;let{fragPrevious:i}=this,{fragments:s,endSN:o}=r;const{fragmentHint:h}=r,{maxFragLookUpTolerance:c}=n,p=r.partList,g=!!(this.loadingParts&&p!=null&&p.length&&h);g&&h&&!this.bitrateTest&&p[p.length-1].fragment.sn===h.sn&&(s=s.concat(h),o=h.sn);let x;if(e<t){var D;const N=e<this.lastCurrentTime||e>t-c||(D=this.media)!=null&&D.paused||!this.startFragRequested?0:c;x=ur(i,s,e,N)}else x=s[s.length-1];if(x){const T=x.sn-r.startSN,N=this.fragmentTracker.getState(x);if((N===Br.OK||N===Br.PARTIAL&&x.gap)&&(i=x),i&&x.sn===i.sn&&(!g||p[0].fragment.sn>x.sn||!r.live&&!g)&&i&&x.level===i.level){const _e=s[T+1];x.sn<o&&this.fragmentTracker.getState(_e)!==Br.OK?x=_e:x=null}}return x}alignPlaylists(e,t,r){const n=e.fragments.length;if(!n)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,s=!t,o=e.alignedSliding&&F(i);if(s||!o&&!i){Ks(r,e);const h=e.fragmentStart;return this.log(`Live playlist sliding: ${h.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${n}`),h}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let r=this.startPosition;r<t&&(r=-1);const n=this.timelineOffset;if(r===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&F(s)?(r=t+s,s<0&&(r+=e.edge),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Setting startPosition to ${r} for start time offset ${s} found in ${i?"multivariant":"media"} playlist`),this.startPosition=r):e.live?(r=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${r}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=r=0),this.lastCurrentTime=r+n}this.nextLoadPosition=r+n}getLoadPosition(){var e;const{media:t}=this;let r=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?r=t.currentTime:this.nextLoadPosition>=0&&(r=this.nextLoadPosition),r}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&ce(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==yt.FRAG_LOADING_WAITING_RETRY)&&(this.state=yt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const T=this.getCurrentContext(t.chunkMeta);T&&(t.frag=T.frag)}const r=t.frag;if(!r||r.type!==e||!this.levels)return;if(this.fragContextChanged(r)){var n;this.warn(`Frag load error must match current frag to retry ${r.url} > ${(n=this.fragCurrent)==null?void 0:n.url}`);return}const i=t.details===ne.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(r,!0);const s=t.errorAction,{action:o,flags:h,retryCount:c=0,retryConfig:p}=s||{},g=!!s&&!!p,x=g&&o===en.RetryRequest,D=g&&!s.resolved&&h===st.MoveAllAlternatesMatchingHost;if(!x&&D&&ce(r)&&!r.endList)this.resetFragmentErrors(e),this.treatAsGap(r),s.resolved=!0;else if((x||D)&&c<p.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const T=gn(p,c);this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${c+1}/${p.maxNumRetry} in ${T}ms`),s.resolved=!0,this.retryDate=self.performance.now()+T,this.state=yt.FRAG_LOADING_WAITING_RETRY}else if(p&&s)if(this.resetFragmentErrors(e),c<p.maxNumRetry)!i&&o!==en.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${c})`);return}else o===en.SendAlternateToPenaltyBox?this.state=yt.WAITING_LEVEL:this.state=yt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===yt.PARSING||this.state===yt.PARSED){const t=e.frag,r=e.parent,n=this.getFwdBufferInfo(this.mediaBuffer,r),i=n&&n.len>.5;i&&this.reduceMaxBufferLength(n.len,(t==null?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===fe.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==yt.STOPPED&&(this.state=yt.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const n=er.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===yt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==yt.STOPPED&&(this.state=yt.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,r,n){const i=r.details;if(!i){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((h,c)=>{const p=e.elementaryStreams[c];if(p){const g=p.endPTS-p.startPTS;if(g<=0)return this.warn(`Could not parse fragment ${e.sn} ${c} duration reliably (${g})`),h||!1;const x=n?0:va(i,e,p.startPTS,p.endPTS,p.startDTS,p.endDTS);return this.hls.trigger(v.LEVEL_PTS_UPDATED,{details:i,level:r,drift:x,type:c,frag:e,start:p.startPTS,end:p.endPTS}),!0}return h},!1)){var o;if(r.fragmentError===0&&this.treatAsGap(e,r),((o=this.transmuxer)==null?void 0:o.error)===null){const h=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(h.message),this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_PARSING_ERROR,fatal:!1,error:h,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=yt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(v.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===fe.MAIN?"level":"track"}fragInfo(e,t=!0,r){var n,i;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${((n=t&&!r?e.startPTS:(r||e).start)!=null?n:NaN).toFixed(3)}-${((i=t&&!r?e.endPTS:(r||e).end)!=null?i:NaN).toFixed(3)}]${r&&e.type==="main"?"INDEPENDENT="+(r.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 Ws(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class Sa{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;if(e.length)e.length===1?r=e[0]:r=Aa(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function Aa(a,e){const t=new Uint8Array(e);let r=0;for(let n=0;n<a.length;n++){const i=a[n];t.set(i,r),r+=i.length}return t}var As={exports:{}},Ts;function Ta(){return Ts||(Ts=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function n(h,c,p){this.fn=h,this.context=c,this.once=p||!1}function i(h,c,p,g,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var D=new n(p,g||h,x),T=t?t+c:c;return h._events[T]?h._events[T].fn?h._events[T]=[h._events[T],D]:h._events[T].push(D):(h._events[T]=D,h._eventsCount++),h}function s(h,c){--h._eventsCount===0?h._events=new r:delete h._events[c]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],p,g;if(this._eventsCount===0)return c;for(g in p=this._events)e.call(p,g)&&c.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(p)):c},o.prototype.listeners=function(c){var p=t?t+c:c,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,D=g.length,T=new Array(D);x<D;x++)T[x]=g[x].fn;return T},o.prototype.listenerCount=function(c){var p=t?t+c:c,g=this._events[p];return g?g.fn?1:g.length:0},o.prototype.emit=function(c,p,g,x,D,T){var N=t?t+c:c;if(!this._events[N])return!1;var H=this._events[N],_e=arguments.length,Ue,Re;if(H.fn){switch(H.once&&this.removeListener(c,H.fn,void 0,!0),_e){case 1:return H.fn.call(H.context),!0;case 2:return H.fn.call(H.context,p),!0;case 3:return H.fn.call(H.context,p,g),!0;case 4:return H.fn.call(H.context,p,g,x),!0;case 5:return H.fn.call(H.context,p,g,x,D),!0;case 6:return H.fn.call(H.context,p,g,x,D,T),!0}for(Re=1,Ue=new Array(_e-1);Re<_e;Re++)Ue[Re-1]=arguments[Re];H.fn.apply(H.context,Ue)}else{var Qe=H.length,Je;for(Re=0;Re<Qe;Re++)switch(H[Re].once&&this.removeListener(c,H[Re].fn,void 0,!0),_e){case 1:H[Re].fn.call(H[Re].context);break;case 2:H[Re].fn.call(H[Re].context,p);break;case 3:H[Re].fn.call(H[Re].context,p,g);break;case 4:H[Re].fn.call(H[Re].context,p,g,x);break;default:if(!Ue)for(Je=1,Ue=new Array(_e-1);Je<_e;Je++)Ue[Je-1]=arguments[Je];H[Re].fn.apply(H[Re].context,Ue)}}return!0},o.prototype.on=function(c,p,g){return i(this,c,p,g,!1)},o.prototype.once=function(c,p,g){return i(this,c,p,g,!0)},o.prototype.removeListener=function(c,p,g,x){var D=t?t+c:c;if(!this._events[D])return this;if(!p)return s(this,D),this;var T=this._events[D];if(T.fn)T.fn===p&&(!x||T.once)&&(!g||T.context===g)&&s(this,D);else{for(var N=0,H=[],_e=T.length;N<_e;N++)(T[N].fn!==p||x&&!T[N].once||g&&T[N].context!==g)&&H.push(T[N]);H.length?this._events[D]=H.length===1?H[0]:H:s(this,D)}return this},o.prototype.removeAllListeners=function(c){var p;return c?(p=t?t+c:c,this._events[p]&&s(this,p)):(this._events=new r,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}(As)),As.exports}var Da=Ta(),Ds=G(Da);const Wi="1.6.0",Ci={};function Ys(){return typeof __HLS_WORKER_BUNDLE__=="function"}function ka(){const a=Ci[Wi];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),n={worker:new self.Worker(t),objectURL:t,clientCount:1};return Ci[Wi]=n,n}function Ca(a){const e=Ci[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,n={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Ci[a]=n,n}function La(a){const e=Ci[a||Wi];if(e&&e.clientCount--===1){const{worker:r,objectURL:n}=e;delete Ci[a||Wi],n&&self.URL.revokeObjectURL(n),r.terminate()}}function Ra(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 as(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 os(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 Yi(a,e){const t=e;let r=0;for(;as(a,e);){r+=10;const n=os(a,e+6);r+=n,Ra(a,e+10)&&(r+=10),e+=r}if(r>0)return a.subarray(t,t+r)}function Ia(a,e,t,r){const n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=e[t+2],s=i>>2&15;if(s>12){const D=new Error(`invalid ADTS sampling index:${s}`);a.emit(v.ERROR,v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_PARSING_ERROR,fatal:!0,error:D,reason:D.message});return}const o=(i>>6&3)+1,h=e[t+3]>>6&3|(i&1)<<2,c="mp4a.40."+o,p=n[s];let g=s;(o===5||o===29)&&(g-=3);const x=[o<<3|(g&14)>>1,(g&1)<<7|h<<3];return ye.log(`manifest codec:${r}, parsed codec:${c}, channels:${h}, rate:${p} (ADTS object type:${o} sampling index:${s})`),{config:x,samplerate:p,channelCount:h,codec:c,parsedCodec:c,manifestCodec:r}}function Ui(a,e){return a[e]===255&&(a[e+1]&246)===240}function qi(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 fo(a,e){return e+5<a.length}function ls(a,e){return e+1<a.length&&Ui(a,e)}function po(a,e){return fo(a,e)&&Ui(a,e)&&qs(a,e)<=a.length-e}function Pa(a,e){if(ls(a,e)){const t=qi(a,e);if(e+t>=a.length)return!1;const r=qs(a,e);if(r<=t)return!1;const n=e+r;return n===a.length||ls(a,n)}return!1}function Zs(a,e,t,r,n){if(!a.samplerate){const i=Ia(e,t,r,n);if(!i)return;b(a,i)}}function Oa(a){return 1024*9e4/a}function Ma(a,e){const t=qi(a,e);if(e+t<=a.length){const r=qs(a,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function Fa(a,e,t,r,n){const i=Oa(a.samplerate),s=r+n*i,o=Ma(e,t);let h;if(o){const{frameLength:g,headerLength:x}=o,D=x+g,T=Math.max(0,t+D-e.length);T?(h=new Uint8Array(D-x),h.set(e.subarray(t+x,e.length),0)):h=e.subarray(t+x,t+D);const N={unit:h,pts:s};return T||a.samples.push(N),{sample:N,length:D,missing:T}}const c=e.length-t;return h=new Uint8Array(c),h.set(e.subarray(t,e.length),0),{sample:{unit:h,pts:s},length:c,missing:-1}}function Ba(a,e){return as(a,e)&&os(a,e+6)+10<=a.length-e}function Xs(a){if(a.size<2)return;const e=He(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function Qs(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const r=He(a.data.subarray(t),!0);t+=r.length+1;const n=He(a.data.subarray(t));return{key:a.type,info:r,data:n}}const e=He(a.data.subarray(1));return{key:a.type,info:"",data:e}}function Na(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const r=He(a.data.subarray(t),!0);t+=r.length+1;const n=He(a.data.subarray(t));return{key:a.type,info:r,data:n}}const e=He(a.data);return{key:a.type,info:"",data:e}}function Ua(a){return btoa(String.fromCharCode(...a))}function Js(a,e){if(a<0)return-Js(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const n=Math.floor(a*t);return(n%2===0?n:n+1)/t}else return Math.round(a*t)/t}function mo(a,e){const t=new URL(a),r=new URL(e);if(t.origin!==r.origin)return a;const n=t.pathname.split("/").slice(1),i=r.pathname.split("/").slice(1,-1);for(;n[0]===i[0];)n.shift(),i.shift();for(;i.length;)i.shift(),n.unshift("..");return n.join("/")}function $a(){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,n=>{const i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(n=="x"?i:i&3|8).toString(16)})}}}function za(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function ea(a,e=0,t=1/0){return us(a,e,t,Uint8Array)}function us(a,e,t,r){const n=ta(a);let i=1;"BYTES_PER_ELEMENT"in r&&(i=r.BYTES_PER_ELEMENT);const s=Ga(a)?a.byteOffset:0,o=(s+a.byteLength)/i,h=(s+e)/i,c=Math.floor(Math.max(0,Math.min(h,o))),p=Math.floor(Math.min(c+Math.max(t,0),o));return new r(n,c,p-c)}function ta(a){return a instanceof ArrayBuffer?a:a.buffer}function Ga(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function go(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 r=a.data.subarray(1).indexOf(0);if(r===-1)return;const n=He(ea(a.data,1,r)),i=a.data[2+r],s=a.data.subarray(3+r).indexOf(0);if(s===-1)return;const o=He(ea(a.data,3+r,s));let h;return n==="-->"?h=He(ea(a.data,4+r+s)):h=za(a.data.subarray(4+r+s)),e.mimeType=n,e.pictureType=i,e.description=o,e.data=h,e}function _o(a){return a.type==="PRIV"?Xs(a):a.type[0]==="W"?Na(a):a.type==="APIC"?go(a):Qs(a)}function vo(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=os(a,4),r=10;return{type:e,size:t,data:a.subarray(r,r+t)}}const Zi=10,yo=10;function ja(a){let e=0;const t=[];for(;as(a,e);){const r=os(a,e+6);a[e+5]>>6&1&&(e+=Zi),e+=Zi;const n=e+r;for(;e+yo<n;){const i=vo(a.subarray(e)),s=_o(i);s&&t.push(s),e+=i.size+Zi}Ra(a,e)&&(e+=Zi)}return t}function ra(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function bo(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,t&&(r+=4772185884e-2),Math.round(r)}}function ks(a){const e=ja(a);for(let t=0;t<e.length;t++){const r=e[t];if(ra(r))return bo(r)}}let In=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 pe(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Cs{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,r,n){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,r){}demux(e,t){this.cachedData&&(e=Ve(this.cachedData,e),this.cachedData=null);let r=Yi(e,0),n=r?r.length:0,i;const s=this._audioTrack,o=this._id3Track,h=r?ks(r):void 0,c=e.length;for((this.basePTS===null||this.frameIndex===0&&F(h))&&(this.basePTS=na(h,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),r&&r.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:In.audioId3,duration:Number.POSITIVE_INFINITY});n<c;){if(this.canParse(e,n)){const p=this.appendFrame(s,e,n);p?(this.frameIndex++,this.lastPTS=p.sample.pts,n+=p.length,i=n):n=c}else Ba(e,n)?(r=Yi(e,n),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:In.audioId3,duration:Number.POSITIVE_INFINITY}),n+=r.length,i=n):n++;if(n===c&&i!==c){const p=e.slice(i);this.cachedData?this.cachedData=Ve(this.cachedData,p):this.cachedData=p}}return{audioTrack:s,videoTrack:pe(),id3Track:o,textTrack:pe()}}demuxSampleAes(e,t,r){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:pe(),id3Track:this._id3Track,textTrack:pe()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const na=(a,e,t)=>{if(F(a))return a*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let Xi=null;const Ha=[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],ia=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Ka=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Va=[0,1,1,4];function Wa(a,e,t,r,n){if(t+24>e.length)return;const i=sa(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,o=r+n*s,h={unit:e.subarray(t,t+i.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(h),{sample:h,length:i.frameLength,missing:0}}}function sa(a,e){const t=a[e+1]>>3&3,r=a[e+1]>>1&3,n=a[e+2]>>4&15,i=a[e+2]>>2&3;if(t!==1&&n!==0&&n!==15&&i!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,h=t===3?3-r:r===3?3:4,c=Ha[h*14+n-1]*1e3,g=ia[(t===3?0:t===2?1:2)*3+i],x=o===3?1:2,D=Ka[t][r],T=Va[r],N=D*8*T,H=Math.floor(D*c/g+s)*T;if(Xi===null){const Re=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Xi=Re?parseInt(Re[1]):0}return!!Xi&&Xi<=87&&r===2&&c>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:g,channelCount:x,frameLength:H,samplesPerFrame:N}}}function Ls(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function cs(a,e){return e+1<a.length&&Ls(a,e)}function xo(a,e){return Ls(a,e)&&4<=a.length-e}function Rs(a,e){if(e+1<a.length&&Ls(a,e)){const r=sa(a,e);let n=4;r!=null&&r.frameLength&&(n=r.frameLength);const i=e+n;return i===a.length||cs(a,i)}return!1}class Ya extends Cs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const r=Yi(e,0);let n=(r==null?void 0:r.length)||0;if(Rs(e,n))return!1;for(let i=e.length;n<i;n++)if(Pa(e,n))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return po(e,t)}appendFrame(e,t,r){Zs(e,this.observer,t,r,e.manifestCodec);const n=Fa(e,t,r,this.basePTS,this.frameIndex);if(n&&n.missing===0)return n}}const qa=(a,e)=>{let t=0,r=5;e+=r;const n=new Uint32Array(1),i=new Uint32Array(1),s=new Uint8Array(1);for(;r>0;){s[0]=a[e];const o=Math.min(r,8),h=8-o;i[0]=4278190080>>>24+h<<h,n[0]=(s[0]&i[0])>>h,t=t?t<<o|n[0]:n[0],e+=1,r-=o}return t};class Eo extends Cs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,r){const n=aa(e,t,r,this.basePTS,this.frameIndex);if(n!==-1)return{sample:e.samples[e.samples.length-1],length:n,missing:0}}static probe(e){if(!e)return!1;const t=Yi(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&ks(t)!==void 0&&qa(e,r)<16}}function aa(a,e,t,r,n){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const i=e[t+4]>>6;if(i>=3)return-1;const o=[48e3,44100,32e3][i],h=e[t+4]&63,p=[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][h*3+i]*2;if(t+p>e.length)return-1;const g=e[t+6]>>5;let x=0;g===2?x+=2:(g&1&&g!==1&&(x+=2),g&4&&(x+=2));const D=(e[t+6]<<8|e[t+7])>>12-x&1,N=[2,1,2,3,3,4,4,5][g]+D,H=e[t+5]>>3,_e=e[t+5]&7,Ue=new Uint8Array([i<<6|H<<1|_e>>2,(_e&3)<<6|g<<3|D<<2|h>>4,h<<4&224]),Re=1536/o*9e4,Qe=r+n*Re,Je=e.subarray(t,t+p);return a.config=Ue,a.channelCount=N,a.samplerate=o,a.samples.push({unit:Je,pts:Qe}),p}class oa extends Cs{resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Yi(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&ks(t)!==void 0&&qa(e,r)<=16)return!1;for(let n=e.length;r<n;r++)if(Rs(e,r))return ye.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return xo(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return Wa(e,t,r,this.basePTS,this.frameIndex)}}const wo=/\/emsg[-/]ID3/i;class So{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,r,n){const i=this.videoTrack=pe("video",1),s=this.audioTrack=pe("audio",1),o=this.txtTrack=pe("text",1);if(this.id3Track=pe("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const h=Ne(e);if(h.video){const{id:c,timescale:p,codec:g,supplemental:x}=h.video;i.id=c,i.timescale=o.timescale=p,i.codec=g,i.supplemental=x}if(h.audio){const{id:c,timescale:p,codec:g}=h.audio;s.id=c,s.timescale=p,s.codec=g}o.id=at.text,i.sampleDuration=0,i.duration=s.duration=n}resetContiguity(){this.remainderData=null}static probe(e){return ze(e)}demux(e,t){this.timeOffset=t;let r=e;const n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Ve(this.remainderData,e));const o=Ye(r);this.remainderData=o.remainder,n.samples=o.valid||new Uint8Array}else n.samples=r;const s=this.extractID3Track(n,t);return i.samples=it(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const n=this.extractID3Track(t,this.timeOffset);return r.samples=it(e,t),{videoTrack:t,audioTrack:pe(),id3Track:n,textTrack:pe()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const n=Ke(e.samples,["emsg"]);n&&n.forEach(i=>{const s=ct(i);if(wo.test(s.schemeIdUri)){const o=Ao(s,t);let h=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;h<=.001&&(h=Number.POSITIVE_INFINITY);const c=s.payload;r.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:In.emsg,duration:h})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=Ao(s,t);r.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:In.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r}demuxSampleAes(e,t,r){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 Ao(a,e){return F(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class I{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Vn(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,dr.cbc)}decryptAacSample(e,t,r){const n=e[t].unit;if(n.length<=16)return;const i=n.subarray(16,n.length-n.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(o=>{const h=new Uint8Array(o);n.set(h,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)})}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length){r();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,r=new Int8Array(t);let n=0;for(let i=32;i<e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let n=0;for(let i=32;i<e.length-16;i+=160,n+=16)e.set(r.subarray(n,n+16),i);return e}decryptAvcSample(e,t,r,n,i){const s=mt(i.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(h=>{i.data=this.getAvcDecryptedUnit(s,h),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,n)})}decryptAvcSamples(e,t,r,n){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length){n();return}const i=e[t].units;for(;!(r>=i.length);r++){const s=i[r];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,r,n,s),!this.decrypter.isSync()))return}}}}class l{constructor(){this.VideoSample=null}createVideoSample(e,t,r){return{key:e,frame:!1,pts:t,dts:r,units:[],length:0}}getLastNalUnit(e){var t;let r=this.VideoSample,n;if((!r||r.units.length===0)&&(r=e[e.length-1]),(t=r)!=null&&t.units){const i=r.units;n=i[i.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const r=t.samples,n=r.length;if(n){const i=r[n-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,r){const n=t.byteLength;let i=e.naluState||0;const s=i,o=[];let h=0,c,p,g,x=-1,D=0;for(i===-1&&(x=0,D=this.getNALuType(t,0),i=0,h=1);h<n;){if(c=t[h++],!i){i=c?0:1;continue}if(i===1){i=c?0:2;continue}if(!c)i=3;else if(c===1){if(p=h-i-1,x>=0){const T={data:t.subarray(x,p),type:D};o.push(T)}else{const T=this.getLastNalUnit(e.samples);T&&(s&&h<=4-s&&T.state&&(T.data=T.data.subarray(0,T.data.byteLength-s)),p>0&&(T.data=Ve(T.data,t.subarray(0,p)),T.state=0))}h<n?(g=this.getNALuType(t,h),x=h,D=g,i=0):i=-1}else i=0}if(x>=0&&i>=0){const T={data:t.subarray(x,n),type:D,state:i};o.push(T)}if(o.length===0){const T=this.getLastNalUnit(e.samples);T&&(T.data=Ve(T.data,t))}return e.naluState=i,o}}class f{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,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}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 r=this.word>>>32-t;if(e>32&&ye.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?r<<t|this.readBits(t):r}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 d extends l{parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s=this.VideoSample,o,h=!1;r.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),i.forEach(c=>{var p,g;switch(c.type){case 1:{let N=!1;o=!0;const H=c.data;if(h&&H.length>4){const _e=this.readSliceType(H);(_e===2||_e===4||_e===7||_e===9)&&(N=!0)}if(N){var x;(x=s)!=null&&x.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.frame=!0,s.key=N;break}case 5:o=!0,(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,pt(c.data,1,r.pts,t.samples);break}case 7:{var D,T;o=!0,h=!0;const N=c.data,H=this.readSPS(N);if(!e.sps||e.width!==H.width||e.height!==H.height||((D=e.pixelRatio)==null?void 0:D[0])!==H.pixelRatio[0]||((T=e.pixelRatio)==null?void 0:T[1])!==H.pixelRatio[1]){e.width=H.width,e.height=H.height,e.pixelRatio=H.pixelRatio,e.sps=[N];const _e=N.subarray(1,4);let Ue="avc1.";for(let Re=0;Re<3;Re++){let Qe=_e[Re].toString(16);Qe.length<2&&(Qe="0"+Qe),Ue+=Qe}e.codec=Ue}break}case 8:o=!0,e.pps=[c.data];break;case 9:o=!0,e.audFound=!0,(g=s)!=null&&g.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(c)}),n&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new f(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r=8,n=8,i;for(let s=0;s<e;s++)n!==0&&(i=t.readEG(),n=(r+i+256)%256),r=n===0?r:n}readSPS(e){const t=new f(e);let r=0,n=0,i=0,s=0,o,h,c;const p=t.readUByte.bind(t),g=t.readBits.bind(t),x=t.readUEG.bind(t),D=t.readBoolean.bind(t),T=t.skipBits.bind(t),N=t.skipEG.bind(t),H=t.skipUEG.bind(t),_e=this.skipScalingList.bind(this);p();const Ue=p();if(g(5),T(3),p(),H(),Ue===100||Ue===110||Ue===122||Ue===244||Ue===44||Ue===83||Ue===86||Ue===118||Ue===128){const ot=x();if(ot===3&&T(1),H(),H(),T(1),D())for(h=ot!==3?8:12,c=0;c<h;c++)D()&&(c<6?_e(16,t):_e(64,t))}H();const Re=x();if(Re===0)x();else if(Re===1)for(T(1),N(),N(),o=x(),c=0;c<o;c++)N();H(),T(1);const Qe=x(),Je=x(),ft=g(1);ft===0&&T(1),T(1),D()&&(r=x(),n=x(),i=x(),s=x());let et=[1,1];if(D()&&D())switch(p()){case 1:et=[1,1];break;case 2:et=[12,11];break;case 3:et=[10,11];break;case 4:et=[16,11];break;case 5:et=[40,33];break;case 6:et=[24,11];break;case 7:et=[20,11];break;case 8:et=[32,11];break;case 9:et=[80,33];break;case 10:et=[18,11];break;case 11:et=[15,11];break;case 12:et=[64,33];break;case 13:et=[160,99];break;case 14:et=[4,3];break;case 15:et=[3,2];break;case 16:et=[2,1];break;case 255:{et=[p()<<8|p(),p()<<8|p()];break}}return{width:Math.ceil((Qe+1)*16-r*2-n*2),height:(2-ft)*(Je+1)*16-(ft?2:4)*(i+s),pixelRatio:et}}}class m extends l{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s=this.VideoSample,o,h=!1;r.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),i.forEach(c=>{var p,g;switch(c.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,r.pts,r.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,h){var x;(x=s)!=null&&x.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,pt(c.data,2,r.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=b(e.params,this.readVPS(c.data)),this.initVPS=c.data),e.vps=[c.data];break;case 33:if(o=!0,h=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],c.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const D=this.readSPS(c.data);e.width=D.width,e.height=D.height,e.pixelRatio=D.pixelRatio,e.codec=D.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const T in D.params)e.params[T]=D.params[T]}this.pushParameterSet(e.sps,c.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const D=this.readPPS(c.data);for(const T in D)e.params[T]=D[T]}this.pushParameterSet(e.pps,c.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(g=s)!=null&&g.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:o=!1;break}s&&o&&s.units.push(c)}),n&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,r){(r&&r[0]===this.initVPS||!r&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let r=0;for(let n=0;n<e.byteLength;n++)n>=2&&e[n]===3&&e[n-1]===0&&e[n-2]===0||(t[r]=e[n],r++);return new Uint8Array(t.buffer,0,r)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new f(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const r=t.readBits(3),n=t.readBoolean();return{numTemporalLayers:r+1,temporalIdNested:n}}readSPS(e){const t=new f(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const n=t.readBits(2),i=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),h=t.readUByte(),c=t.readUByte(),p=t.readUByte(),g=t.readUByte(),x=t.readUByte(),D=t.readUByte(),T=t.readUByte(),N=t.readUByte(),H=t.readUByte(),_e=t.readUByte(),Ue=[],Re=[];for(let Ir=0;Ir<r;Ir++)Ue.push(t.readBoolean()),Re.push(t.readBoolean());if(r>0)for(let Ir=r;Ir<8;Ir++)t.readBits(2);for(let Ir=0;Ir<r;Ir++)Ue[Ir]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Re[Ir]&&t.readUByte();t.readUEG();const Qe=t.readUEG();Qe==3&&t.skipBits(1);const Je=t.readUEG(),ft=t.readUEG(),et=t.readBoolean();let ot=0,_t=0,nt=0,At=0;et&&(ot+=t.readUEG(),_t+=t.readUEG(),nt+=t.readUEG(),At+=t.readUEG());const Pt=t.readUEG(),br=t.readUEG(),rr=t.readUEG(),Zt=t.readBoolean();for(let Ir=Zt?0:r;Ir<=r;Ir++)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 Cn=0;Cn<4;Cn++)for(let ii=0;ii<(Cn===3?2:6);ii++)if(!t.readBoolean())t.readUEG();else{const yi=Math.min(64,1<<4+(Cn<<1));Cn>1&&t.readEG();for(let Ns=0;Ns<yi;Ns++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const Yt=t.readUEG();let Tt=0;for(let Ir=0;Ir<Yt;Ir++){let Cn=!1;if(Ir!==0&&(Cn=t.readBoolean()),Cn){Ir===Yt&&t.readUEG(),t.readBoolean(),t.readUEG();let ii=0;for(let ds=0;ds<=Tt;ds++){const yi=t.readBoolean();let Ns=!1;yi||(Ns=t.readBoolean()),(yi||Ns)&&ii++}Tt=ii}else{const ii=t.readUEG(),ds=t.readUEG();Tt=ii+ds;for(let yi=0;yi<ii;yi++)t.readUEG(),t.readBoolean();for(let yi=0;yi<ds;yi++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Ir=t.readUEG();for(let Cn=0;Cn<Ir;Cn++){for(let ii=0;ii<rr+4;ii++)t.readBits(1);t.readBits(1)}}let or=0,nr=1,gr=1,Cr=!0,$r=1,Wr=0;t.readBoolean(),t.readBoolean();let Pn=!1;if(t.readBoolean()){if(t.readBoolean()){const ps=t.readUByte(),Gl=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],lo=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ps>0&&ps<16?(nr=Gl[ps-1],gr=lo[ps-1]):ps===255&&(nr=t.readBits(16),gr=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(),Pn=t.readBoolean(),Pn&&(ot+=t.readUEG(),_t+=t.readUEG(),nt+=t.readUEG(),At+=t.readUEG()),t.readBoolean()&&($r=t.readBits(32),Wr=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const lo=t.readBoolean(),jl=t.readBoolean();let da=!1;(lo||jl)&&(da=t.readBoolean(),da&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),da&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Hl=0;Hl<=r;Hl++){Cr=t.readBoolean();const ec=Cr||t.readBoolean();let Kl=!1;ec?t.readEG():Kl=t.readBoolean();const Vl=Kl?1:t.readUEG()+1;if(lo)for(let pa=0;pa<Vl;pa++)t.readUEG(),t.readUEG(),da&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(jl)for(let pa=0;pa<Vl;pa++)t.readUEG(),t.readUEG(),da&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),or=t.readUEG())}let rs=Je,zl=ft;if(et||Pn){let Ir=1,Cn=1;Qe===1?Ir=Cn=2:Qe==2&&(Ir=2),rs=Je-Ir*_t-Ir*ot,zl=ft-Cn*At-Cn*nt}const Q0=n?["A","B","C"][n]:"",J0=o<<24|h<<16|c<<8|p;let qo=0;for(let Ir=0;Ir<32;Ir++)qo=(qo|(J0>>Ir&1)<<31-Ir)>>>0;let Zo=qo.toString(16);return s===1&&Zo==="2"&&(Zo="6"),{codecString:`hvc1.${Q0}${s}.${Zo}.${i?"H":"L"}${_e}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:n,general_profile_compatibility_flags:[o,h,c,p],general_constraint_indicator_flags:[g,x,D,T,N,H],general_level_idc:_e,bit_depth:Pt+8,bit_depth_luma_minus8:Pt,bit_depth_chroma_minus8:br,min_spatial_segmentation_idc:or,chroma_format_idc:Qe,frame_rate:{fixed:Cr,fps:Wr/$r}},width:rs,height:zl,pixelRatio:[nr,gr]}}readPPS(e){const t=new f(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 n=t.readBoolean(),i=t.readBoolean();let s=1;return i&&n?s=0:i?s=3:n&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const w=188;class L{constructor(e,t,r,n){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=r,this.logger=n,this.videoParser=null}static probe(e,t){const r=L.syncOffset(e);return r>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){const t=e.length;let r=Math.min(w*5,t-w)+1,n=0;for(;n<r;){let i=!1,s=-1,o=0;for(let h=n;h<t;h+=w)if(e[h]===71&&(t-h===w||e[h+w]===71)){if(o++,s===-1&&(s=h,s!==0&&(r=Math.min(s+w*99,e.length-w)+1)),i||(i=X(e,h)===0),i&&o>1&&(s===0&&o>2||h+w>r))return s}else{if(o)return-1;break}n++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:at[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=L.createTrack("video"),this._videoTrack.duration=n,this._audioTrack=L.createTrack("audio",n),this._id3Track=L.createTrack("id3"),this._txtTrack=L.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,r=!1,n=!1){r||(this.sampleAes=null);let i;const s=this._videoTrack,o=this._audioTrack,h=this._id3Track,c=this._txtTrack;let p=s.pid,g=s.pesData,x=o.pid,D=h.pid,T=o.pesData,N=h.pesData,H=null,_e=this.pmtParsed,Ue=this._pmtId,Re=e.length;if(this.remainderData&&(e=Ve(this.remainderData,e),Re=e.length,this.remainderData=null),Re<w&&!n)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:h,textTrack:c};const Qe=Math.max(0,L.syncOffset(e));Re-=(Re-Qe)%w,Re<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,Re,e.buffer.byteLength-Re));let Je=0;for(let et=Qe;et<Re;et+=w)if(e[et]===71){const ot=!!(e[et+1]&64),_t=X(e,et),nt=(e[et+3]&48)>>4;let At;if(nt>1){if(At=et+5+e[et+4],At===et+w)continue}else At=et+4;switch(_t){case p:if(ot){if(g&&(i=lt(g,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new d;break;case"hevc":this.videoParser=new m;break}this.videoParser!==null&&this.videoParser.parsePES(s,c,i,!1)}g={data:[],size:0}}g&&(g.data.push(e.subarray(At,et+w)),g.size+=et+w-At);break;case x:if(ot){if(T&&(i=lt(T,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,i);break;case"mp3":this.parseMPEGPES(o,i);break;case"ac3":this.parseAC3PES(o,i);break}T={data:[],size:0}}T&&(T.data.push(e.subarray(At,et+w)),T.size+=et+w-At);break;case D:ot&&(N&&(i=lt(N,this.logger))&&this.parseID3PES(h,i),N={data:[],size:0}),N&&(N.data.push(e.subarray(At,et+w)),N.size+=et+w-At);break;case 0:ot&&(At+=e[At]+1),Ue=this._pmtId=le(e,At);break;case Ue:{ot&&(At+=e[At]+1);const Pt=Se(e,At,this.typeSupported,r,this.observer,this.logger);p=Pt.videoPid,p>0&&(s.pid=p,s.segmentCodec=Pt.segmentVideoCodec),x=Pt.audioPid,x>0&&(o.pid=x,o.segmentCodec=Pt.segmentAudioCodec),D=Pt.id3Pid,D>0&&(h.pid=D),H!==null&&!_e&&(this.logger.warn(`MPEG-TS PMT found at ${et} after unknown PID '${H}'. Backtracking to sync byte @${Qe} to parse all TS packets.`),H=null,et=Qe-188),_e=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=_t;break}}else Je++;Je>0&&We(this.observer,new Error(`Found ${Je} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=g,o.pesData=T,h.pesData=N;const ft={audioTrack:o,videoTrack:s,id3Track:h,textTrack:c};return n&&this.extractRemainingSamples(ft),ft}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:r,id3Track:n,textTrack:i}=e,s=r.pesData,o=t.pesData,h=n.pesData;let c;if(s&&(c=lt(s,this.logger))){if(this.videoParser===null)switch(r.segmentCodec){case"avc":this.videoParser=new d;break;case"hevc":this.videoParser=new m;break}this.videoParser!==null&&(this.videoParser.parsePES(r,i,c,!0),r.pesData=null)}else r.pesData=s;if(o&&(c=lt(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,c);break;case"mp3":this.parseMPEGPES(t,c);break;case"ac3":this.parseAC3PES(t,c);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;h&&(c=lt(h,this.logger))?(this.parseID3PES(n,c),n.pesData=null):n.pesData=h}demuxSampleAes(e,t,r){const n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new I(this.observer,this.config,t);return this.decrypt(n,i)}decrypt(e,t){return new Promise(r=>{const{audioTrack:n,videoTrack:i}=e;n.samples&&n.segmentCodec==="aac"?t.decryptAacSamples(n.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{r(e)}):r(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{r(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 r=0;const n=this.aacOverFlow;let i=t.data;if(n){this.aacOverFlow=null;const g=n.missing,x=n.sample.unit.byteLength;if(g===-1)i=Ve(n.sample.unit,i);else{const D=x-g;n.sample.unit.set(i.subarray(0,g),D),e.samples.push(n.sample),r=n.missing}}let s,o;for(s=r,o=i.length;s<o-1&&!ls(i,s);s++);if(s!==r){let g;const x=s<o-1;if(x?g=`AAC PES did not start with ADTS header,offset:${s}`:g="No ADTS header found in AAC PES",We(this.observer,new Error(g),x,this.logger),!x)return}Zs(e,this.observer,i,s,this.audioCodec);let h;if(t.pts!==void 0)h=t.pts;else if(n){const g=Oa(e.samplerate);h=n.sample.pts+g}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let c=0,p;for(;s<o;)if(p=Fa(e,i,s,h,c),s+=p.length,p.missing){this.aacOverFlow=p;break}else for(c++;s<o-1&&!ls(i,s);s++);}parseMPEGPES(e,t){const r=t.data,n=r.length;let i=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<n;)if(cs(r,s)){const h=Wa(e,r,s,o,i);if(h)s+=h.length,i++;else break}else s++}parseAC3PES(e,t){{const r=t.data,n=t.pts;if(n===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const i=r.length;let s=0,o=0,h;for(;o<i&&(h=aa(e,r,o,n,s++))>0;)o+=h}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const r=b({},t,{type:this._videoTrack?In.emsg:In.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function X(a,e){return((a[e+1]&31)<<8)+a[e+2]}function le(a,e){return(a[e+10]&31)<<8|a[e+11]}function Se(a,e,t,r,n,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],h=e+3+o-4,c=(a[e+10]&15)<<8|a[e+11];for(e+=12+c;e<h;){const p=X(a,e),g=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!r){rt("ADTS AAC",i);break}case 15:s.audioPid===-1&&(s.audioPid=p);break;case 21:s.id3Pid===-1&&(s.id3Pid=p);break;case 219:if(!r){rt("H.264",i);break}case 27:s.videoPid===-1&&(s.videoPid=p);break;case 3:case 4:!t.mpeg&&!t.mp3?i.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=p,s.segmentAudioCodec="mp3");break;case 193:if(!r){rt("AC-3",i);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=p,s.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&g>0){let x=e+5,D=g;for(;D>2;){switch(a[x]){case 106:t.ac3!==!0?i.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=p,s.segmentAudioCodec="ac3");break}const N=a[x+1]+2;x+=N,D-=N}}break;case 194:case 135:return We(n,new Error("Unsupported EC-3 in M2TS found"),void 0,i),s;case 36:s.videoPid===-1&&(s.videoPid=p,s.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"));break}e+=g+5}return s}function We(a,e,t,r){r.warn(`parsing error: ${e.message}`),a.emit(v.ERROR,v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function rt(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function lt(a,e){let t=0,r,n,i,s,o;const h=a.data;if(!a||a.size===0)return null;for(;h[0].length<19&&h.length>1;)h[0]=Ve(h[0],h[1]),h.splice(1,1);if(r=h[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(n=(r[4]<<8)+r[5],n&&n>a.size-6)return null;const p=r[7];p&192&&(s=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,p&64?(o=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[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),i=r[8];let g=i+9;if(a.size<=g)return null;a.size-=g;const x=new Uint8Array(a.size);for(let D=0,T=h.length;D<T;D++){r=h[D];let N=r.byteLength;if(g)if(g>N){g-=N;continue}else r=r.subarray(g),N-=g,g=0;x.set(r,t),t+=N}return n&&(n-=i+3),{data:x,pts:s,dts:o,len:n}}return null}class xt{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 wt=Math.pow(2,32)-1;class Me{static init(){Me.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 Me.types)Me.types.hasOwnProperty(e)&&(Me.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]),r=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]);Me.HDLR_TYPES={video:t,audio:r};const n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);Me.STTS=Me.STSC=Me.STCO=i,Me.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Me.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Me.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Me.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]),h=new Uint8Array([0,0,0,1]);Me.FTYP=Me.box(Me.types.ftyp,s,h,s,o),Me.DINF=Me.box(Me.types.dinf,Me.box(Me.types.dref,n))}static box(e,...t){let r=8,n=t.length;const i=n;for(;n--;)r+=t[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=r&255,s.set(e,4),n=0,r=8;n<i;n++)s.set(t[n],r),r+=t[n].byteLength;return s}static hdlr(e){return Me.box(Me.types.hdlr,Me.HDLR_TYPES[e])}static mdat(e){return Me.box(Me.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(wt+1)),n=Math.floor(t%(wt+1));return Me.box(Me.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,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255,85,196,0,0]))}static mdia(e){return Me.box(Me.types.mdia,Me.mdhd(e.timescale||0,e.duration||0),Me.hdlr(e.type),Me.minf(e))}static mfhd(e){return Me.box(Me.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"?Me.box(Me.types.minf,Me.box(Me.types.smhd,Me.SMHD),Me.DINF,Me.stbl(e)):Me.box(Me.types.minf,Me.box(Me.types.vmhd,Me.VMHD),Me.DINF,Me.stbl(e))}static moof(e,t,r){return Me.box(Me.types.moof,Me.mfhd(e),Me.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=Me.trak(e[t]);return Me.box.apply(null,[Me.types.moov,Me.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(Me.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=Me.trex(e[t]);return Me.box.apply(null,[Me.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(wt+1)),n=Math.floor(t%(wt+1)),i=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,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&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 Me.box(Me.types.mvhd,i)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let n,i;for(n=0;n<t.length;n++)i=t[n].flags,r[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return Me.box(Me.types.sdtp,r)}static stbl(e){return Me.box(Me.types.stbl,Me.stsd(e),Me.box(Me.types.stts,Me.STTS),Me.box(Me.types.stsc,Me.STSC),Me.box(Me.types.stsz,Me.STSZ),Me.box(Me.types.stco,Me.STCO))}static avc1(e){let t=[],r=[],n,i,s;for(n=0;n<e.sps.length;n++)i=e.sps[n],s=i.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(i));for(n=0;n<e.pps.length;n++)i=e.pps[n],s=i.byteLength,r.push(s>>>8&255),r.push(s&255),r=r.concat(Array.prototype.slice.call(i));const o=Me.box(Me.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(r))),h=e.width,c=e.height,p=e.pixelRatio[0],g=e.pixelRatio[1];return Me.box(Me.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,h>>8&255,h&255,c>>8&255,c&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,Me.box(Me.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Me.box(Me.types.pasp,new Uint8Array([p>>24,p>>16&255,p>>8&255,p&255,g>>24,g>>16&255,g>>8&255,g&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 Me.box(Me.types.mp4a,Me.audioStsd(e),Me.box(Me.types.esds,Me.esds(e)))}static mp3(e){return Me.box(Me.types[".mp3"],Me.audioStsd(e))}static ac3(e){return Me.box(Me.types["ac-3"],Me.audioStsd(e),Me.box(Me.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Me.box(Me.types.stsd,Me.STSD,Me.mp4a(e));if(t==="ac3"&&e.config)return Me.box(Me.types.stsd,Me.STSD,Me.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Me.box(Me.types.stsd,Me.STSD,Me.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Me.box(Me.types.stsd,Me.STSD,Me.avc1(e));if(t==="hevc"&&e.vps)return Me.box(Me.types.stsd,Me.STSD,Me.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,r=(e.duration||0)*(e.timescale||0),n=e.width||0,i=e.height||0,s=Math.floor(r/(wt+1)),o=Math.floor(r%(wt+1));return Me.box(Me.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,n>>8&255,n&255,0,0,i>>8&255,i&255,0,0]))}static traf(e,t){const r=Me.sdtp(e),n=e.id,i=Math.floor(t/(wt+1)),s=Math.floor(t%(wt+1));return Me.box(Me.types.traf,Me.box(Me.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255])),Me.box(Me.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255])),Me.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,Me.box(Me.types.trak,Me.tkhd(e),Me.mdia(e))}static trex(e){const t=e.id;return Me.box(Me.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 r=e.samples||[],n=r.length,i=12+16*n,s=new Uint8Array(i);let o,h,c,p,g,x;for(t+=8+i,s.set([e.type==="video"?1:0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,n&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<n;o++)h=r[o],c=h.duration,p=h.size,g=h.flags,x=h.cts,s.set([c>>>24&255,c>>>16&255,c>>>8&255,c&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255,g.isLeading<<2|g.dependsOn,g.isDependedOn<<6|g.hasRedundancy<<4|g.paddingValue<<1|g.isNonSync,g.degradPrio&61440,g.degradPrio&15,x>>>24&255,x>>>16&255,x>>>8&255,x&255],12+16*o);return Me.box(Me.types.trun,s)}static initSegment(e){Me.types||Me.init();const t=Me.moov(e);return Ve(Me.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],n=4,i=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),n-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),r.length]);let s=i.length;for(let T=0;T<r.length;T+=1){s+=3;for(let N=0;N<r[T].length;N+=1)s+=2+r[T][N].length}const o=new Uint8Array(s);o.set(i,0),s=i.length;const h=r.length-1;for(let T=0;T<r.length;T+=1){o.set(new Uint8Array([32+T|(T===h?128:0),0,r[T].length]),s),s+=3;for(let N=0;N<r[T].length;N+=1)o.set(new Uint8Array([r[T][N].length>>8,r[T][N].length&255]),s),s+=2,o.set(r[T][N],s),s+=r[T][N].length}const c=Me.box(Me.types.hvcC,o),p=e.width,g=e.height,x=e.pixelRatio[0],D=e.pixelRatio[1];return Me.box(Me.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,p>>8&255,p&255,g>>8&255,g&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]),c,Me.box(Me.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Me.box(Me.types.pasp,new Uint8Array([x>>24,x>>16&255,x>>8&255,x&255,D>>24,D>>16&255,D>>8&255,D&255])))}}Me.types=void 0,Me.HDLR_TYPES=void 0,Me.STTS=void 0,Me.STSC=void 0,Me.STCO=void 0,Me.STSZ=void 0,Me.VMHD=void 0,Me.SMHD=void 0,Me.STSD=void 0,Me.FTYP=void 0,Me.DINF=void 0;const Kt=9e4;function ir(a,e,t=1,r=!1){const n=a*e*t;return r?Math.round(n):n}function cr(a,e,t=1,r=!1){return ir(a,e,1/t,r)}function ar(a,e=!1){return ir(a,1e3,1/Kt,e)}function jr(a,e=1){return ir(a,Kt,1/e)}const Ur=10*1e3,Qr=1024,Jr=1152,sn=1536;let un=null,dn=null;function Nr(a,e,t,r){return{duration:e,size:t,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class Tn{constructor(e,t,r,n){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.logger=n,this.ISGenerated=!1,un===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);un=s?parseInt(s[1]):0}if(dn===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);dn=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const r=e[0].pts,n=e.reduce((i,s)=>{let o=s.pts,h=o-i;return h<-4294967296&&(t=!0,o=pn(o,r),h=o-i),h>0?i:o},r);return t&&this.logger.debug("PTS rollover detected"),n}remux(e,t,r,n,i,s,o,h){let c,p,g,x,D,T,N=i,H=i;const _e=e.pid>-1,Ue=t.pid>-1,Re=t.samples.length,Qe=e.samples.length>0,Je=o&&Re>0||Re>1;if((!_e||Qe)&&(!Ue||Je)||this.ISGenerated||o){if(this.ISGenerated){var et,ot,_t,nt;const rr=this.videoTrackConfig;(rr&&(t.width!==rr.width||t.height!==rr.height||((et=t.pixelRatio)==null?void 0:et[0])!==((ot=rr.pixelRatio)==null?void 0:ot[0])||((_t=t.pixelRatio)==null?void 0:_t[1])!==((nt=rr.pixelRatio)==null?void 0:nt[1]))||!rr&&Je||this.nextAudioPts===null&&Qe)&&this.resetInitSegment()}this.ISGenerated||(g=this.generateIS(e,t,i,s));const At=this.isVideoContiguous;let Pt=-1,br;if(Je&&(Pt=Zn(t.samples),!At&&this.config.forceKeyFrameOnDiscontinuity))if(T=!0,Pt>0){this.logger.warn(`[mp4-remuxer]: Dropped ${Pt} out of ${Re} video samples due to a missing keyframe`);const rr=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Pt),t.dropped+=Pt,H+=(t.samples[0].pts-rr)/t.inputTimeScale,br=H}else Pt===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${Re} video samples`),T=!1);if(this.ISGenerated){if(Qe&&Je){const rr=this.getVideoStartPts(t.samples),Ht=(pn(e.samples[0].pts,rr)-rr)/t.inputTimeScale;N+=Math.max(0,Ht),H+=Math.max(0,-Ht)}if(Qe){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),g=this.generateIS(e,t,i,s)),p=this.remuxAudio(e,N,this.isAudioContiguous,s,Ue||Je||h===fe.AUDIO?H:void 0),Je){const rr=p?p.endPTS-p.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),g=this.generateIS(e,t,i,s)),c=this.remuxVideo(t,H,At,rr)}}else Je&&(c=this.remuxVideo(t,H,At,0));c&&(c.firstKeyFrame=Pt,c.independent=Pt!==-1,c.firstKeyFramePTS=br)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(D=bn(r,i,this._initPTS,this._initDTS)),n.samples.length&&(x=mi(n,i,this._initPTS))),{audio:p,video:c,initSegment:g,independent:T,text:x,id3:D}}generateIS(e,t,r,n){const i=e.samples,s=t.samples,o=this.typeSupported,h={},c=this._initPTS;let p=!c||n,g="audio/mp4",x,D,T;if(p&&(x=D=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(g="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}h.audio={id:"audio",container:g,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):Me.initSegment([e]),metadata:{channelCount:e.channelCount}},p&&(T=e.inputTimeScale,!c||T!==c.timescale?x=D=i[0].pts-Math.round(T*r):p=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Me.initSegment([t]),metadata:{width:t.width,height:t.height}},p)if(T=t.inputTimeScale,!c||T!==c.timescale){const N=this.getVideoStartPts(s),H=Math.round(T*r);D=Math.min(D,pn(s[0].dts,N)-H),x=Math.min(x,N-H)}else p=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(h).length)return this.ISGenerated=!0,p?(this._initPTS={baseTime:x,timescale:T},this._initDTS={baseTime:D,timescale:T}):x=T=void 0,{tracks:h,initPTS:x,timescale:T}}remuxVideo(e,t,r,n){const i=e.inputTimeScale,s=e.samples,o=[],h=s.length,c=this._initPTS;let p=this.nextAvcDts,g=8,x=this.videoSampleDuration,D,T,N=Number.POSITIVE_INFINITY,H=Number.NEGATIVE_INFINITY,_e=!1;if(!r||p===null){const Tt=t*i,Lt=s[0].pts-pn(s[0].dts,s[0].pts);un&&p!==null&&Math.abs(Tt-Lt-p)<15e3?r=!0:p=Tt-Lt}const Ue=c.baseTime*i/c.timescale;for(let Tt=0;Tt<h;Tt++){const Lt=s[Tt];Lt.pts=pn(Lt.pts-Ue,p),Lt.dts=pn(Lt.dts-Ue,p),Lt.dts<s[Tt>0?Tt-1:Tt].dts&&(_e=!0)}_e&&s.sort(function(Tt,Lt){const or=Tt.dts-Lt.dts,nr=Tt.pts-Lt.pts;return or||nr}),D=s[0].dts,T=s[s.length-1].dts;const Re=T-D,Qe=Re?Math.round(Re/(h-1)):x||e.inputTimeScale/30;if(r){const Tt=D-p,Lt=Tt>Qe,or=Tt<-1;if((Lt||or)&&(Lt?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ar(Tt,!0)} ms (${Tt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ar(-Tt,!0)} ms (${Tt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!or||p>=s[0].pts||un)){D=p;const nr=s[0].pts-Tt;if(Lt)s[0].dts=D,s[0].pts=nr;else{let gr=!0;for(let Cr=0;Cr<s.length&&!(s[Cr].dts>nr&&gr);Cr++){const $r=s[Cr].pts;if(s[Cr].dts-=Tt,s[Cr].pts-=Tt,Cr<s.length-1){const Wr=s[Cr+1].pts,Pn=s[Cr].pts,jn=Wr<=Pn,rs=Wr<=$r;gr=jn==rs}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${ar(nr,!0)}/${ar(D,!0)}, delta: ${ar(Tt,!0)} ms`)}}D=Math.max(0,D);let Je=0,ft=0,et=D;for(let Tt=0;Tt<h;Tt++){const Lt=s[Tt],or=Lt.units,nr=or.length;let gr=0;for(let Cr=0;Cr<nr;Cr++)gr+=or[Cr].data.length;ft+=gr,Je+=nr,Lt.length=gr,Lt.dts<et?(Lt.dts=et,et+=Qe/4|0||1):et=Lt.dts,N=Math.min(Lt.pts,N),H=Math.max(Lt.pts,H)}T=s[h-1].dts;const ot=ft+4*Je+8;let _t;try{_t=new Uint8Array(ot)}catch(Tt){this.observer.emit(v.ERROR,v.ERROR,{type:ge.MUX_ERROR,details:ne.REMUX_ALLOC_ERROR,fatal:!1,error:Tt,bytes:ot,reason:`fail allocating video mdat ${ot}`});return}const nt=new DataView(_t.buffer);nt.setUint32(0,ot),_t.set(Me.types.mdat,4);let At=!1,Pt=Number.POSITIVE_INFINITY,br=Number.POSITIVE_INFINITY,rr=Number.NEGATIVE_INFINITY,Zt=Number.NEGATIVE_INFINITY;for(let Tt=0;Tt<h;Tt++){const Lt=s[Tt],or=Lt.units;let nr=0;for(let $r=0,Wr=or.length;$r<Wr;$r++){const Pn=or[$r],jn=Pn.data,rs=Pn.data.byteLength;nt.setUint32(g,rs),g+=4,_t.set(jn,g),g+=rs,nr+=4+rs}let gr;if(Tt<h-1)x=s[Tt+1].dts-Lt.dts,gr=s[Tt+1].pts-Lt.pts;else{const $r=this.config,Wr=Tt>0?Lt.dts-s[Tt-1].dts:Qe;if(gr=Tt>0?Lt.pts-s[Tt-1].pts:Qe,$r.stretchShortVideoTrack&&this.nextAudioPts!==null){const Pn=Math.floor($r.maxBufferHole*i),jn=(n?N+n*i:this.nextAudioPts)-Lt.pts;jn>Pn?(x=jn-Wr,x<0?x=Wr:At=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${jn/90} ms to the next segment; using duration ${x/90} ms for the last video frame.`)):x=Wr}else x=Wr}const Cr=Math.round(Lt.pts-Lt.dts);Pt=Math.min(Pt,x),rr=Math.max(rr,x),br=Math.min(br,gr),Zt=Math.max(Zt,gr),o.push(Nr(Lt.key,x,nr,Cr))}if(o.length){if(un){if(un<70){const Tt=o[0].flags;Tt.dependsOn=2,Tt.isNonSync=0}}else if(dn&&Zt-br<rr-Pt&&Qe/rr<.025&&o[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Tt=D;for(let Lt=0,or=o.length;Lt<or;Lt++){const nr=Tt+o[Lt].duration,gr=Tt+o[Lt].cts;if(Lt<or-1){const Cr=nr+o[Lt+1].cts;o[Lt].duration=Cr-gr}else o[Lt].duration=Lt?o[Lt-1].duration:Qe;o[Lt].cts=0,Tt=nr}}}x=At||!x?Qe:x,this.nextAvcDts=p=T+x,this.videoSampleDuration=x,this.isVideoContiguous=!0;const Yt={data1:Me.moof(e.sequenceNumber++,D,b(e,{samples:o})),data2:_t,startPTS:N/i,endPTS:(H+x)/i,startDTS:D/i,endDTS:p/i,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Yt}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Jr;case"ac3":return sn;default:return Qr}}remuxAudio(e,t,r,n,i){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,h=s/o,c=this.getSamplesPerFrame(e),p=c*h,g=this._initPTS,x=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,D=[],T=i!==void 0;let N=e.samples,H=x?0:8,_e=this.nextAudioPts||-1;const Ue=t*s,Re=g.baseTime*s/g.timescale;if(this.isAudioContiguous=r=r||N.length&&_e>0&&(n&&Math.abs(Ue-_e)<9e3||Math.abs(pn(N[0].pts-Re,Ue)-_e)<20*p),N.forEach(function(Ht){Ht.pts=pn(Ht.pts-Re,Ue)}),!r||_e<0){if(N=N.filter(Ht=>Ht.pts>=0),!N.length)return;i===0?_e=0:n&&!T?_e=Math.max(0,Ue):_e=N[0].pts}if(e.segmentCodec==="aac"){const Ht=this.config.maxAudioFramesDrift;for(let Xt=0,Yt=_e;Xt<N.length;Xt++){const Tt=N[Xt],Lt=Tt.pts,or=Lt-Yt,nr=Math.abs(1e3*or/s);if(or<=-Ht*p&&T)Xt===0&&(this.logger.warn(`Audio frame @ ${(Lt/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*or/s)} ms.`),this.nextAudioPts=_e=Yt=Lt);else if(or>=Ht*p&&nr<Ur&&T){let gr=Math.round(or/p);Yt=Lt-gr*p,Yt<0&&(gr--,Yt+=p),Xt===0&&(this.nextAudioPts=_e=Yt),this.logger.warn(`[mp4-remuxer]: Injecting ${gr} audio frame @ ${(Yt/s).toFixed(3)}s due to ${Math.round(1e3*or/s)} ms gap.`);for(let Cr=0;Cr<gr;Cr++){const $r=Math.max(Yt,0);let Wr=xt.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Wr||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Wr=Tt.unit.subarray()),N.splice(Xt,0,{unit:Wr,pts:$r}),Yt+=p,Xt++}}Tt.pts=Yt,Yt+=p}}let Qe=null,Je=null,ft,et=0,ot=N.length;for(;ot--;)et+=N[ot].unit.byteLength;for(let Ht=0,Xt=N.length;Ht<Xt;Ht++){const Yt=N[Ht],Tt=Yt.unit;let Lt=Yt.pts;if(Je!==null){const nr=D[Ht-1];nr.duration=Math.round((Lt-Je)/h)}else if(r&&e.segmentCodec==="aac"&&(Lt=_e),Qe=Lt,et>0){et+=H;try{ft=new Uint8Array(et)}catch(nr){this.observer.emit(v.ERROR,v.ERROR,{type:ge.MUX_ERROR,details:ne.REMUX_ALLOC_ERROR,fatal:!1,error:nr,bytes:et,reason:`fail allocating audio mdat ${et}`});return}x||(new DataView(ft.buffer).setUint32(0,et),ft.set(Me.types.mdat,4))}else return;ft.set(Tt,H);const or=Tt.byteLength;H+=or,D.push(Nr(!0,c,or,0)),Je=Lt}const _t=D.length;if(!_t)return;const nt=D[D.length-1];this.nextAudioPts=_e=Je+h*nt.duration;const At=x?new Uint8Array(0):Me.moof(e.sequenceNumber++,Qe/h,b({},e,{samples:D}));e.samples=[];const Pt=Qe/s,br=_e/s,Zt={data1:At,data2:ft,startPTS:Pt,endPTS:br,startDTS:Pt,endDTS:br,type:"audio",hasAudio:!0,hasVideo:!1,nb:_t};return this.isAudioContiguous=!0,Zt}}function pn(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 Zn(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function bn(a,e,t,r){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let o=0;o<n;o++){const h=a.samples[o];h.pts=pn(h.pts-t.baseTime*i/t.timescale,e*i)/i,h.dts=pn(h.dts-r.baseTime*i/r.timescale,e*i)/i}const s=a.samples;return a.samples=[],{samples:s}}function mi(a,e,t){const r=a.samples.length;if(!r)return;const n=a.inputTimeScale;for(let s=0;s<r;s++){const o=a.samples[s];o.pts=pn(o.pts-t.baseTime*n/t.timescale,e*n)/n}a.samples.sort((s,o)=>s.pts-o.pts);const i=a.samples;return a.samples=[],{samples:i}}class gi{constructor(e,t,r,n){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=n}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,r,n){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(W(e,n)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:r}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const n=this.initData=Ne(e);n.audio&&(t=Xa(n.audio,E.AUDIO)),n.video&&(r=Xa(n.video,E.VIDEO));const i={};n.audio&&n.video?i.audiovideo={container:"video/mp4",codec:t+","+r,supplemental:n.video.supplemental,initSegment:e,id:"main"}:n.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?i.video={container:"video/mp4",codec:r,supplemental:n.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,r,n,i,s){var o,h;let{initPTS:c,lastEndTime:p}=this;const g={audio:void 0,video:void 0,text:n,id3:r,initSegment:void 0};F(p)||(p=this.lastEndTime=i||0);const x=t.samples;if(!(x!=null&&x.length))return g;const D={initPTS:void 0,timescale:1};let T=this.initData;if((o=T)!=null&&o.length||(this.generateInitSegment(x),T=this.initData),!((h=T)!=null&&h.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),g;this.emitInitSegment&&(D.tracks=this.initTracks,this.emitInitSegment=!1);const N=Be(x,T),H=Pe(T,x),_e=H===null?i:H;(s||!c)&&(Za(c,_e,i,N)||D.timescale!==c.timescale)&&(D.initPTS=_e-i,c&&c.timescale===1&&this.logger.warn(`Adjusting initPTS @${i} from ${c.baseTime/c.timescale} to ${D.initPTS}`),this.initPTS=c={baseTime:D.initPTS,timescale:1});const Ue=e?_e-c.baseTime/c.timescale:p,Re=Ue+N;De(T,x,c.baseTime/c.timescale),N>0?this.lastEndTime=Re:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Qe=!!T.audio,Je=!!T.video;let ft="";Qe&&(ft+="audio"),Je&&(ft+="video");const et={data1:x,startPTS:Ue,startDTS:Ue,endPTS:Re,endDTS:Re,type:ft,hasAudio:Qe,hasVideo:Je,nb:1,dropped:0};return g.audio=et.type==="audio"?et:void 0,g.video=et.type!=="audio"?et:void 0,g.initSegment=D,g.id3=bn(r,i,c,c),n.samples.length&&(g.text=mi(n,i,c)),g}}function Za(a,e,t,r){if(a===null)return!0;const n=Math.max(r,1),i=e-a.baseTime/a.timescale;return Math.abs(i-t)>n}function Xa(a,e){const t=a==null?void 0:a.codec;return t&&t.length>4?t:e===E.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?me(t,!1):(ye.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(ye.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let kn;try{kn=self.performance.now.bind(self.performance)}catch(a){kn=Date.now}const _i=[{demux:So,remux:gi},{demux:L,remux:Tn},{demux:Ya,remux:Tn},{demux:oa,remux:Tn}];_i.splice(2,0,{demux:Eo,remux:Tn});class $i{constructor(e,t,r,n,i,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=r,this.id=i,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,n){const i=r.transmuxing;i.executeStart=kn();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:h}=this;n&&(this.currentTransmuxState=n);const{contiguous:c,discontinuity:p,trackSwitch:g,accurateTimeOffset:x,timeOffset:D,initSegmentChange:T}=n||o,{audioCodec:N,videoCodec:H,defaultInitPts:_e,duration:Ue,initSegmentData:Re}=h,Qe=Is(s,t);if(Qe&&ln(Qe.method)){const ot=this.getDecrypter(),_t=rn(Qe.method);if(ot.isSync()){let nt=ot.softwareDecrypt(s,Qe.key.buffer,Qe.iv.buffer,_t);if(r.part>-1){const Pt=ot.flush();nt=Pt&&Pt.buffer}if(!nt)return i.executeEnd=kn(),Qi(r);s=new Uint8Array(nt)}else return this.asyncResult=!0,this.decryptionPromise=ot.webCryptoDecrypt(s,Qe.key.buffer,Qe.iv.buffer,_t).then(nt=>{const At=this.push(nt,null,r);return this.decryptionPromise=null,At}),this.decryptionPromise}const Je=this.needsProbing(p,g);if(Je){const ot=this.configureTransmuxer(s);if(ot)return this.logger.warn(`[transmuxer] ${ot.message}`),this.observer.emit(v.ERROR,v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_PARSING_ERROR,fatal:!1,error:ot,reason:ot.message}),i.executeEnd=kn(),Qi(r)}(p||g||T||Je)&&this.resetInitSegment(Re,N,H,Ue,t),(p||T||Je)&&this.resetInitialTimestamp(_e),c||this.resetContiguity();const ft=this.transmux(s,Qe,D,x,r);this.asyncResult=hs(ft);const et=this.currentTransmuxState;return et.contiguous=!0,et.discontinuity=!1,et.trackSwitch=!1,i.executeEnd=kn(),ft}flush(e){const t=e.transmuxing;t.executeStart=kn();const{decrypter:r,currentTransmuxState:n,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:o}=n;if(r){const g=r.flush();g&&s.push(this.push(g.buffer,null,e))}const{demuxer:h,remuxer:c}=this;if(!h||!c){t.executeEnd=kn();const g=[Qi(e)];return this.asyncResult?Promise.resolve(g):g}const p=h.flush(o);return hs(p)?(this.asyncResult=!0,p.then(g=>(this.flushRemux(s,g,e),s))):(this.flushRemux(s,p,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,r){const{audioTrack:n,videoTrack:i,id3Track:s,textTrack:o}=t,{accurateTimeOffset:h,timeOffset:c}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===fe.MAIN?"level":"track"} ${r.level}`);const p=this.remuxer.remux(n,i,s,o,c,h,!0,this.id);e.push({remuxResult:p,chunkMeta:r}),r.transmuxing.executeEnd=kn()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;!t||!r||(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,n,i){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,r,n),o.resetInitSegment(e,t,r,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,n,i){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,r,n,i):s=this.transmuxUnencrypted(e,r,n,i),s}transmuxUnencrypted(e,t,r,n){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:h}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,o,h,t,r,!1,this.id),chunkMeta:n}}transmuxSampleAes(e,t,r,n,i){return this.demuxer.demuxSampleAes(e,t,r).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,r,n,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:n}=this;let i;for(let g=0,x=_i.length;g<x;g++){var s;if((s=_i[g].demux)!=null&&s.probe(e,this.logger)){i=_i[g];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,h=this.remuxer,c=i.remux,p=i.demux;(!h||!(h instanceof c))&&(this.remuxer=new c(r,t,n,this.logger)),(!o||!(o instanceof p))&&(this.demuxer=new p(r,t,n,this.logger),this.probe=p.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Vn(this.config)),e}}function Is(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 Qi=a=>({remuxResult:{},chunkMeta:a});function hs(a){return"then"in a&&a.then instanceof Function}class To{constructor(e,t,r,n,i){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=r,this.duration=n,this.defaultInitPts=i||null}}class Do{constructor(e,t,r,n,i,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=r,this.trackSwitch=n,this.timeOffset=i,this.initSegmentChange=s}}let Ps=0;class la{constructor(e,t,r,n){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Ps++,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=h=>{const c=h.data,p=this.hls;if(!(!p||!(c!=null&&c.event)||c.instanceNo!==this.instanceNo))switch(c.event){case"init":{var g;const x=(g=this.workerContext)==null?void 0:g.objectURL;x&&self.URL.revokeObjectURL(x);break}case"transmuxComplete":{this.handleTransmuxComplete(c.data);break}case"flush":{this.onFlush(c.data);break}case"workerLog":{p.logger[c.data.logType]&&p.logger[c.data.logType](c.data.message);break}default:{c.data=c.data||{},c.data.frag=this.frag,c.data.part=this.part,c.data.id=this.id,p.trigger(c.event,c.data);break}}},this.onWorkerError=h=>{if(!this.hls)return;const c=new Error(`${h.message} (${h.filename}:${h.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:c})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=r,this.onFlush=n;const s=(h,c)=>{c=c||{},c.frag=this.frag||void 0,h===v.ERROR&&(c=c,c.parent=this.id,c.part=this.part,this.error=c.error),this.hls.trigger(h,c)};this.observer=new Ds,this.observer.on(v.FRAG_DECRYPTED,s),this.observer.on(v.ERROR,s);const o=Qt(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const h=this.hls.logger;if(i.workerPath||Ys()){try{i.workerPath?(h.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=Ca(i.workerPath)):(h.log(`injecting Web Worker for "${t}"`),this.workerContext=ka());const{worker:p}=this.workerContext;p.addEventListener("message",this.onWorkerMessage),p.addEventListener("error",this.onWorkerError),p.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:fr(i)})}catch(p){h.warn(`Error setting up "${t}" Web Worker, fallback to inline`,p),this.terminateWorker(),this.error=null,this.transmuxer=new $i(this.observer,o,i,"",t,e.logger)}return}}this.transmuxer=new $i(this.observer,o,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Ps++;const t=this.hls.config,r=Qt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:fr(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),La(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,r,n,i,s,o,h,c,p){var g,x;c.transmuxing.start=self.performance.now();const{instanceNo:D,transmuxer:T}=this,N=s?s.start:i.start,H=i.decryptdata,_e=this.frag,Ue=!(_e&&i.cc===_e.cc),Re=!(_e&&c.level===_e.level),Qe=_e?c.sn-_e.sn:-1,Je=this.part?c.part-this.part.index:-1,ft=Qe===0&&c.id>1&&c.id===(_e==null?void 0:_e.stats.chunkCount),et=!Re&&(Qe===1||Qe===0&&(Je===1||ft&&Je<=0)),ot=self.performance.now();(Re||Qe||i.stats.parsing.start===0)&&(i.stats.parsing.start=ot),s&&(Je||!et)&&(s.stats.parsing.start=ot);const _t=!(_e&&((g=i.initSegment)==null?void 0:g.url)===((x=_e.initSegment)==null?void 0:x.url)),nt=new Do(Ue,et,h,Re,N,_t);if(!et||Ue||_t){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${c.sn}${c.part>-1?" part: "+c.part:""} ${this.id===fe.MAIN?"level":"track"}: ${c.level} id: ${c.id}
|
|
discontinuity: ${Ue}
|
|
trackSwitch: ${Re}
|
|
contiguous: ${et}
|
|
accurateTimeOffset: ${h}
|
|
timeOffset: ${N}
|
|
initSegmentChange: ${_t}`);const At=new To(r,n,t,o,p);this.configureTransmuxer(At)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:D,cmd:"demux",data:e,decryptdata:H,chunkMeta:c,state:nt},e instanceof ArrayBuffer?[e]:[]);else if(T){const At=T.push(e,H,c,nt);hs(At)?At.then(Pt=>{this.handleTransmuxComplete(Pt)}).catch(Pt=>{this.transmuxerError(Pt,c,"transmuxer-interface push error")}):this.handleTransmuxComplete(At)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(r){const n=r.flush(e);hs(n)?n.then(i=>{this.handleFlushResult(i,e)}).catch(i=>{this.transmuxerError(i,e,"transmuxer-interface flush error")}):this.handleFlushResult(n,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(r=>{this.handleTransmuxComplete(r)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const ua=100;class Qa extends Vs{constructor(e,t,r){super(e,t,r,"audio-stream-controller",fe.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(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(v.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(v.BUFFER_RESET,this.onBufferReset,this),e.on(v.BUFFER_CREATED,this.onBufferCreated,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(v.FRAG_LOADING,this.onFragLoading,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(v.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(v.BUFFER_RESET,this.onBufferReset,this),e.off(v.BUFFER_CREATED,this.onBufferCreated,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(v.FRAG_LOADING,this.onFragLoading,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i}){if(r===fe.MAIN){const s=t.cc,o=this.fragCurrent;if(this.initPTS[s]={baseTime:n,timescale:i},this.log(`InitPTS for cc: ${s} found from main: ${n}/${i}`),this.mainAnchor=t,this.state===yt.WAITING_INIT_PTS){const h=this.waitingData;(!h&&!this.loadingParts||h&&h.frag.cc!==s)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&o&&o.cc!==s?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,o.abortRequests(),this.resetLoadingState()):this.state===yt.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),r=e.cc;return Ii(t,r,e)||t&&Hn(t.fragments,r)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=yt.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(ua),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=yt.IDLE):this.state=yt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case yt.IDLE:this.doTickIdle();break;case yt.WAITING_TRACK:{const{levels:t,trackId:r}=this,n=t==null?void 0:t[r],i=n==null?void 0:n.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=yt.WAITING_INIT_PTS}break}case yt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),r=this.retryDate;if(!r||t>=r||(e=this.media)!=null&&e.seeking){const{levels:n,trackId:i}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((n==null?void 0:n[i])||null),this.state=yt.IDLE}break}case yt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:r,part:n,cache:i,complete:s}=t,o=this.mainAnchor;if(this.initPTS[r.cc]!==void 0){this.waitingData=null,this.state=yt.FRAG_LOADING;const h=i.flush().buffer,c={frag:r,part:n,payload:h,networkDetails:null};this._handleFragmentLoadProgress(c),s&&super._handleFragmentLoadComplete(c)}else o&&o.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${r.cc}) cancelled because video is at cc ${o.cc}`),this.nextLoadPosition=this.findSyncFrag(o).start,this.clearWaitingFragment())}else this.state=yt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==yt.STOPPED&&(this.state=yt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:r,media:n,trackId:i}=this,s=t.config;if(!this.buffering||!n&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(r!=null&&r[i]))return;const o=r[i],h=o.details;if(!h||this.waitForLive(o)||this.waitForCdnTuneIn(h)){this.state=yt.WAITING_TRACK,this.startFragRequested=!1;return}const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,E.AUDIO,fe.AUDIO));const p=this.getFwdBufferInfo(c,fe.AUDIO);if(p===null)return;if(!this.switchingTrack&&this._streamEnded(p,h)){t.trigger(v.BUFFER_EOS,{type:"audio"}),this.state=yt.ENDED;return}const g=p.len,x=t.maxBufferLength,D=h.fragments,T=D[0].start,N=this.getLoadPosition(),H=this.flushing?N:p.end;if(this.switchingTrack&&n){const Re=N;h.PTSKnown&&Re<T&&(p.end>T||p.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=T+.05)}if(g>=x&&!this.switchingTrack&&H<D[D.length-1].start)return;let _e=this.getNextFragment(H,h);if(_e&&this.isLoopLoading(_e,H)&&(_e=this.getNextFragmentLoopLoading(_e,h,p,fe.MAIN,x)),!_e){this.bufferFlushed=!0;return}let Ue=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Ue&&ce(_e)&&!_e.endList&&(!h.live||!this.loadingParts&&H<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Ue)===Br.OK&&(this.mainFragLoading=Ue=null),Ue&&ce(Ue))){if(_e.start>Ue.end){const Qe=this.fragmentTracker.getFragAtPos(H,fe.MAIN);Qe&&Qe.end>Ue.end&&(Ue=Qe,this.mainFragLoading={frag:Qe,targetBufferTime:null})}if(_e.start>Ue.end)return}this.loadFragment(_e,o,H)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new Ut(r))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:n}=this;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),r?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==yt.STOPPED&&(this.setInterval(ua),this.state=yt.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 r=this.cachedTrackLoadedData;r&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(v.AUDIO_TRACK_LOADED,r))}onAudioTrackLoaded(e,t){var r;const{levels:n}=this,{details:i,id:s,groupId:o,track:h}=t;if(!n){this.warn(`Audio tracks reset while loading track ${s} "${h.name}" of "${o}"`);return}const c=this.mainDetails;if(!c||i.endCC>c.endCC||c.expired){this.cachedTrackLoadedData=t,this.state!==yt.STOPPED&&(this.state=yt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${h.name}" of "${o}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const p=n[s];let g=0;if(i.live||(r=p.details)!=null&&r.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;if(p.details){var x;g=this.alignPlaylists(i,p.details,(x=this.levelLastLoaded)==null?void 0:x.details)}i.alignedSliding||(pi(i,c),i.alignedSliding||Ss(i,c),g=i.fragmentStart)}p.details=i,this.levelLastLoaded=p,this.startFragRequested||this.setStartPosition(c,g),this.hls.trigger(v.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state===yt.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=yt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{config:s,trackId:o,levels:h}=this;if(!h){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const c=h[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const p=c.details;if(!p){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const g=s.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let x=this.transmuxer;x||(x=this.transmuxer=new la(this.hls,fe.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const D=this.initPTS[r.cc],T=(t=r.initSegment)==null?void 0:t.data;if(D!==void 0){const H=n?n.index:-1,_e=H!==-1,Ue=new Wn(r.level,r.sn,r.stats.chunkCount,i.byteLength,H,_e);x.push(i,T,g,"",r,n,p.totalduration,!1,Ue,D)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${p.startSN} ,${p.endSN}],track ${o}`);const{cache:N}=this.waitingData=this.waitingData||{frag:r,part:n,cache:new Sa,complete:!1};N.push(new Uint8Array(i)),this.state!==yt.STOPPED&&(this.state=yt.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 r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===fe.MAIN&&ce(t.frag)&&(this.mainFragLoading=t,this.state===yt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:n}=t;if(r.type!==fe.AUDIO){!this.audioOnly&&r.type===fe.MAIN&&!r.elementaryStreams.video&&!r.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ce(r)){this.fragPrevious=r;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(v.AUDIO_TRACK_SWITCHED,A({},i)))}this.fragBufferedComplete(r,n),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=yt.ERROR;return}switch(t.details){case ne.FRAG_GAP:case ne.FRAG_PARSING_ERROR:case ne.FRAG_DECRYPT_ERROR:case ne.FRAG_LOAD_ERROR:case ne.FRAG_LOAD_TIMEOUT:case ne.KEY_LOAD_ERROR:case ne.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(fe.AUDIO,t);break;case ne.AUDIO_TRACK_LOAD_ERROR:case ne.AUDIO_TRACK_LOAD_TIMEOUT:case ne.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===yt.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===we.AUDIO_TRACK&&(this.state=yt.IDLE);break;case ne.BUFFER_ADD_CODEC_ERROR:case ne.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case ne.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case ne.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==E.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==E.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===yt.ENDED&&(this.state=yt.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,fe.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:h,part:c,level:p}=o,{details:g}=p,{audio:x,text:D,id3:T,initSegment:N}=i;if(this.fragContextChanged(h)||!g){this.fragmentTracker.removeFragment(h);return}if(this.state=yt.PARSING,this.switchingTrack&&x&&this.completeAudioSwitch(this.switchingTrack),N!=null&&N.tracks){const H=h.initSegment||h;this._bufferInitSegment(p,N.tracks,H,s),n.trigger(v.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:r,tracks:N.tracks})}if(x){const{startPTS:H,endPTS:_e,startDTS:Ue,endDTS:Re}=x;c&&(c.elementaryStreams[E.AUDIO]={startPTS:H,endPTS:_e,startDTS:Ue,endDTS:Re}),h.setElementaryStreamInfo(E.AUDIO,H,_e,Ue,Re),this.bufferFragmentData(x,h,c,s)}if(T!=null&&(t=T.samples)!=null&&t.length){const H=b({id:r,frag:h,details:g},T);n.trigger(v.FRAG_PARSING_METADATA,H)}if(D){const H=b({id:r,frag:h,details:g},D);n.trigger(v.FRAG_PARSING_USERDATA,H)}}_bufferInitSegment(e,t,r,n){if(this.state!==yt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const i=t.audio;i.id=fe.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&s.split(",").length===1&&(i.levelCodec=s),this.hls.trigger(v.BUFFER_CODECS,t);const o=i.initSegment;if(o!=null&&o.byteLength){const h={type:"audio",frag:r,part:null,chunkMeta:n,parent:r.type,data:o};this.hls.trigger(v.BUFFER_APPENDING,h)}this.tickImmediate()}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);if(this.switchingTrack||n===Br.NOT_LOADED||n===Br.PARTIAL){var i;if(!ce(e))this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.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=yt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&Ss(t.details,s)}else super.loadFragment(e,t,r)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:o}=this.bufferedTrack;an({name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:o},e,lr)||(Dr(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(v.AUDIO_TRACK_SWITCHED,A({},e))}}class Ji extends Z{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,r){const n=t==null?void 0:t.renditionReports;if(n){let i=-1;for(let s=0;s<n.length;s++){const o=n[s];let h;try{h=new self.URL(o.URI,t.url).href}catch(c){this.warn(`Could not construct new URL for Rendition Report: ${c}`),h=o.URI||""}if(h===e){i=s;break}else h===e.substring(0,h.length)&&(i=s)}if(i!==-1){const s=n[i],o=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let h=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const p=Math.min(t.age-t.partTarget,t.targetduration);h>=0&&p>t.partTarget&&(h+=1)}const c=r&&xn(r);return new cn(o,h>=0?h:void 0,c)}}}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(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}return e}playlistLoaded(e,t,r){const{details:n,stats:i}=t,s=self.performance.now(),o=i.loading.first?Math.max(0,s-i.loading.first):0;n.advancedDateTime=Date.now()-o;const h=this.hls.config.timelineOffset;if(h!==n.appliedTimelineOffset){const p=Math.max(h||0,0);n.appliedTimelineOffset=p,n.fragments.forEach(g=>{g.start=g.playlistOffset+p})}if(n.live||r!=null&&r.live){const p="levelInfo"in t?t.levelInfo:t.track;if(n.reloaded(r),r&&n.fragments.length>0){ya(r,n);const Ue=n.playlistParsingError;if(Ue){this.warn(Ue);const Re=this.hls;if(!Re.config.ignorePlaylistParsingErrors){var c;const{networkDetails:Qe}=t;Re.trigger(v.ERROR,{type:ge.NETWORK_ERROR,details:ne.LEVEL_PARSING_ERROR,fatal:!1,url:n.url,error:Ue,reason:Ue.message,level:t.level||void 0,parent:(c=n.fragments[0])==null?void 0:c.type,networkDetails:Qe,stats:i});return}n.playlistParsingError=null}}n.requestScheduled===-1&&(n.requestScheduled=i.loading.start);const g=this.hls.mainForwardBufferInfo,x=g?g.end-g.len:0,D=(n.edge-x)*1e3,T=wa(n,D);if(n.requestScheduled+T<s?n.requestScheduled=s:n.requestScheduled+=T,this.log(`live playlist ${e} ${n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:n.updated?"UPDATED":"MISSED"}`),!this.canLoad||!n.live)return;let N,H,_e;if(n.canBlockReload&&n.endSN&&n.advanced){const Ue=this.hls.config.lowLatencyMode,Re=n.lastPartSn,Qe=n.endSN,Je=n.lastPartIndex,ft=Je!==-1,et=Re===Qe;ft?et?(H=Qe+1,_e=Ue?0:Je):(H=Re,_e=Ue?Je+1:n.maxPartIndex):H=Qe+1;const ot=n.age,_t=ot+n.ageHeader;let nt=Math.min(_t-n.partTarget,n.targetduration*1.5);if(nt>0){if(_t>n.targetduration*3)this.log(`Playlist last advanced ${ot.toFixed(2)}s ago. Omitting segment and part directives.`),H=void 0,_e=void 0;else if(r!=null&&r.tuneInGoal&&_t-n.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${nt} with playlist age: ${n.age}`),nt=0;else{const At=Math.floor(nt/n.targetduration);if(H+=At,_e!==void 0){const Pt=Math.round(nt%n.targetduration/n.partTarget);_e+=Pt}this.log(`CDN Tune-in age: ${n.ageHeader}s last advanced ${ot.toFixed(2)}s goal: ${nt} skip sn ${At} to part ${_e}`)}n.tuneInGoal=nt}if(N=this.getDeliveryDirectives(n,t.deliveryDirectives,H,_e),Ue||!et){n.requestScheduled=s,this.loadingPlaylist(p,N);return}}else(n.canBlockReload||n.canSkipUntil)&&(N=this.getDeliveryDirectives(n,t.deliveryDirectives,H,_e));N&&H!==void 0&&n.canBlockReload&&(n.requestScheduled=i.loading.first+Math.max(T-o*2,T/2)),this.scheduleLoading(p,N,n)}else this.clearTimer()}scheduleLoading(e,t,r){const n=r||e.details;if(!n){this.loadingPlaylist(e,t);return}const i=self.performance.now(),s=n.requestScheduled;if(i>=s){this.loadingPlaylist(e,t);return}const o=s-i;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,r,n){let i=xn(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,i=_r.No),new cn(r,n,i)}checkRetry(e){const t=e.details,r=Xn(e),n=e.errorAction,{action:i,retryCount:s=0,retryConfig:o}=n||{},h=!!n&&!!o&&(i===en.RetryRequest||!n.resolved&&i===en.SendAlternateToPenaltyBox);if(h){var c;if(s>=o.maxNumRetry)return!1;if(r&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const p=gn(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),p),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${p}ms`)}e.levelRetry=!0,n.resolved=!0}return h}}function Xo(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!ca(a[t].attrs,e[t].attrs))return!1;return!0}function ca(a,e,t){const r=a["STABLE-RENDITION-ID"];return r&&!t?r===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(n=>a[n]!==e[n])}function ko(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Zl extends Ji{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(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(v.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(v.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.LEVEL_LOADING,this.onLevelLoading,this),e.off(v.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(v.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(v.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:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==n){this.warn(`Audio track with id:${r} and group:${n} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,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 r=t.audioGroups||null,n=this.groupIds;let i=this.currentTrack;if(!r||(n==null?void 0:n.length)!==(r==null?void 0:r.length)||r!=null&&r.some(o=>(n==null?void 0:n.indexOf(o))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(x=>!r||r.indexOf(x.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(x=>x.default)&&(this.selectDefaultTrack=!1),o.forEach((x,D)=>{x.id=D});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const h=this.hls.config.audioPreference;if(!i&&h){const x=Xr(h,o,lr);if(x>-1)i=o[x];else{const D=Xr(h,this.tracks);i=this.tracks[D]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const p={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${r==null?void 0:r.join(",")}`),this.hls.trigger(v.AUDIO_TRACKS_UPDATED,p);const g=this.trackId;if(c!==-1&&g===-1)this.setAudioTrack(c);else if(o.length&&g===-1){var s;const x=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(x.message),this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:x})}}}onError(e,t){t.fatal||!t.context||t.context.type===we.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 r=this.allAudioTracks;if(this.selectDefaultTrack=!1,r.length){const n=this.currentTrack;if(n&&an(e,n,lr))return n;const i=Xr(e,this.tracksInGroup,lr);if(i>-1){const s=this.tracksInGroup[i];return this.setAudioTrack(i),s}else if(n){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=Mr(e,t.levels,r,s,lr);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=Xr(e,r);if(s>-1)return r[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 r=this.currentTrack,n=t[e],i=n.details&&!n.details.live;if(e===this.trackId&&n===r&&i||(this.log(`Switching to audio-track ${e} "${n.name}" lang:${n.lang} group:${n.groupId} channels:${n.channels}`),this.trackId=e,this.currentTrack=n,this.hls.trigger(v.AUDIO_TRACK_SWITCHING,A({},n)),i))return;const s=this.switchParams(n.url,r==null?void 0:r.details,n.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if(!(this.selectDefaultTrack&&!n.default)&&(!e||an(e,n,lr)))return r}if(e){const{name:r,lang:n,assocLang:i,characteristics:s,audioCodec:o,channels:h}=e;for(let c=0;c<t.length;c++){const p=t[c];if(an({name:r,lang:n,assocLang:i,characteristics:s,audioCodec:o,channels:h},p,lr))return c}for(let c=0;c<t.length;c++){const p=t[c];if(ca(e.attrs,p.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return c}for(let c=0;c<t.length;c++){const p=t[c];if(ca(e.attrs,p.attrs,["LANGUAGE"]))return c}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Dr(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,n=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${r} "${e.name}" lang:${e.lang} group:${n}${(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:""):""} ${i}`),this.hls.trigger(v.AUDIO_TRACK_LOADING,{url:i,id:r,groupId:n,deliveryDirectives:t||null,track:e})}}class Xl{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,r){if(this.queues===null||this.tracks===null)return;const n=this.queues[t];n.push(e),n.length===1&&!r&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const r={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(r,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const r={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(r)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const r=(t=e[0])==null?void 0:t.label;(r==="async-blocker"||r==="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 n=t[0];try{n.execute()}catch(i){var r;if(n.onError(i),this.queues===null||this.tracks===null)return;const s=(r=this.tracks[e])==null?void 0:r.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,r;return(t=this.queues)!=null&&t[e]||(r=this.tracks)!=null&&r[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const r=(t=this.tracks)==null?void 0:t[e],n=r==null?void 0:r.buffer;return n?`SourceBuffer${n.updating?" updating":""}${r.ended?" ended":""}${r.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(r=>r.label).join(", "))||""}}const Qo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Jo="HlsJsTrackRemovedError";class Ql extends Error{constructor(e){super(e),this.name=Jo}}class Jl extends Z{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=r=>{var n;this.hls&&((n=this.mediaSource)==null?void 0:n.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=r=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=r=>{const{media:n,mediaSource:i}=this;r&&this.log("Media source opened"),!(!n||!i)&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(v.MEDIA_ATTACHED,{media:n,mediaSource:i}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:r,_objectUrl:n}=this;r!==n&&this.error(`Media element src was set while attaching MediaSource (${n} > ${r})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=$e(xe(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(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.BUFFER_RESET,this.onBufferReset,this),e.on(v.BUFFER_APPENDING,this.onBufferAppending,this),e.on(v.BUFFER_CODECS,this.onBufferCodecs,this),e.on(v.BUFFER_EOS,this.onBufferEos,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.FRAG_PARSED,this.onFragParsed,this),e.on(v.FRAG_CHANGED,this.onFragChanged,this),e.on(v.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.BUFFER_RESET,this.onBufferReset,this),e.off(v.BUFFER_APPENDING,this.onBufferAppending,this),e.off(v.BUFFER_CODECS,this.onBufferCodecs,this),e.off(v.BUFFER_EOS,this.onBufferEos,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.FRAG_PARSED,this.onFragParsed,this),e.off(v.FRAG_CHANGED,this.onFragChanged,this),e.off(v.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const r={};if(this.operationQueue){const i=this.isUpdating();i||this.operationQueue.removeBlockers();const s=this.isQueued();(i||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${i?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const n=this.transferData;return!this.sourceBufferCount&&n&&n.mediaSource===t?b(r,n.tracks):this.sourceBuffers.forEach(i=>{const[s]=i;s&&(r[s]=b({},this.tracks[s]),this.removeBuffer(s)),i[0]=i[1]=null}),{media:e,mediaSource:t,tracks:r}}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 r;let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsTotal=n,this.log(`${n} bufferCodec event(s) expected.`),(r=this.transferData)!=null&&r.mediaSource&&this.sourceBufferCount&&n&&this.bufferCreated()}onMediaAttaching(e,t){const r=this.media=t.media,n=xe(this.appendSource);if(this.transferData=this.overrides=void 0,r&&n){const i=!!t.mediaSource;(i||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new n;if(this.assignMediaSource(s),i)this._objectUrl=r.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{r.removeAttribute("src");const h=self.ManagedMediaSource;r.disableRemotePlayback=r.disableRemotePlayback||h&&s instanceof h,el(r),eu(r,o),r.load()}catch(h){r.src=o}else r.src=o}r.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,r;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(r=e.constructor)==null?void 0:r.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 r=this.tracks,n=t.tracks,i=n?Object.keys(n):null,s=i?i.length:0,o=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(n&&i&&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: ${fr(r,(h,c)=>h==="initSegment"?void 0:c)};
|
|
transfer tracks: ${fr(n,(h,c)=>h==="initSegment"?void 0:c)}}`),!Oe(n,r)){t.mediaSource=null,t.tracks=void 0;const h=e.currentTime,c=this.details,p=Math.max(h,(c==null?void 0:c.fragments[0].start)||0);if(p-h>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${h} -> ${p}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(n)}"->"${Object.keys(r)}") start time: ${p} currentTime: ${h}`),this.onMediaDetaching(v.MEDIA_DETACHING,{}),this.onMediaAttaching(v.MEDIA_ATTACHING,t),e.currentTime=p;return}this.transferData=void 0,i.forEach(h=>{const c=h,p=n[c];if(p){const g=p.buffer;if(g){const x=this.fragmentTracker,D=p.id;if(x.hasFragments(D)||x.hasParts(D)){const H=er.getBuffered(g);x.detectEvictedFragments(c,H,D,null,!0)}const T=Co(c),N=[c,g];this.sourceBuffers[T]=N,g.updating&&this.operationQueue&&this.operationQueue.prependBlocker(c),this.trackSourceBuffer(c,p)}}}),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 r=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:n,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log(`media source ${r?"transferring":"detaching"}`),r)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=i.readyState==="open";try{const h=i.sourceBuffers;for(let c=h.length;c--;)o&&h[c].abort(),i.removeSourceBuffer(h[c]);o&&i.endOfStream()}catch(h){this.warn(`onMediaDetaching: ${h.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}n&&(n.removeEventListener("emptied",this._onMediaEmptied),r||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(n.removeAttribute("src"),this.appendSource&&el(n),n.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(v.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const r=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),r)try{var n;(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(r)}catch(i){this.warn(`onBufferReset ${e}`,i)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Co(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Xl(this.tracks)}onBufferCodecs(e,t){const r=this.tracks,n=Object.keys(t);this.log(`BUFFER_CODECS: "${n}" (current SB count ${this.sourceBufferCount})`);const i="audiovideo"in t&&(r.audio||r.video)||r.audiovideo&&("audio"in t||"video"in t),s=!i&&this.sourceBufferCount&&this.media&&n.some(o=>!r[o]);if(i||s){this.warn(`Unsupported transition between "${Object.keys(r)}" and "${n}" SourceBuffers`);return}n.forEach(o=>{var h,c,p;const g=t[o],{id:x,codec:D,levelCodec:T,container:N,metadata:H,supplemental:_e}=g;let Ue=r[o];const Re=(h=this.transferData)==null||(c=h.tracks)==null?void 0:c[o],Qe=Re!=null&&Re.buffer?Re:Ue,Je=(Qe==null?void 0:Qe.pendingCodec)||(Qe==null?void 0:Qe.codec),ft=Qe==null?void 0:Qe.levelCodec;Ue||(Ue=r[o]={buffer:void 0,listeners:[],codec:D,supplemental:_e,container:N,levelCodec:T,metadata:H,id:x});const et=Mt(Je,ft),ot=et==null?void 0:et.replace(Qo,"$1");let _t=Mt(D,T);const nt=(p=_t)==null?void 0:p.replace(Qo,"$1");_t&&et&&ot!==nt&&(o.slice(0,5)==="audio"&&(_t=me(_t,this.appendSource)),this.log(`switching codec ${Je} to ${_t}`),_t!==(Ue.pendingCodec||Ue.codec)&&(Ue.pendingCodec=_t),Ue.container=N,this.appendChangeType(o,N,_t))}),(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 r=this.tracks[t];return e[t]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec},e},{})}appendChangeType(e,t,r){const n=`${t};codecs=${r}`,i={label:`change-type=${n}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${n}`),o.changeType(n),s.codec=r,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const r=e.start,n=r+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(r,fe.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const h=this.tracks.video;(this.lastVideoAppendEnd>n||h!=null&&h.buffer&&er.isBuffered(h.buffer,n)||((o=this.fragmentTracker.getAppendedFrag(n,fe.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:r}=this,{data:n,type:i,parent:s,frag:o,part:h,chunkMeta:c}=t,p=c.buffering[i],g=o.sn,x=self.performance.now();p.start=x;const D=o.stats.buffering,T=h?h.stats.buffering:null;D.start===0&&(D.start=x),T&&T.start===0&&(T.start=x);const N=r.audio;let H=!1;i==="audio"&&(N==null?void 0:N.container)==="audio/mpeg"&&(H=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const _e=this.tracks.video,Ue=_e==null?void 0:_e.buffer;if(Ue&&g!=="initSegment"){const Je=h||o,ft=this.blockedAudioAppend;if(i==="audio"&&s!=="main"&&!this.blockedAudioAppend){const ot=Je.start+Je.duration*.05,_t=Ue.buffered,nt=this.currentOp("video");!_t.length&&!nt?this.blockAudio(Je):!nt&&!er.isBuffered(Ue,ot)&&this.lastVideoAppendEnd<ot&&this.blockAudio(Je)}else if(i==="video"){const et=Je.end;if(ft){const ot=ft.frag.start;(et>ot||et<this.lastVideoAppendEnd||er.isBuffered(Ue,ot))&&this.unblockAudio()}this.lastVideoAppendEnd=et}}const Re=(h||o).start,Qe={label:`append-${i}`,execute:()=>{if(p.executeStart=self.performance.now(),H){const Je=this.tracks[i];if(Je){const ft=Je.buffer;if(ft){const et=Re-ft.timestampOffset;Math.abs(et)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Re} (delta: ${et}) sn: ${g})`),ft.timestampOffset=Re)}}}this.appendExecutor(n,i)},onStart:()=>{},onComplete:()=>{const Je=self.performance.now();p.executeEnd=p.end=Je,D.first===0&&(D.first=Je),T&&T.first===0&&(T.first=Je);const ft={};this.sourceBuffers.forEach(([et,ot])=>{et&&(ft[et]=er.getBuffered(ot))}),this.appendErrors[i]=0,i==="audio"||i==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(v.BUFFER_APPENDED,{type:i,frag:o,part:h,chunkMeta:c,parent:o.type,timeRanges:ft})},onError:Je=>{var ft;const et={type:ge.MEDIA_ERROR,parent:o.type,details:ne.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:o,part:h,chunkMeta:c,error:Je,err:Je,fatal:!1};if(Je.code===DOMException.QUOTA_EXCEEDED_ERR)et.details=ne.BUFFER_FULL_ERROR;else if(Je.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!((ft=this.media)!=null&&ft.error))et.errorAction=Fr(!0);else if(Je.name===Jo)this.sourceBufferCount===0?et.errorAction=Fr(!0):++this.appendErrors[i];else{const ot=++this.appendErrors[i];this.warn(`Failed ${ot}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer`),ot>=this.hls.config.appendErrorMaxRetry&&(et.fatal=!0)}this.hls.trigger(v.ERROR,et)}};this.append(Qe,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,r){return this.log(`queuing "${e}" remove ${t}-${r}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,r)},onStart:()=>{},onComplete:()=>{this.hls.trigger(v.BUFFER_FLUSHED,{type:e})},onError:n=>{this.warn(`Failed to remove ${t}-${r} from "${e}" SourceBuffer`,n)}}}onBufferFlushing(e,t){const{type:r,startOffset:n,endOffset:i}=t;r?this.append(this.getFlushOp(r,n,i),r):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,n,i),s)})}onFragParsed(e,t){const{frag:r,part:n}=t,i=[],s=n?n.elementaryStreams:r.elementaryStreams;s[E.AUDIOVIDEO]?i.push("audiovideo"):(s[E.AUDIO]&&i.push("audio"),s[E.VIDEO]&&i.push("video"));const o=()=>{const h=self.performance.now();r.stats.buffering.end=h,n&&(n.stats.buffering.end=h);const c=n?n.stats:r.stats;this.hls.trigger(v.FRAG_BUFFERED,{frag:r,part:n,stats:c,id:r.type})};i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(o,i)}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,r;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((r=this.tracks[e])==null?void 0:r.ending))})}onBufferEos(e,t){var r;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 n=((r=this.overrides)==null?void 0:r.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})&&(n?(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(v.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(v.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===ne.BUFFER_APPEND_ERROR&&t.frag){var r;const n=(r=t.errorAction)==null?void 0:r.nextAutoLevel;F(n)&&n!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:r}=this;if(!r||t===null||!this.sourceBufferCount)return;const n=e.config,i=r.currentTime,s=t.levelTargetDuration,o=t.live&&n.liveBackBufferLength!==null?n.liveBackBufferLength:n.backBufferLength;if(F(o)&&o>=0){const h=Math.max(o,s),c=Math.floor(i/s)*s-h;this.flushBackBuffer(i,s,c)}if(F(n.frontBufferFlushThreshold)&&n.frontBufferFlushThreshold>0){const h=Math.max(n.maxBufferLength,n.frontBufferFlushThreshold),c=Math.max(h,s),p=Math.floor(i/s)*s+c;this.flushFrontBuffer(i,s,p)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([n,i])=>{if(i){const o=er.getBuffered(i);if(o.length>0&&r>o.start(0)){var s;this.hls.trigger(v.BACK_BUFFER_REACHED,{bufferEnd:r});const h=this.tracks[n];if((s=this.details)!=null&&s.live)this.hls.trigger(v.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r});else if(h!=null&&h.ended){this.log(`Cannot flush ${n} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(v.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:n})}}})}flushFrontBuffer(e,t,r){this.sourceBuffers.forEach(([n,i])=>{if(i){const s=er.getBuffered(i),o=s.length;if(o<2)return;const h=s.start(o-1),c=s.end(o-1);if(r>h||e>=h&&e<=c)return;this.hls.trigger(v.BUFFER_FLUSHING,{startOffset:h,endOffset:1/0,type:n})}})}getDurationAndRange(){var e;const{details:t,mediaSource:r}=this;if(!t||!this.media||(r==null?void 0:r.readyState)!=="open")return null;const n=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&r.setLiveSeekableRange){const c=Math.max(0,t.fragmentStart),p=Math.max(c,n);return{duration:1/0,start:c,end:p}}return{duration:1/0}}const i=(e=this.overrides)==null?void 0:e.duration;if(i)return F(i)?{duration:i}:null;const s=this.media.duration,o=F(r.duration)?r.duration:0;return n>o&&n>s||!F(s)?{duration:n}:null}updateMediaSource({duration:e,start:t,end:r}){const n=this.mediaSource;!this.media||!n||n.readyState!=="open"||(n.duration!==e&&(F(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),n.duration=e),t!==void 0&&r!==void 0&&(this.log(`MediaSource duration is set to ${n.duration}. Setting seekable range to ${t}-${r}.`),n.setLiveSeekableRange(t,r)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:r}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${fr(r)}`),this.tracksReady){var n;const i=(n=this.transferData)==null?void 0:n.tracks;i&&Object.keys(i).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,r])=>{if(t){const n=this.tracks[t];e[t]={buffer:r,container:n.container,codec:n.codec,supplemental:n.supplemental,levelCodec:n.levelCodec,id:n.id,metadata:n.metadata}}}),this.hls.trigger(v.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(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:r}=this;if(!r)throw new Error("createSourceBuffers called when mediaSource was null");for(const i in e){const s=i,o=e[s];if(this.isPending(o)){const h=this.getTrackCodec(o,s),c=`${o.container};codecs=${h}`;o.codec=h,this.log(`creating sourceBuffer(${c})${this.currentOp(s)?" Queued":""} ${fr(o)}`);try{const p=r.addSourceBuffer(c),g=Co(s),x=[s,p];t[g]=x,o.buffer=p}catch(p){var n;this.error(`error while trying to add sourceBuffer: ${p.message}`),this.shiftAndExecuteNext(s),(n=this.operationQueue)==null||n.removeBlockers(),delete this.tracks[s],this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,sourceBufferName:s,mimeType:c,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let n=e.codec;r&&(t==="video"||t==="audiovideo")&&Ae(r,"video")&&(n=Dt(n,r));const i=Mt(n,e.levelCodec);return i?t.slice(0,5)==="audio"?me(i,this.appendSource):i:""}trackSourceBuffer(e,t){const r=t.buffer;if(!r)return;const n=this.getTrackCodec(t,e);this.tracks[e]={buffer:r,codec:n,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",(i,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(v.BUFFER_FLUSHED,{type:i})})}get mediaSrc(){var e,t;const r=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return r==null?void 0:r.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 r=this.currentOp(e);r&&(r.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var r;const n=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(r=this.mediaSource)==null?void 0:r.readyState}`);this.error(`${n}`,t),this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:n,fatal:!1});const i=this.currentOp(e);i&&i.onError(n)}removeExecutor(e,t,r){const{media:n,mediaSource:i}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!n||!i||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const h=F(n.duration)?n.duration:1/0,c=F(i.duration)?i.duration:1/0,p=Math.max(0,t),g=Math.min(r,h,c);g>p&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${p},${g}] from the ${e} SourceBuffer`),o.remove(p,g)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],n=r==null?void 0:r.buffer;if(!n)throw new Ql(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);r.ending=!1,r.ended=!1,n.appendBuffer(e)}blockUntilOpen(e){this.isUpdating()||this.isQueued()?this.blockBuffers(e):e()}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){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:r}=this,n=t.map(s=>this.appendBlocker(s));t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(n).then(s=>{r===this.operationQueue&&(e(),this.stepOperationQueue(t))})}stepOperationQueue(e){e.forEach(t=>{var r;const n=(r=this.tracks[t])==null?void 0:r.buffer;!n||n.updating||this.shiftAndExecuteNext(t)})}append(e,t,r){this.operationQueue&&this.operationQueue.append(e,t,r)}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,r){const n=this.tracks[e];if(!n)return;const i=n.buffer;if(!i)return;const s=r.bind(this,e);n.listeners.push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const r=t.buffer;r&&(t.listeners.forEach(n=>{r.removeEventListener(n.event,n.listener)}),t.listeners.length=0)}}function el(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function eu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function Co(a){return a==="audio"?1:0}class Lo{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(v.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.BUFFER_CODECS,this.onBufferCodecs,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(v.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.BUFFER_CODECS,this.onBufferCodecs,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.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 r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&F(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,r=this.getMaxLevel(e.length-1);r!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${r}: ${e[r].height}p@${e[r].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=r,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 r=t.filter((n,i)=>this.isLevelAllowed(n)&&i<=e);return this.clientRect=null,Lo.getMaxLevelByMediaSize(r,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 r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,!t.width&&!t.height&&(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.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(r=>e.bitrate===r.bitrate&&e.width===r.width&&e.height===r.height)}static getMaxLevelByMediaSize(e,t,r){if(!(e!=null&&e.length))return-1;const n=(o,h)=>h?o.width!==h.width||o.height!==h.height:!0;let i=e.length-1;const s=Math.max(t,r);for(let o=0;o<e.length;o+=1){const h=e[o];if((h.width>=s||h.height>=s)&&n(h,e[o+1])){i=o;break}}return i}}const Gn={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},tu={HLS:"h"},ha={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},ru={[ha.OBJECT]:["br","d","ot","tb"],[ha.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[ha.SESSION]:["cid","pr","sf","sid","st","v"],[ha.STATUS]:["bs","rtp"]};class Os{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof Os?r:new Os(r))),this.value=e,this.params=t}}const nu="Dict";function iu(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 su(a,e,t,r){return new Error(`failed to ${a} "${iu(e)}" as ${t}`,{cause:r})}function Li(a,e,t){return su("serialize",a,e,t)}class tl{constructor(e){this.description=e}}const rl="Bare Item",au="Boolean";function ou(a){if(typeof a!="boolean")throw Li(a,au);return a?"?1":"?0"}const lu="Byte Sequence";function uu(a){if(ArrayBuffer.isView(a)===!1)throw Li(a,lu);return`:${Ua(a)}:`}const cu="Integer";function hu(a){return a<-999999999999999||999999999999999<a}function nl(a){if(hu(a))throw Li(a,cu);return a.toString()}function fu(a){return`@${nl(a.getTime()/1e3)}`}const du="Decimal";function pu(a){const e=Js(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Li(a,du);const t=e.toString();return t.includes(".")?t:`${t}.0`}const mu="String",gu=/[\x00-\x1f\x7f]+/;function _u(a){if(gu.test(a))throw Li(a,mu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vu(a){return a.description||a.toString().slice(7,-1)}const yu="Token";function il(a){const e=vu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Li(e,yu);return e}function Ro(a){switch(typeof a){case"number":if(!F(a))throw Li(a,rl);return Number.isInteger(a)?nl(a):pu(a);case"string":return _u(a);case"symbol":return il(a);case"boolean":return ou(a);case"object":if(a instanceof Date)return fu(a);if(a instanceof Uint8Array)return uu(a);if(a instanceof tl)return il(a);default:throw Li(a,rl)}}const bu="Key";function Io(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Li(a,bu);return a}function Po(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Io(e)}`:`;${Io(e)}=${Ro(t)}`).join("")}function sl(a){return a instanceof Os?`${Ro(a.value)}${Po(a.params)}`:Ro(a)}function xu(a){return`(${a.value.map(sl).join(" ")})${Po(a.params)}`}function Eu(a,e={whitespace:!0}){if(typeof a!="object")throw Li(a,nu);const t=a instanceof Map?a.entries():Object.entries(a),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([n,i])=>{i instanceof Os||(i=new Os(i));let s=Io(n);return i.value===!0?s+=Po(i.params):(s+="=",Array.isArray(i.value)?s+=xu(i):s+=sl(i)),s}).join(`,${r}`)}function wu(a,e){return Eu(a,e)}function Su(a){return a==="ot"||a==="sf"||a==="st"}function Au(a){return typeof a=="number"?F(a):a!=null&&a!==""&&a!==!1}const Ja=a=>Math.round(a),Tu=(a,e)=>(e!=null&&e.baseUrl&&(a=mo(a,e.baseUrl)),encodeURIComponent(a)),eo=a=>Ja(a/100)*100,Du={br:Ja,d:Ja,bl:eo,dl:eo,mtp:eo,nor:Tu,rtp:eo,tb:Ja};function ku(a,e){const t={};if(a==null||typeof a!="object")return t;const r=Object.keys(a).sort(),n=b({},Du,e==null?void 0:e.formatters),i=e==null?void 0:e.filter;return r.forEach(s=>{if(i!=null&&i(s))return;let o=a[s];const h=n[s];h&&(o=h(o,e)),!(s==="v"&&o===1)&&(s=="pr"&&o===1||Au(o)&&(Su(s)&&typeof o=="string"&&(o=new tl(o)),t[s]=o))}),t}function al(a,e={}){return a?wu(ku(a,e),b({whitespace:!1},e)):""}function Cu(a,e={}){const t={};if(!a)return t;const r=Object.entries(a),n=Object.entries(ru).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=r.reduce((s,o)=>{var h,c;const[p,g]=o,x=((h=n.find(D=>D[1].includes(p)))===null||h===void 0?void 0:h[0])||ha.REQUEST;return(c=s[x])!==null&&c!==void 0||(s[x]={}),s[x][p]=g,s},{});return Object.entries(i).reduce((s,[o,h])=>(s[o]=al(h,e),s),t)}function Lu(a,e,t){return b(a,Cu(e,t))}const Ru="CMCD";function Iu(a,e={}){if(!a)return"";const t=al(a,e);return`${Ru}=${encodeURIComponent(t)}`}const ol=/CMCD=[^&#]+/;function Pu(a,e,t){const r=Iu(e,t);if(!r)return a;if(ol.test(a))return a.replace(ol,r);const n=a.includes("?")?"&":"?";return`${a}${n}${r}`}class Ou{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=n=>{try{this.apply(n,{ot:Gn.MANIFEST,su:!this.initialized})}catch(i){this.hls.logger.warn("Could not generate manifest CMCD data.",i)}},this.applyFragmentData=n=>{try{const{frag:i,part:s}=n,o=this.hls.levels[i.level],h=this.getObjectType(i),c={d:(s||i).duration*1e3,ot:h};(h===Gn.VIDEO||h===Gn.AUDIO||h==Gn.MUXED)&&(c.br=o.bitrate/1e3,c.tb=this.getTopBandwidth(h)/1e3,c.bl=this.getBufferLength(h));const p=s?this.getNextPart(s):this.getNextFrag(i);p!=null&&p.url&&p.url!==i.url&&(c.nor=p.url),this.apply(n,c)}catch(i){this.hls.logger.warn("Could not generate segment CMCD data.",i)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;r!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.includeKeys=r.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHED,this.onMediaDetached,this),e.on(v.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHED,this.onMediaDetached,this),e.off(v.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 r,n;this.audioBuffer=(r=t.tracks.audio)==null?void 0:r.buffer,this.videoBuffer=(n=t.tracks.video)==null?void 0:n.buffer}createData(){var e;return{v:1,sf:tu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){b(t,this.createData());const r=t.ot===Gn.INIT||t.ot===Gn.VIDEO||t.ot===Gn.MUXED;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:n}=this;n&&(t=Object.keys(t).reduce((s,o)=>(n.includes(o)&&(s[o]=t[o]),s),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),Lu(e.headers,t,i)):e.url=Pu(e.url,t,i)}getNextFrag(e){var t;const r=(t=this.hls.levels[e.level])==null?void 0:t.details;if(r){const n=e.sn-r.startSN;return r.fragments[n+1]}}getNextPart(e){var t,r;const{index:n,fragment:i}=e,s=(t=this.hls.levels[i.level])==null||(r=t.details)==null?void 0:r.partList;if(s){const{sn:o}=i;for(let h=s.length-1;h>=0;h--){const c=s[h];if(c.index===n&&c.fragment.sn===o)return s[h+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Gn.TIMED_TEXT;if(e.sn==="initSegment")return Gn.INIT;if(t==="audio")return Gn.AUDIO;if(t==="main")return this.hls.audioTracks.length?Gn.VIDEO:Gn.MUXED}getTopBandwidth(e){let t=0,r;const n=this.hls;if(e===Gn.AUDIO)r=n.audioTracks;else{const i=n.maxAutoLevel,s=i>-1?i+1:n.levels.length;r=n.levels.slice(0,s)}for(const i of r)i.bitrate>t&&(t=i.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,r=e===Gn.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:er.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new r(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,o){t(i),this.loader.load(i,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new r(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,o){t(i),this.loader.load(i,s,o)}}}}const Mu=3e5;class Fu extends Z{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(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.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(r=>r!==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:r}=t;r!==null&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((r==null?void 0:r.action)===en.SendAlternateToPenaltyBox&&r.flags===st.MoveAllAlternatesMatchingHost){const n=this.levels;let i=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:h,type:c}=t.context;o&&n?s=this.getPathwayForGroupId(o,c,s):h&&(s=h)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!i&&n&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),r.resolved=this.pathwayId!==s),r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${n&&n.length} priorities: ${fr(i)} penalized: ${fr(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}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 r=this.penalizedPathways,n=performance.now();Object.keys(r).forEach(i=>{n-r[i]>Mu&&delete r[i]});for(let i=0;i<e.length;i++){const s=e[i];if(s in r)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,h=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,ws(t),this.hls.trigger(v.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[o];h&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==h.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==h.bitrate&&this.log(`Unstable Pathways change from bitrate ${h.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,r){const n=this.getLevelsForPathway(r).concat(this.levels||[]);for(let i=0;i<n.length;i++)if(t===we.AUDIO_TRACK&&n[i].hasAudioGroup(e)||t===we.SUBTITLE_TRACK&&n[i].hasSubtitleGroup(e))return n[i].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},n={};e.forEach(i=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":h}=i;if(t.some(p=>p.pathwayId===s))return;const c=this.getLevelsForPathway(o).map(p=>{const g=new pr(p.attrs);g["PATHWAY-ID"]=s;const x=g.AUDIO&&`${g.AUDIO}_clone_${s}`,D=g.SUBTITLES&&`${g.SUBTITLES}_clone_${s}`;x&&(r[g.AUDIO]=x,g.AUDIO=x),D&&(n[g.SUBTITLES]=D,g.SUBTITLES=D);const T=ul(p.uri,g["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",h),N=new Ut({attrs:g,audioCodec:p.audioCodec,bitrate:p.bitrate,height:p.height,name:p.name,url:T,videoCodec:p.videoCodec,width:p.width});if(p.audioGroups)for(let H=1;H<p.audioGroups.length;H++)N.addGroupId("audio",`${p.audioGroups[H]}_clone_${s}`);if(p.subtitleGroups)for(let H=1;H<p.subtitleGroups.length;H++)N.addGroupId("text",`${p.subtitleGroups[H]}_clone_${s}`);return N});t.push(...c),ll(this.audioTracks,r,h,s),ll(this.subtitleTracks,n,h,s)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;this.loader&&this.loader.destroy(),this.loader=new r(t);let n;try{n=new self.URL(e)}catch(p){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(n.protocol!=="data:"){const p=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;n.searchParams.set("_HLS_pathway",this.pathwayId),n.searchParams.set("_HLS_throughput",""+p)}const i={responseType:"json",url:n.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},h={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},c={onSuccess:(p,g,x,D)=>{this.log(`Loaded steering manifest: "${n}"`);const T=p.data;if((T==null?void 0:T.VERSION)!==1){this.log(`Steering VERSION ${T.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=T.TTL;const{"RELOAD-URI":N,"PATHWAY-CLONES":H,"PATHWAY-PRIORITY":_e}=T;if(N)try{this.uri=new self.URL(N,n).href}catch(Re){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${N}`);return}this.scheduleRefresh(this.uri||x.url),H&&this.clonePathways(H);const Ue={steeringManifest:T,url:n.toString()};this.hls.trigger(v.STEERING_MANIFEST_LOADED,Ue),_e&&this.updatePathwayPriority(_e)},onError:(p,g,x,D)=>{if(this.log(`Error loading steering manifest: ${p.code} ${p.text} (${g.url})`),this.stopLoad(),p.code===410){this.enabled=!1,this.log(`Steering manifest ${g.url} no longer available`);return}let T=this.timeToLoad*1e3;if(p.code===429){const N=this.loader;if(typeof(N==null?void 0:N.getResponseHeader)=="function"){const H=N.getResponseHeader("Retry-After");H&&(T=parseFloat(H)*1e3)}this.log(`Steering manifest ${g.url} rate limited`);return}this.scheduleRefresh(this.uri||g.url,T)},onTimeout:(p,g,x)=>{this.log(`Timeout loading steering manifest (${g.url})`),this.scheduleRefresh(this.uri||g.url)}};this.log(`Requesting steering manifest: ${n}`),this.loader.load(i,h,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var r;const n=(r=this.hls)==null?void 0:r.media;if(n&&!n.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function ll(a,e,t,r){a&&Object.keys(e).forEach(n=>{const i=a.filter(s=>s.groupId===n).map(s=>{const o=b({},s);return o.details=void 0,o.attrs=new pr(o.attrs),o.url=o.attrs.URI=ul(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[n],o.attrs["PATHWAY-ID"]=r,o});a.push(...i)})}function ul(a,e,t,r){const{HOST:n,PARAMS:i,[t]:s}=r;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const h=new self.URL(a);return n&&!o&&(h.host=n),i&&Object.keys(i).sort().forEach(c=>{c&&h.searchParams.set(c,i[c])}),h.href}class Ms extends Z{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Ms.CDMCleanupPromise?[Ms.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:r,initData:n}=t,i=`"${t.type}" event: init data type: "${r}"`;if(this.debug(i),n!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=jt(this.config));const o=s.map(Ni).filter(h=>!!h);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=Fi(s);let h,c;if(r==="sinf"){if(o!==xr.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${r}" for selected key-system ${o}`);return}const T=Ct(new Uint8Array(n));try{const N=kr(JSON.parse(T).sinf),H=ke(N);if(!H)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");h=new Uint8Array(H.subarray(8,24)),c=xr.FAIRPLAY}catch(N){this.warn(`${i} Failed to parse sinf: ${N}`);return}}else{if(o!==xr.WIDEVINE&&o!==xr.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${r}" for selected key-system ${o}`);return}const T=Ge(n),N=T.filter(_e=>!!_e.systemId&&Bi(_e.systemId)===o);N.length>1&&this.warn(`${i} Using first of ${N.length} pssh found for selected key-system ${o}`);const H=N[0];if(!H){T.length===0||T.some(_e=>!_e.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${T.map(_e=>Bi(_e.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(c=Bi(H.systemId),H.version===0&&H.data)if(c===xr.WIDEVINE){const _e=H.data.length-22;h=new Uint8Array(H.data.subarray(_e,_e+16))}else c===xr.PLAYREADY&&(h=Vr(H.data))}if(!c||!h)return;const p=Q.hexDump(h),{keyIdToKeySessionPromise:g,mediaKeySessions:x}=this;let D=g[p];for(let T=0;T<x.length;T++){const N=x[T],H=N.decryptdata;if(!H.keyId)continue;const _e=Q.hexDump(H.keyId);if(p===_e||H.uri.replace(/-/g,"").indexOf(p)!==-1){if(D=g[_e],H.pssh)break;delete g[_e],H.pssh=new Uint8Array(n),H.keyId=h,D=g[p]=D.then(()=>this.generateRequestWithPreferredKeySession(N,r,n,"encrypted-event-key-match")),D.catch(Ue=>this.handleError(Ue));break}}if(!D){if(c!==o){this.log(`Ignoring "${t.type}" event with ${c} init data for selected key-system ${o}`);return}D=g[p]=this.getKeySystemSelectionPromise([c]).then(({keySystem:T,mediaKeys:N})=>{var H;this.throwIfDestroyed();const _e=new ri("ISO-23001-7",p,(H=Ni(T))!=null?H:"");return _e.pssh=new Uint8Array(n),_e.keyId=h,this.attemptSetMediaKeys(T,N).then(()=>{this.throwIfDestroyed();const Ue=this.createMediaKeySessionContext({decryptdata:_e,keySystem:T,mediaKeys:N});return this.generateRequestWithPreferredKeySession(Ue,r,n,"encrypted-event-no-match")})}),D.catch(T=>this.handleError(T))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(v.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(v.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(v.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(v.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(v.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(v.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,n=t[e];if(n)return n.licenseUrl;if(e===xr.WIDEVINE&&r)return r}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,r=t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(s,o,h)=>!!s&&h.indexOf(s)===o,n=t.map(s=>s.audioCodec).filter(r),i=t.map(s=>s.videoCodec).filter(r);return n.length+i.length===0&&i.push("avc1.42e01e"),new Promise((s,o)=>{const h=c=>{const p=c.shift();this.getMediaKeysPromise(p,n,i).then(g=>s({keySystem:p,mediaKeys:g})).catch(g=>{c.length?h(c):g instanceof ni?o(g):o(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_NO_ACCESS,error:g,fatal:!0},g.message))})};h(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if(typeof r!="function"){let n=`Configured requestMediaKeySystemAccess is not a function ${r}`;return qt===null&&self.location.protocol==="http:"&&(n=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(n))}return r(e,t)}getMediaKeysPromise(e,t,r){const n=Gr(e,t,r,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=i==null?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${fr(n)}`),s=this.requestMediaKeySystemAccess(e,n);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(h=>{this.log(`Failed to obtain access to key-system "${e}": ${h}`)}),s.then(h=>{this.log(`Access for key-system "${h.keySystem}" obtained`);const c=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=h.createMediaKeys().then(p=>(this.log(`Media-keys created for "${e}"`),c.then(g=>g?this.setMediaKeysServerCertificate(p,e,g):p))),o.mediaKeys.catch(p=>{this.error(`Failed to create media-keys for "${e}"}: ${p}`)}),o.mediaKeys})}return s.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${Q.hexDump(e.keyId||[])}`);const n=r.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:n,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),n=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(r,i,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 Q.hexDump(e.keyId)}updateKeySession(e,t){var r;const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyID ${Q.hexDump(((r=e.decryptdata)==null?void 0:r.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),n.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,r)=>{const n=jt(this.config),i=e.map(Fi).filter(s=>!!s&&n.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(i).then(({keySystem:s})=>{const o=Ni(s);o?t(o):r(new Error(`Unable to find format for key-system "${s}"`))}).catch(r)})}loadKey(e){const t=e.keyInfo.decryptdata,r=this.getKeyIdString(t),n=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);let i=this.keyIdToKeySessionPromise[r];return i||(i=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:h})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(o,h).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:o,mediaKeys:h,decryptdata:t}))))),(this.keyIdToKeySessionPromise[r]=i.then(o=>{const h="cenc",c=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(o,h,c,"playlist-key")})).catch(o=>this.handleError(o))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ni?this.hls.trigger(v.ERROR,e.data):this.hls.trigger(v.ERROR,{type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){const n=Fi(e.keyFormat),i=n?[n]:jt(this.config);return this.attemptKeySystemAccess(i)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=jt(this.config)),e.length===0)throw new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${fr({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const n=Promise.all(r).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(n),n.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(n),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(i=>r.indexOf(i)===-1)})}generateRequestWithPreferredKeySession(e,t,r,n){var i,s;const o=(i=this.config.drmSystems)==null||(s=i[e.keySystem])==null?void 0:s.generateRequest;if(o)try{const T=o.call(this.hls,t,r,e);if(!T)throw new Error("Invalid response from configured generateRequest filter");t=T.initDataType,r=T.initData?T.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(T){var h;if(this.warn(T.message),(h=this.hls)!=null&&h.config.debug)throw T}if(r===null)return this.log(`Skipping key-session request for "${n}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${n}": ${c} (init data type: ${t} length: ${r?r.byteLength:null})`);const p=new Ds,g=e._onmessage=T=>{const N=e.mediaKeysSession;if(!N){p.emit("error",new Error("invalid state"));return}const{messageType:H,message:_e}=T;this.log(`"${H}" message event for session "${N.sessionId}" message size: ${_e.byteLength}`),H==="license-request"||H==="license-renewal"?this.renewLicense(e,_e).catch(Ue=>{p.eventNames().length?p.emit("error",Ue):this.handleError(Ue)}):H==="license-release"?e.keySystem===xr.FAIRPLAY&&(this.updateKeySession(e,Dn("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${H}"`)},x=e._onkeystatuseschange=T=>{if(!e.mediaKeysSession){p.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const H=e.keyStatus;p.emit("keyStatus",H),H==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",g),e.mediaKeysSession.addEventListener("keystatuseschange",x);const D=new Promise((T,N)=>{p.on("error",N),p.on("keyStatus",H=>{H.startsWith("usable")?T():H==="output-restricted"?N(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):H==="internal-error"?N(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${H}"`)):H==="expired"?N(new Error("key expired while generating request")):this.warn(`unhandled key status change "${H}"`)})});return e.mediaKeysSession.generateRequest(t,r).then(()=>{var T;this.log(`Request generated for key-session "${(T=e.mediaKeysSession)==null?void 0:T.sessionId}" keyId: ${c}`)}).catch(T=>{throw new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_NO_SESSION,error:T,fatal:!1},`Error generating key-session request: ${T}`)}).then(()=>D).catch(T=>{throw p.removeAllListeners(),this.removeSession(e),T}).then(()=>(p.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,r)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Q.hexDump("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))} session keyId: ${Q.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,r=t.loader,n=new r(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const h={responseType:"arraybuffer",url:i},c=t.certLoadPolicy.default,p={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},g={onSuccess:(x,D,T,N)=>{s(x.data)},onError:(x,D,T,N)=>{o(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:T,response:A({url:h.url,data:void 0},x)},`"${e}" certificate request failed (${i}). Status: ${x.code} (${x.text})`))},onTimeout:(x,D,T)=>{o(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:T,response:{url:h.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(x,D,T)=>{o(new Error("aborted"))}};n.load(h,p,g)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((n,i)=>{e.setServerCertificate(r).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${r==null?void 0:r.byteLength}) on "${t}"`),n(e)}).catch(s=>{i(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(r=>this.updateKeySession(e,new Uint8Array(r)).catch(n=>{throw new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:n,fatal:!0},n.message)}))}unpackPlayReadyKeyMessage(e,t){const r=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!r.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const n=new DOMParser().parseFromString(r,"application/xml"),i=n.querySelectorAll("HttpHeader");if(i.length>0){let p;for(let g=0,x=i.length;g<x;g++){var s,o;p=i[g];const D=(s=p.querySelector("name"))==null?void 0:s.textContent,T=(o=p.querySelector("value"))==null?void 0:o.textContent;D&&T&&e.setRequestHeader(D,T)}}const h=n.querySelector("Challenge"),c=h==null?void 0:h.textContent;if(!c)throw new Error("Cannot find <Challenge> in key message");return Dn(atob(c))}setupLicenseXHR(e,t,r,n){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,r,n)}).catch(s=>{if(!r.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,r,n)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||n})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:n}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((n,i)=>{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 i(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let h=o.response;this.log(`License received ${h instanceof ArrayBuffer?h.byteLength:h}`);const c=this.config.licenseResponseCallback;if(c)try{h=c.call(this.hls,o,s,e)}catch(p){this.error(p)}n(h)}else{const h=r.errorRetry,c=h?h.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)i(new ni({type:ge.KEY_SYSTEM_ERROR,details:ne.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 p=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${p} attempts left`),this.requestLicense(e,t).then(n,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:h,licenseChallenge:c})=>{e.keySystem==xr.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(h,c)),h.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,r.removeEventListener("encrypted",this.onMediaEncrypted),r.removeEventListener("waitingforkey",this.onWaitingForKey),r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const r=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},ri.clearKeyUriToKeyIdMap();const n=r.length;Ms.CDMCleanupPromise=Promise.all(r.map(i=>this.removeSession(i)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(i=>{var s;this.log(`Could not clear media keys: ${i}`),(s=this.hls)==null||s.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${i}`)})}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),r.length=0)}).catch(i=>{var s;this.log(`Could not close sessions and clear media keys: ${i}`),(s=this.hls)==null||s.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${i}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const r=t.reduce((n,i)=>(n.indexOf(i.keyFormat)===-1&&n.push(i.keyFormat),n),[]);this.log(`Selecting key-system from session-keys ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r}=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),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const n=this.mediaKeySessions.indexOf(e);return n>-1&&this.mediaKeySessions.splice(n,1),t.remove().catch(i=>{var s;this.log(`Could not remove session: ${i}`),(s=this.hls)==null||s.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${i}`)})}).then(()=>t.close()).catch(i=>{var s;this.log(`Could not close session: ${i}`),(s=this.hls)==null||s.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${i}`)})})}}}Ms.CDMCleanupPromise=void 0;class ni 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 Bu{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(v.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(v.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(v.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const n=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=n,n&&typeof n.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,r){const n=performance.now();if(t){if(this.lastTime){const i=n-this.lastTime,s=r-this.lastDroppedFrames,o=t-this.lastDecodedFrames,h=1e3*s/i,c=this.hls;if(c.trigger(v.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:r}),h>0&&s>c.config.fpsDroppedMonitoringThreshold*o){let p=c.currentLevel;c.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+p),p>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=p)&&(p=p-1,c.trigger(v.FPS_DROP_LEVEL_CAPPING,{level:p,droppedLevel:c.currentLevel}),c.autoLevelCapping=p,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,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 cl(a,e){let t;try{t=new Event("addtrack")}catch(r){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function hl(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(r){ye.debug(`[texttrack-utils]: ${r}`);try{const n=new self.TextTrackCue(e.startTime,e.endTime,e.text);n.id=e.id,a.addCue(n)}catch(n){ye.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${n}`)}}t==="disabled"&&(a.mode=t)}function Fs(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let r=a.cues.length;r--;)e&&a.cues[r].removeEventListener("enter",e),a.removeCue(a.cues[r]);t==="disabled"&&(a.mode=t)}function Oo(a,e,t,r){const n=a.mode;if(n==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const i=Uu(a.cues,e,t);for(let s=0;s<i.length;s++)(!r||r(i[s]))&&a.removeCue(i[s])}n==="disabled"&&(a.mode=n)}function Nu(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let r=0,n=t,i;for(;r<=n;)if(i=Math.floor((n+r)/2),e<a[i].startTime)n=i-1;else if(e>a[i].startTime&&r<t)r=i+1;else return i;return a[r].startTime-e<e-a[n].startTime?r:n}function Uu(a,e,t){const r=[],n=Nu(a,e);if(n>-1)for(let i=n,s=a.length;i<s;i++){const o=a[i];if(o.startTime>=e&&o.endTime<=t)r.push(o);else if(o.startTime>t)return r}return r}function to(a){const e=[];for(let t=0;t<a.length;t++){const r=a[t];(r.kind==="subtitles"||r.kind==="captions")&&r.label&&e.push(a[t])}return e}class $u extends Ji{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 r=to(this.media.textTracks);for(let i=0;i<r.length;i++)if(r[i].mode==="hidden")t=r[i];else if(r[i].mode==="showing"){t=r[i];break}const n=this.findTrackForTextTrack(t);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},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(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(v.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(v.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.LEVEL_LOADING,this.onLevelLoading,this),e.off(v.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(v.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(v.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 r=this.media;if(!r)return;const n=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||r.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,n)return;to(r.textTracks).forEach(s=>{Fs(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:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==n){this.warn(`Subtitle track with id:${r} and group:${n} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,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 r=t.subtitleGroups||null,n=this.groupIds;let i=this.currentTrack;if(!r||(n==null?void 0:n.length)!==(r==null?void 0:r.length)||r!=null&&r.some(s=>(n==null?void 0:n.indexOf(s))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(p=>!r||r.indexOf(p.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(p=>p.default)&&(this.selectDefaultTrack=!1),s.forEach((p,g)=>{p.id=g});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!i&&o){this.selectDefaultTrack=!1;const p=Xr(o,s);if(p>-1)i=s[p];else{const g=Xr(o,this.tracks);i=this.tracks[g]}}let h=this.findTrackId(i);h===-1&&i&&(h=this.findTrackId(null));const c={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${r==null?void 0:r.join(",")}" group-id`),this.hls.trigger(v.SUBTITLE_TRACKS_UPDATED,c),h!==-1&&this.trackId===-1&&this.setSubtitleTrack(h)}}findTrackId(e){const t=this.tracksInGroup,r=this.selectDefaultTrack;for(let n=0;n<t.length;n++){const i=t[n];if(!(r&&!i.default||!r&&!e)&&(!e||an(i,e)))return n}if(e){for(let n=0;n<t.length;n++){const i=t[n];if(ca(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const i=t[n];if(ca(e.attrs,i.attrs,["LANGUAGE"]))return n}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if(ko(n,e))return r}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===we.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 r=this.currentTrack;if(r&&an(e,r))return r;const n=Xr(e,this.tracksInGroup);if(n>-1){const i=this.tracksInGroup[n];return this.setSubtitleTrack(n),i}else{if(r)return null;{const i=Xr(e,t);if(i>-1)return t[i]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,n=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${r} "${e.name}" lang:${e.lang} group:${n}${(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:""):""} ${i}`),this.hls.trigger(v.SUBTITLE_TRACK_LOADING,{url:i,id:r,groupId:n,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=to(e.textTracks),r=this.currentTrack;let n;if(r&&(n=t.filter(i=>ko(r,i))[0],n||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(i=>{i.mode!=="disabled"&&i!==n&&(i.mode="disabled")}),n){const i=this.subtitleDisplay?"showing":"hidden";n.mode!==i&&(n.mode=i)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!F(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,n=t[e]||null;if(this.trackId=e,this.currentTrack=n,this.toggleTrackModes(),!n){this.hls.trigger(v.SUBTITLE_TRACK_SWITCH,{id:e});return}const i=!!n.details&&!n.details.live;if(e===this.trackId&&n===r&&i)return;this.log(`Switching to subtitle-track ${e}`+(n?` "${n.name}" lang:${n.lang} group:${n.groupId}`:""));const{id:s,groupId:o="",name:h,type:c,url:p}=n;this.hls.trigger(v.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:h,type:c,url:p});const g=this.switchParams(n.url,r==null?void 0:r.details,n.details);this.loadPlaylist(g)}}function fa(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const Bs=.025;let ro=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function zu(a,e,t){return`${a.identifier}-${t+1}-${fa(e)}`}class Gu{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Mo(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,r=Mo(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=F(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 Mo(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)<Bs))}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"?ro.Range:ro.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 ju(this)}}function Mo(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<Bs)?e.start:e.start+e.duration}function fl(a,e,t){const r=new self.URL(a,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function ju(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function Fo(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Hu{constructor(e,t,r,n){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const c=this.interstitial.playoutLimit,p=this.currentTime;this.startOffset+p>=c&&this.hls.trigger(v.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new e(t);this.interstitial=r,this.assetItem=n;let s=n.uri;try{s=fl(s,i.sessionId).href}catch(h){}i.loadSource(s);const o=()=>{this.hasDetails=!0};i.once(v.LEVEL_LOADED,o),i.once(v.AUDIO_TRACK_LOADED,o),i.once(v.SUBTITLE_TRACK_LOADED,o),i.on(v.MEDIA_ATTACHING,(h,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&c.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const r=this.timelineOffset,n=er.bufferInfo(e,r,0);return this.getAssetTime(n.end)>=this._bufferedEosTime-.02}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=er.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const r=e-t;if(Math.abs(r)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,r=this.duration;return Math.min(Math.max(0,e-t),r)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,r){this.hls.on(e,t)}once(e,t,r){this.hls.once(e,t)}off(e,t,r){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${Fo(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const dl=.033;class Ku extends Z{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((r,n)=>e<=n.startOffset&&t>n.startOffset?(delete n.error,r+1):r,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 r=-1;e.nextEvent?r=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(r=this.findEventIndex(e.previousEvent.identifier)+1);const n=this.items;if(n)for(n[r]||(t===void 0&&(t=e.start),r=this.findItemIndexAtTime(t));r>=0&&(i=n[r])!=null&&i.event;){var i;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let n=0;n<r.length;n++){let i=r[n];if(t&&t!=="primary"&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return n}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let n=e;n<=t&&r[n];n++){const i=r[n].event;if(i!=null&&i.restrictions.jump&&!i.appendInPlace)return n}return-1}findEventIndex(e){const t=this.items;if(t)for(let n=t.length;n--;){var r;if(((r=t[n].event)==null?void 0:r.identifier)===e)return n}return-1}findAssetIndex(e,t){const r=e.assetList,n=r.length;if(n>1)for(let i=0;i<n;i++){const s=r[i];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&t<o+(s.duration||0))return i}}return 0}get assetIdAtEnd(){var e,t;const r=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(r){const n=r.assetList,i=n[n.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:n}=r,i=this.events,s=this.parseDateRanges(n,{url:r.url},t),o=Object.keys(n),h=i?i.filter(c=>!o.includes(c.identifier)):[];s.length&&s.sort((c,p)=>{const g=c.cue.pre,x=c.cue.post,D=p.cue.pre,T=p.cue.post;if(g&&!D)return-1;if(D&&!g||x&&!T)return 1;if(T&&!x)return-1;if(!g&&!D&&!x&&!T){const N=c.startTime,H=p.startTime;if(N!==H)return N-H}return c.dateRange.tagOrder-p.dateRange.tagOrder}),this.events=s,h.forEach(c=>{this.removeEvent(c)}),this.updateSchedule(e,h)}updateSchedule(e,t=[]){const r=this.events||[];if(r.length||t.length||this.length<2){const n=this.items,i=this.parseSchedule(r,e);(t.length||(n==null?void 0:n.length)!==i.length||i.some((o,h)=>Math.abs(o.playout.start-n[h].playout.start)>.005||Math.abs(o.playout.end-n[h].playout.end)>.005))&&(this.items=i,this.onScheduleUpdate(t,n))}}parseDateRanges(e,t,r){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s],h=e[o];if(h.isInterstitial){let c=this.eventMap[o];c?c.setDateRange(h):(c=new Gu(h,t),this.eventMap[o]=c,r===!1&&(c.appendInPlace=r)),n.push(c)}}return n}parseSchedule(e,t){const r=[],n=t.main.details,i=n.live?1/0:n.edge;let s=0;if(e=e.filter(h=>!h.error&&!(h.cue.once&&h.hasPlayed)),e.length){this.resolveOffsets(e,t);let h=0,c=0;if(e.forEach((p,g)=>{const x=p.cue.pre,D=p.cue.post,T=e[g-1]||null,N=p.appendInPlace,H=D?i:p.startOffset,_e=p.duration,Ue=p.timelineOccupancy===ro.Range?_e:0,Re=p.resumptionOffset,Qe=(T==null?void 0:T.startTime)===H,Je=H+p.cumulativeDuration;let ft=N?Je+_e:H+Re;if(x||!D&&H<=0){const ot=c;c+=Ue,p.timelineStart=Je;const _t=s;s+=_e,r.push({event:p,start:Je,end:ft,playout:{start:_t,end:s},integrated:{start:ot,end:c}})}else if(H<=i){if(!Qe){const nt=H-h;if(nt>dl){const At=h,Pt=c;c+=nt;const br=s;s+=nt;const rr={previousEvent:e[g-1]||null,nextEvent:p,start:At,end:At+nt,playout:{start:br,end:s},integrated:{start:Pt,end:c}};r.push(rr)}else nt>0&&T&&(T.cumulativeDuration+=nt,r[r.length-1].end=H)}D&&(ft=Je),p.timelineStart=Je;const ot=c;c+=Ue;const _t=s;s+=_e,r.push({event:p,start:Je,end:ft,playout:{start:_t,end:s},integrated:{start:ot,end:c}})}else return;const et=p.resumeTime;D||et>i?h=i:h=et}),h<i){var o;const p=h,g=c,x=i-h;c+=x;const D=s;s+=x,r.push({previousEvent:((o=r[r.length-1])==null?void 0:o.event)||null,nextEvent:null,start:h,end:p+x,playout:{start:D,end:s},integrated:{start:g,end:c}})}this.setDurations(i,s,c)}else r.push({previousEvent:null,nextEvent:null,start:0,end:i,playout:{start:0,end:i},integrated:{start:0,end:i}}),this.setDurations(i,i,i);return r}setDurations(e,t,r){this.durations={primary:e,playout:t,integrated:r}}resolveOffsets(e,t){const r=t.main.details,n=r.live?1/0:r.edge;let i=0,s=-1;e.forEach((o,h)=>{const c=o.cue.pre,p=o.cue.post,g=c?0:p?n:o.startTime;this.updateAssetDurations(o),s===g?o.cumulativeDuration=i:(i=0,s=g),!p&&o.snapOptions.in&&(o.resumeAnchor=ur(null,r.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&h+1<e.length&&e[h+1].startTime-e[h].resumeTime<dl&&(e[h+1].appendInPlace=!1,e[h+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const D=F(o.resumeOffset)?o.resumeOffset:o.duration;i+=D})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,n=e.startTime+e.resumptionOffset;return Math.abs(r-n)>Bs?(this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${n}`),!1):t?!Object.keys(t).some(s=>{const o=t[s].details,h=o.edge;if(r>=h)return this.log(`"${e.identifier}" resumption ${r} past ${s} playlist end ${h}`),!1;const c=ur(null,o.fragments,r);if(!c)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const p=s==="audio"?.175:0;return Math.abs(c.start-r)<Bs+p||Math.abs(c.end-r)<Bs+p?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${s} fragment bounds (${c.start}-${c.end} sn: ${c.sn} cc: ${c.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${r} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,n=!1,i=!1;e.assetList.forEach((s,o)=>{const h=t+r;s.startOffset=r,s.timelineStart=h,n||(n=s.duration===null),i||(i=!!s.error);const c=s.error?0:s.duration||0;r+=c}),n&&!i?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function es(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class Vu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let n;try{n=fl(r,this.hls.sessionId,e.baseUrl)}catch(x){const D=this.assignAssetListError(e,ne.ASSET_LIST_LOAD_ERROR,x,r);this.hls.trigger(v.ERROR,D);return}t&&n.protocol!=="data:"&&n.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=i.loader,o=new s(i),h={responseType:"json",url:n.href},c=i.interstitialAssetListLoadPolicy.default,p={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},g={onSuccess:(x,D,T,N)=>{const H=x.data,_e=H==null?void 0:H.ASSETS;if(!Array.isArray(_e)){const Ue=this.assignAssetListError(e,ne.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),T.url,D,N);this.hls.trigger(v.ERROR,Ue);return}e.assetListResponse=H,this.hls.trigger(v.ASSET_LIST_LOADED,{event:e,assetListResponse:H,networkDetails:N})},onError:(x,D,T,N)=>{const H=this.assignAssetListError(e,ne.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${x.code} ${x.text} (${D.url})`),D.url,N,T);this.hls.trigger(v.ERROR,H)},onTimeout:(x,D,T)=>{const N=this.assignAssetListError(e,ne.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${D.url})`),D.url,x,T);this.hls.trigger(v.ERROR,N)}};return o.load(h,p,g),this.hls.trigger(v.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,r,n,i,s){return e.error=r,{type:ge.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:n,error:r,networkDetails:s,stats:i}}}function zi(a,e,t){Ri(a,e,t),a.addEventListener(e,t)}function Ri(a,e,t){a.removeEventListener(e,t)}function pl(a){a==null||a.play().catch(()=>{})}class Wu extends Z{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 r=this.currentTime;if(r===void 0||this.playbackDisabled)return;const n=r-this.timelinePos;if(Math.abs(n)<1/7056e5)return;const s=n<=-.01;this.timelinePos=r,this.bufferedPos=r;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(r,r-n)&&this.updateSchedule(),this.checkBuffer(),s&&r<o.start||r>=o.end){var h;const x=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(o)&&(h=this.media)!=null&&h.paused&&(this.shouldPlay=!1),!s){const D=this.findItemIndex(o);if(x>D){const T=this.schedule.findJumpRestrictedIndex(D+1,x);if(T>D){this.setSchedulePosition(T);return}}}this.setSchedulePosition(x);return}const c=this.playingAsset;if(!c){if(this.playingLastItem&&this.isInterstitial(o)){const x=o.event.assetList[0];x&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,x))}return}const p=c.timelineStart,g=c.duration||0;(s&&r<p||r>=p+g)&&this.setScheduleToAssetAtTime(r,c)},this.onTimeupdate=()=>{const r=this.currentTime;if(r===void 0||this.playbackDisabled)return;if(r>this.timelinePos)this.timelinePos=r,r>this.bufferedPos&&this.checkBuffer();else return;const n=this.playingItem;if(!n||this.playingLastItem)return;if(r>=n.end){this.timelinePos=n.end;const o=this.findItemIndex(n);this.setSchedulePosition(o+1)}const i=this.playingAsset;if(!i)return;const s=i.timelineStart+(i.duration||0);r>=s&&this.setScheduleToAssetAtTime(r,i)},this.onScheduleUpdate=(r,n)=>{const i=this.schedule,s=this.playingItem,o=i.events||[],h=i.items||[],c=i.durations,p=r.map(D=>D.identifier),g=!!(o.length||p.length);if(g&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
Schedule: ${h.map(D=>es(D))}`),p.length&&this.log(`Removed events ${p}`),this.playerQueue.forEach(D=>{if(D.interstitial.appendInPlace){const T=D.assetItem.timelineStart,N=D.timelineOffset-T;if(N)try{D.timelineOffset=T}catch(H){Math.abs(N)>Bs&&this.warn(`${H} ("${D.assetId}" ${D.timelineOffset}->${T})`)}}}),s){const D=this.updateItem(s,this.timelinePos);this.itemsMatch(s,D)&&(this.playingItem=D,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const x=this.bufferingItem;if(x){const D=this.updateItem(x,this.bufferedPos);this.itemsMatch(x,D)?this.bufferingItem=D:x.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(x.event,null))}if(r.forEach(D=>{D.assetList.forEach(T=>{this.clearAssetPlayer(T.identifier,null)})}),g||n){if(this.hls.trigger(v.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:h.slice(0),durations:c,removedIds:p}),this.isInterstitial(s)&&p.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Vu(e),this.schedule=new Ku(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(v.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(v.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(v.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(v.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(v.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(v.BUFFER_APPENDED,this.onBufferAppended,this),e.on(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(v.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(v.MEDIA_ENDED,this.onMediaEnded,this),e.on(v.ERROR,this.onError,this),e.on(v.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(v.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(v.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(v.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(v.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(v.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(v.BUFFER_CODECS,this.onBufferCodecs,this),e.off(v.BUFFER_APPENDED,this.onBufferAppended,this),e.off(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(v.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(v.MEDIA_ENDED,this.onMediaEnded,this),e.off(v.ERROR,this.onError,this),e.off(v.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){Ri(e,"play",this.onPlay),Ri(e,"pause",this.onPause),Ri(e,"seeking",this.onSeeking),Ri(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;zi(r,"seeking",this.onSeeking),zi(r,"timeupdate",this.onTimeupdate),zi(r,"play",this.onPlay),zi(r,"pause",this.onPause)}onMediaAttached(e,t){const r=this.effectivePlayingItem,n=this.detachedData;if(this.detachedData=null,r===null)this.checkStart();else if(!n){this.clearScheduleState();const i=this.findItemIndex(r);this.setSchedulePosition(i)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const r=!!t.transferMedia,n=this.media;if(this.media=null,!r&&(n&&this.removeMediaListeners(n),this.detachedData)){const i=this.getBufferingPlayer();i&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,i.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,r=g=>g&&e.getAssetPlayer(g.identifier),n=(g,x,D,T,N)=>{if(g){let H=g[x].start;const _e=g.event;if(_e){if(x==="playout"||_e.timelineOccupancy!==ro.Point){const Ue=r(D);(Ue==null?void 0:Ue.interstitial)===_e&&(H+=Ue.assetItem.startOffset+Ue[N])}}else{const Ue=T==="bufferedPos"?s():e[T];H+=Ue-g.start}return H}return 0},i=(g,x)=>{if(g!==0&&x!=="primary"&&e.schedule.length){var D;const T=e.schedule.findItemIndexAtTime(g),N=(D=e.schedule.items)==null?void 0:D[T];if(N){const H=N[x].start-N.start;return g+H}}return g},s=()=>{const g=e.bufferedPos;return g===Number.MAX_VALUE?o("primary"):Math.max(g,0)},o=g=>{var x;return(x=e.primaryDetails)!=null&&x.live?e.primaryDetails.edge:e.schedule.durations[g]},h=(g,x)=>{var D,T;const N=e.effectivePlayingItem;if(N!=null&&(D=N.event)!=null&&D.restrictions.skip)return;e.log(`seek to ${g} "${x}"`);const H=e.effectivePlayingItem,_e=e.schedule.findItemIndexAtTime(g,x),Ue=(T=e.schedule.items)==null?void 0:T[_e],Re=e.getBufferingPlayer(),Qe=Re==null?void 0:Re.interstitial,Je=Qe==null?void 0:Qe.appendInPlace,ft=H&&e.itemsMatch(H,Ue);if(H&&(Je||ft)){const ot=r(e.playingAsset),_t=(ot==null?void 0:ot.media)||e.primaryMedia;if(_t){const nt=x==="primary"?_t.currentTime:n(H,x,e.playingAsset,"timelinePos","currentTime"),At=g-nt,Pt=(Je?nt:_t.currentTime)+At;if(Pt>=0&&(!ot||Je||Pt<=ot.duration)){_t.currentTime=Pt;return}}}if(Ue){let ot=g;if(x!=="primary"){const nt=Ue[x].start,At=g-nt;ot=Ue.start+At}const _t=!e.isInterstitial(Ue);if((!e.isInterstitial(H)||H.event.appendInPlace)&&(_t||Ue.event.appendInPlace)){const nt=e.media||(Je?Re==null?void 0:Re.media:null);nt&&(nt.currentTime=ot)}else if(H){const nt=e.findItemIndex(H);if(_e>nt){const Pt=e.schedule.findJumpRestrictedIndex(nt+1,_e);if(Pt>nt){e.setSchedulePosition(Pt);return}}let At=0;if(_t)e.timelinePos=ot,e.checkBuffer();else{var et;const Pt=Ue==null||(et=Ue.event)==null?void 0:et.assetList;if(Pt){const br=g-(Ue[x]||Ue).start;for(let rr=Pt.length;rr--;){const Zt=Pt[rr];if(Zt.duration&&br>=Zt.startOffset&&br<Zt.startOffset+Zt.duration){At=rr;break}}}}e.setSchedulePosition(_e,At)}}},c=()=>{const g=e.effectivePlayingItem;if(e.isInterstitial(g))return g;const x=t();return e.isInterstitial(x)?x:null},p={get currentTime(){const g=c(),x=e.effectivePlayingItem;return x&&x===g?n(x,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-x.playout.start:0},set currentTime(g){const x=c(),D=e.effectivePlayingItem;D&&D===x&&h(g+D.playout.start,"playout")},get duration(){const g=c();return g?g.playout.end-g.playout.start:0},get assetPlayers(){var g;const x=(g=c())==null?void 0:g.event.assetList;return x?x.map(D=>e.getAssetPlayer(D.identifier)):[]},get playingIndex(){var g;const x=(g=c())==null?void 0:g.event;return x&&e.effectivePlayingAsset?x.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return c()}};this.manager={get events(){var g,x;return((g=e.schedule)==null||(x=g.events)==null?void 0:x.slice(0))||[]},get schedule(){var g,x;return((g=e.schedule)==null||(x=g.items)==null?void 0:x.slice(0))||[]},get interstitialPlayer(){return c()?p:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const g=t();return e.findItemIndex(g)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const g=e.effectivePlayingItem;return e.findItemIndex(g)},primary:{get bufferedEnd(){return s()},get currentTime(){const g=e.timelinePos;return g>0?g:0},set currentTime(g){h(g,"primary")},get duration(){return o("primary")},get seekableStart(){var g;return((g=e.primaryDetails)==null?void 0:g.fragmentStart)||0}},integrated:{get bufferedEnd(){return n(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return n(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(g){h(g,"integrated")},get duration(){return o("integrated")},get seekableStart(){var g;return i(((g=e.primaryDetails)==null?void 0:g.fragmentStart)||0,"integrated")}},skip:()=>{const g=e.effectivePlayingItem,x=g==null?void 0:g.event;if(x&&!x.restrictions.skip){const D=e.findItemIndex(g);if(x.appendInPlace){const T=g.playout.start+g.event.duration;h(T+.001,"playout")}else e.advanceAfterAssetEnded(x,D,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,r=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!r?!1:this.findItemIndex(t)===r.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,r;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&&(t=e.event)!=null&&t.appendInPlace&&(i=this.primaryMedia);const s=(r=i)==null?void 0:r.currentTime;if(!(s===void 0||!F(s)))return s}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const r=this.getAssetPlayer(e);r&&this.transferMediaFromPlayer(r,t)}transferMediaFromPlayer(e,t){const r=e.interstitial.appendInPlace,n=e.media;if(r&&n===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&n){this.detachedData={media:n};return}const i=e.transferMedia();this.log(`transfer MediaSource from ${e} ${fr(i)}`),this.detachedData=i}else t&&n&&(this.shouldPlay||(this.shouldPlay=!n.paused))}transferMediaTo(e,t){var r,n;if(e.media===t)return;let i=null;const s=this.hls,o=e!==s,h=o&&e.interstitial.appendInPlace,c=(r=this.detachedData)==null?void 0:r.mediaSource;let p;if(s.media)h&&(i=s.transferMedia(),this.detachedData=i),p="Primary";else if(c){const D=this.getBufferingPlayer();D?(i=D.transferMedia(),p=`${D}`):p="detached MediaSource"}else p="detached media";if(!i){if(c)i=this.detachedData,this.log(`using detachedData: MediaSource ${fr(i)}`);else if(!this.detachedData||s.media===t){const D=this.playerQueue;D.length>1&&D.forEach(T=>{if(o&&T.interstitial.appendInPlace!==h){const N=T.interstitial;this.clearInterstitial(T.interstitial,null),N.appendInPlace=!1,N.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${N}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const g=i&&"mediaSource"in i&&((n=i.mediaSource)==null?void 0:n.readyState)!=="closed",x=g&&i?i:t;if(this.log(`${g?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${p}`),x===i){const D=o&&e.assetId===this.schedule.assetIdAtEnd;x.overrides={duration:this.schedule.duration,endOfStream:!o||D,cueRemoval:!o}}e.attachMedia(x)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const r=this.timelinePos,n=this.effectivePlayingItem;if(r===-1){const i=this.hls.startPosition;if(this.timelinePos=i,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(i>=0||!this.primaryLive){const s=this.timelinePos=i>0?i:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(n&&!this.playingItem){const i=e.findItemIndex(n);this.setSchedulePosition(i)}}advanceAfterAssetEnded(e,t,r){const n=r+1;if(!e.isAssetPastPlayoutLimit(n)&&!e.assetList[n].error)this.setSchedulePosition(t,n);else{const i=this.schedule.items;if(i){const s=t+1,o=i.length;if(s>=o){this.setSchedulePosition(-1);return}const h=e.resumeTime;this.timelinePos<h&&(this.timelinePos=h,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const r=this.schedule,n=t.parentIdentifier,i=r.getEvent(n);if(i){const s=r.findEventIndex(n),o=r.findAssetIndex(i,e);this.setSchedulePosition(s,o)}}setSchedulePosition(e,t){const r=this.schedule.items;if(!r||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const n=e>=0?r[e]:null,i=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(i)){var o;const c=i.event,p=this.playingAsset,g=p==null?void 0:p.identifier,x=g?this.getAssetPlayer(g):null;if(x&&g&&(!this.eventItemsMatch(i,n)||t!==void 0&&g!==((o=c.assetList)==null?void 0:o[t].identifier))){var h;const D=c.findAssetIndex(p);this.log(`INTERSTITIAL_ASSET_ENDED ${D+1}/${c.assetList.length} ${Fo(p)}`),this.endedAsset=p,this.playingAsset=null,this.hls.trigger(v.INTERSTITIAL_ASSET_ENDED,{asset:p,assetListIndex:D,event:c,schedule:r.slice(0),scheduleIndex:e,player:x}),this.retreiveMediaSource(g,n),x.media&&!((h=this.detachedData)!=null&&h.mediaSource)&&x.detachMedia()}if(!this.eventItemsMatch(i,n)&&(this.endedItem=i,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${c} ${es(i)}`),c.hasPlayed=!0,this.hls.trigger(v.INTERSTITIAL_ENDED,{event:c,schedule:r.slice(0),scheduleIndex:e}),c.cue.once)){this.updateSchedule();const D=this.schedule.items;if(n&&D){const T=this.schedule.findItemIndex(n);this.advanceSchedule(T,D,t,i,s)}return}}this.advanceSchedule(e,r,t,i,s)}advanceSchedule(e,t,r,n,i){const s=e>=0?t[e]:null,o=this.primaryMedia,h=this.playerQueue;if(h.length&&h.forEach(c=>{const p=c.interstitial,g=this.schedule.findEventIndex(p.identifier);(g<e||g>e+1)&&this.clearInterstitial(p,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const c=s.event;r===void 0&&(r=this.schedule.findAssetIndex(c,this.timelinePos));const p=this.waitingItem;this.assetsBuffered(s,o)||this.setBufferingItem(s);let g=this.preloadAssets(c,r);if(this.eventItemsMatch(s,p||n)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${es(s)} ${c.appendInPlace?"append in place":""}`),this.hls.trigger(v.INTERSTITIAL_STARTED,{event:c,schedule:t.slice(0),scheduleIndex:e})),!c.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${c}`);return}if(c.assetListLoader&&(c.assetListLoader.destroy(),c.assetListLoader=void 0),!o){this.log(`Waiting for attachMedia to start Interstitial ${c}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const x=c.assetList[r];if(!x){const D=t[e+1],T=this.media;D&&T&&!this.isInterstitial(D)&&T.currentTime<D.start&&(T.currentTime=this.timelinePos=D.start),this.advanceAfterAssetEnded(c,e,r||0);return}if(g||(g=this.getAssetPlayer(x.identifier)),g===null||g.destroyed){const D=c.assetList.length;this.warn(`asset ${r+1}/${D} player destroyed ${c}`),g=this.createAssetPlayer(c,x,r)}if(!this.eventItemsMatch(s,this.bufferingItem)&&c.appendInPlace&&this.isAssetBuffered(x))return;this.startAssetPlayer(g,r,t,e,o),this.shouldPlay&&pl(g.media)}else s!==null?(this.resumePrimary(s,e,n),this.shouldPlay&&pl(this.hls.media)):i&&this.isInterstitial(n)&&(this.endedItem=null,this.playingItem=n,n.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,r){var n;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${es(e)}`),!((n=this.detachedData)!=null&&n.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!r)return;const i=this.schedule.items;i&&(this.log(`resumed ${es(e)}`),this.hls.trigger(v.INTERSTITIALS_PRIMARY_RESUMED,{schedule:i.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const r=e.start;if(this.primaryLive){const n=this.primaryDetails;if(t===0)return this.hls.startPosition;if(n&&(r<n.fragmentStart||r>n.edge))return this.hls.liveSyncPosition||-1}return r}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:er.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,r){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const n=this.primaryMedia;if(!n)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,n),r&&this.startLoadingPrimaryAt(e,r)),r||(this.timelinePos=e,this.startLoadingPrimaryAt(e,r))}startLoadingPrimaryAt(e,t){var r;const n=this.hls;!n.loadingEnabled||!n.media||Math.abs((((r=n.mainForwardBufferInfo)==null?void 0:r.start)||n.media.currentTime)-e)>.5?n.startLoad(e,t):n.bufferingEnabled||n.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(v.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(v.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const r=this.hls.levels[t.level],n=A(A({},this.mediaSelection||this.altSelection),{},{main:r});this.mediaSelection=n,this.schedule.parseInterstitialDateRanges(n,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const r=this.hls.audioTracks[t.id],n=this.mediaSelection;if(!n){this.altSelection=A(A({},this.altSelection),{},{audio:r});return}const i=A(A({},n),{},{audio:r});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],n=this.mediaSelection;if(!n){this.altSelection=A(A({},this.altSelection),{},{subtitles:r});return}const i=A(A({},n),{},{subtitles:r});this.mediaSelection=i}onAudioTrackSwitching(e,t){const r=vr(t);this.playerQueue.forEach(n=>n.hls.setAudioOption(t)||n.hls.setAudioOption(r))}onSubtitleTrackSwitch(e,t){const r=vr(t);this.playerQueue.forEach(n=>n.hls.setSubtitleOption(t)||t.id!==-1&&n.hls.setSubtitleOption(r))}onBufferCodecs(e,t){const r=t.tracks;r&&(this.requiredTracks=r)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const r=this.playingItem;if(r&&!this.itemsMatch(r,this.bufferingItem)&&!this.isInterstitial(r)){const n=this.timelinePos;this.bufferedPos=n,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let n=0;n<t.length;n++){const i=t[n];if(i.cue.post){var r;const s=this.schedule.findEventIndex(i.identifier),o=(r=this.schedule.items)==null?void 0:r[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 r=this.findItemIndex(t);this.setSchedulePosition(r+1)}else this.shouldPlay=!1}updateItem(e,t){const r=this.schedule.items;if(e&&r){const n=this.findItemIndex(e,t);return r[n]||null}return null}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var r;return!!t&&(e===t||e.event.identifier===((r=t.event)==null?void 0:r.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const r=er.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=r.len<1),this.updateBufferedPos(r.end,t,e)}updateBufferedPos(e,t,r){const n=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],i)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let h=n.findItemIndexAtTime(e);if(this.bufferedPos<e){var c,p;const g=this.findItemIndex(i),x=Math.min(g+1,t.length-1),D=t[x];if((h===-1&&i&&e>=i.end||(c=D.event)!=null&&c.appendInPlace&&e+.01>=D.start)&&(h=x),x-o>1&&(i==null||(p=i.event)==null?void 0:p.appendInPlace)===!1)return;if(this.bufferedPos=e,h>g&&h>o)this.bufferedToItem(D);else{const T=this.primaryDetails;this.primaryLive&&T&&e>T.edge-T.targetduration&&D.start<T.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(D)&&this.preloadAssets(D.event,0)}}else r&&s&&!this.itemsMatch(s,i)&&(h===o?this.bufferedToItem(s):h===o+1&&this.bufferedToItem(t[h]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(n=>{const i=this.getAssetPlayer(n.identifier);return!(i!=null&&i.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:n,events:i}=r;if(!n||!i)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const h=o?o.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${es(e)}`+(t?` (${h.toFixed(2)} remaining)`:"")),s?e.event.assetList.forEach(c=>{const p=this.getAssetPlayer(c.identifier);p&&p.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(c=>c.pauseBuffering()))}this.hls.trigger(v.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:n.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const r=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(r!==null){this.bufferingAsset=null;const n=this.detachedData;n?n.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),r=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(r)}bufferedToEvent(e,t){const r=e.event,n=r.assetList.length===0&&!r.assetListLoader,i=r.cue.once;if(n||!i){const s=this.preloadAssets(r,t);if(s!=null&&s.interstitial.appendInPlace){const o=r.assetList[t],h=this.primaryMedia;o&&h&&this.bufferAssetPlayer(s,h)}}}preloadAssets(e,t){const r=e.assetUrl,n=e.assetList.length,i=n===0&&!e.assetListLoader,s=e.cue.once;if(i){const h=e.timelineStart;if(e.appendInPlace){var o;const x=this.playingItem;!this.isInterstitial(x)&&(x==null||(o=x.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(h+.25)}let c,p=0;if(!this.playingItem&&this.primaryLive&&(p=this.hls.startPosition,p===-1&&(p=this.hls.liveSyncPosition||0)),p&&!(e.cue.pre||e.cue.post)){const x=p-h;x>0&&(c=Math.round(x*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:n} ${e}${c?` live-start: ${p} start-offset: ${c}`:""}`),r)return this.createAsset(e,0,0,h,e.duration,r);const g=this.assetListLoader.loadAssetList(e,c);g&&(e.assetListLoader=g)}else if(!s&&n){for(let h=t;h<n;h++){const c=e.assetList[h],p=this.getAssetPlayerQueueIndex(c.identifier);(p===-1||this.playerQueue[p].destroyed)&&!c.error&&this.createAssetPlayer(e,c,h)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(n=>{this.hls.trigger(v.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:n})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let r=0;r<t.length;r++)if(e===t[r].assetId)return r;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 r=0;r<e.length;r++)if(e[r].media===t)return e[r]}return null}createAsset(e,t,r,n,i,s){const o={parentIdentifier:e.identifier,identifier:zu(e,s,t),duration:i,startOffset:r,timelineStart:n,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,r){this.log(`create HLSAssetPlayer for ${Fo(t)}`);const n=this.hls,i=n.userConfig;let s=i.videoPreference;const o=n.loadLevelObj||n.levels[n.currentLevel];(s||o)&&(s=b({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const h=n.audioTracks[n.audioTrack],c=n.subtitleTracks[n.subtitleTrack];let p=0;if(this.primaryLive||e.appendInPlace){const Re=this.timelinePos-t.timelineStart;if(Re>1){const Qe=t.duration;Qe&&Re<Qe&&(p=Re)}}const g=t.identifier,x=A(A({},i),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:n.sessionId,assetPlayerId:g,abrEwmaDefaultEstimate:n.bandwidthEstimate,interstitialsController:void 0,startPosition:p,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:h||i.audioPreference,subtitlePreference:c||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(x.timelineOffset=t.timelineStart));const D=x.cmcd;D!=null&&D.sessionId&&D.contentId&&(x.cmcd=b({},D,{contentId:fa(t.uri)})),this.getAssetPlayer(g)&&this.warn(`Duplicate date range identifier ${e} and asset ${g}`);const T=new Hu(this.HlsPlayerClass,x,e,t);this.playerQueue.push(T),e.assetList[r]=t;const N=Re=>{if(Re.live){const ft=new Error(`Interstitials MUST be VOD assets ${e}`),et={fatal:!0,type:ge.OTHER_ERROR,details:ne.INTERSTITIAL_ASSET_ITEM_ERROR,error:ft};this.handleAssetItemError(et,e,this.schedule.findEventIndex(e.identifier),r,ft.message);return}const Qe=Re.edge-Re.fragmentStart,Je=t.duration;(Je===null||Qe>Je)&&(this.log(`Interstitial asset "${g}" duration change ${Je} > ${Qe}`),t.duration=Qe,this.updateSchedule())};T.on(v.LEVEL_UPDATED,(Re,{details:Qe})=>N(Qe)),T.on(v.LEVEL_PTS_UPDATED,(Re,{details:Qe})=>N(Qe));const H=(Re,Qe)=>{const Je=this.getAssetPlayer(g);if(Je&&Qe.tracks){Je.off(v.BUFFER_CODECS,H),Je.tracks=Qe.tracks;const ft=this.primaryMedia;this.bufferingAsset===Je.assetItem&&ft&&!Je.media&&this.bufferAssetPlayer(Je,ft)}};T.on(v.BUFFER_CODECS,H);const _e=()=>{var Re;const Qe=this.getAssetPlayer(g);if(this.log(`buffered to end of asset ${Qe}`),!Qe)return;const Je=this.schedule.findEventIndex(e.identifier),ft=e.findAssetIndex(t),et=ft+1,ot=(Re=this.schedule.items)==null?void 0:Re[Je];if(this.isInterstitial(ot))if(ft!==-1&&!e.isAssetPastPlayoutLimit(et)&&!e.assetList[et].error)this.bufferedToItem(ot,et);else{var _t;const nt=(_t=this.schedule.items)==null?void 0:_t[Je+1];nt&&this.bufferedToItem(nt)}};T.on(v.BUFFERED_TO_END,_e);const Ue=Re=>()=>{if(!this.getAssetPlayer(g))return;this.shouldPlay=!0;const Je=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Je,Re)};return T.once(v.MEDIA_ENDED,Ue(r)),T.once(v.PLAYOUT_LIMIT_REACHED,Ue(1/0)),T.on(v.ERROR,(Re,Qe)=>{const Je=this.getAssetPlayer(g);if(Qe.details===ne.BUFFER_STALLED_ERROR){if(Je!=null&&Je.media){const ft=Je.currentTime,et=Je.duration-ft;ft&&e.appendInPlace&&et/Je.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${g} ${e} at ${Je.media.currentTime}`),_e()):(this.warn(`Stalled at ${ft} of ${ft+et} in asset ${g} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(Qe,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${Qe.error} ${e}`)}),T.on(v.DESTROYING,()=>{if(!this.getAssetPlayer(g))return;const Qe=new Error(`Asset player destroyed unexpectedly ${g}`),Je={fatal:!0,type:ge.OTHER_ERROR,details:ne.INTERSTITIAL_ASSET_ITEM_ERROR,error:Qe};this.handleAssetItemError(Je,e,this.schedule.findEventIndex(e.identifier),r,Qe.message)}),this.hls.trigger(v.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:T}),T}clearInterstitial(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(r!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&es(t)}`);const n=this.playerQueue[r];this.transferMediaFromPlayer(n,t),this.playerQueue.splice(r,1),n.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,r,n,i){const{interstitial:s,assetItem:o,assetId:h}=e,c=s.assetList.length,p=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!p||p.identifier!==h)&&(p&&(this.clearAssetPlayer(p.identifier,r[n]),delete p.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${c} ${e}`),this.hls.trigger(v.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:r.slice(0),scheduleIndex:n,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){var r,n;const{interstitial:i,assetItem:s,assetId:o}=e,h=this.schedule.findEventIndex(i.identifier),c=(r=this.schedule.items)==null?void 0:r[h];if(!c)return;this.setBufferingItem(c),this.bufferingAsset=s;const p=this.getBufferingPlayer();if(p===e)return;const g=i.appendInPlace;if(g&&(p==null?void 0:p.interstitial.appendInPlace)===!1)return;const x=(p==null?void 0:p.tracks)||((n=this.detachedData)==null?void 0:n.tracks)||this.requiredTracks;if(g&&s!==this.playingAsset){if(!e.tracks)return;if(x&&!Oe(x,e.tracks)){const D=new Error(`Asset "${o}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(x)}')`),T={fatal:!0,type:ge.OTHER_ERROR,details:ne.INTERSTITIAL_ASSET_ITEM_ERROR,error:D},N=i.findAssetIndex(s);this.handleAssetItemError(T,i,h,N,D.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,r,n,i){if(e.details===ne.BUFFER_STALLED_ERROR)return;const s=t.assetList[n]||null;let o=null;if(s){const g=this.getAssetPlayerQueueIndex(s.identifier);o=this.playerQueue[g]||null}const h=this.schedule.items,c=b({},e,{fatal:!1,errorAction:Fr(!0),asset:s,assetListIndex:n,event:t,schedule:h,scheduleIndex:r,player:o});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(v.INTERSTITIAL_ASSET_ERROR,c),!e.fatal)return;const p=new Error(i);s&&(this.playingAsset!==s&&this.clearAssetPlayer(s.identifier,null),s.error=p),t.assetList.some(g=>!g.error)?t.appendInPlace&&(t.error=p):t.error=p,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;if(this.updateSchedule(),r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${r?es(r):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let n=this.timelinePos;n===-1&&(n=this.hls.startPosition);const i=this.updateItem(r,n);if(this.itemsMatch(r,i))this.clearInterstitial(e,null);else{const s=this.schedule.findItemIndexAtTime(n);this.setSchedulePosition(s)}}else this.checkStart()}onAssetListLoaded(e,t){var r;const n=t.event,i=n.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(i))return;const o=n.timelineStart,h=n.duration;let c=0;s.forEach((T,N)=>{const H=parseFloat(T.DURATION);this.createAsset(n,N,c,o+c,H,T.URI),c+=H}),n.duration=c,this.log(`Loaded asset-list with duration: ${c} (was: ${h}) ${n}`);const p=this.waitingItem,g=(p==null?void 0:p.event.identifier)===i;this.updateSchedule();const x=(r=this.bufferingItem)==null?void 0:r.event;if(g){var D;const T=this.schedule.findEventIndex(i),N=(D=this.schedule.items)==null?void 0:D[T];if(N){if(!this.playingItem&&this.timelinePos>N.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==T){n.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${n}`),this.primaryFallback(n);return}this.setBufferingItem(N)}this.setSchedulePosition(T)}else if((x==null?void 0:x.identifier)===i&&x.appendInPlace){const T=n.assetList[0],N=this.getAssetPlayer(T.identifier),H=this.primaryMedia;T&&N&&H&&this.bufferAssetPlayer(N,H)}}onError(e,t){switch(t.details){case ne.ASSET_LIST_PARSING_ERROR:case ne.ASSET_LIST_LOAD_ERROR:case ne.ASSET_LIST_LOAD_TIMEOUT:{const r=t.interstitial;r&&this.primaryFallback(r);break}case ne.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const ml=500;class Yu extends Vs{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",fe.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(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(v.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(v.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(v.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(v.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(v.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(v.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=yt.IDLE,this.setInterval(ml),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:r,success:n}=t;if(ce(r)&&(this.fragPrevious=r),this.state=yt.IDLE,!n)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const o=r.start;for(let c=0;c<i.length;c++)if(o>=i[c].start&&o<=i[c].end){s=i[c];break}const h=r.start+r.duration;s?s.end=h:(s={start:o,end:h},i.push(s)),this.fragmentTracker.fragBuffered(r),this.fragBufferedComplete(r,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:r,endOffset:n}=t;if(r===0&&n!==Number.POSITIVE_INFINITY){const i=n-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=i){s.shift();continue}else if(s[o].start<i)s[o].start=i;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(r,i,fe.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===fe.SUBTITLE&&(t.details===ne.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==yt.STOPPED&&(this.state=yt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Xo(this.levels,t)){this.levels=t.map(r=>new Ut(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const n=new Ut(r);return this.tracksBuffered[n.id]=[],n}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,fe.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var r;if(this.currentTrackId=t.id,!((r=this.levels)!=null&&r.length)||this.currentTrackId===-1){this.clearInterval();return}const n=this.levels[this.currentTrackId];n!=null&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.state!==yt.STOPPED&&this.setInterval(ml)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:n,levels:i}=this,{details:s,id:o}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const h=i[o];if(o>=i.length||!h)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 c=0;if(s.live||(r=h.details)!=null&&r.live){const g=this.mainDetails;if(s.deltaUpdateFailed||!g)return;const x=g.fragments[0];if(!h.details)s.hasProgramDateTime&&g.hasProgramDateTime?(Ss(s,g),c=s.fragmentStart):x&&(c=x.start,bs(s,c));else{var p;c=this.alignPlaylists(s,h.details,(p=this.levelLastLoaded)==null?void 0:p.details),c===0&&x&&(c=x.start,bs(s,c))}}h.details=s,this.levelLastLoaded=h,o===n&&(this.hls.trigger(v.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===yt.IDLE&&(ur(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,n=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&n!=null&&n.key&&n.iv&&ln(n.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer,rn(n.method)).catch(o=>{throw i.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const h=performance.now();i.trigger(v.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:h}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=yt.IDLE})}}doTick(){if(!this.media){this.state=yt.IDLE;return}if(this.state===yt.IDLE){const{currentTrackId:e,levels:t}=this,r=t==null?void 0:t[e];if(!r||!t.length||!r.details||this.waitForLive(r))return;const{config:n}=this,i=this.getLoadPosition(),s=er.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,n.maxBufferHole),{end:o,len:h}=s,c=r.details,p=this.hls.maxBufferLength+c.levelTargetDuration;if(h>p)return;const g=c.fragments,x=g.length,D=c.edge;let T=null;const N=this.fragPrevious;if(o<D){const Ue=n.maxFragLookUpTolerance,Re=o>D-Ue?0:Ue;T=ur(N,g,Math.max(g[0].start,o),Re),!T&&N&&N.start<g[0].start&&(T=g[0])}else T=g[x-1];if(T=this.filterReplacedPrimary(T,r.details),!T)return;const H=T.sn-c.startSN,_e=g[H-1];if(_e&&_e.cc===T.cc&&this.fragmentTracker.getState(_e)===Br.NOT_LOADED&&(T=_e),this.fragmentTracker.getState(T)===Br.NOT_LOADED){const Ue=this.mapToInitFragWhenRequired(T);Ue&&this.loadFragment(Ue,r,o)}}}loadFragment(e,t,r){ce(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new qu(this.tracksBuffered[this.currentTrackId]||[])}}class qu{constructor(e){this.buffered=void 0;const t=(r,n,i)=>{if(n=n>>>0,n>i-1)throw new DOMException(`Failed to execute '${r}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${i})`);return e[n][r]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}const Zu={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},gl=a=>String.fromCharCode(Zu[a]||a),vi=15,Gi=100,Xu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Qu={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ju={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},e0={25:2,26:4,29:6,30:8,31:10,27:13,28:15},t0=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class r0{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r=typeof t=="function"?t():t;ye.log(`${this.time} [${e}] ${r}`)}}}const fs=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class _l{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 r=0;r<t.length;r++){const n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}}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 n0{constructor(){this.uchar=" ",this.penState=new _l}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 i0{constructor(e){this.chars=[],this.pos=0,this.currPenState=new _l,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Gi;t++)this.chars.push(new n0);this.logger=e}equals(e){for(let t=0;t<Gi;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Gi;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Gi;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>Gi&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Gi)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r<t+1;r++)this.chars[r].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=gl(e);if(this.pos>=Gi){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<Gi;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 r=0;r<Gi;r++){const n=this.chars[r].uchar;n!==" "&&(t=!1),e.push(n)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Bo{constructor(e){this.rows=[],this.currRow=vi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<vi;t++)this.rows.push(new i0(e));this.logger=e}reset(){for(let e=0;e<vi;e++)this.rows[e].clear();this.currRow=vi-1}equals(e){let t=!0;for(let r=0;r<vi;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<vi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<vi;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 = "+fr(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<vi;o++)this.rows[o].clear();const i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[i].cueStartTime,h=this.logger.time;if(o!==null&&h!==null&&o<h)for(let c=0;c<this.nrRollUpRows;c++)this.rows[t-this.nrRollUpRows+c+1].copy(s.rows[i+c])}}this.currRow=t;const r=this.rows[this.currRow];if(e.indent!==null){const i=e.indent,s=Math.max(i-1,0);r.setCursor(e.indent),e.color=r.chars[s].penState.foreground}const n={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(n)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+fr(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 r="",n=-1;for(let i=0;i<vi;i++){const s=this.rows[i].getTextString();s&&(n=i+1,e?t.push("Row "+n+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?r="["+t.join(" | ")+"]":r=t.join(`
|
|
`)),r}getTextAndFormat(){return this.rows}}class vl{constructor(e,t,r){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 Bo(r),this.nonDisplayedMemory=new Bo(r),this.lastOutputScreen=new Bo(r),this.currRollUpRow=this.displayedMemory.rows[vi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[vi-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 r=0;r<e.length;r++)this.writeScreen.insertChar(e[r]);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 r=Math.floor(e/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=n[r]}this.logger.log(2,"MIDROW: "+fr(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 yl{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=a0(),this.logger=void 0;const n=this.logger=new r0;this.channels=[null,new vl(e,t,n),new vl(e+1,r,n)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let r=0;r<t.length;r+=2){const n=t[r]&127,i=t[r+1]&127;let s=!1,o=null;if(n===0&&i===0)continue;this.logger.log(3,()=>"["+fs([t[r],t[r+1]])+"] -> ("+fs([n,i])+")");const h=this.cmdHistory;if(n>=16&&n<=31){if(s0(n,i,h)){no(null,null,h),this.logger.log(3,()=>"Repeated command ("+fs([n,i])+") is dropped");continue}no(n,i,this.cmdHistory),s=this.parseCmd(n,i),s||(s=this.parseMidrow(n,i)),s||(s=this.parsePAC(n,i)),s||(s=this.parseBackgroundAttributes(n,i))}else no(null,null,h);if(!s&&(o=this.parseChars(n,i),o)){const p=this.currentChannel;p&&p>0?this.channels[p].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+fs([n,i])+" orig: "+fs([t[r],t[r+1]]))}}parseCmd(e,t){const r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=33&&t<=35;if(!(r||n))return!1;const i=e===20||e===21||e===23?1:2,s=this.channels[i];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=i,!0}parseMidrow(e,t){let r=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?r=1:r=2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const n=this.channels[r];return n?(n.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+fs([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let r;const n=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,i=(e===16||e===24)&&t>=64&&t<=95;if(!(n||i))return!1;const s=e<=23?1:2;t>=64&&t<=95?r=s===1?Xu[e]:Ju[e]:r=s===1?Qu[e]:e0[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(r,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let r;const n={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?r=t-96:r=t-64,n.underline=(r&1)===1,r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=Math.floor((r-16)/2)*4,n}parseChars(e,t){let r,n=null,i=null;if(e>=25?(r=2,i=e-8):(r=1,i=e),i>=17&&i<=19){let s;i===17?s=t+80:i===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+gl(s)+"' in channel "+r),n=[s]}else e>=32&&e<=127&&(n=t===0?[e]:[e,t]);return n&&this.logger.log(3,()=>"Char codes = "+fs(n).join(",")),n}parseBackgroundAttributes(e,t){const r=(e===16||e===24)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=45&&t<=47;if(!(r||n))return!1;let i;const s={};e===16||e===24?(i=Math.floor((t-32)/2),s.background=t0[i],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()}no(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function no(a,e,t){t.a=a,t.b=e}function s0(a,e,t){return t.a===a&&t.b===e}function a0(){return{a:null,b:null}}var No=function(){if(ti!=null&&ti.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,h){if(typeof h!="string"||!Array.isArray(o))return!1;const c=h.toLowerCase();return~o.indexOf(c)?c:!1}function r(o){return t(a,o)}function n(o){return t(e,o)}function i(o,...h){let c=1;for(;c<arguments.length;c++){const p=arguments[c];for(const g in p)o[g]=p[g]}return o}function s(o,h,c){const p=this,g={enumerable:!0};p.hasBeenReset=!1;let x="",D=!1,T=o,N=h,H=c,_e=null,Ue="",Re=!0,Qe="auto",Je="start",ft=50,et="middle",ot=50,_t="middle";Object.defineProperty(p,"id",i({},g,{get:function(){return x},set:function(nt){x=""+nt}})),Object.defineProperty(p,"pauseOnExit",i({},g,{get:function(){return D},set:function(nt){D=!!nt}})),Object.defineProperty(p,"startTime",i({},g,{get:function(){return T},set:function(nt){if(typeof nt!="number")throw new TypeError("Start time must be set to a number.");T=nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"endTime",i({},g,{get:function(){return N},set:function(nt){if(typeof nt!="number")throw new TypeError("End time must be set to a number.");N=nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"text",i({},g,{get:function(){return H},set:function(nt){H=""+nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"region",i({},g,{get:function(){return _e},set:function(nt){_e=nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"vertical",i({},g,{get:function(){return Ue},set:function(nt){const At=r(nt);if(At===!1)throw new SyntaxError("An invalid or illegal string was specified.");Ue=At,this.hasBeenReset=!0}})),Object.defineProperty(p,"snapToLines",i({},g,{get:function(){return Re},set:function(nt){Re=!!nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"line",i({},g,{get:function(){return Qe},set:function(nt){if(typeof nt!="number"&&nt!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Qe=nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"lineAlign",i({},g,{get:function(){return Je},set:function(nt){const At=n(nt);if(!At)throw new SyntaxError("An invalid or illegal string was specified.");Je=At,this.hasBeenReset=!0}})),Object.defineProperty(p,"position",i({},g,{get:function(){return ft},set:function(nt){if(nt<0||nt>100)throw new Error("Position must be between 0 and 100.");ft=nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",i({},g,{get:function(){return et},set:function(nt){const At=n(nt);if(!At)throw new SyntaxError("An invalid or illegal string was specified.");et=At,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",i({},g,{get:function(){return ot},set:function(nt){if(nt<0||nt>100)throw new Error("Size must be between 0 and 100.");ot=nt,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",i({},g,{get:function(){return _t},set:function(nt){const At=n(nt);if(!At)throw new SyntaxError("An invalid or illegal string was specified.");_t=At,this.hasBeenReset=!0}})),p.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class o0{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function bl(a){function e(r,n,i,s){return(r|0)*3600+(n|0)*60+(i|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 l0{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let n=0;n<r.length;++n)if(t===r[n]){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 r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function xl(a,e,t,r){const n=r?a.split(r):[a];for(const i in n){if(typeof n[i]!="string")continue;const s=n[i].split(t);if(s.length!==2)continue;const o=s[0],h=s[1];e(o,h)}}const Uo=new No(0,0,""),io=Uo.align==="middle"?"middle":"center";function u0(a,e,t){const r=a;function n(){const o=bl(a);if(o===null)throw new Error("Malformed timestamp: "+r);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function i(o,h){const c=new l0;xl(o,function(x,D){let T;switch(x){case"region":for(let N=t.length-1;N>=0;N--)if(t[N].id===D){c.set(x,t[N].region);break}break;case"vertical":c.alt(x,D,["rl","lr"]);break;case"line":T=D.split(","),c.integer(x,T[0]),c.percent(x,T[0])&&c.set("snapToLines",!1),c.alt(x,T[0],["auto"]),T.length===2&&c.alt("lineAlign",T[1],["start",io,"end"]);break;case"position":T=D.split(","),c.percent(x,T[0]),T.length===2&&c.alt("positionAlign",T[1],["start",io,"end","line-left","line-right","auto"]);break;case"size":c.percent(x,D);break;case"align":c.alt(x,D,["start",io,"end","left","right"]);break}},/:/,/\s/),h.region=c.get("region",null),h.vertical=c.get("vertical","");let p=c.get("line","auto");p==="auto"&&Uo.line===-1&&(p=-1),h.line=p,h.lineAlign=c.get("lineAlign","start"),h.snapToLines=c.get("snapToLines",!0),h.size=c.get("size",100),h.align=c.get("align",io);let g=c.get("position","auto");g==="auto"&&Uo.position===50&&(g=h.align==="start"||h.align==="left"?0:h.align==="end"||h.align==="right"?100:50),h.position=g}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=n(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);a=a.slice(3),s(),e.endTime=n(),s(),i(a,e)}function El(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class c0{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new o0,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 r(){let i=t.buffer,s=0;for(i=El(i);s<i.length&&i[s]!=="\r"&&i[s]!==`
|
|
`;)++s;const o=i.slice(0,s);return i[s]==="\r"&&++s,i[s]===`
|
|
`&&++s,t.buffer=i.slice(s),o}function n(i){xl(i,function(s,o){},/:/)}try{let i="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;i=r();const o=i.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:i=r(),t.state){case"HEADER":/:/.test(i)?n(i):i||(t.state="ID");continue;case"NOTE":i||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){t.state="NOTE";break}if(!i)continue;if(t.cue=new No(0,0,""),t.state="CUE",i.indexOf("-->")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{u0(i,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=i.indexOf("-->")!==-1;if(!i||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+=i}continue;case"BADCUE":i||(t.state="ID")}}}catch(i){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 h0=/\r\n|\n\r|\n|\r/g,$o=function(e,t,r=0){return e.slice(r,r+t.length)===t},f0=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!F(t)||!F(r)||!F(n)||!F(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*n,t+=60*60*1e3*i,t};function zo(a,e,t){return fa(a.toString())+fa(e.toString())+fa(t)}const d0=function(e,t,r){let n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new){e.ccOffset=e.presentationOffset=n.start,n.new=!1;return}for(;(s=i)!=null&&s.new;){var s;e.ccOffset+=n.start-i.start,n.new=!1,n=i,i=e[n.prevCC]}e.presentationOffset=r};function p0(a,e,t,r,n,i,s){const o=new c0,h=He(new Uint8Array(a)).trim().replace(h0,`
|
|
`).split(`
|
|
`),c=[],p=e?jr(e.baseTime,e.timescale):0;let g="00:00.000",x=0,D=0,T,N=!0;o.oncue=function(H){const _e=t[r];let Ue=t.ccOffset;const Re=(x-p)/9e4;if(_e!=null&&_e.new&&(D!==void 0?Ue=t.ccOffset=_e.start:d0(t,r,Re)),Re){if(!e){T=new Error("Missing initPTS for VTT MPEGTS");return}Ue=Re-t.presentationOffset}const Qe=H.endTime-H.startTime,Je=pn((H.startTime+Ue-D)*9e4,n*9e4)/9e4;H.startTime=Math.max(Je,0),H.endTime=Math.max(Je+Qe,0);const ft=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(ft)),H.id||(H.id=zo(H.startTime,H.endTime,ft)),H.endTime>0&&c.push(H)},o.onparsingerror=function(H){T=H},o.onflush=function(){if(T){s(T);return}i(c)},h.forEach(H=>{if(N)if($o(H,"X-TIMESTAMP-MAP=")){N=!1,H.slice(16).split(",").forEach(_e=>{$o(_e,"LOCAL:")?g=_e.slice(6):$o(_e,"MPEGTS:")&&(x=parseInt(_e.slice(7)))});try{D=f0(g)/1e3}catch(_e){T=_e}return}else H===""&&(N=!1);o.parse(H+`
|
|
`)}),o.flush()}const Go="stpp.ttml.im1t",wl=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Sl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,m0={left:"start",center:"center",right:"end",start:"start",end:"end"};function Al(a,e,t,r){const n=Ke(new Uint8Array(a),["mdat"]);if(n.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const i=n.map(o=>He(o)),s=cr(e.baseTime,1,e.timescale);try{i.forEach(o=>t(g0(o,s)))}catch(o){r(o)}}function g0(a,e){const n=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!n)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((g,x)=>(g[x]=n.getAttribute(`ttp:${x}`)||i[x],g),{}),o=n.getAttribute("xml:space")!=="preserve",h=Tl(jo(n,"styling","style")),c=Tl(jo(n,"layout","region")),p=jo(n,"body","[begin]");return[].map.call(p,g=>{const x=Dl(g,o);if(!x||!g.hasAttribute("begin"))return null;const D=Ko(g.getAttribute("begin"),s),T=Ko(g.getAttribute("dur"),s);let N=Ko(g.getAttribute("end"),s);if(D===null)throw kl(g);if(N===null){if(T===null)throw kl(g);N=D+T}const H=new No(D-e,N-e,x);H.id=zo(H.startTime,H.endTime,H.text);const _e=c[g.getAttribute("region")],Ue=h[g.getAttribute("style")],Re=_0(_e,Ue,h),{textAlign:Qe}=Re;if(Qe){const Je=m0[Qe];Je&&(H.lineAlign=Je),H.align=Qe}return b(H,Re),H}).filter(g=>g!==null)}function jo(a,e,t){const r=a.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function Tl(a){return a.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function Dl(a,e){return[].slice.call(a.childNodes).reduce((t,r,n)=>{var i;return r.nodeName==="br"&&n?t+`
|
|
`:(i=r.childNodes)!=null&&i.length?Dl(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function _0(a,e,t){const r="http://www.w3.org/ns/ttml#styling";let n=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(n=t[s]),i.reduce((o,h)=>{const c=Ho(e,r,h)||Ho(a,r,h)||Ho(n,r,h);return c&&(o[h]=c),o},{})}function Ho(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function kl(a){return new Error(`Could not parse ttml timestamp ${a}`)}function Ko(a,e){if(!a)return null;let t=bl(a);return t===null&&(wl.test(a)?t=v0(a,e):Sl.test(a)&&(t=y0(a,e))),t}function v0(a,e){const t=wl.exec(a),r=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+r/e.frameRate}function y0(a,e){const t=Sl.exec(a),r=Number(t[1]);switch(t[2]){case"h":return r*3600;case"m":return r*60;case"ms":return r*1e3;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}class so{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,r){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class b0{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=Rl(),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(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(v.FRAG_LOADING,this.onFragLoading,this),e.on(v.FRAG_LOADED,this.onFragLoaded,this),e.on(v.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(v.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(v.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(v.FRAG_LOADING,this.onFragLoading,this),e.off(v.FRAG_LOADED,this.onFragLoaded,this),e.off(v.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(v.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(v.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(v.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new so(this,"textTrack1"),t=new so(this,"textTrack2"),r=new so(this,"textTrack3"),n=new so(this,"textTrack4");this.cea608Parser1=new yl(1,e,t),this.cea608Parser2=new yl(3,r,n)}addCues(e,t,r,n,i){let s=!1;for(let o=i.length;o--;){const h=i[o],c=x0(h[0],h[1],t,r);if(c>=0&&(h[0]=Math.min(h[0],t),h[1]=Math.max(h[1],r),s=!0,c/(r-t)>.5))return}if(s||i.push([t,r]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,r,n)}else{const o=this.Cues.newCue(null,t,r,n);this.hls.trigger(v.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i}){const{unparsedVttFrags:s}=this;r===fe.MAIN&&(this.initPTS[t.cc]={baseTime:n,timescale:i}),s.length&&(this.unparsedVttFrags=[],s.forEach(o=>{this.onFragLoaded(v.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let n=0;n<r.textTracks.length;n++){const i=r.textTracks[n];if(Ll(i,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:r,media:n}=this,{label:i,languageCode:s}=t[e],o=this.getExistingTrack(i,s);if(o)r[e]=o,Fs(r[e]),cl(r[e],n);else{const h=this.createTextTrack("captions",i,s);h&&(h[e]=!0,r[e]=h)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r=t.label,n={_id:e,label:r,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(v.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,r){const n=this.media;if(n)return n.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const r=!!t.transferMedia;if(this.media=null,r)return;const{captionsTracks:n}=this;Object.keys(n).forEach(i=>{Fs(n[i]),delete n[i]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Rl(),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 r=0;r<t.length;r++)Fs(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],n=r.some(i=>i.textCodec===Go);if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(Xo(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const s=this.media,o=s?to(s.textTracks):null;if(this.tracks.forEach((h,c)=>{let p;if(o){let g=null;for(let x=0;x<o.length;x++)if(o[x]&&Ll(o[x],h)){g=o[x],o[x]=null;break}g&&(p=g)}if(p)Fs(p);else{const g=Cl(h);p=this.createTextTrack(g,h.name,h.lang),p&&(p.mode="disabled")}p&&this.textTracks.push(p)}),o!=null&&o.length){const h=o.filter(c=>c!==null).map(c=>c.label);h.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${h.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(v.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(r=>{const n=/(?:CC|SERVICE)([1-4])/.exec(r.instreamId);if(!n)return;const i=`textTrack${n[1]}`,s=this.captionsProperties[i];s&&(s.label=r.name,r.lang&&(s.languageCode=r.lang),s.media=r)})}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===fe.MAIN){var r,n;const{cea608Parser1:i,cea608Parser2:s,lastSn:o}=this,{cc:h,sn:c}=t.frag,p=(r=(n=t.part)==null?void 0:n.index)!=null?r:-1;i&&s&&(c!==o+1||c===o&&p!==this.lastPartIndex+1||h!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=h,this.lastSn=c,this.lastPartIndex=p}}onFragLoaded(e,t){const{frag:r,payload:n}=t;if(r.type===fe.SUBTITLE)if(n.byteLength){const i=r.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const o=this.tracks[r.level],h=this.vttCCs;h[r.cc]||(h[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),o&&o.textCodec===Go?this._parseIMSC1(r,n):this._parseVTTs(t)}}else this.hls.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;Al(t,this.initPTS[e.cc],n=>{this._appendCues(n,e.level),r.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},n=>{r.logger.log(`Failed to parse IMSC1: ${n}`),r.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:n})})}_parseVTTs(e){var t;const{frag:r,payload:n}=e,{initPTS:i,unparsedVttFrags:s}=this,o=i.length-1;if(!i[r.cc]&&o===-1){s.push(e);return}const h=this.hls,c=(t=r.initSegment)!=null&&t.data?Ve(r.initSegment.data,new Uint8Array(n)).buffer:n;p0(c,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,p=>{this._appendCues(p,r.level),h.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},p=>{const g=p.message==="Missing initPTS for VTT MPEGTS";g?s.push(e):this._fallbackToIMSC1(r,n),h.logger.log(`Failed to parse VTT cue: ${p}`),!(g&&o>r.cc)&&h.trigger(v.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:p})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||Al(t,this.initPTS[e.cc],()=>{r.textCodec=Go,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||n.mode==="disabled")return;e.forEach(i=>hl(n,i))}else{const n=this.tracks[t];if(!n)return;const i=n.default?"default":"subtitles"+t;r.trigger(v.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===fe.SUBTITLE&&this.onFragLoaded(v.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:r,samples:n}=t;if(!(r.type===fe.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let i=0;i<n.length;i++){const s=n[i].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(n[i].pts,o[0]),this.cea608Parser2.addData(n[i].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:n,type:i}){const{media:s}=this;if(!(!s||s.currentTime<r)){if(!i||i==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(h=>Oo(o[h],t,r))}if(this.config.renderTextTracksNatively&&t===0&&n!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(h=>Oo(o[h],t,n))}}}extractCea608Data(e){const t=[[],[]],r=e[0]&31;let n=2;for(let i=0;i<r;i++){const s=e[n++],o=127&e[n++],h=127&e[n++];if(o===0&&h===0)continue;if((4&s)!==0){const p=3&s;(p===0||p===1)&&(t[p].push(o),t[p].push(h))}}return t}}function Cl(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Ll(a,e){return!!a&&a.kind===Cl(e)&&ko(e,a)}function x0(a,e,t,r){return Math.min(e,r)-Math.max(a,t)}function Rl(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const E0=/\s/,w0={newCue(a,e,t,r){const n=[];let i,s,o,h,c;const p=self.VTTCue||self.TextTrackCue;for(let x=0;x<r.rows.length;x++)if(i=r.rows[x],o=!0,h=0,c="",!i.isEmpty()){var g;for(let N=0;N<i.chars.length;N++)E0.test(i.chars[N].uchar)&&o?h++:(c+=i.chars[N].uchar,o=!1);i.cueStartTime=e,e===t&&(t+=1e-4),h>=16?h--:h++;const D=El(c.trim()),T=zo(e,t,D);a!=null&&(g=a.cues)!=null&&g.getCueById(T)||(s=new p(e,t,D),s.id=T,s.line=x+1,s.align="left",s.position=10+Math.min(80,Math.floor(h*8/32)*10),n.push(s))}return a&&n.length&&(n.sort((x,D)=>x.line==="auto"||D.line==="auto"?0:x.line>8&&D.line>8?D.line-x.line:x.line-D.line),n.forEach(x=>hl(a,x))),n}};function S0(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const A0=/(\d+)-(\d+)\/(\d+)/;class Il{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||C0,this.controller=new self.AbortController,this.stats=new S}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,r){const n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();const i=T0(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:h,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=h&&F(h)?h:c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},t.timeout),(hs(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(g=>{var x;this.response=this.loader=g;const D=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},c-(D-n.loading.start)),!g.ok){const{status:N,statusText:H}=g;throw new L0(H||"fetch, bad network response",N,g)}n.loading.first=D,n.total=k0(g.headers)||n.total;const T=(x=this.callbacks)==null?void 0:x.onProgress;return T&&F(t.highWaterMark)?this.loadProgressively(g,n,e,t.highWaterMark,T):s?g.arrayBuffer():e.responseType==="json"?g.json():g.text()}).then(g=>{var x,D;const T=this.response;if(!T)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const N=g[o];N&&(n.loaded=n.total=N);const H={url:T.url,data:g,code:T.status},_e=(x=this.callbacks)==null?void 0:x.onProgress;_e&&!F(t.highWaterMark)&&_e(n,e,g,T),(D=this.callbacks)==null||D.onSuccess(H,n,e,T)}).catch(g=>{var x;if(self.clearTimeout(this.requestTimeout),n.aborted)return;const D=g&&g.code||0,T=g?g.message:null;(x=this.callbacks)==null||x.onError({code:D,text:T},e,g?g.details:null,n)})}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,r,n=0,i){const s=new Sa,o=e.body.getReader(),h=()=>o.read().then(c=>{if(c.done)return s.dataLength&&i(t,r,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const p=c.value,g=p.length;return t.loaded+=g,g<n||s.dataLength?(s.push(p),s.dataLength>=n&&i(t,r,s.flush().buffer,e)):i(t,r,p.buffer,e),h()}).catch(()=>Promise.reject());return h()}}function T0(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(b({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function D0(a){const e=A0.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function k0(a){const e=a.get("Content-Range");if(e){const r=D0(e);if(F(r))return r}const t=a.get("Content-Length");if(t)return parseInt(t)}function C0(a,e){return new self.Request(a.url,e)}class L0 extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const R0=/^age:\s*[\d.]+\s*$/im;class Pl{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 S,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,r){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=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0,n.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==r||this.stats.aborted))return i(r,t.url)}).catch(s=>{if(!(this.loader!==r||this.stats.aborted))return r.open("GET",t.url,!0),i(r,t.url)}).then(()=>{this.loader!==r||this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:r.status,text:s.message},t,r,n)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const n=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=r.loadPolicy;if(n)for(const o in n)e.setRequestHeader(o,n[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),r.timeout=i&&F(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const n=t.readyState,i=this.config;if(!r.aborted&&n>=2&&(r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),n===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const c=t.status,p=t.responseType==="text"?t.responseText:null;if(c>=200&&c<300){const T=p!=null?p:t.response;if(T!=null){var s,o;r.loading.end=Math.max(self.performance.now(),r.loading.first);const N=t.responseType==="arraybuffer"?T.byteLength:T.length;r.loaded=r.total=N,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const H=(s=this.callbacks)==null?void 0:s.onProgress;H&&H(r,e,T,t);const _e={url:t.responseURL,data:T,code:c};(o=this.callbacks)==null||o.onSuccess(_e,r,e,t);return}}const g=i.loadPolicy.errorRetry,x=r.retry,D={url:e.url,data:void 0,code:c};if(Qn(g,x,!1,D))this.retry(g);else{var h;ye.error(`${c} while loading ${e.url}`),(h=this.callbacks)==null||h.onError({code:c,text:t.statusText},e,t,r)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Qn(e,t,!0))this.retry(e);else{var r;ye.warn(`timeout while loading ${(r=this.context)==null?void 0:r.url}`);const n=this.callbacks;n&&(this.abortInternal(),n.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=gn(e,r.retry),r.retry++,ye.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${r.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&&R0.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 I0={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},P0=A(A({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Pl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:mn,bufferController:Jl,capLevelController:Lo,errorController:tr,fpsController:Bu,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:qt,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default:I0},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},O0()),{},{subtitleStreamController:Yu,subtitleTrackController:$u,timelineController:b0,audioStreamController:Qa,audioTrackController:Zl,emeController:Ms,cmcdController:Ou,contentSteeringController:Fu,interstitialsController:Wu});function O0(){return{cueHandler:w0,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 M0(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 r=Vo(a),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,h=e[o]===void 0,c=[];i.forEach(p=>{const g=`${s}Loading${p}`,x=e[g];if(x!==void 0&&h){c.push(g);const D=r[o].default;switch(e[o]={default:D},p){case"TimeOut":D.maxLoadTimeMs=x,D.maxTimeToFirstByteMs=x;break;case"MaxRetry":D.errorRetry.maxNumRetry=x,D.timeoutRetry.maxNumRetry=x;break;case"RetryDelay":D.errorRetry.retryDelayMs=x,D.timeoutRetry.retryDelayMs=x;break;case"MaxRetryTimeout":D.errorRetry.maxRetryDelayMs=x,D.timeoutRetry.maxRetryDelayMs=x;break}}}),c.length&&t.warn(`hls.js config: "${c.join('", "')}" setting(s) are deprecated, use "${o}": ${fr(e[o])}`)}),A(A({},r),e)}function Vo(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Vo):Object.keys(a).reduce((e,t)=>(e[t]=Vo(a[t]),e),{}):a}function F0(a,e){const t=a.loader;t!==Il&&t!==Pl?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):S0()&&(a.loader=Il,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const ao=2,B0=.1,N0=.05,U0=100;class $0 extends Nn{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var r;(r=this.media)!=null&&r.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var r;this.ended=((r=this.media)==null?void 0:r.currentTime)||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.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(U0),this.mediaSource=t.mediaSource;const r=this.media=t.media;zi(r,"playing",this.onMediaPlaying),zi(r,"waiting",this.onMediaWaiting),zi(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(Ri(r,"playing",this.onMediaPlaying),Ri(r,"waiting",this.onMediaWaiting),Ri(r,"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 r,n;const i=(r=this.hls)==null?void 0:r.config;if(!i)return;const{media:s,stalled:o}=this;if(!s)return;const{seeking:h}=s,c=this.seeking&&!h,p=!this.seeking&&h,g=s.paused&&!h||s.ended||s.playbackRate===0;if(this.seeking=h,e!==t){t&&(this.ended=0),this.moved=!0,h||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!g&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(p||c){c&&this.stallResolved(e);return}if(g){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!1}));return}if(!er.getBuffered(s).length){this.nudgeRetry=0;return}const x=er.bufferInfo(s,e,0),D=x.nextStart||0,T=this.fragmentTracker;if(h&&T&&this.hls){const ft=Ol(this.hls.inFlightFragments,e),et=x.len>ao,ot=!D||ft||D-e>ao&&!T.getPartialFragment(e);if(et||ot)return;this.moved=!1}const N=(n=this.hls)==null?void 0:n.latestLevelDetails;if(!this.moved&&this.stalled!==null&&T){if(!(x.len>0)&&!D)return;const et=Math.max(D,x.start||0)-e,_t=!!(N!=null&&N.live)?N.targetduration*2:ao,nt=T.getPartialFragment(e);if(et>0&&(et<=_t||nt)){s.paused||this._trySkipBufferHole(nt);return}}const H=i.detectStallWithCurrentTimeMs,_e=self.performance.now(),Ue=this.waiting;if(o===null){Ue>0&&_e-Ue<H?this.stalled=Ue:this.stalled=_e;return}const Re=_e-o;if(!h&&(Re>=H||Ue)&&this.hls){var Qe;if(((Qe=this.mediaSource)==null?void 0:Qe.readyState)==="ended"&&!(N!=null&&N.live)&&Math.abs(e-((N==null?void 0:N.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(v.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(x),!this.media||!this.hls)return}const Je=er.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(Je,Re)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const r=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(r)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(v.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var r;const n=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(r=this.buffered.audio)!=null&&r.length&&n&&n.length>1&&e>n.end(0)){const i=er.bufferedInfo(er.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){const s=er.timeRangesToArray(n),o=er.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const h=er.bufferedInfo(s,e,0).bufferedIndex,c=s[o].end,p=s[o+1].start;if((h===-1||h>o)&&p-c<1&&e-c<2){const g=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${c} -> ${p} buffered index: ${h}`);this.warn(g.message),this.media.currentTime+=1e-6;const x=this.fragmentTracker.getPartialFragment(e)||void 0,D=er.bufferInfo(this.media,e,0);this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:g,reason:g.message,frag:x,buffer:D.len,bufferInfo:D})}}}}}_tryFixBufferStall(e,t){var r,n;const{fragmentTracker:i,media:s}=this,o=(r=this.hls)==null?void 0:r.config;if(!s||!i||!o)return;const h=s.currentTime,c=(n=this.hls)==null?void 0:n.latestLevelDetails,p=i.getPartialFragment(h);if((p||c!=null&&c.live&&h<c.fragmentStart)&&(this._trySkipBufferHole(p)||!this.media))return;const g=e.buffered;(g&&g.length>1&&e.len>o.maxBufferHole||e.nextStart&&e.nextStart-h<o.maxBufferHole)&&(t>o.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:r,stallReported:n,stalled:i}=this;if(!n&&i!==null&&r&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${fr(e)})`);this.warn(s.message),t.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:n}=this,i=(t=this.hls)==null?void 0:t.config;if(!n||!r||!i)return 0;const s=n.currentTime,o=er.bufferInfo(n,s,0),h=s<o.start?o.start:o.nextStart;if(h&&this.hls){const p=o.len<=i.maxBufferHole,g=o.len>0&&o.len<1&&n.readyState<3,x=h-s;if(x>0&&(p||g)){if(x>i.maxBufferHole){let T=!1;if(s===0){const N=r.getAppendedFrag(0,fe.MAIN);N&&h<N.end&&(T=!0)}if(!T){const N=e||r.getAppendedFrag(s,fe.MAIN);if(N){var c;if(!((c=this.hls.loadLevelObj)!=null&&c.details)||Ol(this.hls.inFlightFragments,h))return 0;let _e=!1,Ue=N.end;for(;Ue<h;){const Re=r.getPartialFragment(Ue);if(Re)Ue+=Re.duration;else{_e=!0;break}}if(_e)return 0}}}const D=Math.max(h+N0,s+B0);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${D}`),this.moved=!0,n.currentTime=D,!(e!=null&&e.gap)){const T=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${D}`);this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:T,reason:T.message,frag:e||void 0,buffer:o.len,bufferInfo:o})}return D}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:n}=this,i=t==null?void 0:t.config;if(!r||!i)return 0;const s=r.currentTime;if(this.nudgeRetry++,n<i.nudgeMaxRetry){const o=s+(n+1)*i.nudgeOffset,h=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(h.message),r.currentTime=o,t.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_NUDGE_ON_STALL,error:h,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Ol(a,e){const t=Ml(a.main);if(t&&t.start<=e)return t;const r=Ml(a.audio);return r&&r.start<=e?r:null}function Ml(a){if(!a)return null;switch(a.state){case yt.IDLE:case yt.STOPPED:case yt.ENDED:case yt.ERROR:return null}return a.frag}const z0=.25;function Wo(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Fl(a,e,t,r,n){let i=new a(e,t,"");try{i.value=r,n&&(i.type=n)}catch(s){i=new a(e,t,fr(n?A({type:n},r):r))}return i}const oo=(()=>{const a=Wo();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function G0(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class j0{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(v.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(v.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(v.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var r;this.media=t.media,((r=t.overrides)==null?void 0:r.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&Fs(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 r=e[t];if(r.kind==="metadata"&&r.label==="id3")return cl(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:r,enableID3MetadataCues:n}}}=this;if(!r&&!n)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Wo();if(s)for(let o=0;o<i.length;o++){const h=i[o].type;if(h===In.emsg&&!r||!n)continue;const c=ja(i[o].data);if(c){const p=i[o].pts;let g=p+i[o].duration;g>oo&&(g=oo),g-p<=0&&(g=p+z0);for(let D=0;D<c.length;D++){const T=c[D];if(!ra(T)){this.updateId3CueEnds(p,h);const N=Fl(s,p,g,T,h);N&&this.id3Track.addCue(N)}}}}}updateId3CueEnds(e,t){var r;const n=(r=this.id3Track)==null?void 0:r.cues;if(n)for(let i=n.length;i--;){const s=n[i];s.type===t&&s.startTime<e&&s.endTime===oo&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:n}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:h}}=s;if(i&&(o||h)){let c;n==="audio"?c=p=>p.type===In.audioId3&&h:n==="video"?c=p=>p.type===In.emsg&&o:c=p=>p.type===In.audioId3&&h||p.type===In.emsg&&o,Oo(i,t,r,c)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:r}=this,{dateRanges:n}=e,i=Object.keys(n);let s=this.dateRangeCuesAppended;if(r&&t){var o;if((o=r.cues)!=null&&o.length){const p=Object.keys(s).filter(g=>!i.includes(g));for(let g=p.length;g--;){const x=p[g],D=s[x].cues;delete s[x],Object.keys(D).forEach(T=>{try{const N=D[T];N.removeEventListener("enter",this.onEventCueEnter),r.removeCue(N)}catch(N){}})}}else s=this.dateRangeCuesAppended={}}const h=e.fragments[e.fragments.length-1];if(i.length===0||!F(h==null?void 0:h.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const c=Wo();for(let p=0;p<i.length;p++){const g=i[p],x=n[g],D=x.startTime,T=s[g],N=(T==null?void 0:T.cues)||{};let H=(T==null?void 0:T.durationKnown)||!1,_e=oo;const{duration:Ue,endDate:Re}=x;if(Re&&Ue!==null)_e=D+Ue,H=!0;else if(x.endOnNext&&!H){const Je=i.reduce((ft,et)=>{if(et!==x.id){const ot=n[et];if(ot.class===x.class&&ot.startDate>x.startDate&&(!ft||x.startDate<ft.startDate))return ot}return ft},null);Je&&(_e=Je.startTime,H=!0)}const Qe=Object.keys(x.attr);for(let Je=0;Je<Qe.length;Je++){const ft=Qe[Je];if(!ns(ft))continue;const et=N[ft];if(et)H&&!T.durationKnown?et.endTime=_e:Math.abs(et.startTime-D)>.01&&(et.startTime=D,et.endTime=_e);else if(c){let ot=x.attr[ft];kt(ft)&&(ot=G0(ot));const nt=Fl(c,D,_e,{key:ft,data:ot},In.dateRange);nt&&(nt.id=g,this.id3Track.addCue(nt),N[ft]=nt,this.hls.config.interstitialsController&&(ft==="X-ASSET-LIST"||ft==="X-ASSET-URL")&&nt.addEventListener("enter",this.onEventCueEnter))}}s[g]={cues:N,dateRange:x,durationKnown:H}}}}class H0{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,r=this.levelDetails;if(!t||!r)return;this.currentTime=t.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!r.live)return;const o=this.targetLatency;if(o===null)return;const h=n-o,c=Math.min(this.maxLatency,o+r.targetduration);if(h<c&&h>.05&&this.forwardBufferLength>1){const g=Math.min(2,Math.max(1,s)),x=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20,D=Math.min(g,Math.max(1,x));this.changeMediaPlaybackRate(t,D)}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:r,targetduration:n}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,h=this.hls.userConfig;let c=o&&r||t;(this._targetLatencyUpdated||h.liveSyncDuration||h.liveSyncDurationCount||c===0)&&(c=i!==void 0?i:s*n);const p=n;return c+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,p)}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 r=this.levelDetails;if(r===null)return null;const n=r.edge,i=e-t-this.edgeStalled,s=n-r.totalduration,o=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,i),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 r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(v.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(v.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(v.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(v.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 r;t.details===ne.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(r=this.levelDetails)!=null&&r.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var r,n;e.playbackRate!==t&&((r=this.hls)==null||r.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(n=this.targetLatency)==null?void 0:n.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 K0 extends Ji{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(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this),e.on(v.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this),e.off(v.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 r=this.hls.config.preferManagedMediaSource,n=[],i={},s={};let o=!1,h=!1,c=!1;t.levels.forEach(p=>{var g;const x=p.attrs;let{audioCodec:D,videoCodec:T}=p;D&&(p.audioCodec=D=me(D,r)||void 0),((g=T)==null?void 0:g.indexOf("avc1"))===0&&(T=p.videoCodec=zt(T));const{width:N,height:H,unknownCodecs:_e}=p;let Ue=_e?_e.length:0;if(_e)for(let At=Ue;At--;){const Pt=_e[At];this.isAudioSupported(Pt)?(p.audioCodec=D=D?`${D},${Pt}`:Pt,Ue--,Et.audio[D.substring(0,4)]=2):this.isVideoSupported(Pt)&&(p.videoCodec=T=T?`${T},${Pt}`:Pt,Ue--,Et.video[T.substring(0,4)]=2)}if(o||(o=!!(N&&H)),h||(h=!!T),c||(c=!!D),Ue||D&&!this.isAudioSupported(D)||T&&!this.isVideoSupported(T)){this.log(`Some or all CODECS not supported "${x.CODECS}"`);return}const{CODECS:Re,"FRAME-RATE":Qe,"HDCP-LEVEL":Je,"PATHWAY-ID":ft,RESOLUTION:et,"VIDEO-RANGE":ot}=x,nt=`${`${ft||"."}-`}${p.bitrate}-${et}-${Qe}-${Re}-${ot}-${Je}`;if(i[nt])if(i[nt].uri!==p.url&&!p.attrs["PATHWAY-ID"]){const At=s[nt]+=1;p.attrs["PATHWAY-ID"]=new Array(At+1).join(".");const Pt=this.createLevel(p);i[nt]=Pt,n.push(Pt)}else i[nt].addGroupId("audio",x.AUDIO),i[nt].addGroupId("text",x.SUBTITLES);else{const At=this.createLevel(p);i[nt]=At,s[nt]=1,n.push(At)}}),this.filterAndSortMediaOptions(n,t,o,h,c)}createLevel(e){const t=new Ut(e),r=e.supplemental;if(r!=null&&r.videoCodec&&!this.isVideoSupported(r.videoCodec)){const n=new Error(`SUPPLEMENTAL-CODECS not supported "${r.videoCodec}"`);this.log(n.message),t.supportedResult=Tr(n,[])}return t}isAudioSupported(e){return Ae(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Ae(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,n,i){let s=[],o=[],h=e;if((r||n)&&i&&(h=h.filter(({videoCodec:T,videoRange:N,width:H,height:_e})=>(!!T||!!(H&&_e))&&_n(N))),h.length===0){Promise.resolve().then(()=>{if(this.hls){let T="no level with compatible codecs found in manifest",N=T;t.levels.length&&(N=`one or more CODECS in variant not supported: ${fr(t.levels.map(_e=>_e.attrs.CODECS).filter((_e,Ue,Re)=>Re.indexOf(_e)===Ue))}`,this.warn(N),T+=` (${N})`);const H=new Error(T);this.hls.trigger(v.ERROR,{type:ge.MEDIA_ERROR,details:ne.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:H,reason:N})}});return}t.audioTracks&&(s=t.audioTracks.filter(T=>!T.audioCodec||this.isAudioSupported(T.audioCodec)),Bl(s)),t.subtitles&&(o=t.subtitles,Bl(o));const c=h.slice(0);h.sort((T,N)=>{if(T.attrs["HDCP-LEVEL"]!==N.attrs["HDCP-LEVEL"])return(T.attrs["HDCP-LEVEL"]||"")>(N.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&T.height!==N.height)return T.height-N.height;if(T.frameRate!==N.frameRate)return T.frameRate-N.frameRate;if(T.videoRange!==N.videoRange)return Lr.indexOf(T.videoRange)-Lr.indexOf(N.videoRange);if(T.videoCodec!==N.videoCodec){const H=q(T.videoCodec),_e=q(N.videoCodec);if(H!==_e)return _e-H}if(T.uri===N.uri&&T.codecSet!==N.codecSet){const H=oe(T.codecSet),_e=oe(N.codecSet);if(H!==_e)return _e-H}return T.averageBitrate!==N.averageBitrate?T.averageBitrate-N.averageBitrate:0});let p=c[0];if(this.steering&&(h=this.steering.filterParsedLevels(h),h.length!==c.length)){for(let T=0;T<c.length;T++)if(c[T].pathwayId===h[0].pathwayId){p=c[T];break}}this._levels=h;for(let T=0;T<h.length;T++)if(h[T]===p){var g;this._firstLevel=T;const N=p.bitrate,H=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${h.length} level(s) found, first bitrate: ${N}`),((g=this.hls.userConfig)==null?void 0:g.abrEwmaDefaultEstimate)===void 0){const _e=Math.min(N,this.hls.config.abrEwmaDefaultEstimateMax);_e>H&&H===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=_e)}break}const x=i&&!n,D={levels:h,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:n,altAudio:!x&&s.some(T=>!!T.url)};this.hls.trigger(v.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 p=new Error("invalid level idx"),g=e<0;if(this.hls.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.LEVEL_SWITCH_ERROR,level:e,fatal:g,error:p,reason:p.message}),g)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,n=this.currentLevel,i=n?n.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,r===e&&n&&i===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 ${r}${i?" with Pathway "+i:""}`);const h={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(v.LEVEL_SWITCHING,h);const c=s.details;if(!c||c.live){const p=this.switchParams(s.uri,n==null?void 0:n.details,c);this.loadPlaylist(p)}}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(),r=e.filter(n=>t.indexOf(n)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=r}}onError(e,t){t.fatal||!t.context||t.context.type===we.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===fe.MAIN){const r=t.elementaryStreams;if(!Object.keys(r).some(i=>!!r[i]))return;const n=this._levels[t.level];n!=null&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var r;const{level:n,details:i}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${n}`),(o=t.deliveryDirectives)!=null&&o.skip&&(i.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let h=s.details;h===t.details&&h.advanced&&(h=void 0),this.playlistLoaded(n,t,h)}else(r=t.deliveryDirectives)!=null&&r.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=this.getUrlWithDirectives(e.uri,t),n=this.currentLevelIndex,i=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${n}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${i?" Pathway "+i:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(v.LEVEL_LOADING,{url:r,level:n,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 r=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(o=>o.level=-1)),!1));ws(r),this._levels=r,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 n=r.length-1;this._firstLevel=Math.min(this._firstLevel,n),this._startLevel&&(this._startLevel=Math.min(this._startLevel,n)),this.hls.trigger(v.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:r}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(v.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}function Bl(a){const e={};a.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function Nl(){return self.SourceBuffer||self.WebKitSourceBuffer}function Ul(){if(!xe())return!1;const e=Nl();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function V0(){if(!Ul())return!1;const a=xe();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(B(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(B(e,"audio"))))}function W0(){var a;const e=Nl();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Y0=100;class q0 extends Vs{constructor(e,t,r){super(e,t,r,"stream-controller",fe.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 n=this.media,i=n?n.currentTime:null;if(i===null||!F(i)||(this.log(`Media seeked to ${i.toFixed(3)}`),!this.getBufferedFrag(i)))return;const s=this.getFwdBufferInfoAtPos(n,i,fe.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${i} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(v.MANIFEST_PARSED,this.onManifestParsed,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.LEVEL_LOADED,this.onLevelLoaded,this),e.on(v.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(v.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(v.BUFFER_CREATED,this.onBufferCreated,this),e.on(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(v.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(v.MANIFEST_PARSED,this.onManifestParsed,this),e.off(v.LEVEL_LOADED,this.onLevelLoaded,this),e.off(v.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(v.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(v.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(v.BUFFER_CREATED,this.onBufferCreated,this),e.off(v.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(v.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:r,hls:n}=this;if(this.stopLoad(),this.setInterval(Y0),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this._hasEnoughToStart=!!t}r>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=yt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=yt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case yt.WAITING_LEVEL:{const{levels:t,level:r}=this,n=t==null?void 0:t[r],i=n==null?void 0:n.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=yt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=yt.IDLE;break}break}case yt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),r=this.retryDate;if(!r||t>=r||(e=this.media)!=null&&e.seeking){const{levels:n,level:i}=this,s=n==null?void 0:n[i];this.resetStartWhenNotLoaded(s||null),this.state=yt.IDLE}}break}this.state===yt.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:r,media:n}=this;if(t===null||!n&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(r!=null&&r[i]))return;const s=r[i],o=this.getMainFwdBufferInfo();if(o===null)return;const h=this.getLevelDetails();if(h&&this._streamEnded(o,h)){const N={};this.altAudio===2&&(N.type="video"),this.hls.trigger(v.BUFFER_EOS,N),this.state=yt.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const c=s.details;if(!c||this.state===yt.WAITING_LEVEL||this.waitForLive(s)){this.level=i,this.state=yt.WAITING_LEVEL,this.startFragRequested=!1;return}const p=o.len,g=this.getMaxBufferLength(s.maxBitrate);if(p>=g)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const x=this.backtrackFragment?this.backtrackFragment.start:o.end;let D=this.getNextFragment(x,c);if(this.couldBacktrack&&!this.fragPrevious&&D&&ce(D)&&this.fragmentTracker.getState(D)!==Br.OK){var T;const H=((T=this.backtrackFragment)!=null?T:D).sn-c.startSN,_e=c.fragments[H-1];_e&&D.cc===_e.cc&&(D=_e,this.fragmentTracker.removeFragment(_e))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(D&&this.isLoopLoading(D,x)){if(!D.gap){const H=this.audioOnly&&!this.altAudio?E.AUDIO:E.VIDEO,_e=(H===E.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;_e&&this.afterBufferFlushed(_e,H,fe.MAIN)}D=this.getNextFragmentLoopLoading(D,c,o,fe.MAIN,g)}D&&(D.initSegment&&!D.initSegment.data&&!this.bitrateTest&&(D=D.initSegment),this.loadFragment(D,s,x))}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);n===Br.NOT_LOADED||n===Br.PARTIAL?ce(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,r):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,fe.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 r;const n=this.getAppendedFrag(t.currentTime);n&&n.start>1&&this.flushMainBuffer(0,n.start-1);const i=this.getLevelDetails();if(i!=null&&i.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<i.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,h=e[o],c=this.fragLastKbps;c&&this.fragCurrent?r=this.fragCurrent.duration*h.maxBitrate/(1e3*c)+1:r=0}else r=0;const s=this.getBufferedFrag(t.currentTime+r);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const h=o.maxStartPTS?o.maxStartPTS:o.start,c=o.duration,p=Math.max(s.end,h+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,c*(this.couldBacktrack?.5:.125)),c*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(p,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 yt.KEY_LOADING:case yt.FRAG_LOADING:case yt.FRAG_LOADING_WAITING_RETRY:case yt.PARSING:case yt.PARSED:this.state=yt.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 r=t.media;zi(r,"playing",this.onMediaPlaying),zi(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(Ri(r,"playing",this.onMediaPlaying),Ri(r,"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(v.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 r=!1,n=!1;t.levels.forEach(i=>{const s=i.audioCodec;s&&(r=r||s.indexOf("mp4a.40.2")!==-1,n=n||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=r&&n&&!W0(),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:r}=this;if(!r||this.state!==yt.IDLE)return;const n=t.levelInfo;(!n.details||n.details.live&&(this.levelLastLoaded!==n||n.details.expired)||this.waitForCdnTuneIn(n.details))&&(this.state=yt.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:n,startFragRequested:i}=this,s=t.level,o=t.details,h=o.totalduration;if(!n){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:${h}`);const c=t.levelInfo,p=this.fragCurrent;p&&(this.state===yt.FRAG_LOADING||this.state===yt.FRAG_LOADING_WAITING_RETRY)&&p.level!==t.level&&p.loader&&this.abortCurrentFrag();let g=0;if(o.live||(r=c.details)!=null&&r.live){var x;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;g=this.alignPlaylists(o,c.details,(x=this.levelLastLoaded)==null?void 0:x.details)}if(c.details=o,this.levelLastLoaded=c,i||this.setStartPosition(o,g),this.hls.trigger(v.LEVEL_UPDATED,{details:o,level:s}),this.state===yt.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=yt.IDLE}i&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const n=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,h=i>=s-t.maxFragLookUpTolerance&&i<=o;if(n!==null&&r.duration>n&&(i<n||!h)){const c=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!h&&r.readyState<4||i<o-c)&&(this._hasEnoughToStart||(this.nextLoadPosition=n),r.readyState&&(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${n.toFixed(3)}`),r.currentTime=n))}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const o=s[r.level];if(!o){this.warn(`Level ${r.level} not found on progress`);return}const h=o.details;if(!h){this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),this.fragmentTracker.removeFragment(r);return}const c=o.videoCodec,p=h.PTSKnown||!h.live,g=(t=r.initSegment)==null?void 0:t.data,x=this._getAudioCodec(o),D=this.transmuxer=this.transmuxer||new la(this.hls,fe.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),T=n?n.index:-1,N=T!==-1,H=new Wn(r.level,r.sn,r.stats.chunkCount,i.byteLength,T,N),_e=this.initPTS[r.cc];D.push(i,g,x,c,r,n,h.totalduration,p,H,_e)}onAudioTrackSwitching(e,t){const r=this.hls,n=this.altAudio===2;if(Dr(t.url,r))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(n){this.fragmentTracker.removeAllFragments(),r.once(v.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(v.AUDIO_TRACK_SWITCHED,t)}),r.trigger(v.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}r.trigger(v.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=Dr(t.url,this.hls);if(r){const n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r?2:0,this.tick()}onBufferCreated(e,t){const r=t.tracks;let n,i,s=!1;for(const o in r){const h=r[o];if(h.id==="main"){if(i=o,n=h,o==="video"){const c=r[o];c&&(this.videoBuffer=c.buffer)}}else s=!0}s&&n?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:n}=t,i=r.type===fe.MAIN;if(i){if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),this.state===yt.PARSED&&(this.state=yt.IDLE);return}const o=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),ce(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}const s=this.media;s&&(!this._hasEnoughToStart&&er.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal){this.state=yt.ERROR;return}switch(t.details){case ne.FRAG_GAP:case ne.FRAG_PARSING_ERROR:case ne.FRAG_DECRYPT_ERROR:case ne.FRAG_LOAD_ERROR:case ne.FRAG_LOAD_TIMEOUT:case ne.KEY_LOAD_ERROR:case ne.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(fe.MAIN,t);break;case ne.LEVEL_LOAD_ERROR:case ne.LEVEL_LOAD_TIMEOUT:case ne.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===yt.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===we.LEVEL&&(this.state=yt.IDLE);break;case ne.BUFFER_ADD_CODEC_ERROR:case ne.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case ne.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case ne.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=yt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==E.AUDIO||!this.altAudio){const r=(t===E.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,fe.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 r=this.startPosition;if(r>=0&&t<r){if(e.seeking){this.log(`could not seek to ${r}, already seeking at ${t}`);return}const n=this.timelineOffset;n&&r&&(r+=n);const i=this.getLevelDetails(),s=er.getBuffered(e),o=s.length?s.start(0):0,h=o-r,c=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);h>0&&(h<c||this.loadingParts&&h<2*((i==null?void 0:i.partTarget)||0))&&(this.log(`adjusting start position by ${h} to match buffer start`),r+=h,this.startPosition=r),t<r&&(this.log(`seek to target start position ${r} from current time ${t} buffer start ${o}`),e.currentTime=r)}}_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(r=>{const{hls:n}=this,i=r==null?void 0:r.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=yt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=i.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),n.trigger(v.FRAG_LOADED,r),i.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const r=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:h,part:c,level:p}=o,{video:g,text:x,id3:D,initSegment:T}=i,{details:N}=p,H=this.altAudio?void 0:i.audio;if(this.fragContextChanged(h)){this.fragmentTracker.removeFragment(h);return}if(this.state=yt.PARSING,T){if(T!=null&&T.tracks){const Re=h.initSegment||h;this._bufferInitSegment(p,T.tracks,Re,s),n.trigger(v.FRAG_PARSING_INIT_SEGMENT,{frag:Re,id:r,tracks:T.tracks})}const _e=T.initPTS,Ue=T.timescale;F(_e)&&(this.initPTS[h.cc]={baseTime:_e,timescale:Ue},n.trigger(v.INIT_PTS_FOUND,{frag:h,id:r,initPTS:_e,timescale:Ue}))}if(g&&N){const _e=N.fragments[h.sn-1-N.startSN],Ue=h.sn===N.startSN,Re=!_e||h.cc>_e.cc;if(i.independent!==!1){const{startPTS:Qe,endPTS:Je,startDTS:ft,endDTS:et}=g;if(c)c.elementaryStreams[g.type]={startPTS:Qe,endPTS:Je,startDTS:ft,endDTS:et};else if(g.firstKeyFrame&&g.independent&&s.id===1&&!Re&&(this.couldBacktrack=!0),g.dropped&&g.independent){const ot=this.getMainFwdBufferInfo(),_t=(ot?ot.end:this.getLoadPosition())+this.config.maxBufferHole,nt=g.firstKeyFramePTS?g.firstKeyFramePTS:Qe;if(!Ue&&_t<nt-this.config.maxBufferHole&&!Re){this.backtrack(h);return}else Re&&(h.gap=!0);h.setElementaryStreamInfo(g.type,h.start,Je,h.start,et,!0)}else Ue&&Qe-(N.appliedTimelineOffset||0)>ao&&(h.gap=!0);h.setElementaryStreamInfo(g.type,Qe,Je,ft,et),this.backtrackFragment&&(this.backtrackFragment=h),this.bufferFragmentData(g,h,c,s,Ue||Re)}else if(Ue||Re)h.gap=!0;else{this.backtrack(h);return}}if(H){const{startPTS:_e,endPTS:Ue,startDTS:Re,endDTS:Qe}=H;c&&(c.elementaryStreams[E.AUDIO]={startPTS:_e,endPTS:Ue,startDTS:Re,endDTS:Qe}),h.setElementaryStreamInfo(E.AUDIO,_e,Ue,Re,Qe),this.bufferFragmentData(H,h,c,s)}if(N&&D!=null&&(t=D.samples)!=null&&t.length){const _e={id:r,frag:h,details:N,samples:D.samples};n.trigger(v.FRAG_PARSING_METADATA,_e)}if(N&&x){const _e={id:r,frag:h,details:N,samples:x.samples};n.trigger(v.FRAG_PARSING_USERDATA,_e)}}_bufferInitSegment(e,t,r,n){if(this.state!==yt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:i,video:s,audiovideo:o}=t;if(i){let c=Mt(i.codec,e.audioCodec);c==="mp4a"&&(c="mp4a.40.5");const p=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){c&&(c.indexOf("mp4a.40.5")!==-1?c="mp4a.40.2":c="mp4a.40.5");const g=i.metadata;g&&"channelCount"in g&&(g.channelCount||1)!==1&&p.indexOf("firefox")===-1&&(c="mp4a.40.5")}c&&c.indexOf("mp4a.40.5")!==-1&&p.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(c="mp4a.40.2",this.log(`Android: force audio codec to ${c}`)),e.audioCodec&&e.audioCodec!==c&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${c}"`),i.levelCodec=c,i.id=fe.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${c||""}/${e.audioCodec||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=fe.MAIN;const c=s.codec;if((c==null?void 0:c.length)===4)switch(c){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||""}/${c}]${s.codec!==c?" 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 h=Object.keys(t);if(h.length){if(this.hls.trigger(v.BUFFER_CODECS,t),!this.hls)return;h.forEach(c=>{const g=t[c].initSegment;g!=null&&g.byteLength&&this.hls.trigger(v.BUFFER_APPENDING,{type:c,data:g,frag:r,part:null,chunkMeta:n,parent:r.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,fe.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,r=e==null?void 0:e[t];return r?this.getMaxBufferLength(r.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=yt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(er.isBuffered(e,r)?t=this.getAppendedFrag(r):er.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const n=this.fragPlaying,i=t.level;(!n||t.sn!==n.sn||n.level!==i)&&(this.fragPlaying=t,this.hls.trigger(v.FRAG_CHANGED,{frag:t}),(!n||n.level!==i)&&this.hls.trigger(v.LEVEL_SWITCHED,{level:i}))}}}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 F(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(F(t)){const r=this.getLevelDetails(),n=this.currentFrag||(r?ur(null,r.fragments,t):null);if(n){const i=n.programDateTime;if(i!==null){const s=i+(t-n.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 Z0{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyUriToKeyInfo){const n=this.keyUriToKeyInfo[r].loader;if(n){var t;if(e&&e!==((t=n.context)==null?void 0:t.frag.type))return;n.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=ne.KEY_LOAD_ERROR,r,n,i){return new En({type:ge.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:r,networkDetails:n})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:r,cc:n}=e;for(let i=0;i<t.length;i++){const s=t[i];if(n<=s.cc&&(r==="initSegment"||s.sn==="initSegment"||r<s.sn)){this.emeController.selectKeySystemFormat(s).then(o=>{s.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,n;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const c=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,ne.KEY_LOAD_ERROR,c))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,ne.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let o=this.keyUriToKeyInfo[s];if((r=o)!=null&&r.decryptdata.key)return i.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((n=o)!=null&&n.keyLoadPromise){var h;switch((h=o.mediaKeySessionContext)==null?void 0:h.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(i.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.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,ne.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const n=this.emeController.loadKey(r);if(n)return(e.keyLoadPromise=n.then(i=>(e.mediaKeySessionContext=i,r))).catch(i=>{throw e.keyLoadPromise=null,i})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,n=r.loader,i=new n(r);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((s,o)=>{const h={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=r.keyLoadPolicy.default,p={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},g={onSuccess:(x,D,T,N)=>{const{frag:H,keyInfo:_e,url:Ue}=T;if(!H.decryptdata||_e!==this.keyUriToKeyInfo[Ue])return o(this.createKeyLoadError(H,ne.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),N));_e.decryptdata.key=H.decryptdata.key=new Uint8Array(x.data),H.keyLoader=null,_e.loader=null,s({frag:H,keyInfo:_e})},onError:(x,D,T,N)=>{this.resetLoader(D),o(this.createKeyLoadError(t,ne.KEY_LOAD_ERROR,new Error(`HTTP Error ${x.code} loading key ${x.text}`),T,A({url:h.url,data:void 0},x)))},onTimeout:(x,D,T)=>{this.resetLoader(D),o(this.createKeyLoadError(t,ne.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),T))},onAbort:(x,D,T)=>{this.resetLoader(D),o(this.createKeyLoadError(t,ne.INTERNAL_ABORTED,new Error("key loading aborted"),T))}};i.load(h,p,g)})}resetLoader(e){const{frag:t,keyInfo:r,url:n}=e,i=r.loader;t.keyLoader===i&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[n],i&&i.destroy()}}function $l(a){const{type:e}=a;switch(e){case we.AUDIO_TRACK:return fe.AUDIO;case we.SUBTITLE_TRACK:return fe.SUBTITLE;default:return fe.MAIN}}function Yo(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class X0{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(v.MANIFEST_LOADING,this.onManifestLoading,this),e.on(v.LEVEL_LOADING,this.onLevelLoading,this),e.on(v.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(v.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(v.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(v.MANIFEST_LOADING,this.onManifestLoading,this),e.off(v.LEVEL_LOADING,this.onLevelLoading,this),e.off(v.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(v.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(v.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,n=t.loader,i=r||n,s=new i(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:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:we.MANIFEST,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:n,pathwayId:i,url:s,deliveryDirectives:o,levelInfo:h}=t;this.load({id:r,level:n,pathwayId:i,responseType:"text",type:we.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:h})}onAudioTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:o}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:we.AUDIO_TRACK,url:i,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:o}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:we.SUBTITLE_TRACK,url:i,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const r=this.loaders[we.LEVEL];if(r){const n=r.context;n&&!t.levels.some(i=>i===n.levelOrTrack)&&(r.abort(),delete this.loaders[we.LEVEL])}}load(e){var t;const r=this.hls.config;let n=this.getInternalLoader(e);if(n){const c=this.hls.logger,p=n.context;if(p&&p.levelOrTrack===e.levelOrTrack&&(p.url===e.url||p.deliveryDirectives&&!e.deliveryDirectives)){p.url===e.url?c.log(`[playlist-loader]: ignore ${e.url} ongoing request`):c.log(`[playlist-loader]: ignore ${e.url} in favor of ${p.url}`);return}c.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}let i;if(e.type===we.MANIFEST?i=r.manifestLoadPolicy.default:i=b({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),F((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===we.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===we.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===we.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const p=c.partTarget,g=c.targetduration;if(p&&g){const x=Math.max(p*3,g*.8)*1e3;i=b({},i,{maxTimeToFirstByteMs:Math.min(x,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(x,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},o={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},h={onSuccess:(c,p,g,x)=>{const D=this.getInternalLoader(g);this.resetInternalLoader(g.type);const T=c.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,g,new Error("no EXTM3U delimiter"),x||null,p);return}p.parsing.start=performance.now(),qn.isMediaPlaylist(T)||g.type!==we.MANIFEST?this.handleTrackOrLevelPlaylist(c,p,g,x||null,D):this.handleMasterPlaylist(c,p,g,x)},onError:(c,p,g,x)=>{this.handleNetworkError(p,g,!1,c,x)},onTimeout:(c,p,g)=>{this.handleNetworkError(p,g,!0,void 0,c)}};n.load(e,o,h)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:r}=this.hls;(e||r)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,r,n){const i=this.hls,s=e.data,o=Yo(e,r),h=qn.parseMasterPlaylist(s,o);if(h.playlistParsingError){this.handleManifestParsingError(e,r,h.playlistParsingError,n,t);return}const{contentSteering:c,levels:p,sessionData:g,sessionKeys:x,startTimeOffset:D,variableList:T}=h;this.variableList=T;const{AUDIO:N=[],SUBTITLES:H,"CLOSED-CAPTIONS":_e}=qn.parseMasterPlaylistMedia(s,o,h);N.length&&!N.some(Re=>!Re.url)&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),N.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new pr({}),bitrate:0,url:""})),i.trigger(v.MANIFEST_LOADED,{levels:p,audioTracks:N,subtitles:H,captions:_e,contentSteering:c,url:o,stats:t,networkDetails:n,sessionData:g,sessionKeys:x,startTimeOffset:D,variableList:T})}handleTrackOrLevelPlaylist(e,t,r,n,i){const s=this.hls,{id:o,level:h,type:c}=r,p=Yo(e,r),g=F(h)?h:F(o)?o:0,x=$l(r),D=qn.parseLevelPlaylist(e.data,p,g,x,0,this.variableList);if(c===we.MANIFEST){const T={attrs:new pr({}),bitrate:0,details:D,name:"",url:p};D.requestScheduled=t.loading.start+wa(D,0),s.trigger(v.MANIFEST_LOADED,{levels:[T],audioTracks:[],url:p,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=D,this.handlePlaylistLoaded(D,e,t,r,n,i)}handleManifestParsingError(e,t,r,n,i){this.hls.trigger(v.ERROR,{type:ge.NETWORK_ERROR,details:ne.MANIFEST_PARSING_ERROR,fatal:t.type===we.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:n,stats:i})}handleNetworkError(e,t,r=!1,n,i){let s=`A network ${r?"timeout":"error"+(n?" (status "+n.code+")":"")} occurred while loading ${e.type}`;e.type===we.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===we.AUDIO_TRACK||e.type===we.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let h=ne.UNKNOWN,c=!1;const p=this.getInternalLoader(e);switch(e.type){case we.MANIFEST:h=r?ne.MANIFEST_LOAD_TIMEOUT:ne.MANIFEST_LOAD_ERROR,c=!0;break;case we.LEVEL:h=r?ne.LEVEL_LOAD_TIMEOUT:ne.LEVEL_LOAD_ERROR,c=!1;break;case we.AUDIO_TRACK:h=r?ne.AUDIO_TRACK_LOAD_TIMEOUT:ne.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case we.SUBTITLE_TRACK:h=r?ne.SUBTITLE_TRACK_LOAD_TIMEOUT:ne.SUBTITLE_LOAD_ERROR,c=!1;break}p&&this.resetInternalLoader(e.type);const g={type:ge.NETWORK_ERROR,details:h,fatal:c,url:e.url,loader:p,context:e,error:o,networkDetails:t,stats:i};if(n){const x=(t==null?void 0:t.url)||e.url;g.response=A({url:x,data:void 0},n)}this.hls.trigger(v.ERROR,g)}handlePlaylistLoaded(e,t,r,n,i,s){const o=this.hls,{type:h,level:c,id:p,groupId:g,deliveryDirectives:x}=n,D=Yo(t,n),T=$l(n),N=typeof n.level=="number"&&T===fe.MAIN?c:void 0;if(!e.fragments.length){const _e=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(v.ERROR,{type:ge.NETWORK_ERROR,details:ne.LEVEL_EMPTY_ERROR,fatal:!1,url:D,error:_e,reason:_e.message,response:t,context:n,level:N,parent:T,networkDetails:i,stats:r});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const H=e.playlistParsingError;if(H){if(this.hls.logger.warn(H),!o.config.ignorePlaylistParsingErrors){o.trigger(v.ERROR,{type:ge.NETWORK_ERROR,details:ne.LEVEL_PARSING_ERROR,fatal:!1,url:D,error:H,reason:H.message,response:t,context:n,level:N,parent:T,networkDetails:i,stats:r});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),h){case we.MANIFEST:case we.LEVEL:o.trigger(v.LEVEL_LOADED,{details:e,levelInfo:n.levelOrTrack||o.levels[0],level:N||0,id:p||0,stats:r,networkDetails:i,deliveryDirectives:x,withoutMultiVariant:h===we.MANIFEST});break;case we.AUDIO_TRACK:o.trigger(v.AUDIO_TRACK_LOADED,{details:e,track:n.levelOrTrack,id:p||0,groupId:g||"",stats:r,networkDetails:i,deliveryDirectives:x});break;case we.SUBTITLE_TRACK:o.trigger(v.SUBTITLE_TRACK_LOADED,{details:e,track:n.levelOrTrack,id:p||0,groupId:g||"",stats:r,networkDetails:i,deliveryDirectives:x});break}}}class ts{static get version(){return Wi}static isMSESupported(){return Ul()}static isSupported(){return V0()}static getMediaSource(){return xe()}static get Events(){return v}static get MetadataSchema(){return In}static get ErrorTypes(){return ge}static get ErrorDetails(){return ne}static get DefaultConfig(){return ts.defaultConfig?ts.defaultConfig:P0}static set DefaultConfig(e){ts.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Ds,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=Ie(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=M0(ts.DefaultConfig,e,t);this.userConfig=e,r.progressive&&F0(r,t);const{abrController:n,bufferController:i,capLevelController:s,errorController:o,fpsController:h}=r,c=new o(this),p=this.abrController=new n(this),g=new xi(this),x=r.interstitialsController,D=x?this.interstitialsController=new x(this,ts):null,T=this.bufferController=new i(this,g),N=this.capLevelController=new s(this),H=new h(this),_e=new X0(this),Ue=r.contentSteeringController,Re=Ue?new Ue(this):null,Qe=this.levelController=new K0(this,Re),Je=new j0(this),ft=new Z0(this.config),et=this.streamController=new q0(this,g,ft),ot=this.gapController=new $0(this,g);N.setStreamController(et),H.setStreamController(et);const _t=[_e,Qe,et];D&&_t.splice(1,0,D),Re&&_t.splice(1,0,Re),this.networkControllers=_t;const nt=[p,T,ot,N,H,Je,g];this.audioTrackController=this.createController(r.audioTrackController,_t);const At=r.audioStreamController;At&&_t.push(this.audioStreamController=new At(this,g,ft)),this.subtitleTrackController=this.createController(r.subtitleTrackController,_t);const Pt=r.subtitleStreamController;Pt&&_t.push(this.subtititleStreamController=new Pt(this,g,ft)),this.createController(r.timelineController,nt),ft.emeController=this.emeController=this.createController(r.emeController,nt),this.cmcdController=this.createController(r.cmcdController,nt),this.latencyController=this.createController(H0,nt),this.coreComponents=nt,_t.push(c);const br=c.onErrorOut;typeof br=="function"&&this.on(v.ERROR,br,c),this.on(v.MANIFEST_LOADED,_e.onManifestLoaded,_e)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,n){this._emitter.off(e,t,r,n)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),!this.triggeringException){this.triggeringException=!0;const n=e===v.ERROR;this.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.INTERNAL_EXCEPTION,fatal:n,event:e,error:r}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(v.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 i=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(v.ERROR,{type:ge.OTHER_ERROR,details:ne.ATTACH_MEDIA_ERROR,fatal:!0,error:i});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,r=t?e.media:e,n=t?e:{media:r};this._media=r,this.trigger(v.MEDIA_ATTACHING,n)}detachMedia(){this.logger.log("detachMedia"),this.trigger(v.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(v.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,r=this._url,n=this._url=ae.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${n}`),t&&r&&(r!==n||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(v.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 r=0;r<this.networkControllers.length&&(this.networkControllers[r].startLoad(e,t),!(!this.started||!this.networkControllers));r++);}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={[fe.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[fe.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[fe.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=$a()),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){Zr(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 r=e.length;for(let n=0;n<r;n++)if(e[n].maxBitrate>=t)return n;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let n;if(t===-1&&e!=null&&e.length?n=e.length-1:n=t,r)for(let i=n;i--;){const s=e[i].attrs["HDCP-LEVEL"];if(s&&s<=r)return i}return n}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 r=Rr(t);return It(e,r,navigator.mediaCapabilities)}}ts.defaultConfig=void 0}}]);
|
|
}()); |