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.
NewEduCoderBuild/p__knowledgegraph__Detail__...

1 line
1.8 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self.webpackChunk=self.webpackChunk||[]).push([[2524],{65030:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var i=n(33885),r=n(42978),a=n(75931),s=n(43403),o=n(92310),l=n.n(o),u=n(29301),c=n(76846),h=n(96452),d=n(6089),f=n(80402),p=n(34280),m=n(49658),g=n(59301),_=n(54476),v=n(77900),y=n(8654);function b(e){var t=e.prefixCls,n=e.align,i=e.arrow,r=e.arrowPos,a=i||{},s=a.className,o=a.content,u=r.x,c=void 0===u?0:u,h=r.y,d=void 0===h?0:h,f=g.useRef();if(!n||!n.points)return null;var p={position:"absolute"};if(!1!==n.autoArrow){var m=n.points[0],_=n.points[1],v=m[0],y=m[1],b=_[0],x=_[1];v!==b&&["t","b"].includes(v)?"t"===v?p.top=0:p.bottom=0:p.top=d,y!==x&&["l","r"].includes(y)?"l"===y?p.left=0:p.right=0:p.left=c}return g.createElement("div",{ref:f,className:l()("".concat(t,"-arrow"),s),style:p},o)}function x(e){var t=e.prefixCls,n=e.open,i=e.zIndex,r=e.mask,a=e.motion;return r?g.createElement(v.default,(0,_.Z)({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),(function(e){var n=e.className;return g.createElement("div",{style:{zIndex:i},className:l()("".concat(t,"-mask"),n)})})):null}var E=g.memo((function(e){return e.children}),(function(e,t){return t.cache}));var w=g.forwardRef((function(e,t){var n=e.popup,a=e.className,s=e.prefixCls,o=e.style,c=e.target,h=e.onVisibleChanged,d=e.open,f=e.keepDom,m=e.fresh,w=e.onClick,T=e.mask,S=e.arrow,A=e.arrowPos,C=e.align,L=e.motion,R=e.maskMotion,I=e.forceRender,D=e.getPopupContainer,k=e.autoDestroy,M=e.portal,P=e.zIndex,O=e.onMouseEnter,N=e.onMouseLeave,F=e.onPointerEnter,B=e.onPointerDownCapture,U=e.ready,G=e.offsetX,z=e.offsetY,j=e.offsetR,H=e.offsetB,V=e.onAlign,W=e.onPrepare,Z=e.stretch,K=e.targetWidth,q=e.targetHeight,X="function"==typeof n?n():n,Y=d||f,Q=(null==D?void 0:D.length)>0,$=g.useState(!D||!Q),J=(0,r.Z)($,2),ee=J[0],te=J[1];if((0,p.Z)((function(){!ee&&Q&&c&&te(!0)}),[ee,Q,c]),!ee)return null;var ne="auto",ie={left:"-1000vw",top:"-1000vh",right:ne,bottom:ne};if(U||!d){var re,ae=C.points,se=C.dynamicInset||(null===(re=C._experimental)||void 0===re?void 0:re.dynamicInset),oe=se&&"r"===ae[0][1],le=se&&"b"===ae[0][0];oe?(ie.right=j,ie.left=ne):(ie.left=G,ie.right=ne),le?(ie.bottom=H,ie.top=ne):(ie.top=z,ie.bottom=ne)}var ue={};return Z&&(Z.includes("height")&&q?ue.height=q:Z.includes("minHeight")&&q&&(ue.minHeight=q),Z.includes("width")&&K?ue.width=K:Z.includes("minWidth")&&K&&(ue.minWidth=K)),d||(ue.pointerEvents="none"),g.createElement(M,{open:I||Y,getContainer:D&&function(){return D(c)},autoDestroy:k},g.createElement(x,{prefixCls:s,open:d,zIndex:P,mask:T,motion:R}),g.createElement(u.Z,{onResize:V,disabled:!d},(function(e){return g.createElement(v.default,(0,_.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:I,leavedClassName:"".concat(s,"-hidden")},L,{onAppearPrepare:W,onEnterPrepare:W,visible:d,onVisibleChanged:function(e){var t;null==L||null===(t=L.onVisibleChanged)||void 0===t||t.call(L,e),h(e)}}),(function(n,r){var u=n.className,c=n.style,h=l()(s,u,a);return g.createElement("div",{ref:(0,y.sQ)(e,t,r),className:h,style:(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({"--arrow-x":"".concat(A.x||0,"px"),"--arrow-y":"".concat(A.y||0,"px")},ie),ue),c),{},{boxSizing:"border-box",zIndex:P},o),onMouseEnter:O,onMouseLeave:N,onPointerEnter:F,onClick:w,onPointerDownCapture:B},S&&g.createElement(b,{prefixCls:s,arrow:S,arrowPos:A,align:C}),g.createElement(E,{cache:!d&&!m},X))}))})))}));var T=g.forwardRef((function(e,t){var n=e.children,i=e.getTriggerDOMNode,r=(0,y.Yr)(n),a=g.useCallback((function(e){(0,y.mH)(t,i?i(e):e)}),[i]),s=(0,y.x1)(a,(0,y.C4)(n));return r?g.cloneElement(n,{ref:s}):n})),S=g.createContext(null);function A(e){return e?Array.isArray(e)?e:[e]:[]}function C(e,t,n,i){return g.useMemo((function(){var r=A(null!=n?n:t),a=A(null!=i?i:t),s=new Set(r),o=new Set(a);return e&&(s.has("hover")&&(s.delete("hover"),s.add("click")),o.has("hover")&&(o.delete("hover"),o.add("click"))),[s,o]}),[e,t,n,i])}var L=n(29194);function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function I(e,t,n,i){for(var r=n.points,a=Object.keys(e),s=0;s<a.length;s+=1){var o,l=a[s];if(R(null===(o=e[l])||void 0===o?void 0:o.points,r,i))return"".concat(t,"-placement-").concat(l)}return""}function D(e,t,n,i){return t||(n?{motionName:"".concat(e,"-").concat(n)}:i?{motionName:i}:null)}function k(e){return e.ownerDocument.defaultView}function M(e){for(var t=[],n=null==e?void 0:e.parentElement,i=["hidden","scroll","clip","auto"];n;){var r=k(n).getComputedStyle(n);[r.overflowX,r.overflowY,r.overflow].some((function(e){return i.includes(e)}))&&t.push(n),n=n.parentElement}return t}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function O(e){return P(parseFloat(e),0)}function N(e,t){var n=(0,i.Z)({},e);return(t||[]).forEach((function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=k(e).getComputedStyle(e),i=t.overflow,r=t.overflowClipMargin,a=t.borderTopWidth,s=t.borderBottomWidth,o=t.borderLeftWidth,l=t.borderRightWidth,u=e.getBoundingClientRect(),c=e.offsetHeight,h=e.clientHeight,d=e.offsetWidth,f=e.clientWidth,p=O(a),m=O(s),g=O(o),_=O(l),v=P(Math.round(u.width/d*1e3)/1e3),y=P(Math.round(u.height/c*1e3)/1e3),b=(d-f-g-_)*v,x=(c-h-p-m)*y,E=p*y,w=m*y,T=g*v,S=_*v,A=0,C=0;if("clip"===i){var L=O(r);A=L*v,C=L*y}var R=u.x+T-A,I=u.y+E-C,D=R+u.width+2*A-T-S-b,M=I+u.height+2*C-E-w-x;n.left=Math.max(n.left,R),n.top=Math.max(n.top,I),n.right=Math.min(n.right,D),n.bottom=Math.min(n.bottom,M)}})),n}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="".concat(t),i=n.match(/^(.*)\%$/);return i?e*(parseFloat(i[1])/100):parseFloat(n)}function B(e,t){var n=t||[],i=(0,r.Z)(n,2),a=i[0],s=i[1];return[F(e.width,a),F(e.height,s)]}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function G(e,t){var n,i=t[0],r=t[1];return n="t"===i?e.y:"b"===i?e.y+e.height:e.y+e.height/2,{x:"l"===r?e.x:"r"===r?e.x+e.width:e.x+e.width/2,y:n}}function z(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map((function(e,i){return i===t?n[e]||"c":e})).join("")}function j(e,t,n,a,s,o,l){var u=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:s[a]||{}}),h=(0,r.Z)(u,2),f=h[0],m=h[1],_=g.useRef(0),v=g.useMemo((function(){return t?M(t):[]}),[t]),y=g.useRef({});e||(y.current={});var b=(0,d.Z)((function(){if(t&&n&&e){var u,h,d,f,p,g=t,_=g.ownerDocument,b=k(g),x=b.getComputedStyle(g).position,E=g.style.left,w=g.style.top,T=g.style.right,S=g.style.bottom,A=g.style.overflow,C=(0,i.Z)((0,i.Z)({},s[a]),o),R=_.createElement("div");if(null===(u=g.parentElement)||void 0===u||u.appendChild(R),R.style.left="".concat(g.offsetLeft,"px"),R.style.top="".concat(g.offsetTop,"px"),R.style.position=x,R.style.height="".concat(g.offsetHeight,"px"),R.style.width="".concat(g.offsetWidth,"px"),g.style.left="0",g.style.top="0",g.style.right="auto",g.style.bottom="auto",g.style.overflow="hidden",Array.isArray(n))p={x:n[0],y:n[1],width:0,height:0};else{var I,D,M=n.getBoundingClientRect();M.x=null!==(I=M.x)&&void 0!==I?I:M.left,M.y=null!==(D=M.y)&&void 0!==D?D:M.top,p={x:M.x,y:M.y,width:M.width,height:M.height}}var O=g.getBoundingClientRect(),F=b.getComputedStyle(g),j=F.height,H=F.width;O.x=null!==(h=O.x)&&void 0!==h?h:O.left,O.y=null!==(d=O.y)&&void 0!==d?d:O.top;var V=_.documentElement,W=V.clientWidth,Z=V.clientHeight,K=V.scrollWidth,q=V.scrollHeight,X=V.scrollTop,Y=V.scrollLeft,Q=O.height,$=O.width,J=p.height,ee=p.width,te={left:0,top:0,right:W,bottom:Z},ne={left:-Y,top:-X,right:K-Y,bottom:q-X},ie=C.htmlRegion,re="visible",ae="visibleFirst";"scroll"!==ie&&ie!==ae&&(ie=re);var se=ie===ae,oe=N(ne,v),le=N(te,v),ue=ie===re?le:oe,ce=se?le:ue;g.style.left="auto",g.style.top="auto",g.style.right="0",g.style.bottom="0";var he=g.getBoundingClientRect();g.style.left=E,g.style.top=w,g.style.right=T,g.style.bottom=S,g.style.overflow=A,null===(f=g.parentElement)||void 0===f||f.removeChild(R);var de=P(Math.round($/parseFloat(H)*1e3)/1e3),fe=P(Math.round(Q/parseFloat(j)*1e3)/1e3);if(0===de||0===fe||(0,c.Sh)(n)&&!(0,L.Z)(n))return;var pe=C.offset,me=C.targetOffset,ge=B(O,pe),_e=(0,r.Z)(ge,2),ve=_e[0],ye=_e[1],be=B(p,me),xe=(0,r.Z)(be,2),Ee=xe[0],we=xe[1];p.x-=Ee,p.y-=we;var Te=C.points||[],Se=(0,r.Z)(Te,2),Ae=Se[0],Ce=U(Se[1]),Le=U(Ae),Re=G(p,Ce),Ie=G(O,Le),De=(0,i.Z)({},C),ke=Re.x-Ie.x+ve,Me=Re.y-Ie.y+ye;function At(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ue,i=O.x+e,r=O.y+t,a=i+$,s=r+Q,o=Math.max(i,n.left),l=Math.max(r,n.top),u=Math.min(a,n.right),c=Math.min(s,n.bottom);return Math.max(0,(u-o)*(c-l))}var Pe,Oe,Ne,Fe,Be=At(ke,Me),Ue=At(ke,Me,le),Ge=G(p,["t","l"]),ze=G(O,["t","l"]),je=G(p,["b","r"]),He=G(O,["b","r"]),Ve=C.overflow||{},We=Ve.adjustX,Ze=Ve.adjustY,Ke=Ve.shiftX,qe=Ve.shiftY,Xe=function(e){return"boolean"==typeof e?e:e>=0};function Ct(){Pe=O.y+Me,Oe=Pe+Q,Ne=O.x+ke,Fe=Ne+$}Ct();var Ye=Xe(Ze),Qe=Le[0]===Ce[0];if(Ye&&"t"===Le[0]&&(Oe>ce.bottom||y.current.bt)){var $e=Me;Qe?$e-=Q-J:$e=Ge.y-He.y-ye;var Je=At(ke,$e),et=At(ke,$e,le);Je>Be||Je===Be&&(!se||et>=Ue)?(y.current.bt=!0,Me=$e,ye=-ye,De.points=[z(Le,0),z(Ce,0)]):y.current.bt=!1}if(Ye&&"b"===Le[0]&&(Pe<ce.top||y.current.tb)){var tt=Me;Qe?tt+=Q-J:tt=je.y-ze.y-ye;var nt=At(ke,tt),it=At(ke,tt,le);nt>Be||nt===Be&&(!se||it>=Ue)?(y.current.tb=!0,Me=tt,ye=-ye,De.points=[z(Le,0),z(Ce,0)]):y.current.tb=!1}var rt=Xe(We),at=Le[1]===Ce[1];if(rt&&"l"===Le[1]&&(Fe>ce.right||y.current.rl)){var st=ke;at?st-=$-ee:st=Ge.x-He.x-ve;var ot=At(st,Me),lt=At(st,Me,le);ot>Be||ot===Be&&(!se||lt>=Ue)?(y.current.rl=!0,ke=st,ve=-ve,De.points=[z(Le,1),z(Ce,1)]):y.current.rl=!1}if(rt&&"r"===Le[1]&&(Ne<ce.left||y.current.lr)){var ut=ke;at?ut+=$-ee:ut=je.x-ze.x-ve;var ct=At(ut,Me),ht=At(ut,Me,le);ct>Be||ct===Be&&(!se||ht>=Ue)?(y.current.lr=!0,ke=ut,ve=-ve,De.points=[z(Le,1),z(Ce,1)]):y.current.lr=!1}Ct();var dt=!0===Ke?0:Ke;"number"==typeof dt&&(Ne<le.left&&(ke-=Ne-le.left-ve,p.x+ee<le.left+dt&&(ke+=p.x-le.left+ee-dt)),Fe>le.right&&(ke-=Fe-le.right-ve,p.x>le.right-dt&&(ke+=p.x-le.right+dt)));var ft=!0===qe?0:qe;"number"==typeof ft&&(Pe<le.top&&(Me-=Pe-le.top-ye,p.y+J<le.top+ft&&(Me+=p.y-le.top+J-ft)),Oe>le.bottom&&(Me-=Oe-le.bottom-ye,p.y>le.bottom-ft&&(Me+=p.y-le.bottom+ft)));var pt=O.x+ke,mt=pt+$,gt=O.y+Me,_t=gt+Q,vt=p.x,yt=vt+ee,bt=p.y,xt=bt+J,Et=(Math.max(pt,vt)+Math.min(mt,yt))/2-pt,wt=(Math.max(gt,bt)+Math.min(_t,xt))/2-gt;null==l||l(t,De);var Tt=he.right-O.x-(ke+O.width),St=he.bottom-O.y-(Me+O.height);1===de&&(ke=Math.round(ke),Tt=Math.round(Tt)),1===fe&&(Me=Math.round(Me),St=Math.round(St)),m({ready:!0,offsetX:ke/de,offsetY:Me/fe,offsetR:Tt/de,offsetB:St/fe,arrowX:Et/de,arrowY:wt/fe,scaleX:de,scaleY:fe,align:De})}})),x=function(){m((function(e){return(0,i.Z)((0,i.Z)({},e),{},{ready:!1})}))};return(0,p.Z)(x,[a]),(0,p.Z)((function(){e||x()}),[e]),[f.ready,f.offsetX,f.offsetY,f.offsetR,f.offsetB,f.arrowX,f.arrowY,f.scaleX,f.scaleY,f.align,function(){_.current+=1;var e=_.current;Promise.resolve().then((function(){_.current===e&&b()}))}]}var H=n(94480);function V(e,t,n,i,r){(0,p.Z)((function(){if(e&&t&&n){var a=n,s=M(t),o=M(a),l=k(a),u=new Set([l].concat((0,H.Z)(s),(0,H.Z)(o)));function c(){i(),r()}return u.forEach((function(e){e.addEventListener("scroll",c,{passive:!0})})),l.addEventListener("resize",c,{passive:!0}),i(),function(){u.forEach((function(e){e.removeEventListener("scroll",c),l.removeEventListener("resize",c)}))}}}),[e,t,n])}n(48736);function W(e,t,n,i,r,a,s,o){var l=g.useRef(e);l.current=e;var u=g.useRef(!1);return g.useEffect((function(){if(t&&i&&(!r||a)){var e=function(){u.current=!1},c=function(e){var t;!l.current||s((null===(t=e.composedPath)||void 0===t||null===(t=t.call(e))||void 0===t?void 0:t[0])||e.target)||u.current||o(!1)},d=k(i);d.addEventListener("pointerdown",e,!0),d.addEventListener("mousedown",c,!0),d.addEventListener("contextmenu",c,!0);var f=(0,h.A)(n);return f&&(f.addEventListener("mousedown",c,!0),f.addEventListener("contextmenu",c,!0)),function(){d.removeEventListener("pointerdown",e,!0),d.removeEventListener("mousedown",c,!0),d.removeEventListener("contextmenu",c,!0),f&&(f.removeEventListener("mousedown",c,!0),f.removeEventListener("contextmenu",c,!0))}}}),[t,n,i,r,a]),function(){u.current=!0}}var Z=["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"];var K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.Z,t=g.forwardRef((function(t,n){var s=t.prefixCls,o=void 0===s?"rc-trigger-popup":s,_=t.children,v=t.action,y=void 0===v?"hover":v,b=t.showAction,x=t.hideAction,E=t.popupVisible,A=t.defaultPopupVisible,L=t.onPopupVisibleChange,R=t.afterPopupVisibleChange,k=t.mouseEnterDelay,M=t.mouseLeaveDelay,P=void 0===M?.1:M,O=t.focusDelay,N=t.blurDelay,F=t.mask,B=t.maskClosable,U=void 0===B||B,G=t.getPopupContainer,z=t.forceRender,H=t.autoDestroy,K=t.destroyPopupOnHide,q=t.popup,X=t.popupClassName,Y=t.popupStyle,Q=t.popupPlacement,$=t.builtinPlacements,J=void 0===$?{}:$,ee=t.popupAlign,te=t.zIndex,ne=t.stretch,ie=t.getPopupClassNameFromAlign,re=t.fresh,ae=t.alignPoint,se=t.onPopupClick,oe=t.onPopupAlign,le=t.arrow,ue=t.popupMotion,ce=t.maskMotion,he=t.popupTransitionName,de=t.popupAnimation,fe=t.maskTransitionName,pe=t.maskAnimation,me=t.className,ge=t.getTriggerDOMNode,_e=(0,a.Z)(t,Z),ve=H||K||!1,ye=g.useState(!1),be=(0,r.Z)(ye,2),xe=be[0],Ee=be[1];(0,p.Z)((function(){Ee((0,m.Z)())}),[]);var we=g.useRef({}),Te=g.useContext(S),Se=g.useMemo((function(){return{registerSubPopup:function(e,t){we.current[e]=t,null==Te||Te.registerSubPopup(e,t)}}}),[Te]),Ae=(0,f.Z)(),Ce=g.useState(null),Le=(0,r.Z)(Ce,2),Re=Le[0],Ie=Le[1],De=g.useRef(null),ke=(0,d.Z)((function(e){De.current=e,(0,c.Sh)(e)&&Re!==e&&Ie(e),null==Te||Te.registerSubPopup(Ae,e)})),Me=g.useState(null),Pe=(0,r.Z)(Me,2),Oe=Pe[0],Ne=Pe[1],Fe=g.useRef(null),Be=(0,d.Z)((function(e){(0,c.Sh)(e)&&Oe!==e&&(Ne(e),Fe.current=e)})),Ue=g.Children.only(_),Ge=(null==Ue?void 0:Ue.props)||{},ze={},je=(0,d.Z)((function(e){var t,n,i=Oe;return(null==i?void 0:i.contains(e))||(null===(t=(0,h.A)(i))||void 0===t?void 0:t.host)===e||e===i||(null==Re?void 0:Re.contains(e))||(null===(n=(0,h.A)(Re))||void 0===n?void 0:n.host)===e||e===Re||Object.values(we.current).some((function(t){return(null==t?void 0:t.contains(e))||e===t}))})),He=D(o,ue,de,he),Ve=D(o,ce,pe,fe),We=g.useState(A||!1),Ze=(0,r.Z)(We,2),Ke=Ze[0],qe=Ze[1],Xe=null!=E?E:Ke,Ye=(0,d.Z)((function(e){void 0===E&&qe(e)}));(0,p.Z)((function(){qe(E||!1)}),[E]);var Qe=g.useRef(Xe);Qe.current=Xe;var $e=g.useRef([]);$e.current=[];var Je=(0,d.Z)((function(e){var t;Ye(e),(null!==(t=$e.current[$e.current.length-1])&&void 0!==t?t:Xe)!==e&&($e.current.push(e),null==L||L(e))})),et=g.useRef(),tt=function(){clearTimeout(et.current)},nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;tt(),0===t?Je(e):et.current=setTimeout((function(){Je(e)}),1e3*t)};g.useEffect((function(){return tt}),[]);var it=g.useState(!1),rt=(0,r.Z)(it,2),at=rt[0],st=rt[1];(0,p.Z)((function(e){e&&!Xe||st(!0)}),[Xe]);var ot=g.useState(null),lt=(0,r.Z)(ot,2),ut=lt[0],ct=lt[1],ht=g.useState(null),dt=(0,r.Z)(ht,2),ft=dt[0],pt=dt[1],mt=function(e){pt([e.clientX,e.clientY])},gt=j(Xe,Re,ae&&null!==ft?ft:Oe,Q,J,ee,oe),_t=(0,r.Z)(gt,11),vt=_t[0],yt=_t[1],bt=_t[2],xt=_t[3],Et=_t[4],wt=_t[5],Tt=_t[6],St=_t[7],At=_t[8],Ct=_t[9],Lt=_t[10],Rt=C(xe,y,b,x),It=(0,r.Z)(Rt,2),Dt=It[0],kt=It[1],Mt=Dt.has("click"),Pt=kt.has("click")||kt.has("contextMenu"),Ot=(0,d.Z)((function(){at||Lt()}));V(Xe,Oe,Re,Ot,(function(){Qe.current&&ae&&Pt&&nt(!1)})),(0,p.Z)((function(){Ot()}),[ft,Q]),(0,p.Z)((function(){!Xe||null!=J&&J[Q]||Ot()}),[JSON.stringify(ee)]);var Nt=g.useMemo((function(){var e=I(J,o,Ct,ae);return l()(e,null==ie?void 0:ie(Ct))}),[Ct,ie,J,o,ae]);g.useImperativeHandle(n,(function(){return{nativeElement:Fe.current,popupElement:De.current,forceAlign:Ot}}));var Ft=g.useState(0),Bt=(0,r.Z)(Ft,2),Ut=Bt[0],Gt=Bt[1],zt=g.useState(0),jt=(0,r.Z)(zt,2),Ht=jt[0],Vt=jt[1],Wt=function(){if(ne&&Oe){var e=Oe.getBoundingClientRect();Gt(e.width),Vt(e.height)}};function Zt(e,t,n,i){ze[e]=function(r){var a;null==i||i(r),nt(t,n);for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];null===(a=Ge[e])||void 0===a||a.call.apply(a,[Ge,r].concat(o))}}(0,p.Z)((function(){ut&&(Lt(),ut(),ct(null))}),[ut]),(Mt||Pt)&&(ze.onClick=function(e){var t;Qe.current&&Pt?nt(!1):!Qe.current&&Mt&&(mt(e),nt(!0));for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];null===(t=Ge.onClick)||void 0===t||t.call.apply(t,[Ge,e].concat(i))});var Kt,qt,Xt=W(Xe,Pt,Oe,Re,F,U,je,nt),Yt=Dt.has("hover"),Qt=kt.has("hover");Yt&&(Zt("onMouseEnter",!0,k,(function(e){mt(e)})),Zt("onPointerEnter",!0,k,(function(e){mt(e)})),Kt=function(e){(Xe||at)&&null!=Re&&Re.contains(e.target)&&nt(!0,k)},ae&&(ze.onMouseMove=function(e){var t;null===(t=Ge.onMouseMove)||void 0===t||t.call(Ge,e)})),Qt&&(Zt("onMouseLeave",!1,P),Zt("onPointerLeave",!1,P),qt=function(){nt(!1,P)}),Dt.has("focus")&&Zt("onFocus",!0,O),kt.has("focus")&&Zt("onBlur",!1,N),Dt.has("contextMenu")&&(ze.onContextMenu=function(e){var t;Qe.current&&kt.has("contextMenu")?nt(!1):(mt(e),nt(!0)),e.preventDefault();for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];null===(t=Ge.onContextMenu)||void 0===t||t.call.apply(t,[Ge,e].concat(i))}),me&&(ze.className=l()(Ge.className,me));var $t=g.useRef(!1);$t.current||($t.current=z||Xe||at);var Jt=(0,i.Z)((0,i.Z)({},Ge),ze),en={};["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"].forEach((function(e){_e[e]&&(en[e]=function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];null===(t=Jt[e])||void 0===t||t.call.apply(t,[Jt].concat(i)),_e[e].apply(_e,i)})}));var tn=g.cloneElement(Ue,(0,i.Z)((0,i.Z)({},Jt),en)),nn={x:wt,y:Tt},rn=le?(0,i.Z)({},!0!==le?le:{}):null;return g.createElement(g.Fragment,null,g.createElement(u.Z,{disabled:!Xe,ref:Be,onResize:function(){Wt(),Ot()}},g.createElement(T,{getTriggerDOMNode:ge},tn)),$t.current&&g.createElement(S.Provider,{value:Se},g.createElement(w,{portal:e,ref:ke,prefixCls:o,popup:q,className:l()(X,Nt),style:Y,target:Oe,onMouseEnter:Kt,onMouseLeave:qt,onPointerEnter:Kt,zIndex:te,open:Xe,keepDom:at,fresh:re,onClick:se,onPointerDownCapture:Xt,mask:F,motion:He,maskMotion:Ve,onVisibleChanged:function(e){st(!1),Lt(),null==R||R(e)},onPrepare:function(){return new Promise((function(e){Wt(),ct((function(){return e}))}))},forceRender:z,autoDestroy:ve,getPopupContainer:G,align:Ct,arrow:rn,arrowPos:nn,ready:vt,offsetX:yt,offsetY:bt,offsetR:xt,offsetB:Et,onAlign:Ot,stretch:ne,targetWidth:Ut/St,targetHeight:Ht/At})))}));return t}(s.Z)},90059:function(e,t,n){"use strict";var i=n(82242),r=n.n(i),a=(n(59301),n(93314)),s=n(99571),o=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,i=void 0===n?{}:n,l=e.styles,u=void 0===l?{}:l,c=e.customText,h=e.ButtonText,d=e.ButtonClick,f=e.Buttonclass,p=e.ButtonTwo,m=e.imgStyles,g=e.loading,_=void 0!==g&&g,v=e.className,y=void 0===v?"":v;return(0,o.jsxs)("section",{className:"tc animated fadeIn ".concat(y),style:r()({color:"#999",margin:"100px auto",visibility:_?"hidden":"visible"},u),children:[(0,o.jsx)("img",{src:t||a,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,o.jsx)("p",{className:"mt20 font14",children:c||"暂时还没有相关数据哦!"}),h&&(0,o.jsx)(s.ZP,r()(r()({className:f,onClick:d},i),{},{children:h})),p&&p]})}},99074:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var i=n(82242),r=n.n(i),a=n(7557),s=n.n(a),o=n(41498),l=n.n(o),u=n(79800),c=n.n(u),h=n(59301),d={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(99571),p=n(70557),m=n(49337),g=n(25399),_=n(32985),v=n(99534),y=n(90059),b=n(6816),x=n(78288),E=n(37712),w=function(e){var t,n,i,a,o,u,w=e.editOffice,T=void 0===w?"view":w,S=e.data,A=e.issaver,C=e.onSaver,L=(e.theme,e.type),R=e.filename,I=e.monacoEditor,D=e.className,k=e.style,M=e.close,P=e.onClose,O=e.hasMask,N=e.disabledDownload,F=e.onImgDimensions,B=e.showNodata,U=e.recordInfo,G=(0,h.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),z=c()(G,2),j=(z[0],z[1],(0,h.useState)("")),H=c()(j,2),V=(H[0],H[1]),W=(0,h.useState)(),Z=c()(W,2),K=Z[0],q=Z[1],X="build"===window.ENV?"/react/build":"",Y=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,Q=(0,h.useRef)();null!==(t=S)&&void 0!==t&&t.startsWith("/api")&&"txt"!==L&&(S=b.Z.API_SERVER+S);function $(e){return J.apply(this,arguments)}function J(){return(J=l()(s()().mark((function e(t){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"pdfdata"===t.data.type&&(C(t.data.data),window.removeEventListener("message",$,!1)),console.log("mess---:",t.data);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}R&&I&&(I.filename=R),(0,h.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&V(t[1])}))}),[]),(0,h.useEffect)((function(){var e;"office"===L&&(S.indexOf("bigfilescdn.")>-1||S.indexOf("bigfiles1")>-1?q({url:S,fileType:(e=S,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:S.indexOf("model=edit")?"edit":"view"}):ee())}),[L,S]);var ee=function(){var e=l()(s()().mark((function e(){var t,n,i;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",S),t=S,S.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,v.gJ)({attachment_id:n});case 6:(i=e.sent).url=Y+i.url,q(i);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){S.startsWith("http")||S.startsWith("blob:")?ne():(0,_.Sv)(R||"educoder",S,R)},ne=function(){U&&(0,x.fc)({id:null==U?void 0:U.id,watch_type:1,course_id:null==U?void 0:U.course_id}),(0,_.Nd)(R||"educoder",decodeURIComponent(S))};return(0,E.jsxs)("div",{style:r()({},k||{}),className:"".concat(O&&d.bgBlack," ").concat(L?d.wrp:"hide"),children:[M&&(0,E.jsxs)("div",{className:d.close,ref:Q,children:[!!F&&(0,E.jsx)(g.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return Q.current},children:(0,E.jsx)("span",{onClick:function(){P(),F()},children:(0,E.jsx)("i",{className:"icon-yulanpizhu"})})}),!N&&(0,E.jsx)(g.Z,{title:"点击下载此文件",getPopupContainer:function(){return Q.current},children:(0,E.jsx)("span",{onClick:ne,children:(0,E.jsx)("i",{className:"icon-quxiaozhiding"})})}),A&&(0,E.jsx)(g.Z,{title:"保存pdf并退出",getPopupContainer:function(){return Q.current},children:(0,E.jsx)("span",{className:"",onClick:function(){var e=document.getElementById("pdfiframe");window.addEventListener("message",$,!1),setTimeout((function(){e.contentWindow.postMessage("getData","*")}),300)},children:(0,E.jsx)("i",{className:"icon-baocun"})})}),(0,E.jsx)(g.Z,{title:"关闭",getPopupContainer:function(){return Q.current},children:(0,E.jsx)("span",{className:"",onClick:function(){P()},children:(0,E.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,E.jsx)("div",{className:"".concat(d[D]," ").concat(D," ").concat(d.monaco," ").concat("txt"===L?"show":"hide"),children:"txt"===L&&(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(m.ZP,r()({},I))})}),"audio"===L&&(0,E.jsx)("audio",{src:"".concat((null===(n=S)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(i=S)||void 0===i?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(S),autoPlay:!0}),"video"===L&&(0,E.jsx)(E.Fragment,{children:(null===(a=S)||void 0===a?void 0:a.indexOf("http"))>-1?(0,E.jsx)("video",{controls:!0,src:"".concat(S),autoPlay:!0}):(0,E.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})}),"office"===L&&K&&(0,E.jsx)("iframe",{src:"".concat(X,"/office.html?key=").concat(K.key,"&url=").concat(btoa(K.url),"&callbackUrl=").concat(Y+(K.callbackUrl||""),"&fileType=").concat(K.fileType,"&title=").concat(K.title||"","&model=").concat(T,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!N)}),"html"===L&&(0,E.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===L&&(0,E.jsx)("iframe",{id:"pdfiframe",src:"".concat(X,"/js/pdfview/index.html?filename=").concat(R||"educoder.pdf","&url=").concat(encodeURIComponent(S),"&disabledDownload=").concat(!!N,"&model=").concat(T)}),"image"===L&&(0,E.jsx)("img",{src:"".concat((null===(o=S)||void 0===o?void 0:o.indexOf("http://"))>-1||(null===(u=S)||void 0===u?void 0:u.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(S)}),("other"===L||"download"===L)&&(0,E.jsx)(E.Fragment,{children:B?(0,E.jsx)(y.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,E.jsx)(f.ZP,{icon:(0,E.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:te,disabled:N,children:"下载"})}):(0,E.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:te,disabled:N,children:[(0,E.jsx)(p.Z,{}),"点击下载"]})}),"flowChart"===L&&(0,E.jsx)("div",{className:"embed",children:(0,E.jsx)("iframe",{src:"/drawio/src/main/webapp/viewer.html?id=".concat(S||"","&gapi=0&od=0&db=0&gh=0&gl=0"),width:"100%",height:"100%",frameBorder:"0"})})]})}},61422:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var i=n(79800),r=n.n(i),a=n(7557),s=n.n(a),o=n(41498),l=n.n(o),u=n(59301),c=n(6767),h=n(75727),d=n(84201),f=n(44523),p=n(56800),m=n(56102),g=n(66860),_={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},v=n(37712);function y(e){if(isNaN(e))return{minutes:"00",seconds:"00"};var t=new Date(1e3*e).toISOString().substr(11,8);return{hour:t.substr(0,2),minutes:t.substr(3,2),seconds:t.substr(6,2)}}function b(e,t){return e-t}function x(e){e.sort(b);for(var t=0,n=0;n<e.length-1;n++){var i=Math.abs(e[n+1]-e[n]);i<21&&(t+=i)}return t}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}});var E=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i,w=(0,u.forwardRef)((function(e,t){var n,i=e.allow_skip,a=e.src,o=e.toLog,b=e.videoId,w=e.logWatchHistory,T=e.courseId,S=void 0===T?null:T,A=e.startTime,C=e.handlePause,L=void 0===C?function(){}:C,R=e.handlePlay,I=void 0===R?function(){}:R,D=e.handlePlayEnded,k=void 0===D?function(){}:D,M=e.autoPlay,P=void 0!==M&&M,O=e.onPlayEnded,N=void 0===O?function(){}:O,F=e.isShowWaterMark,B=void 0===F||F,U="flv"===(null==a||null===(n=a.split("."))||void 0===n?void 0:n.pop()),G=(0,u.useRef)(),z=(0,u.useRef)(),j=(0,u.useRef)(),H=(0,u.useRef)(),V=(0,u.useRef)(),W=(0,u.useRef)(),Z=(0,u.useRef)(),K=(0,u.useRef)(),q=(0,u.useRef)(),X=(0,u.useRef)(),Y=(0,u.useRef)(),Q=(0,u.useRef)(),$=(0,u.useRef)(),J=(0,u.useRef)(),ee=navigator.userAgent.toLowerCase().match(E),te=ee?ee[0]:"pc",ne=(0,u.useRef)(!1),ie=(0,p.eY)(),re=0,ae=0,se=0,oe=null,le=!1,ue=20,ce=1,he=!1,de=!1,fe=[];(0,u.useImperativeHandle)(t,(function(){return{getLastUpdatedTime:function(){return G.current.currentTime},getDuration:function(){return G.current.duration}}})),c.ZP.config({maxCount:1,getContainer:function(){return j.current}});var pe=(0,u.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={point:G.current.currentTime};function i(){return r.apply(this,arguments)}function r(){return(r=l()(s()().mark((function t(){var i;return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return he=!0,t.next=3,null==w?void 0:w(n);case 3:i=t.sent,oe=i,he=!1,e&&e();case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}oe?(n.log_id=oe,n.watch_duration=x(fe),n.total_duration=ae):(S?(n.video_id=parseInt(b,10),n.course_id=S):n.video_id=b,n.duration=re,n.device=te),t&&(n.ed="1"),i()}),[b,S]);function me(){G.current.paused?(H.current.style.display="none",V.current.style.display="block"):(H.current.style.display="block",V.current.style.display="none")}function ge(){Y.current.style.display="none",$.current.style.display="none",Q.current.style.display="none",G.current.muted||0===G.current.volume?Y.current.style.display="block":G.current.volume>0&&G.current.volume<=.5?$.current.style.display="block":Q.current.style.display="block"}(0,u.useEffect)((function(){G.current&&(H.current.style.display="none",V.current.style.display="block"),c.ZP.destroy();var e=null;return d.Z.isSupported&&U&&a&&(null==a?void 0:a.indexOf(".m3u8"))<0?(e=d.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:a,muted:!1}),G.current&&(e.attachMediaElement(G.current),e.load())):G.current.setAttribute("src",a),ge(),function(){e&&(e.unload(),e.pause(),e.destroy(),e=null)}}),[G,U,a]),(0,u.useEffect)((function(){document.getElementById("play"),document.querySelectorAll(".playback-icons use");function e(){I(),A&&!ne.current&&(G.current.currentTime=A),ne.current=!0,fe.push(G.current.currentTime),le||(le=!0,o&&pe())}function t(){return n.apply(this,arguments)}function n(){return(n=l()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:me(),fe.push(G.current.currentTime),o&&pe((function(){oe=null,se=0,le=!1,he=!1,de=!1,fe=[],ae=0,ce=1}),!0),N();case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function r(){W.current.value=Math.round(G.current.currentTime),Z.current.value=Math.round(G.current.currentTime)}function a(){var e,t,n,i,r,a=Math.round(null===(e=G.current)||void 0===e?void 0:e.duration);null===(t=W.current)||void 0===t||null===(n=t.setAttribute)||void 0===n||n.call(t,"max",a),null===(i=Z.current)||void 0===i||null===(r=i.setAttribute)||void 0===r||r.call(i,"max",a);var s,o,l=y(a);K.current&&(K.current.innerText="".concat(l.hour>0?l.hour+":":"").concat(l.minutes,":").concat(l.seconds),null===(s=(o=K.current).setAttribute)||void 0===s||s.call(o,"datetime","".concat(l.hour>0?" "+l.hour+" ":"").concat(l.minutes,"m ").concat(l.seconds,"s")))}function u(){try{var e=Math.round(G.current.duration);W.current.setAttribute("max",e),Z.current.setAttribute("max",e);var t=y(e);K.current.innerText="".concat(t.hour>0?t.hour+":":"").concat(t.minutes,":").concat(t.seconds),K.current.setAttribute("datetime","".concat(t.hour>0?" "+t.hour+" ":"").concat(t.minutes,"m ").concat(t.seconds,"s")),r(),function(){var e=y(Math.round(G.current.currentTime));q.current.innerText="".concat(e.hour>0?e.hour+":":"").concat(e.minutes,":").concat(e.seconds),q.current.setAttribute("datetime","".concat(e.hour>0?" "+e.hour+" ":"").concat(e.minutes,"m ").concat(e.seconds,"s"))}();var n=z.current.getBoundingClientRect();n.width,n.height,n.x,n.y;if(!de){var i=G.current.currentTime,a=i-se;Math.abs(a)<10?(ae+=Math.abs(a),se=i,he||ae-ce*ue>=0&&(ce++,fe.push(se),o&&pe())):(se=i,o&&pe())}}catch(e){console.log("videoplaying:",e)}}function h(){de=!0}function d(){G.current.playing&&fe.push(G.current.currentTime,se),se=G.current.currentTime,de=!1}function f(){(re=G.current.duration)<=20&&(ue=re/3),G.current.addEventListener("play",e)}function p(){L()}function m(e){if(i){var t=e.target.dataset.seek?e.target.dataset.seek:e.target.value;G.current.currentTime=t,Z.current.value=t,W.current.value=t}else c.ZP.warning("该视频禁止快进/后退播放")}function _(e){var t=Math.round(e.offsetX/e.target.clientWidth*parseInt(e.target.getAttribute("max"),10));W.current.setAttribute("data-seek",t);var n=y(t);X.current.textContent="".concat(n.hour>0?n.hour+":":"").concat(n.minutes,":").concat(n.seconds);var i=G.current.getBoundingClientRect();X.current.style.left="".concat(e.pageX-i.left,"px")}function v(e){switch(e.code){case"Space":e.preventDefault(),be();break;case"ArrowRight":if(e.preventDefault(),!i){c.ZP.warning("该视频禁止快进/后退播放");break}if(G.current.currentTime>=G.current.duration)break;G.current.currentTime=parseInt(G.current.currentTime)+5,r();break;case"ArrowLeft":if(e.preventDefault(),!i){c.ZP.warning("该视频禁止快进/后退播放");break}if(0===G.current.currentTime)break;G.current.currentTime=parseInt(G.current.currentTime)-5,r();break;case"ArrowUp":e.preventDefault(),G.current.volume<1&&(G.current.volume=(parseInt(10*G.current.volume)+1)/10);break;case"ArrowDown":e.preventDefault(),G.current.volume>0&&(G.current.volume=(parseInt(10*G.current.volume)-1)/10)}}return j.current.addEventListener((0,g.gH)(),(function(e){e.preventDefault(),(0,g.vp)()?(G.current.style.width="100%",G.current.style.height="100%"):G.current.style.cssText=""})),G.current.addEventListener("canplay",f),G.current.addEventListener("ended",t),G.current.addEventListener("seeking",h),G.current.addEventListener("seeked",d),G.current.addEventListener("loadedmetadata",a),W.current.addEventListener("mousemove",_),W.current.addEventListener("input",m),G.current.addEventListener("timeupdate",u),G.current.addEventListener("pause",p),G.current.addEventListener("volumechange",ge),document.addEventListener("keydown",v),function(){var n,i,r,s,l,c,g,y,b,x,E,w;null===(n=G.current)||void 0===n||n.removeEventListener("canplay",f),null===(i=G.current)||void 0===i||i.removeEventListener("play",e),null===(r=G.current)||void 0===r||r.removeEventListener("ended",t),null===(s=G.current)||void 0===s||s.removeEventListener("seeking",h),null===(l=G.current)||void 0===l||l.removeEventListener("seeked",d),null===(c=W.current)||void 0===c||c.removeEventListener("mousemove",_),null===(g=W.current)||void 0===g||g.removeEventListener("input",m),null===(y=G.current)||void 0===y||y.removeEventListener("timeupdate",u),null===(b=G.current)||void 0===b||b.removeEventListener("pause",p),null===(x=G.current)||void 0===x||x.removeEventListener("loadedmetadata",a),null===(E=G.current)||void 0===E||E.removeEventListener("volumechange",ge),document.removeEventListener("keydown",v),null!==(w=G.current)&&void 0!==w&&w.playing&&(fe.push(se,G.current.currentTime),o&&pe())}}),[G,a]),(0,u.useEffect)((function(){if(G.current.onended=function(){k(G)},G.current.oncontextmenu=function(){return!1},(null==a?void 0:a.indexOf(".m3u8"))>-1)if(G.current.canPlayType("application/vnd.apple.mpegurl"))G.current.src=a;else if(f.ZP.isSupported()){var e=new f.ZP;e.loadSource(a),e.attachMedia(G.current)}}),[a]);var _e=(0,u.useState)(1),ve=r()(_e,2),ye=(ve[0],ve[1]),be=function(){G.current.paused||G.current.ended?G.current.play():G.current.pause(),me()};return(0,v.jsxs)("div",{style:{position:"relative"},ref:j,children:[(0,v.jsx)("div",{ref:z,className:"".concat(_.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(_.animate__loop),children:B&&ie?ie.login:" "}),(0,v.jsx)("div",{className:_.container,children:(0,v.jsxs)("div",{className:_["video-container"],id:"video-container",children:[(0,v.jsx)("div",{className:_["playback-animation"],id:"playback-animation",children:(0,v.jsxs)("svg",{className:_["playback-icons"],children:[(0,v.jsx)("use",{className:"hidden",href:"#play-icon"}),(0,v.jsx)("use",{href:"#pause"})]})}),(0,v.jsx)("video",{className:_.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:G,autoPlay:P}),(0,v.jsxs)("div",{className:"".concat(_["video-controls"]," "),id:"video-controls",children:[(0,v.jsxs)("div",{className:_["bottom-controls"],children:[(0,v.jsxs)("div",{className:_["left-controls"],children:[(0,v.jsx)("button",{"data-title":"播放/暂停",id:"play",onClick:be,children:(0,v.jsxs)("svg",{className:_["playback-icons"],children:[(0,v.jsx)("use",{ref:V,href:"#play-icon"}),(0,v.jsx)("use",{ref:H,style:{display:"none"},href:"#pause"})]})}),(0,v.jsxs)("div",{className:_.time,children:[(0,v.jsx)("time",{id:"time-elapsed",ref:q,children:"00:00"}),(0,v.jsx)("span",{children:" / "}),(0,v.jsx)("time",{id:"duration",ref:K,children:"00:00"})]})]}),(0,v.jsxs)("div",{className:_["right-controls"],children:[i&&(0,v.jsx)(h.Z,{placement:"top",overlayClassName:_.rateOverlay,getPopupContainer:function(e){return e.parentNode},menu:{items:[{key:"1",label:(0,v.jsx)("span",{onClick:function(){ye(1),G.current.playbackRate=1},children:"1.0x"})},{key:"2",label:(0,v.jsx)("span",{onClick:function(){ye(1.5),G.current.playbackRate=1.5},children:"1.5x"})},{key:"3",label:(0,v.jsx)("span",{onClick:function(){ye(2),G.current.playbackRate=2},children:"2.0x"})}]},children:(0,v.jsx)("div",{className:"".concat(_.controlText," mr5"),children:"倍速"})}),(0,v.jsx)(m.CopyToClipboard,{text:a,onCopy:function(){return c.ZP.success("复制成功")},children:(0,v.jsx)("button",{"data-title":"复制链接",children:(0,v.jsx)("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}})})}),(0,v.jsxs)("div",{className:_["volume-controls"],children:[(0,v.jsxs)("button",{"data-title":"开启/关闭声音",className:_["volume-button"],id:"volume-button",onClick:function(){G.current.muted=!G.current.muted,G.current.muted?(J.current.setAttribute("data-volume",volume.value),J.current.value=0):J.current.value=J.current.dataset.volume},children:[(0,v.jsx)("i",{ref:Y,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),(0,v.jsx)("i",{ref:$,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),(0,v.jsx)("i",{ref:Q,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})]}),(0,v.jsx)("input",{className:_.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:J,style:{display:"none"},onClick:ge})]}),(0,v.jsx)("button",{"data-title":"全屏/退出全屏",className:_["fullscreen-button"],onClick:function(){(0,g.vp)()?(0,g.BU)():(0,g.Dj)(j.current)},children:(0,v.jsx)("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})})]})]}),(0,v.jsxs)("div",{className:_["video-progress"],children:[(0,v.jsx)("progress",{ref:Z,value:"0",min:"0"}),(0,v.jsx)("input",{className:_.seek,ref:W,value:"0",min:"0",type:"range",step:"1"}),(0,v.jsx)("div",{className:_["seek-tooltip"],ref:X,id:"seek-tooltip",children:"00:00"})]})]})]})}),(0,v.jsx)("svg",{style:{display:"none"},children:(0,v.jsxs)("defs",{children:[(0,v.jsx)("symbol",{id:"pause",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})}),(0,v.jsx)("symbol",{id:"play-icon",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})}),(0,v.jsx)("symbol",{id:"volume-high",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})}),(0,v.jsx)("symbol",{id:"volume-low",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})}),(0,v.jsx)("symbol",{id:"volume-mute",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})}),(0,v.jsx)("symbol",{id:"fullscreen",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})}),(0,v.jsx)("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})}),(0,v.jsx)("symbol",{id:"pip",viewBox:"0 0 24 24",children:(0,v.jsx)("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})})]})})]})}))},49337:function(e,t,n){"use strict";n.d(t,{SV:function(){return Q},ZP:function(){return Y}});var i=n(82242),r=n.n(i),a=n(37205),s=n.n(a),o=n(91232),l=n.n(o),u=n(79800),c=n.n(u),h=n(39647),d=n.n(h),f=n(7557),p=n.n(f),m=n(41498),g=n.n(m),_=n(59301),v=n(76374),y=["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"],b={quickKey:[{label:"main",content:["public static void main(String[] args) {","\t$0","}"].join("\n")},{label:"System.out.println",content:["System.out.println($0)"].join("\n")},{label:"System.out.print",content:["System.out.print($0)"].join("\n")}],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"]},x={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}) {","\t$0","} else {","\t","}"].join("\n")},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {","\t$0","}"].join("\n")},{label:"if",content:["if () {","\t$0","}"].join("\n")},{label:"for",content:["for(int j=0 ; j<10; j++){","\t$0","}"].join("\n")},{label:"trycatch",content:["try{","\t$0","}catch(ExceptionName e){","}"].join("\n")},{label:"using namespace std;",content:["using namespace std;"].join("\n")},{label:"include <iostream>",content:["#include <iostream>"].join("\n")},{label:"include <vector>",content:["#include <vector>"].join("\n")},{label:"include <cstdio>",content:["#include <cstdio>"].join("\n")},{label:"include <cstring>",content:["#include <cstring>"].join("\n")},{label:"include <sstream>",content:["#include <sstream>"].join("\n")},{label:"include <fstream>",content:["#include <fstream>"].join("\n")},{label:"include <map>",content:["#include <map>"].join("\n")},{label:"include <string>",content:["#include <string>"].join("\n")},{label:"include <cmath>",content:["#include <cmath>"].join("\n")}]},E={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("\n")}]},w={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("\n")}]},T=n(53184),S=n.n(T),A={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},C=function(e,t,n,i){e.languages.registerCompletionItemProvider(t,{provideCompletionItems:function(t,r){var a=t.getWordUntilPosition(r),o={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},l=t.getLineContent(r.lineNumber).substring(a.startColumn-2,a.endColumn),u=function(e,t,n,i){var r=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});return Array.from(new Set(r.match(/\b\w{2,}\b/g)||[])).map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Text,insertText:t,range:i}}))}(e,t,r,o);return{suggestions:[].concat(s()(u),s()(n.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}}))),s()(i.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Snippet,documentation:t.content,insertText:l.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}}))))}}})},L=n(82100),R=n.n(L),I=n(29186),D=n.n(I),k=n(85573),M=n.n(k),P=function(){function e(t,n,i){var r=this;R()(this,e),this.placeholder=t,this.editor=n,this.monaco=i,n.onDidChangeModelContent((function(){return r.onDidChangeModelContent()})),this.onDidChangeModelContent()}return D()(e,[{key:"onDidChangeModelContent",value:function(){""===this.editor.getValue()?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}},{key:"getId",value:function(){return e.ID}},{key:"getDomNode",value:function(){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}},{key:"getPosition",value:function(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}},{key:"dispose",value:function(){this.editor.removeContentWidget(this)}}]),e}();M()(P,"ID","editor.widget.placeholderHint");var O=P,N=n(96236),F=n(6767),B=n(25399),U=n(89392),G=n(13326),z=n(56102),j=n(37712),H=["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"];function V(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function W(){}var Z={"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 K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=Z[e[n]];if(i)return i}return t[0]}return Z[t]||t}var q=null,X=function(){var e=g()(p()().mark((function e(){return p()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.clipboard.writeText(" ");case 3:console.log("内容已自动复制到剪贴板:"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("自动复制失败:",e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),Y=function(e){var t=e.width,i=void 0===t?"100%":t,a=e.height,o=void 0===a?"100%":a,u=e.value,h=e.language,f=void 0===h?"javascript":h,m=e.style,T=void 0===m?{}:m,L=e.options,R=void 0===L?{}:L,I=e.overrideServices,D=void 0===I?{}:I,k=e.theme,M=void 0===k?"vs-dark":k,P=e.onEditBlur,Z=e.isCopy,Y=void 0!==Z&&Z,Q=e.onSave,$=e.autoHeight,J=void 0!==$&&$,ee=e.forbidCopy,te=void 0!==ee&&ee,ne=e.onChange,ie=void 0===ne?W:ne,re=e.editorDidMount,ae=void 0===re?W:re,se=e.onFocus,oe=void 0===se?W:se,le=e.onBreakPoint,ue=void 0===le?W:le,ce=e.breakPointValue,he=void 0===ce?[]:ce,de=e.filename,fe=void 0===de?"educoder.txt":de,pe=e.errorLine,me=e.errorContent,ge=void 0===me?"":me,_e=e.highlightLine,ve=e.openBreakPoint,ye=void 0!==ve&&ve,be=e.placeholder,xe=void 0===be?"":be,Ee=e.showMiniMap,we=void 0===Ee||Ee,Te=(d()(e,H),(0,_.useRef)()),Se=(0,_.useRef)({}),Ae=(0,_.useRef)(),Ce=(0,_.useRef)(),Le=(0,_.useRef)([]),Re=(0,_.useRef)(!1),Ie=(0,_.useRef)(),De=(0,_.useRef)(),ke=(0,_.useRef)(!1),Me=(0,_.useState)(!1),Pe=c()(Me,2),Oe=Pe[0],Ne=Pe[1];(0,_.useEffect)((function(){var e=G.Z.subscribe("formatDocument",(function(e){var t,n=Se.current.instance;null==n||null===(t=n.getAction)||void 0===t||t.call(n,"editor.action.formatDocument").run()}));return window.updateMonacoValue=function(e){ie(e)},e}),[]),(0,_.useEffect)((function(){var e,t=Se.current.instance;(Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout((function(){!function(){var e=Se.current.instance;if(null!=u&&e&&Oe){var t=e.getModel();t&&u!==t.getValue()&&(!0,t.setValue(u),e.layout(),!1)}}()}),500),u&&null!=u&&u.length)&&(null==t||null===(e=t.updateOptions)||void 0===e||e.call(t,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(u.split(/\r\n|\r|\n/g).length))+3,5)}))}),[u,Oe,Se.current]),(0,_.useEffect)((function(){if(pe&&Se.current&&Se.current.instance){var e=Se.current.instance;e.changeViewZones((function(e){var t=document.createElement("div");t.style.padding="10px 20px",t.style.width="calc(100% - 20px)",t.className="my-error-line-wrp",t.innerHTML=ge,e.addZone({afterLineNumber:pe||11,heightInLines:3,domNode:t})}));var t={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}};e.addOverlayWidget(t),e.revealPositionInCenter({lineNumber:20,column:1})}}),[pe,Se.current,Oe]);var Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!e||""===e.trim())return!0;for(var n=Se.current.instance.getModel(),i=n.getLineTokens(t),r=!1,a=0;a<2;a++)1===i.getStandardTokenType(a)&&(r=!0);return r};function Be(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),Q())}(0,_.useEffect)((function(){var e,t=null===(e=Se.current)||void 0===e?void 0:e.instance;if(t&&Oe&&te){var n=t.onDidBlurEditorWidget((function(){ke.current=!1})),i=t.onDidFocusEditorText((function(){ke.current=!0}));return function(){n.dispose(),i.dispose()}}}),[Se.current,Oe,te]),(0,_.useEffect)((function(){var e;if(null!==(e=Se.current)&&void 0!==e&&e.instance&&Oe&&ye){var t=Se.current.instance,n=t.getModel();if(!n)return;!function(){var e,i=[],r=[],a=n.getAllDecorations(),s=l()(a);try{for(s.s();!(e=s.n()).done;){var o,u=e.value;if("highlighted-line"===u.options.className)i.push(null==u||null===(o=u.range)||void 0===o?void 0:o.startLineNumber),r.push(null==u?void 0:u.id)}}catch(e){s.e(e)}finally{s.f()}if(_e!==i[0]){n.deltaDecorations(r,[]);var c=n.getLineCount();_e&&_e<=c&&(t.deltaDecorations([],[{range:new q.Range(_e,1,_e,n.getLineMaxColumn(_e)),options:{isWholeLine:!0,className:"highlighted-line"}}]),t.revealLineInCenter(_e))}}();var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=[],r=[],a=n.getAllDecorations(),s=l()(a);try{for(s.s();!(e=s.n()).done;){var o,u=e.value;if("breakpoints-select"===u.options.linesDecorationsClassName)i.push(null==u||null===(o=u.range)||void 0===o?void 0:o.startLineNumber),r.push(null==u?void 0:u.id)}}catch(e){s.e(e)}finally{s.f()}if(t)return{lines:i,ids:r};ue(i)},r=function(){var e=g()(p()().mark((function e(t){var r;return p()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={range:new q.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}},e.next=3,n.deltaDecorations([],[r]);case 3:i();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=g()(p()().mark((function e(r){var a,s,o,u,c;return p()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=[],s=t.getLineDecorations(r),o=l()(s);try{for(o.s();!(u=o.n()).done;)"breakpoints-select"===(c=u.value).options.linesDecorationsClassName&&a.push(c.id)}catch(e){o.e(e)}finally{o.f()}return e.next=6,n.deltaDecorations(a,[]);case 6:i();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s=function(e){var n,i=t.getLineDecorations(e),r=l()(i);try{for(r.s();!(n=r.n()).done;){if("breakpoints-select"===n.value.options.linesDecorationsClassName)return!0}}catch(e){r.e(e)}finally{r.f()}return!1};if(!(0,U.isEqual)(he,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var o=he.map((function(e){return{range:new q.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}}));n.deltaDecorations([],o)}var u=t.onDidChangeModelContent((function(e){var o=t.getPosition();if(o){var l=o.lineNumber;clearTimeout(De.current),De.current=setTimeout((function(){Fe(n.getLineContent(l),l)?a(l):s(l)?(a(l),r(l)):i()}),100)}})),c=t.onMouseDown((function(e){var t;if(e.target.detail&&null!==(t=e.target)&&void 0!==t&&null!==(t=t.element)&&void 0!==t&&null!==(t=t.className)&&void 0!==t&&t.includes("line-numbers")){var i=e.target.position.lineNumber;if(Fe(n.getLineContent(i),i))return;s(i)?a(i):r(i)}})),h=function(){Le.current=t.deltaDecorations(Le.current,[])},d=t.onMouseMove((function(e){var i;if(h(),e.target.detail&&null!==(i=e.target)&&void 0!==i&&null!==(i=i.element)&&void 0!==i&&null!==(i=i.className)&&void 0!==i&&i.includes("line-numbers")){var r=e.target.position.lineNumber;if(Fe(n.getLineContent(r),r))return;!function(e){var n={range:new q.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Le.current=t.deltaDecorations(Le.current,[n])}(r)}})),f=t.onMouseLeave((function(){h()}));return function(){u.dispose(),c.dispose(),d.dispose(),f.dispose()}}}),[Se.current,Oe,he,_e,ye,f]),(0,_.useEffect)((function(){var e;null!==(e=Se.current)&&void 0!==e&&e.instance&&ye&&Se.current.instance.setPosition({lineNumber:0,column:0})}),[_e]);var Ue=function(){if(J&&Se.current.instance){var e=Se.current.instance.getContentHeight();qe(e<o?o:e)}else qe(o)};var Ge=function(e){if(ke.current){var t=e.keyCode,n=e.ctrlKey,i=e.metaKey,r=e.target;return"paste"!==e.type&&(67!==t&&86!==t||!i&&!n)||"TEXTAREA"!==r.nodeName||(F.ZP.warning({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),e.preventDefault()),!1}};function ze(e,t){var n,i,r=window.URL||window.webkitURL||window,a=new Blob([t]),s=document.createElementNS("http://www.w3.org/1999/xhtml","a");s.href=r.createObjectURL(a),s.download=e,n=s,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}(0,_.useEffect)((function(){Ue()}),[Ue]),(0,_.useEffect)((function(){Te.current&&!Oe&&Promise.all([n.e(8909),n.e(1196)]).then(n.bind(n,71448)).then((function(e){try{q=e,Se.current.instance=q.editor.create(Te.current,{value:u,language:K(f),theme:M,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:we||!1}},D);var t=Se.current.instance,n=N.BH._menuItems,i=s()(n).find((function(e){return"EditorContext"==e[0]._debugName}))[1];if(ae(t,q),setTimeout((function(){Ue(),Se.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ze(fe||"educoder.txt",t.getValue())}})}),500),Se.current.subscription=t.onDidChangeModelContent((function(e){Re.current?clearTimeout(Ie.current):(Ue(),ie(t.getValue(),e)),Ie.current=setTimeout((function(){Re.current=!1}),500)})),window.Monaco||function(e){A.languages.forEach((function(t){e.languages.registerDocumentFormattingEditProvider(t,{provideDocumentFormattingEdits:function(e){return g()(p()().mark((function t(){var n;return p()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=S()(e.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}),t.abrupt("return",[{range:e.getFullModelRange(),text:n}]);case 2:case"end":return t.stop()}}),t)})))()}})})),C(e,"java",b.keywords,b.quickKey),C(e,"cpp",x.keywords,x.quickKey),C(e,"c",y,[]),C(e,"python",E.keywords,E.quickKey),C(e,"scala",w.keywords,w.quickKey)}(q,K(f)),te&&(!function(e,t){var n=e._first;do{var i;t.includes(null===(i=n.element)||void 0===i||null===(i=i.command)||void 0===i?void 0:i.id)&&e._remove(n)}while(n=n.next)}(i,["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"]),Te.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Ge),window.removeEventListener("paste",Ge),window.addEventListener("keydown",Ge),window.addEventListener("paste",Ge)),window.Monaco=q,P&&t.onDidBlurEditorWidget((function(){P(t.getValue())})),oe&&t.onDidFocusEditorText((function(){te&&X(),oe(t.getValue())})),te){X();try{t.onDidPaste((function(e){var n=t.getSelection(),i=Se.current.pastePos||{};new q.Range(i.startLineNumber||n.endLineNumber,i.startColumn||n.endColumn,i.endLineNumber||n.endLineNumber,i.endColumn||n.endColumn);t.executeEdits("",[{range:e.range,text:""}])}))}catch(e){}}var r=function(){var e;return Te.current&&(e=new v.Z((function(e){var t,n=l()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&Se.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(Te.current),e}();return xe&&"string"==typeof xe&&new O(xe,t,q),Ne(!0),function(){var e=Se.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),Se.current.subscription&&Se.current.subscription.dispose(),r.unobserve(Te.current)}}catch(e){}}))}),[]),(0,_.useEffect)((function(){if(Se.current.instance&&Oe)return document.addEventListener("keydown",Be,!1),function(){document.removeEventListener("keydown",Be)}}),[Q,Oe]),(0,_.useEffect)((function(){var e=Se.current.instance;if(e&&Oe){var t=K(f);q.editor.setModelLanguage(e.getModel(),t)}}),[f,Oe]),(0,_.useEffect)((function(){Se.current.instance&&Oe&&q.editor.setTheme(M)}),[M,Oe]),(0,_.useEffect)((function(){var e=Se.current.instance;Ae.current=R,e&&Oe&&(e.updateOptions(r()({},R)),setTimeout((function(){e.getModel().updateOptions(r()({},R))}),200))}),[JSON.stringify(R),Oe]),(0,_.useEffect)((function(){var e=Se.current.instance;e&&Oe&&e.layout()}),[i,o,Oe]);var je=(0,_.useState)(V(i)),He=c()(je,2),Ve=He[0],We=(He[1],(0,_.useState)(V(o))),Ze=c()(We,2),Ke=Ze[0],qe=Ze[1],Xe=r()(r()({},T),{},{width:Ve,height:Ke,position:"relative"});return(0,j.jsx)("div",{className:"my-monaco-editor",ref:Te,style:Xe,children:Y&&(0,j.jsx)(z.CopyToClipboard,{text:u,onCopy:function(){return F.ZP.success("复制成功")},children:(0,j.jsx)(B.Z,{title:"复制代码",children:(0,j.jsxs)("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"},children:[(0,j.jsx)("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," 复制代码"]})})})})};function Q(e){var t=e.width,i=void 0===t?"100%":t,a=e.height,s=void 0===a?"100%":a,o=e.original,u=e.modified,h=e.language,d=e.options,f=void 0===d?{}:d,p=(0,_.useRef)(),m=(0,_.useState)(null),g=c()(m,2),y=g[0],b=g[1];(0,_.useEffect)((function(){return p.current&&Promise.all([n.e(8909),n.e(9404)]).then(n.bind(n,2550)).then((function(e){var t=(q=e).editor.createDiffEditor(p.current,r()(r()({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},f),{},{wordWrap:!0}));b(t);var n=function(e){var t;return p.current&&(t=new v.Z((function(t){var n,i=l()(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&e.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(p.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(p.current)}})),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}}),[]),(0,_.useEffect)((function(){y&&y.setModel({original:q.editor.createModel(o,h),modified:q.editor.createModel(u,h)})}),[o,u,h,y]);var x={width:V(i),height:V(s)};return(0,j.jsx)("div",{className:"my-diff-editor",ref:p,style:x})}},12532:function(e,t,n){"use strict";n.d(t,{jL:function(){return l},w9:function(){return we},QD:function(){return it},cQ:function(){return xe},op:function(){return Ye},O5:function(){return dt},_b:function(){return lt},t7:function(){return O},Gi:function(){return Ce},YG:function(){return Ae},qp:function(){return T},vr:function(){return at},qE:function(){return Je},Je:function(){return B},wb:function(){return ae},cq:function(){return Be},tp:function(){return C}});var i=n(59301),r="banner___PoUBO",a="content___XoDjy",s="btns___Pb35j",o=n(37712),l=function(e){var t=e.dataSource,n=void 0===t?[]:t,i=e.img,l=e.imgWidth,u=void 0===l?346:l,c=e.title,h=e.sunTitle,d=e.bannerExtraContent;return(0,o.jsx)("div",{className:r,children:(0,o.jsxs)("div",{className:a,children:[(0,o.jsxs)("aside",{children:[(0,o.jsxs)("p",{children:[(0,o.jsx)("b",{children:c}),(0,o.jsx)("span",{children:h})]}),n.length>0&&(0,o.jsx)("div",{className:s,children:n.map((function(e,t){return(0,o.jsxs)("div",{onClick:e.click,children:[e.name,e.sign?(0,o.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAA0CAYAAAAkEw66AAAAAXNSR0IArs4c6QAAGNVJREFUeF7VmwmwHVWdxr9zuvvu9+3ZXsxCiNkIQZOwEzMgyADjggsWgzPqOAJaMiCjYiGKqDBQAo4iWGAxA+ooMm7gBhSyhBBRIIBSAQlrHuTt7913t97PmfpOd4cXlLAFGO6rW9237719+/z6+6/nPIHX+XHttddaex38nlW2lLO1svq1wJ4aeFMM9CqFnNKoaYVapDAOicfjGEMKqKk2nrx59Lbt5xx6aPR6DEG8Hj/K3xwY0YtjSx2vYnlspLEsX0BRKUBrINtyX+PZp0r3fR+IIgzFSo9EsahFUfSHWIj7Pa919zvf2vlo+rFXdWivObjHJvR8S6vTJORHckV0+4GBAF4InwQlBCAIkEMXgCLA9Mn9WCef4ft8HWkgVIDn6ckwUA/HQfCzoFX71TsP6n/41aL3moHTWotnJnGysPEFx8ZcAtMqGTjh2NmVTL+iDB6BZurjsRSe2SogjhNwMZIngbZbqgXom8N26/KjV3femB7ebRxfE3DbRnW/k8c3LQvv5yCjOFVVqhgCyNnJmAhoxyOFasz1OeCM2lLTJryI4BQQUn1RAhI24Lc1dBjc2K6Nnv2edfP+sLvIvergxqb0vpHA1fk8lre9xBZpZsYKU9sMYiDvAHKaqU4HuANcZrIpcILiezRdo7z0aUw3BoJYI4gELAeI/bjZmBq9+PGNd5x/+unHua8U4KsKbriujxUSV9gW+rwg9WPTfpHgpEgUQgAFJwU6LSDwjSxA8F2jslSBBJaZKwVGJRv1pSAJLyQ8qlwLOA4Q1us31Z58+OTj3rX/E68E3qsGbmhK/6Nt40oIFMJwZ5URFh/cZoGgHQKODeSsaUEiA5iSy6IqYRnfmPq66YojPILbYbqpGXuhRhRrFPMSUaP+6OTAtuPff8ze97xceK8KuJGG/oBl4XsaKMTTsiwDKVXZjm1qsgRBU84TXi5VXqo24/syP5ce2xEg0gBDeAZWFijo79JnpLQxXSo7iICiIyD8qUfdxuQRRx24x5MvB95uBzfW1G+XFn4GoMMojQNOYWUK45b+jG9mW+PvFNAKEkqVYgI583VZcOB7WRrCqGwiaQovU1lAlaXKM/BMQNIGbN0FLGh0lySCVv0OP3aPOnKf2a2XCm+3ghuc1AvzOdwmLSwIwkQlBoxMtgZYCkvwQLafBYo0l2v6gBcCxRxQyifwM9PckRCniXIGbjo8wiI4bgnRRFul0XAZMABbaggVoytvo12vff7Qt/Rc8LqBm5jQndrBr3MFHOwyemaJbGaaAKzMp00zV2O+6VVnSTCPcYCNdrItEGAOcKxpVUQKLjPZ6VHVgEuf3Kf/rLk0Y4ViTpiAEUYKJaEgVDg2OTq1+j3r5w68FHi7TXFDU/El1Yr8VLudDM4IjUpLVWW2Mg0GgubybATNfN/0C5+eqjQ9oO0ngAmR0ZF5X2bKjLRZBUFgNE03AKhcPqk62wJsm+qjvyM4Aa0idFN1zcmvHraq90uvObihqej4YsH6nzCEyHwRB0WFZeZJ05xupsZSp6sty+2mXX2a/5rP0fT8MAHRZpmWph48J38zi6xUF1Vqft9KAg2BES6PmyChGGFTBVJ1kb/dq7XeeuTBs0deLLxXrLhHn2nP6+4s3Gk7Yl6Q5mpZMMjAGWjT0o+dgkR6BVnUzJSW2PpzhpHVqIygdPiEET3rzwiHP2QCSlrjUm1epE0el+R1/E6SmjDa2nGEat5Bu9089bC9O7/1moDT0GJkMv5eR6f1oVY7MRfjp2SiNgOO5pkFBpnkadmD/qflRrAtiUrBhJFdPnauJhI6SU6noXSyb2BmUZUqzYKEqSSSZ6SUSU34WagYVUsg9N27R7DtkONWrmRcf8HHK1Lc4EjrqHJn6ZdxBIsXkXU2MqVZqU/ja5ZU/MyWR5/Bps1/wfD2p+G7TUy1QziWRHfZgVXsREd3H1YtnoW+vl709nSjv7f0V4MwPnRaRUGlxSm8rG7N0pAMlim/CE4Jk+tRbTxmAoYK4Qit/Mhb9/a9eze9ILW/YQwv5jvmM/fcs720YMnMDeWStabtJrmVUVaqtsy3sRqgAm+96yH85qbb4DZqWNjfi57uHlRKJViWjSCM0Wr5aDRaqDebqDeaqLkRLFugp7OIQudMrFn+JvT3z8Ee8+dgVldxp+tkpUB42ZZgqLrEnyUq89MkODkunjVVoREFMao5G367een6lZ2fejEQXrbiBgbbn+qZUbyETcWs2KZ/Ynsoi6aMgEPjLVz6Xz/B1OjT2P8tyzB7Zm/i6IMQYRghDGk2ielkLaKIPiiM4PshGk0XzWYDU40a6m6Ickmi3N2Lt+y1B5a+eQ+sXLIQM7rLxi1QiR47I2l3xPizFFyitsQnmqhq8juNks1go2BrDRG4WwMv3veItT1TLwTvZYH7w0NP9y7sn3NPqSgXMiCYRuNz1MbE9eEnRnDhpVdh1fxu7L1iCYIwghcECKMYUfaMY4Rh8jogxJgQNQjP+CECpUK4H8bwPR8tgmzW0Ao8lEsW+vrn4sA1S7Fs2VKsXDIP1UrO3BymMD7PEwvj6wJjnjTTJFAEsUJOJj4y8iMUWIfE8bp1Kzs2virgtg23PtHTV7os9JI0wASFNPWg4vI54LGBMZz/je/i71YvQv/sWXA9D2EYIooiAzCOYoRxDM/z4Xo+PC+Az2MR31NpkU4fpKGUQKRkoiSCjCSiSCAKVPLddgON9hQsK0TXjA7su3YVDjt0Hdbu82ZzbQYgVZb6OJOW0GQjZW54XtACInTkHXjt5kXr9+r4zG4Hd/bZZ8uTTz1rY7liHxiHiR9h+sFAQHNxJMulCGed/x2jtHlv6ofruogILaZpEl6MIAiML2u1XQRhaIDxeKZGqoEAObgoTkBGkUp7bvRRfC0QRpZRkYqk6SjHcYDQryNXVNj/oLX4yIc/iMULZyVVSFr0GxVmlQWDg0xSFG5j372rV1fXr1wpdhldX7Kpbn2mtbqrs7jRkqLIC6VDzgIBwZUKwGXfuwFjA49g331WoO26CSwDh/BieK6HyakaPM9LTZbv0WQJL0r2o9ioMkhN2gDka0JkDhYpExW1FtCQEMKGlg6gbWhTxjPFaKBvZgUfP/njOHz9WrRS5QXG9AkvzeXoHxXrVw0n9puxEm8+dGVlaFeqe8ngBifiT1Y65aUha7+0+M7Sj0IeeOixYXznO1fiHQfvY1REs4wiBoIAcRQZkBOTk/B9P1GSCRBBoraQn/dTmDxOiATGLV+nioxjA49wINjAY4YtIaQFwX1hQYtkn/AtW+Okfzsdf/+OA9H2Uj+XdoiZltBebaGh2a9DrONYvfdtK8q/2L3gaurXxaI4WqUJJH2ETTPltVsaX73wvzG7IjGrrwce4RhoieKCMMDY+LiBZ2AwGJjAQKg0Sx6jCrWBmQAlTJo3vx+ZvIvOXLBEEAJCMPFNQrkBBwnNfcuGMFAFlIqRyxdw+he/gv1WL0PDTftzSicd41jBYaURa/SUHLTrjc+vX9mxy47JS1LcpoGB4qKOuZvzebFMpyUPT0BoTD023P0wfvWL67DfPsvhut4O80z8Woip+hQma41UWVQRDMwEXIQ43Se4OApSYEAYeAijwADSmp1RghPGt3Kb5MMJxEx9VJ2QNu8mYNlQUYj+hUtx9nnnolIpw83KrrSSMOCURmfOQejWr37bis6P7DbFba/ptZal77SlyPFy6WC5ZedBKYWLLrkKs6oOCvl8AoR+zWwjeL6L4dFRuJ5CEGpTsEeBQBD4iFWMWEWIwjpU6Ca+kNswNll+zCgECSkcKM02CQtS/nK0oxPDFDzRIYFSfYRIcFRfzgDktRz7z5/E8Scci7ar0g4xc0aePen0VaSAiLxHutVTe6/cRfn1khQ3OBEdU6xYv4oZbzjJopJISrX96aFtuOaH12D5ogXw/QABVZQFhCDC5NQ4xienEIQCbijh+RKTvXPhVYrIPTGAXLOOOJ4AwhAxzTKomTTEdHy1l/guc5voWTmXSPWFSVAwf7FRH83YuD5jxgQooS3HqE9Bomf2fJx9wcXo7KjAp3swLSZApjPeJUvDioLBkttYvHZtf/v5VPeSwD09Fp9Z7pDnEhzvD1MEqo2d2ut+swEPbr4fM3p7jIqYbhjlBKHxdcMjQ0ZtXmjDbSsMLFqJx048AWDWv/kvWPjNy2DXB5hXAHEIpZqwZNVct1INSFkyoJRyE1g6hjaFnp2IDyrxezqFaMClHQdjsjljsrzuk8/4Cg46ZF9zPQYc05k0qpYswFH+uCW9VYcsm7F994CbiL5fKlkf4lyC1nSswnRlWcBfftVP0RgZRqGQR2jKKd/4JZrpxOQExicmEIQWvDCHhu9gyz99FN76VQCt0AZmnnUxSg/cAUuGEKoJaBdSZjVpBCk7EnDahxRlKHCfjbccNPMis29mWSGMH6TqNKQxWStJVayccQvrjv4ATj7lRLTcpL1k2kym0GUJJlASvuvo6JADV3RtfsngbtXa3gsoBA3k3Rakb8GtiuiaUtk+xveUqRjoU9gmKuYFLr/yGkwMjSBH5xrQ4dNPBaYiGBwehOu24QUCXuhgSnTjsTPOQDxvRjqjrNB31tdRfvwB5O0cEI9BaA9SVhCpGqA56+NAa/oIC5AER2XlmfdDhT60FLBoxlYAof0UnjLukAo1arPyxhev2vcAnHbWOSaJNmWe6elRCAm4TukrS0XvOGivrt+9aHDba8GaQt56r4A8XADztYIVKgimXH6M7iDUebackzJLIm8LlIsSP/jRz/HU1ieQcywDLnHwAWq1BsbGR5M6lYrzJEZmLsHw5z8LlOm0AWwfQ885X0Ol/oypHRFPwpZF2FYXwngEgoBEHpEaNwpTyJsqROsCgupMtFeshLt8Oap/ug8d998CKQgvgICfRFppm/QEBAdg1oIlOOMrF6BcLsAPlCnHIjPvClQcgW4nhFThPxy8ovPXLwjugaGh8uxyzwXlvPOxsoPC9PUaZpYoLZobHtAMtAEhoVDKSXSUHdy+YSN+d9MGFKm4NK0gwKHhUTSaNZPL+ZEFzwXGVrwNk6edlkDjHMLmrei78DzkLR8W18qoEUiRgxR5xKoJ2+ox4EJVh5B9UDqPel8vWgccAW/Naug5Myk84OkJzDn3FOTbIwacFASXJMSC/XOZhxISHTP6ceZ5F6GzuxNekEb5IKlIOvISvU7AhPiog5ZVbtgluE0DurigHPx4RnfunXQXbNJm8wEZQAYCphDs99c9YMqDKbALtjJNyNGRQVx++dWwtDA5GHMyz/ewfXAYntdE4AfwjFkINHsXY+JzXwPmdptGXunKH6D79uuRzxVhqwBKDSFnzTTRNIrHIQXz+RAxTVF1obFqPcY/ehLQVU2CLG+AApwNGzHjR99GTk0Bqg0pvCQ9sRxIY6o5aGmjWOnCmed/A70zZ8INmCpxbGwoAF0Fgd5cEBVkfNj+Szvu2CW4rUPumTN6C+faCijwxqTTeNmXssV+bM1w9oiqm2wToELgt1AtSHQULVxzzU/w5/u2mKUMcRCg3W7hmeFhBF4rKaPY6WDGJDrQnrcUrdX7wRkcQuXe22HHU7CFgDT+zE/AKR9au7CsPkSqAWWiaieG3nkCvPe9G+DSGQrqwUdRuHUjylvvQS4ahaObELoBAVqFSCsJzto4Jkg4OQdn/sd/ord/Plw/MtAIj5Y1oywxq+DXrThae8CKzq3PC+6ux4dndRZ67uut2nM68sn6jWxtx/QvZebKiWKCq7WAmtm2IZSPGR0FjI9uxxVXfB+tqTokYgNu++AQVOSZ1EErunSWRBXTyYASkLIAbdGnMBhI6Lhu5COlA61Ck39JUTHRVAtO73ej0TMbEyeeBj1vjlGauP8RVL7/A+SDQdiowVF1SN02UVaa2fAkl2NU5TNnC5z+5QswY/5iuG4EN1KmhtWxwNwuBws7w+G85S1ftaBr8nnB3f1Y8/hqtfzDzhzQU0qm0v4WOLam6ecIjl2GWhuYaFF5IcamJtFZtNDX4WDzvZvxv9dej9BzoaIIo+Oj0FEAzSxfhyYSa50W5iAU20RNafIuwmol/k0yGPAGJJ0OZSJqHkqWEcU22vPegua/nAR0dxvVWZv+iI6fXomcrsNRDWhNU9UmAWZoVVYOgsFBOCjlLXzqjC+ia+6eaHsRmp5GMScxu8NCf4eF7qKIRBQ8mnfkz4PQ/83SuX/d2BSbHmne3Fktv72vDHQUEsWxGnjuIwPH3hf93FQbGKnTXDUeGhiCFDFmVHPoKlu49dYN+O1vb4alYozXpqBjggvNBHDyYIHDhJVQ+IiSYolFuXHqBQhGT+VCWiUTGaOYQIuIhYWQ34tLcBeugH/ch4DuXmBkEJXvXoB8ewwWXGiT77GWSBoA9G9cKBcLB92dFZx02umI8r0m9Vszv4QVsx10FYUZu7GuNHeuN1XkB9FN7Xbwmb0XVh/KuIhNWwOvs2Tn+6rCZAecITezU9PWc5i0Ml0JZKbfwsTHDU0Bky6wYcs20w7qrThGeaW8xJ0bN+HW2+5Eo9k0lQT9jWkEMVHl2dnhoNp4VLBc4uI4JrKRAcgEO7HDXFLQE64oGNz0k0pUkvUhCxZDrz4A4tEHkXvwLtgihNSJa0gEQNfAXp0NZTnGVSxeuADHHHcCpJXD+9f0YcUc2zRgn6sXnr9O3yeBlqeGJyfDE1cvKlxvkuvfP6512QF6y8kCFwYHllHZsgSezAwh7ZhyPIRHH/fMJDDWAn72x8dQb7XRVbZNoKgWLBRyAvfe/wBuuf0u1CYnIWVaQ9K5pRMrdNw8v5khM2rjZ2iYVGJWfxJunJbwBGjm0kx6ohj/zQpryyS82lKQpopgI0AnLodmaop9C4rVAwTWH3wgluy9Fh/cbxbWLSqa6idbJfpcS3PNupNkQnuioVrDk976I1eV7xW3b2lvL5eKczoLQKWQrIqk6rIeWwYuWw1kymwFTLaAgQlgsK5xxa1bUGu66ChYqOSpXMss4Ms5EtsGnsatGzahMTaWhutsLWsaug2s7F5nix7S/CKZ/08L+7RlZMqpDJ4hk62JShWbLj805Ve2II9zlCbJQqW7C/sftA4HrZiPUw/vRweD7S7A0a/XXW1SsLYSeGpIbxiZeOpIccufG8dVOys/5r2o5JNVQaw9WUrxhDRbk46k62/5moobbySKu397gK/9ZgsKFlDNSZQJzhHI2xKOJVDISTRbbfzpwS0YePxxxL73rJzNwNJZ62yG2dzydNlOUqVnK4PTdpKRWLqfLe/JPpO9nuZnTFRNyFj5Apbtswr5rpn4wpELcPiyqhHKrhTHsTJ4TLnCWNdgA3Dr/lHiuo2j1XJf7x2VvNiHTbZyBs9OA8U02zcTMjKJrsNTwEgT+NE9ow9864Ytt/dVZVDNW6LsSBT5XUsgZ7P7L5BzbDPX+qeHH8HAlr+YZQeJjSWpwk4P2pdhk05mcHfHa3YyzXKa9GD6mez9hOiOhHjHwjzzOzZ65s3B/D2XolSt7nnh+5a9a0mfZcZLkTz3MrJronVxoQ+ziPEWsL3GXDZ60NjIr/6sjynk8EsHEPRxDBK8E1ztw+k+njhHFTqJCTMl4Qm21eDd/KR7+NePLt35fPnO/8fj592ljz5sPn49rwBUC4mF0bqmp2HZMguKhOC4kpPpF8fNgLEjkPzyz/qzjo3zcwKSyqOfy2avePKuNHgwUjEB3j4FbB1R973/3zfsh9ten/+nerk35RM36MPfswdu2qMDoqOY9BO59jhb6zJdbVneyhSMixPpnphR7BSBr3tAf9i2cH45j9k0Dy58Zreitwr0dSRK5J0YbwJDLfo39eWTDrTOebkDeL2+13e5nnPZfrh/UTdmVvOJb6fq6OsIzziK9H8lCI6RldtMcX46ZbDT9V//oJ6fAz4iBI7VMfYp5SBmEFw1uTNcezFcB56YQPv329qHfPXo8n2vF4BX8rsXbdS/WD0L72ZThfA4NrqiLIdlMGSfjtBYn1Nx9HH1wDQ7Nj9v6/zGB3S5HWCvUlFfvWiGWMYFQpQzzXSoAfxlWD1w0X1y33tPEkyy33CPk6/TBx8yF7f05pDjuIrOzuaaVUoExxKT43a5akFCtVys3+Wcwweu1dbHV+LxN3VhPsEx8jANGfOAh4eiL5x0iHPeG47YtAv+9I3xp9f0yIvLDAw6ySIY/ExSnpkqVcels/x/syLgtXHpx9bhlF2CO/tanVuzHHfPqmJVOf0nNdr5SFP7D02Eb/3iEfkdtdsbFeCXbtYfXlDGueU85iKZsjXZklnpyZdpGmgWFcS4pGsQnzvuOBG/4CzXFX/Qp+zZi28pPzkZHeNIS337X2+Qp+IckWajb1RsyXWffqOeN8tRH+rKyWOhsSBnYyYziiCAa0k8EQKb2kF01acPc3akXS8IbsW1Onf6AnVib16ewqWz21vq9qu2yNPeqL7thW7xZ65391jcV1jE/1qKFcaeCfDwOYeK9D83nv32/wHzrWgvjJ8Q7AAAAABJRU5ErkJggg==",width:39}):null]},t)}))}),d]}),i&&(0,o.jsx)("img",{style:{marginTop:33,marginRight:38},src:i,width:u})]})})},u=n(79800),c=n.n(u),h="row___aXJjm",d="title___HUKL0",f="tagsWrap___XB2W3",p="action___VdHb1",m="bar___t1kKC",g="tag___V7Eft",_="name___Hk1Ip",v="num___xQpcH",y="active___XryTX",b="tagsBorderWrap___OMxjs",x=n(92310),E=n.n(x),w=n(89392),T=function(e){var t=e.dataSource,n=void 0===t?[]:t,r=e.value,a=e.onChange,s=e.onTitleChange,l=e.className,u=e.title,x=e.titleWidth,T=void 0===x?41:x,S=e.style,A=void 0===S?{}:S,C=e.fontColor,L=void 0===C?"#6A7283":C,R=e.showCount,I=(0,i.useState)(0),D=c()(I,2),k=D[0],M=D[1],P=(0,i.useState)(!1),O=c()(P,2),N=O[0],F=O[1],B=(0,i.useRef)(null),U=(0,i.useRef)(null);return(0,i.useEffect)((function(){var e;0!==n.length&&((null==B||null===(e=B.current)||void 0===e?void 0:e.clientHeight)>97?M(1):M(0));0===n.length&&M(0),F(!1)}),[n]),(0,o.jsxs)("div",{className:E()(h,l),style:A,children:[(0,o.jsx)("div",{onClick:(0,w.throttle)((function(){return null==s?void 0:s()}),2e3),style:{width:T,marginTop:N?12:4},className:"".concat(d," ").concat(s?"current":""),children:u}),(0,o.jsxs)("div",{className:N?"".concat(f," ").concat(b):f,children:[(0,o.jsx)("div",{className:m,ref:U,style:k>0?{height:1===k?97:"auto",overflow:1===k?"hidden":"auto",paddingRight:55}:{paddingRight:0},children:(0,o.jsx)("div",{className:g,ref:B,children:null==n?void 0:n.map((function(e){return(0,o.jsxs)("span",{onClick:function(){return a(e.id)},style:{color:L},className:r===e.id?y:"",children:[(0,o.jsx)("span",{title:e.name,className:_,children:e.name}),!!R&&(0,o.jsx)("span",{className:v,children:e.count})]},e.id)}))})}),!!k&&(0,o.jsx)(i.Fragment,{children:1===k?(0,o.jsxs)("div",{onClick:function(){var e;M(2),(null==B||null===(e=B.current)||void 0===e?void 0:e.clientHeight)>245?F(!0):F(!1)},className:p,children:["展开",(0,o.jsx)("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})]}):(0,o.jsxs)("div",{onClick:function(){U.current.scrollTop=0,M(1),F(!1)},className:p,children:["收起",(0,o.jsx)("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})]})})]})]})},S="tabs___GTqPV",A="active___F26E8",C=function(e){var t=e.dataSource,n=void 0===t?[]:t,i=e.value,r=e.onChange,a=e.className,s=e.style,l=void 0===s?{}:s;return(0,o.jsx)("div",{style:l,className:E()(S,a),children:n.map((function(e){return(0,o.jsx)("span",{onClick:function(){return r(e.id)},className:i===e.id?A:"",children:e.name},e.id)}))})},L="input___PW2zI",R="dropdown___vSy8B",I="menu___NiyBu",D="text___Grueu",k="b1___ZKryM",M="b2___aKyGa",P=n(37568),O=function(e){var t,n=e.dataSource,r=void 0===n?[]:n,a=e.value,s=void 0===a?"":a,l=e.onChange,u=e.onInputChange,h=void 0===u?function(){}:u,d=e.className,f=e.style,p=void 0===f?{}:f,m=e.placeholder,g=e.allowClear,_=void 0!==g&&g,v=(0,i.useState)(""),y=c()(v,2),b=y[0],x=y[1],w=(0,i.useState)(""),T=c()(w,2),S=T[0],A=T[1];(0,i.useEffect)((function(){var e,t=s;null!==(e=JSON.stringify(s))&&void 0!==e&&e.includes("{")&&(x(s.id),t=s.value||"");try{A(decodeURIComponent(t||""))}catch(e){A(decodeURIComponent(t||""))}}),[s]);var C=function(){l(encodeURIComponent(S),b||null)};return(0,o.jsxs)("div",{className:E()(L,d),style:p,children:[!!r.length&&(0,o.jsxs)("div",{className:R,children:[(0,o.jsxs)("div",{className:D,children:[null===(t=r.find((function(e){return e.id===b})))||void 0===t?void 0:t.name,(0,o.jsx)("i",{className:"iconfont icon-zhankai4"}),(0,o.jsx)("b",{className:k}),(0,o.jsx)("b",{className:M})]}),(0,o.jsx)("div",{className:I,children:r.map((function(e,t){return(0,o.jsx)("div",{onClick:function(){var t;(t=e.id)!==b&&(x(t),l(encodeURIComponent(S),t))},children:e.name},t)}))})]}),(0,o.jsx)(P.Z,{onPressEnter:C,value:S,onChange:function(e){A(e.target.value),h(encodeURIComponent(e.target.value),b||null)},placeholder:m,variant:"borderless",allowClear:_,onClear:function(){return l("",b||null)}}),(0,o.jsx)("i",{onClick:C,className:"iconfont icon-sousuo9 font14 current"})]})},N="quickPager___GM30J",F="disabled___Ozc8I",B=function(e){var t=e.value,n=e.onChange,i=e.className,r=e.total,a=e.pageSize,s=e.style,l=void 0===s?{}:s,u=t<2,c=t>=Math.ceil(r/a);return r<=a?(0,o.jsx)(o.Fragment,{}):(0,o.jsxs)("div",{className:E()(N,i),style:l,children:[(0,o.jsx)("div",{onClick:function(){u||n(t-1,"prev")},className:u?F:"",children:"上一页"}),(0,o.jsx)("div",{onClick:function(){c||n(t+1,"next")},className:c?F:"",children:"下一页"})]})},U="list___oOsiS",G="wrap___G6T7F",z="lockWrap___Rl79E",j="li___oZZ7l",H="cover___b2bYW",V="img___IQX7w",W="sign___HkT6C",Z="name___SsJx8",K="e___TMqq0",q="tags___bcjyo",X="rate___YACg7",Y=n(29787),Q=n(25399),$=n(58018),J=n(6816),ee=n(32985),te=n(96908),ne=n(57177),ie=n(81378),re=n(90059),ae=function(e){var t=e.className,n=e.dataSource,i=void 0===n?[]:n,r=e.col,a=void 0===r?4:r,s=e.right,l=e.bottom,u=void 0===l?23:l,c=e.precision,h=void 0===c?0:c,d=e.wrapWidth,f=void 0===d?1200:d,p=e.trackEventItems,m=e.loading,g=Math.floor((f-(a-1)*s)/a);return(0,o.jsx)(Y.Z,{spinning:m,children:(0,o.jsxs)("div",{className:E()(U,t),children:[!!i.length&&i.map((function(e,t){var n=e.name,i=e.id,r=e.identifier,l=e.power,c=(e.cover_image_id,e.pic);return(0,o.jsxs)("div",{className:G,style:{width:g,marginRight:(1+t)%a==0?0:s+h,marginBottom:u},children:[(0,o.jsxs)("a",{target:"_blank",href:"/shixuns/".concat(r,"/challenges"),className:j,onClick:function(e){e.preventDefault(),p&&(0,ee.L9)([p]),l&&(0,ee.xg)("/shixuns/".concat(r,"/challenges"))},children:[(0,o.jsxs)("div",{className:V,children:[(0,o.jsx)("img",{className:H,src:"".concat(c)}),e.is_jupyter&&(0,o.jsx)("img",{className:W,src:te}),e.is_jupyter_lab&&(0,o.jsx)("img",{className:W,src:ne}),e.is_unity_3d&&(0,o.jsx)("img",{className:W,src:ie})]}),(0,o.jsx)("div",{className:Z,children:(0,o.jsx)(Q.Z,{title:n||"实践项目名称-未填写",children:(0,o.jsx)("span",{className:K,children:n||"实践项目名称-未填写"})})}),(0,o.jsxs)("div",{className:q,children:[(0,o.jsx)(Q.Z,{placement:"bottom",title:"关卡数",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),(0,o.jsx)("span",{children:e.challenges_count})]})}),!!e.myshixuns_count&&(0,o.jsx)(Q.Z,{placement:"bottom",title:"学习人数",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-chengyuan font14 mr2"}),(0,o.jsx)("span",{children:e.myshixuns_count})]})}),(0,o.jsx)(Q.Z,{placement:"bottom",title:"难度等级",children:(0,o.jsx)("span",{children:(0,o.jsx)("span",{children:e.level})})}),(0,o.jsxs)("div",{className:X,children:[(0,o.jsx)($.Z,{allowHalf:!0,disabled:!0,defaultValue:e.score_info}),(0,o.jsxs)("span",{children:[" ",e.score_info?"".concat(e.score_info,"分"):"5分"]})]})]})]}),!l&&(0,o.jsxs)("div",{className:z,children:[(0,o.jsx)("img",{src:"".concat(J.Z.IMG_SERVER,"/images/educoder/icon/lockclose.svg")}),(0,o.jsx)("span",{className:"mt15 font16 c-white",children:"定向开放内容,需要授权"})]})]},i)})),!i.length&&(0,o.jsx)(re.Z,{})]})})},se="list___jb2Ay",oe="wrap___VsQDr",le="li___IxCLC",ue="cover___Mu8wr",ce="img___IpFLA",he="movebq___mF7wt",de="bq___Bil0T",fe="sign___DXJ4d",pe="name___l7FoJ",me="e___pXQUG",ge="unit___wCIFR",_e="tags___w_Mil",ve="wrapisCurrent___qIfQT",ye=n(60242),be=n(56800),xe=function(e){var t=e.className,n=e.dataSource,i=void 0===n?[]:n,r=e.col,a=void 0===r?4:r,s=e.right,l=e.bottom,u=void 0===l?23:l,c=e.precision,h=void 0===c?0:c,d=e.wrapWidth,f=void 0===d?1200:d,p=e.trackEventItems,m=e.loading,g=e.onRemove,_=void 0===g?function(){}:g,v=e.isCurrent,y=void 0===v||v,b=e.showProgress,x=void 0!==b&&b,w=e.showAlias,T=void 0!==w&&w,S=Math.floor((f-(a-1)*s)/a),A=[{name:"推荐自学",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101计划",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"国家一流",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"省级一流",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"精品课程",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"军队一流",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"新型教材",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return(0,o.jsx)(Y.Z,{spinning:m,children:(0,o.jsxs)("div",{className:E()(se,t),children:[!(null==i||!i.length)&&(null==i?void 0:i.map((function(e,t){var n,i,r,l,c,d,f=e.name,m=e.id,g=e.identifier,v=(e.featured,e.school_name),b=e.image_url;e.excellent,e.is_plan;return(0,o.jsx)("div",{className:y&&x?ve:oe,style:{width:S,marginRight:(1+t)%a==0?0:s+h,marginBottom:u},children:(0,o.jsxs)("a",{className:le,onClick:function(e){e.preventDefault(),e.stopPropagation(),p&&(0,ee.L9)([p]),(0,ee.xg)("/paths/".concat(g))},children:[(0,o.jsxs)("div",{className:ce,children:[(0,o.jsx)("img",{className:ue,src:"".concat(b)}),y&&(0,be.bg)()&&(null==e?void 0:e.studying)&&(0,o.jsxs)("div",{className:"".concat(he," user-path-items"),onClick:function(t){t.stopPropagation(),_(e)},children:[(0,o.jsx)("i",{className:"iconfont icon-yichu1 mr5 c-red"}),(0,o.jsx)("span",{className:"c-red",children:"移除"})]}),null==e||null===(n=e.subject_tags)||void 0===n?void 0:n.map((function(e,t){var n;if(0===t){var i,r=null===(i=A.find((function(t){return t.name==e})))||void 0===i?void 0:i.swimg;return(0,o.jsx)("img",{className:fe,src:r,style:{left:"-4px"}})}var a=null===(n=A.find((function(t){return t.name==e})))||void 0===n?void 0:n.ptimg;return(0,o.jsx)("img",{className:fe,src:a,style:{left:"".concat(48+52*(t-1)+2*t,"px")}})})),(0,o.jsx)("div",{style:{position:"absolute",top:"150px",left:"4px"},children:(null==e?void 0:e.excellent)&&(0,o.jsx)("div",{className:de,children:"开放课程"})})]}),(0,o.jsx)("div",{className:pe,children:(0,o.jsx)(Q.Z,{title:T&&null!=e&&e.excellent_alias_name?(0,o.jsxs)("span",{children:["课程原名:".concat(f),(0,o.jsx)("br",{}),(0,o.jsx)("span",{children:"课程别名:".concat(null==e?void 0:e.excellent_alias_name)})]}):f,children:(0,o.jsx)("span",{className:me,children:T&&(null==e?void 0:e.excellent_alias_name)||f})})}),y&&x&&0!=(null==e||null===(i=e.progress)||void 0===i?void 0:i.all_score)&&(0,o.jsxs)("div",{style:{padding:"0px 10px",color:"#333",marginTop:10},children:[(0,o.jsx)(ye.Z,{strokeColor:"#44d7b6",gap:"small",percent:((null==e||null===(r=e.progress)||void 0===r?void 0:r.my_score)/(null==e||null===(l=e.progress)||void 0===l?void 0:l.all_score)*100).toFixed(),showInfo:!1}),"已完成 ",null==e||null===(c=e.progress)||void 0===c?void 0:c.my_score,"/",null==e||null===(d=e.progress)||void 0===d?void 0:d.all_score]}),(!y||!x)&&(0,o.jsx)(Q.Z,{title:"发布单位:".concat(v),children:(0,o.jsxs)("div",{className:ge,children:[(0,o.jsx)("i",{className:"iconfont icon-danwei1 font14 mr3"}),v]})}),(!y||!x)&&(0,o.jsx)("div",{className:_e,children:(0,o.jsxs)("div",{children:[(0,o.jsx)(Q.Z,{placement:"bottom",title:"章节数",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),(0,o.jsx)("span",{children:e.stages_count})]})}),(0,o.jsx)(Q.Z,{placement:"bottom",title:"学习人数",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-chengyuan font14 mr3"}),(0,o.jsx)("span",{children:e.members_count})]})})]})})]})},m)}))),!i.length&&(0,o.jsx)(re.Z,{})]})})},Ee={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},we=function(e){var t=e.className,n=e.dataSource,i=void 0===n?[]:n,r=e.col,a=void 0===r?4:r,s=e.right,l=e.bottom,u=void 0===l?23:l,c=e.precision,h=void 0===c?0:c,d=e.wrapWidth,f=void 0===d?1200:d,p=e.trackEventItems,m=e.loading,g=e.handleVery,_=void 0===g?function(){return!0}:g,v=Math.floor((f-(a-1)*s)/a);return(0,o.jsx)(Y.Z,{spinning:m,children:(0,o.jsxs)("div",{className:E()(Ee.list,t),children:[!!i.length&&i.map((function(e,t){var n=e.subject_identifier,i=e.id,r=(e.identifier,e.power,0!=e.is_public&&e.is_public);return(0,o.jsxs)("div",{className:Ee.wrap,style:{width:v,marginRight:(1+t)%a==0?0:s+h,marginBottom:u},children:[(0,o.jsxs)("a",{className:Ee.li,onClick:function(t){t.preventDefault(),_(null==e?void 0:e.first_category_url)&&(p&&(0,ee.L9)([p]),(0,ee.xg)(e.first_category_url))},children:[(0,o.jsxs)("div",{className:Ee.top,children:[(0,o.jsx)(Q.Z,{title:e.name,children:(0,o.jsx)("div",{className:Ee.name,children:e.name})}),(0,o.jsx)("img",{className:Ee.img,src:J.Z.IMG_SERVER+"/images/"+e.avatar_url}),(0,o.jsx)("div",{className:Ee.text,title:e.creator,children:e.creator}),n&&(0,o.jsxs)("div",{className:Ee.btns,children:[(0,o.jsx)("div",{children:"开放课程"}),(0,o.jsx)("aside",{children:"开放课堂"})]}),r&&(0,o.jsx)("div",{className:Ee.sign,children:"公开"})]}),(0,o.jsxs)("div",{className:Ee.bottom,children:[e.visits>0&&(0,o.jsx)(Q.Z,{title:"访问量",placement:"bottom",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-liulanyan"}),(0,o.jsx)("span",{children:e.visits})]})}),e.course_members_count>0&&(0,o.jsx)(Q.Z,{title:"成员",placement:"bottom",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-chengyuan"}),e.course_members_count]})}),e.tasks_count>0&&(0,o.jsx)(Q.Z,{title:"作业",placement:"bottom",children:(0,o.jsxs)("span",{children:[(0,o.jsx)("i",{className:"iconfont icon-zuoye"}),e.tasks_count]})}),e.is_end?(0,o.jsx)("div",{style:{color:"#6B758B"},children:"已结束"}):(0,o.jsx)("div",{style:{color:"#00B187"},children:"进行中"})]})]}),!e.is_accessible&&(0,o.jsxs)("div",{className:Ee.lockWrap,children:[(0,o.jsx)("img",{src:"".concat(J.Z.IMG_SERVER,"/images/educoder/icon/lockclose.svg")}),(0,o.jsx)("span",{className:"mt15 font16 c-white",children:"非课堂成员不可进入"})]})]},i)})),!i.length&&(0,o.jsx)(re.Z,{})]})})},Te={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},Se=n(5030),Ae=function(e){var t=e.dataSource,n=void 0===t?[]:t,i=e.value,r=e.onChange,a=e.className,s=e.style,l=void 0===s?{}:s,u=e.tabBarExtraContent;return(0,o.jsxs)("div",{className:E()(Te.tabs,a),style:l,children:[(0,o.jsx)("div",{className:Te.tabsWrap,children:n.map((function(e,t){return!(null!=e&&e.hide)&&(0,o.jsxs)("aside",{className:Te.tab,onClick:function(){r(e.id),e.link&&Se.history.push(e.link)},children:[(0,o.jsx)("div",{className:i===e.id?Te.active:"",children:e.name}),null==(null==e?void 0:e.resetCount)&&void 0!==(null==e?void 0:e.total)&&(0,o.jsxs)("span",{children:["",null==e?void 0:e.total,""]}),void 0!==(null==e?void 0:e.resetCount)&&void 0!==(null==e?void 0:e.total)&&(0,o.jsx)(Q.Z,{title:null!=(null==e?void 0:e.tip)?null==e?void 0:e.tip:"",children:(0,o.jsxs)("span",{style:{color:"#9096A3"},children:["",(0,o.jsx)("span",{style:{color:"#000"},children:null==e?void 0:e.resetCount}),"/",(0,o.jsx)("span",{children:null==e?void 0:e.total}),""]})})]},t)}))}),(0,o.jsx)("div",{className:Te.tabBar,children:u})]})},Ce=function(e){var t=e.className,n=e.style,i=void 0===n?{}:n,r=e.children;return(0,o.jsx)("div",{className:E()(t),style:i,children:r})},Le="orderWrap___ZfyGX",Re="orderIconWrap___XTB_O",Ie="orderAsc___KWHmA",De="orderDesc___rHdbB",ke="active___a7eSP",Me="cursorPointer___gs9kL",Pe="orderTextWrap___teAKn",Oe=n(75727),Ne=n(93041),Fe=[{id:"updated_at",name:"最新动态"},{id:"created_at",name:"最新创建"},{id:"name",name:"名称排序"}],Be=function(e){var t,n=e.sortValue,i=e.dropValue,r=e.className,a=e.onSort,s=e.onDrop,l=e.dataSource,u=void 0===l?Fe:l;return(0,o.jsxs)("div",{className:E()(Le,r),children:[(0,o.jsx)(Oe.Z,{dropdownRender:function(){return(0,o.jsx)(Ne.Z,{children:u.map((function(e,t){return(0,o.jsx)(Ne.Z.Item,{onClick:function(){return s(e.id)},children:e.name},t)}))})},children:(0,o.jsx)("span",{className:Pe,children:null===(t=u.find((function(e){return i===e.id})))||void 0===t?void 0:t.name})}),(0,o.jsxs)("span",{className:Re,children:[(0,o.jsx)("span",{className:Ie,children:(0,o.jsx)("i",{className:"asc"===n?"iconfont icon-sanjiaoxing-up font12 ".concat(Me," ").concat(ke):"iconfont icon-sanjiaoxing-up font12 ".concat(Me),onClick:function(){return a("asc"===n?"desc":"asc")}})}),(0,o.jsx)("span",{className:De,children:(0,o.jsx)("i",{className:"desc"===n?"iconfont icon-sanjiaoxing-down font12 ".concat(Me," ").concat(ke):"iconfont icon-sanjiaoxing-down font12 ".concat(Me),onClick:function(){return a("asc"===n?"desc":"asc")}})})]})]})},Ue=n(82242),Ge=n.n(Ue),ze=n(7557),je=n.n(ze),He=n(41498),Ve=n.n(He),We=n(39647),Ze=n.n(We),Ke={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},qe=n(99571),Xe=["className","style","children","loading","openLoading","onClick","size","shape"],Ye=function(e){var t=e.className,n=e.style,r=e.children,a=e.loading,s=void 0!==a&&a,l=e.openLoading,u=e.onClick,h=void 0===u?function(){}:u,d=e.size,f=void 0===d?"middle":d,p=e.shape,m=void 0===p?"round":p,g=Ze()(e,Xe),_=(0,i.useState)(!1),v=c()(_,2),y=v[0],b=v[1];return(0,o.jsx)(qe.ZP,Ge()(Ge()({onClick:(0,w.throttle)(function(){var e=Ve()(je()().mark((function e(t){return je()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l&&b(!0),e.prev=1,e.next=4,h(t);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),console.log("error",e.t0);case 9:l&&b(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}(),2e3,{leading:!0,trailing:!1}),className:E()(Ke.btn,Ke["".concat(f,"-").concat(m)],t),style:n,size:f,shape:m,loading:y||s},g),{},{children:r}))},Qe="head___ghH72",$e="node___mjPEy",Je=function(e){var t=e.className,n=e.style,i=e.children,r=void 0===i?null:i,a=e.onClick,s=e.title;return(0,o.jsxs)("div",{className:E()(Qe,t),style:n,children:[(0,o.jsxs)("span",{className:"primary-hover",onClick:a,children:[(0,o.jsx)("i",{className:"iconfont icon-fanhui2 font12"}),"返回"]}),(0,o.jsx)("b",{title:s,children:s}),(0,o.jsx)("div",{className:$e,children:r})]})},et="btns___sNgTb",tt="confirm___Ozirl",nt="cancel___aiq1I",it=function(e){var t=e.confirmShow,n=void 0===t||t,i=e.confirmTitle,r=e.confirmClick,a=e.cancelShow,s=void 0===a||a,l=e.cancelTitle,u=e.cancelClick,c=e.className,h=e.style,d=e.confirmLoading,f=void 0!==d&&d;return(0,o.jsxs)("div",{className:E()(et,c),style:h,children:[n&&(0,o.jsx)(qe.ZP,{loading:f,onClick:r,type:"primary",className:tt,children:i}),s&&(0,o.jsx)(qe.ZP,{onClick:u,className:nt,children:l})]})},rt={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},at=function(e){var t=e.className,n=e.style,i=void 0===n?{}:n,r=e.LeftContent,a=e.children,s=e.RightContent;return(0,o.jsx)("div",{className:E()(rt.fixedBottom,t),style:i,children:(0,o.jsxs)("div",{className:rt.wrap,children:[(0,o.jsx)("div",{className:rt.left,children:r}),(0,o.jsx)("div",{className:rt.center,children:a}),(0,o.jsx)("div",{className:rt.right,children:s})]})})},st="crumbs___V41Oe",ot="hover___bEIVd",lt=function(e){var t=e.className,n=e.style,r=void 0===n?{}:n,a=e.dataSource,s=void 0===a?[]:a;return(0,o.jsx)("div",{className:E()(st,t),style:r,children:s.map((function(e,t){return t<s.length-1?(0,o.jsxs)(i.Fragment,{children:[e.path||e.onClick?(0,o.jsx)("span",{className:ot,onClick:null!=e&&e.onClick?e.onClick:function(){return Se.history.push(e.path)},children:e.name}):(0,o.jsx)("span",{children:e.name}),(0,o.jsxs)("span",{children:[" ",">"," "]})]},t):(0,o.jsx)("span",{style:{color:"#5F6368"},children:e.name},t)}))})},ut=n(11938),ct=["onChange"],ht=ut.Z.Countdown,dt=function(e){var t=e.onChange,n=Ze()(e,ct),r=(0,i.useState)(null),a=c()(r,2),s=a[0],l=a[1];(0,i.useEffect)((function(){"number"==typeof s&&s>=0&&t(s)}),[s]);return(0,o.jsx)(ht,Ge()(Ge()({},n),{},{onChange:function(e){var t=Math.floor(e/1e3);l(t)}}))}},70743:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return X}});var i=n(82242),r=n.n(i),a=n(7557),s=n.n(a),o=n(41498),l=n.n(o),u=n(79800),c=n.n(u),h=n(32985),d=n(25399),f=n(96599),p=n(60242),m=n(37285),g=n(29787),_=n(91882),v=n(82326),y=n(45685),b=n(62957),x=n(59301),E=n(5030),w=n(24455),T=n(11046),S=n(35218),A=n(7305),C=n(37712),L=[{name:"根节点",src:"/images/one.svg",color:"#CC7CF5"},{name:"课程",src:"/images/kc.svg",color:"#3241F7"},{name:"章节",src:"/images/zj.svg",color:"#5e54e7"},{name:"知识点",src:"/images/zsd.svg",color:"#FFDF55"},{name:"实训",src:"/images/sx.svg",color:"#4E9DFF"},{name:"作业",src:"/images/zy.svg",color:"#445DF3"},{name:"视频",src:"/images/sp.svg",color:"#6BC4DE"},{name:"课件",src:"/images/fj.svg",color:"#6BDE73"},{name:"试卷",src:"/images/sj.svg",color:"#2D9534"},{name:"其他",src:"/images/qt.svg",color:"#2D947C"}],R=function(e,t){var n={},i=null;return e.forEach((function(e){n[e.properties.uuid]=r()(r()({},e),{},{id:e.properties.uuid,children:[]})})),t.forEach((function(e){var t=n[e.startNodeUuid],i=n[e.endNodeUuid];t&&(t.id=t.properties.uuid),t&&i&&t.children.push(i)})),e.forEach((function(e){!t.some((function(t){return t.endNodeUuid===e.properties.uuid}))&&(i=n[e.properties.uuid])})),i},I=function(e){var t=e.loading,n=e.nodes,i=void 0===n?[]:n,a=e.relationships,o=void 0===a?[]:a,u=(0,x.useRef)(null),c=(0,x.useRef)(),h=(0,x.useRef)(0);(0,x.useEffect)((function(){(null==i?void 0:i.length)>0&&d()}),[]);var d=function(){var e=l()(s()().mark((function e(){var t,n,a,l,u,h,d;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l=R(null==i?void 0:i.map((function(e,t){var n,i,a,s,o;return r()(r()({},e),{},{key:t,title:null==e||null===(n=e.properties)||void 0===n?void 0:n.name,newcolor:1===parseInt(null==e||null===(i=e.properties)||void 0===i?void 0:i.color)?"#CC7CF5":(null==L||null===(a=L.find((function(t){var n;return(null==t?void 0:t.name)===(null==e||null===(n=e.properties)||void 0===n?void 0:n.nodeType)})))||void 0===a?void 0:a.color)||"#2D947C",colornodeType:1===parseInt(null==e||null===(s=e.properties)||void 0===s?void 0:s.color)?"根节点":(null==L||null===(o=L.find((function(t){var n;return(null==t?void 0:t.name)===(null==e||null===(n=e.properties)||void 0===n?void 0:n.nodeType)})))||void 0===o?void 0:o.name)||"其他"})})),null==o?void 0:o.filter((function(e){return"包含"===e.type}))),null!=c&&c.current&&(null==c||null===(t=c.current)||void 0===t||t.destroy()),u=(0,A.RN)(l),h=null===(n=u.nodes)||void 0===n?void 0:n.filter((function(e,t,n){return t===n.findIndex((function(t){return t.id===e.id}))})),d=null===(a=u.edges)||void 0===a?void 0:a.filter((function(e,t,n){return t===n.findIndex((function(t){return t.source===e.source&&t.target===e.target}))})),f({nodes:h,edges:d});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),f=function(e){var t,n;c.current=null,c.current=new A.kJ({container:u.current,autoResize:!0,autoFit:{type:(null==e||null===(t=e.nodes)||void 0===t?void 0:t.length)>20?"view":"center",options:{direction:"both",when:"always"}},animation:!((null==e||null===(n=e.nodes)||void 0===n?void 0:n.length)>300),data:e,node:{style:{labelText:function(e){return e.title},labelFill:"#333333",fill:function(e){return e.newcolor},labelBackground:!1,labelPlacement:function(e){var t,n,i=(t=e,(n=this.getParentData(t.id,"tree"))?t.style.x>n.style.x?"right":"left":"center");return"center"===i?"right":i},ports:[{placement:"right"},{placement:"left"}]},animation:{enter:!1}},edge:{type:"cubic-horizontal",animation:{enter:!1}},layout:{type:"mindmap",direction:"H",getHeight:function(){return 32},getWidth:function(){return 32},getVGap:function(){return 4},getHGap:function(){return 80},getSide:function(e){return h.current++,h.current%2==0?"left":"right"}},behaviors:["zoom-canvas","collapse-expand","drag-canvas"]}),c.current.render()};return(0,C.jsxs)("div",{style:{height:"100%"},children:[(0,C.jsx)(g.Z,{spinning:t,className:"mt60 w100",tip:"加载中..."}),(0,C.jsx)("div",{style:{height:"100%"},ref:u})]})},D=n(37205),k=n.n(D),M=n(42441),P=n(56800),O=function(e){var t,n,i=e.abilityGoalItem,r=void 0===i?[]:i,a=null===(t=(0,P.eY)())||void 0===t?void 0:t.username,s="number"==typeof(null==r||null===(n=r[0])||void 0===n?void 0:n.user_grasp_rate),o=r.map((function(e){return e.grasp_rate})),l=r.map((function(e){return e.user_grasp_rate}));return(0,C.jsxs)("div",{className:"flex flex-col item-center mt-20px-rem",children:[(0,C.jsxs)("b",{className:"text-16px-rem",children:[" ",s?"能力图谱个人掌握情况":"能力图谱掌握率情况"]}),s&&(0,C.jsxs)("div",{className:"flex item-center gap-20px-rem text-14px-rem mt-10px-rem",children:[(0,C.jsxs)("div",{className:"flex item-center",children:[(0,C.jsx)("b",{className:"mr-10px-rem flex",style:{width:"16rem",height:"8rem",background:"#CDCB56"}}),(0,C.jsx)(d.Z,{title:a,children:(0,C.jsx)("span",{children:(0,h.Pq)(a,4)})})]}),(0,C.jsxs)("div",{className:"flex item-center",children:[(0,C.jsx)("b",{className:"mr-10px-rem flex",style:{width:"16rem",height:"8rem",background:"#028DFD"}}),"系统平均"]})]}),r.length<3&&function(){var e=r.map((function(e){return e.name})),t=[{type:"bar",name:"系统平均",data:o,barMaxWidth:"20%",barGap:"50%",itemStyle:{color:"#028DFD"},label:{show:!0,position:"top",formatter:"{c}%",color:"#666"}}];s&&t.unshift({type:"bar",name:a,data:l,barMaxWidth:"20%",itemStyle:{color:"#CDCB56"},label:{show:!0,position:"top",formatter:"{c}%",color:"#666"}});var n={tooltip:{appendToBody:!0,trigger:"item",formatter:function(e){var t=e.value,n=e.name,i=e.seriesName;return"<div>\n ".concat(n,"<br/>\n ").concat(i,"").concat(t,"%\n </div>")}},grid:{left:"0%",right:"10%",bottom:"3%",containLabel:!0},xAxis:{data:e,axisLabel:{color:"#666",formatter:function(e){return e.length>4?e.substring(0,4)+"...":e}},axisTick:{show:!1},axisLine:{show:!1}},yAxis:{show:!1,type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#666",formatter:"{value}%"},splitLine:{lineStyle:{color:"rgba(164,200,252,0.1)"}}},series:t};return(0,C.jsx)(M.Z,{option:n,className:"w-full"})}(),r.length>=3&&function(){var e=1.2*Math.max.apply(Math,k()(o).concat(k()(s?l:[])))||10,t=[{value:o,name:"系统平均",lineStyle:{color:"rgba(2, 141, 253, 1)",window:3},areaStyle:{color:"rgba(2, 141, 253, 0.35)"},itemStyle:{color:"rgba(2, 141, 253, 1)",borderWidth:2}}];s&&t.unshift({value:l,name:a,lineStyle:{color:"rgba(205, 203, 86, 1)",window:3},areaStyle:{color:"rgba(205, 203, 86, 0.35)"},itemStyle:{color:"rgba(205, 203, 86, 1)",borderWidth:2}});var n={tooltip:{appendToBody:!0,trigger:"item",position:"right"},radar:{indicator:r.map((function(t){return{name:t.name,max:e,min:0}})),splitArea:{areaStyle:{color:["#fff","#f3f4f9"]}},name:{color:"#333",fontSize:12,formatter:function(e){return e.length>3?e.slice(0,3)+"...":e}},nameGap:5,axisLine:{lineStyle:{color:"#D9D9D9"}},splitLine:{lineStyle:{color:"#D9D9D9"}},center:["50%","50%"],radius:"50%"},series:[{type:"radar",symbolSize:2,tooltip:{trigger:"item",formatter:function(e){console.log(e);var t=e.name+"<br/>";return e.value.forEach((function(e,n){t+=r[n].name+""+e+"%<br/>"})),t}},data:t}]};return(0,C.jsx)(M.Z,{option:n,className:"w-full"})}()]})},N=n(12532),F=n(67310),B=n(6816),U=n(99074),G="NextAbility___wLOPq",z="AnchorDomStyle___CG1xj",j="AnchorDom___jjRxi",H={"实训":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA1lJREFUWEfFl09oXFUUxn/nvTEpbXXRos4bgwgGRYtZCIILhQSFtgEjgnShCNJV05pMqQstpV1UjW6seY1pFERB6EYEJVJbRMmALgqCixTFlgoupjOjUhdNo0068z65w0ycmcxMJmbk3e39zne+d/69c40Oz45P1PPnbwxZxEgkHjQjJUg5c4OcRM4zfpLH7LY7mftxjy13Qm1rge6ZVnK5yLEInkfctha+fG9c8+B0T4Ljvx6wQjublgL6T6r3L3EkEoeALR05Xg1a9IwTm403Lo/bUjOOpgLcV98o8hni0f/ouN7MOL8pwTPNorFKQN+kBkrGGYm+rjivkJiR9T2Gs2N2oZa3ToD78qUi33fbedWhE9Gb4JHaSKwIcDm/LjJdC3ur8BnntxqD1ZpYEZAKdTwSR7sZ9lZcnvFaLm3HKi0M5aK7yeUNVPt6dS9uuoV+l4pyBFKhTkVidL0sG8F7xkwubfvNTbiref7oeMhsxGt9+V/bHnC7BVPaqRLnusW7Hh7z2WWpUNOR2N/W0Jj3jBcRd0fi8zqsMW/iKYzDEvs8n6cxslGJjxAD7Xg945QlJzUHDLbuGj72U+zL7rG/g0k9Jvi2FpvwGcqOWSYI9abEqwaP5w/ad6n3tVk3eE/ihTYiMhaEuihx3yqQIYwDhXGbcXfJk3qWiA+BW1ewxheFtI3cO6M7FpfKXeTuFvDYWxi3Tyt2o4jpMlvDMeOSJUMtILY2EfBNIW1PDs4pcfECbyni5QZM0fN5KDdmPwehZlz462rMOHH/AK9khqyYDPU14okmPq63FGDGuXzadt/1rrZHRU4LdtYSVNsomNYDusk8kGgQ8JXn89yVl+xqEOqsxK4mqVhonQIo4jNSGLOzkiwIOWQwIehxYd7SS/8vo/Z7MtQsrggrx2BZxpH8OG+bmZJT2k2J2UaB5SlYTkG7IjRk8M62gMNuw0mGGkacMXg9f9CO9k1psFjCFfG/x2fYiS5vUAUm5PaJJvmvGGRcG645BQ1+8Dz2lowUJb40mJTHBMLltr7VfIY9UVDEB4KH12zD2AdR7KPYhaiTNKxnxHaCXfkZOXDsv+NKFOJbSJyA2FeyaipiW0qrhRPrWl4VEevDpCoi1qdZbR/H9jhtHCb/1/P8H/hZr0qiHgOCAAAAAElFTkSuQmCC","试卷":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA/1JREFUWEe1l19oW2UYxp/nNMmWdO1cZmcSW3TYKWwKoh3MmdBVUOmEDSeINvNGGEwRLwRR0Y12FHF44c2qTvEuCaNCRS+KiJiQP512eOFFB3XzX7FNXVnLlrRL8+e8ck6XmS45OUc9O5fnfO/7/L7n/b7vvB9h8dk1OuVaLF3po1QOqMBOEgGBBLRwgnMimFOA88KWr7zOzfGpZ3cVraSm2aC7Ryd9xVLxuCoSBqTdbPzad14lJeba6DnxxzM92WYxhgDd4xc2rCxl31YFrwFotSZcN2qZ5AetW3zDF/fvWG2UoyGANutCcfULQPb8R+GbwvjDBrf76UZu1AF0RiYeqKA8LkCnPeLXiwLOKg48Nftc6KfavOsAtJmvFgvn7BavChKcdbndu2uduAGg1Ty/OJ+wz3YD/4jJjYGu3t/7thfWdtD1JxBNnlAFx+y03SgXyeFsOKRr6QBri65w0Wi1EyiAvGaUUASbAVGswhNccbnd3VopdIBANP2hKupLBtuk0N6mbJs+GMwZCfijqXEAPSLS8S8gTmcPh45SO+EuFxcXjA4ZkkvZcMjbLLE/kvrY4VBOlSvqd9YhmNvq8t5Of3TiSZHy103qZQ4QTUYgzAO4SyiPQ9BixQkq7GcgkhpRIS//H4DaWF8kqR29PisACpWP6Iuk4oDsu0UAywQ+BRkUkZ56DSboj6amReReKwAyiV4Qz9eNJcbYg2+09zccIPIk+7MDoXTgzNmH1HLpx5vjSP5MXzSZg2CTFQArtuoAxKaquA4VTb0HkTcagOe1ElwFpM0OgEER5XQ0dQkKD2cHQvrC9kfSbwnUdxvnZ862Egw9LN9+EsucEshZCPo7OtqPLCzkXjUW1xuZaVsWoTZzXZwS02reOTrRXSlVPheRB5uWjYzbsg190fSxFiA9Gw7GzW2vQSJHbDmIfJHUZ0fDwSODpNq85uv9UBTlCVuOYl8sdZICHwTXBHgREKfpjiGu3Hmfp8P8Z0SsOkH/TDi0ZJRUWwOJBJRf59JtJcGfAvGYA3BkPhx6xdLvGESZgrJZUiEcEDjMxoHIu+nq/m1gz1//NCSR9JAK9bhpsB0DyMH5cGhIS7W+JVvKxiF4xA6NJgdbxuv0Pla9uKxrSrfHvr+jIMVzIui6FRAEZzweZfcvhx69VM1f15Z3ncncX65Uxu2G0MSdCvfPDASnaifX8GKiO6EWxwTYa4cTJDMet3KoduaGDlQ/6K1a+fKbELze7G/ZHJA5kO9vdW45aXRZNb2c3jOW2ba8Iu8Q6gsC3GbFEa2PFGGk1cPhRrM2LUEjkX1xcVyYT/WqKg8A2CmAn4B+PRdgjoDWip1XqHy5w783meij6bmhxf4NftTdgSGLQUwAAAAASUVORK5CYII=","课件":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAsVJREFUWEfFl0tIVGEUx39nZsxoKpGISlqmC42gxwxCEApBUhC0iR7bMLRyhrZRC6Ntecc0CtoVRRshkbKN0iJ0RmtRBj0WLUKLoEAz0po5cWe4zdWZO/czJuauzz3n9/3P6/sE02/qwSp+fm5FM4dRbUSlDqEu+7syjeg0Iq+RwENWbxqh6eiiiWvxNZrq28z870vASdD1vvZZA5kF7hIOddN05lOpf7wB3iWq+aYXED2PEjYLvMxKmEflKrVyhfquhWI+igPkTj0A2vxPgQt+kjHCoSPF1CgEmOzZQVqGQLeWJ7jjRT4SCBxkz7mXbr9LAXInT5U/uAsiHIq4lcgD5HI+Wj7ZvfSTMWqlxamJPEDS6ga9WF7ZPSEuE43ZnUUOwJb+x6/3ntUujBOqPsbOjg+egBNWK6qDRh1jd8eaqm12KnIASasftMPTuXCKSPy2rzrPr+8jnR5Cda2vLXKDaKxTsCfc/MyXkkNGAieIdN3zdwqkevei6UfAutL2Mkt4y0ZhsvcA6fTjksYrAbAdTSaaSeuw7+QMBtuECauPjHaWFcB2lkrE0cy1kn4D0i+kekZQWsoOMJHoIJPpL+2XUSFpvQFtMAZIWneA7Xl7HSQaL2xfEwDkrZCy5nyr1l0DKasdJT+mg7xgd2yg4AAmACLfVw4wcbMGqCqqWM3CIvVd9ioGEwCYM0yBHCcSu591nLLGUY16pGyYaLzNHCCbApMidAMkdqIUv5gE5OvfbWeigNhFaNSGSwD2o7KhqAIhmWHX2afGCmTb0GgQuQCSPc+ASFEAkSdEYoeMAbKDyGgUuwCM5rFJETqj2GgZyWkisVumsXPF6jcJnWVkG/uuY3lFMNhOpsp7HbvpMgsNoPaGbSyequXrOKdCBS8kNkDFr2ROKip2KXWSVdFruQNR0YeJA1HRp5m7dyr2OF3ewP/pef4HW7pxo3nDj9QAAAAASUVORK5CYII=","视频":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA75JREFUWEe1l19sU2UYxn9v2dwGzmSoEZJtRhY1StAQtN2YkEUiYOL/C6LhQtPWLQwXwXAlRKsXcjMUJQzFrUaCesGFjptBREJ0iXQmXOGCIQKJZDH4Z2Jm6UZ7HnNqCx30z2ktJ2lz8p3ned7ne8/7ft/5DI9Xb5dunonzJLDSgWVAi0GTjGlgIvM76RPDzXP5NnLMkl6krRSoe7naUileF7yAaCiFd5+bMYn4pL6Rd3Z/Y38U4xQ0EInId/4QbzhiG2KOl8DXYgwu4mP7mhb61x2wVD6NvAb6Vuj2+AyfSTxWSeDrOMaRulrW7Rm1yTwmZw+FOrQUh4MSzVUJnhUxTtfVsnbPqJ3J1Z2Vge4u3ZaMc8ItsKoGv2riVE0j7XuP2MWrQ5k7953/MsKIxOobEjwjanBozZ08ka2JKxkItyviOLx5I4NntX3GK4Mx253uGPfPbbVkip8qrfayTRsX6htoGzhmU2kDoYCGJIJehAx+NzgsuF+w1AunACYSHbO3zF3hEpe44GWRMWPKxAODY3Y2bdyvZ4B+QVu5Rsw4OxSzRRYK6HmJLzwKHI6O2dpcbN/jqotPsgmxVaLRo04a5jMedA18KNHjkfhldMyey4ft7dKC6Utsl3gxW1ulNH0+tlnQrzHg4VLgzPOCBrL8YKce4jLvA8tLaZqx383ArxJ3lAJ7NXDFSLtew2FHUV3jqIX8Sgjqqm0g013jEvcV1DZOWTCguJcOKDcDLj7o18/AokIGDH50MzAhWFjNDLid8c+f7EBsLKZrxtduDYxKdFbLwMsdejaVor/YzLOxDD61sF8fOND3fw10d2hJ0mEn4lGPWu46sMXCAT3tiK88kYyj0ZitysVuXKVbE1O8Legpdy+pNe6xzPtyl+JbSpowEjVG597jdiLSpZrzCXolIhJNJbnXAozxaMwWpzejYEDvITZ5EjESBj9I3A0s8MTJA/IZmwdjtvO/7XiFFiZnOIOor1SwLJ5xrrWVeyMHbCb3g2SD4zBQllCFYJvD+qHv7XOXPuubMOzXfgfWV6jrjWbsi8bM3bDS1ywDW1Zr3uRfxASLvamVhzLj+Nz5dO0aMfc0db0BdyTs112OMYxYUp58cXQ6+E08tes7+y0XmfdgsrlDDX87DEi8VBUTxr558+nOnXnBDOQGDPsVcox3Pa0R+Zwa58zH1mzB5YeUmOKGR9R0OcmrEiHPpyVj3AcfN7cy4LZasRAlT8dZsiTraaczKVaasUyixYwmxDTGBGIC42QNDH8Us9NeX92/T9xk1NzUiXsAAAAASUVORK5CYII=","主能力":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAABBRJREFUSEu1ln1MVXUYx7/fc87FQbRaL7PwZZZRDQTOhRxj1mLZqFz9Q8tVWyb34tVirbmsVpvOWfOPXNqGJl7kMvSfbNnLHyWbWfSuw+s95zIYTd0QFGvZ1gvG4J7ze+pc4h0uBLff38/z/Tx7fs8bMctnbuzI1RJOuRCLoSQHhAOyi1Rd4vraYo35HWOlSkLnr3PdvvUUVAJSBGAQwheZilcS6s1S7pUXIGqdCPJS2RJoJbV6QcanwOAmgWyGSPZYH4I90wLNoP0sRXaKIGeWSZjKrEWjvp8Gom7CPQfy50nAkpD4XCe+DyIb5gECyFO3XpN1/7Ha3IHiQNtaJe4RAC3jgB5MOfHPROTBecH+dSb4xS3ZWWsuX716AoJV0FgzDmgGrAMQhNIBG9EgvkvCyD8zaSwbAfqD1jOicCitsDFipPZGLFK4LQks29yT2f/br2cBLPp/gBTd51sUDeddTgKLA/bLSuStNMMugTQgsjCpq3G91VDUlAT6q+y4QArSBSTh6DTKHbhlULLL0yV4MtZYVMaVgfjtCVHn0wVLihNbYhHz7ZJQ+1I3kbgwrG2Qd9MftAKi0JA2IPGRFTErt28X7eNu+xgEFcPaGvVK+gPWVhHsSAuQ/FE3skuj4eW/+6vsnQJ5bdxoI16iP2DvF5FN8waSF3XDWBUN53cXV1uVysXRiZoE9tIMWHshqJkPkMQVzdDui4YLO0tCdrHroAUi104CknU0g/aW4UqaE5Tsg64/YNWvaL0nYN/lQr4Rwc1TaZHY5qX0cRH5YK4wQ9MeO32woMWrSJVwvhXIkum0qCFILypHpPO/Ar00AvojsUjB6dLqtoUDSn0NkTtT6fioLU82vhmwT0KkdLZQb5FqPlYM/Vn7Utdxjs8EI9gWaywqHAIG7WooqZ8NkGCnkalVtL5b0JP8M8HxVGkc7UG+ciZStCsJLK22Fw+40jMTkOCHGdlZVadqc//wqlE50jxdgUzQupR5/Y25P+xZ0j80SwPxHSJq67Sf7R1MwKuxiLnbs0n2mWLTxJslRbGsizWYh5NjryzYfkO/OF1e35A8ISKrJ0YHQ19r1Rd8742rTy7E35w4QVJmhghbEXPjsI3Xh89DyT6SX93xcOHqc83xwyLy1IgB8QuA3QsyFrw3MDBYJ5CHZkr9qC8/14zCNdEwE6PAKuvLf46bck3Hk2cOmkeeeF/0s81xb1LcO1vhKe3Iet0orBkLS6bUDNg/eUuS8OWTaoUS9zkvgLnCSPQK+bq3bKecNv4qu3tSWZN9BPcAGXWUwUcFEhJISaogSHSA2iFNv6k2Gs75a9oCMoPxpynqHQAZAG0Ijmq+7CZvxYx1WrmhPd91Vb5QboPIMggMaOyl4KLyGS3WgTzvJprx/Q3wmMIl7X6GaAAAAABJRU5ErkJggg==","子能力":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAstJREFUSEu9lk1oE1EQx2de06xNxaNSxS+wYltMNi0iBXsSBE/tQawnIZugXtpKUS9VCGgvFgKxF9EkRfHQFA/tSRC9qKAFm2SDKdoKSgVrPUqamK8deSFbt+km2bTb7imZN/v/vbdvvhA0j9MlTzKGk3NB+7TWrv3dfe3Lgb/Z9EsiIMRd56KhEz8r+erZUTU63fJZUugVIH5raba1vRhvzei9IEqxMBBc5GsIGI5OOC7VDSzBAgBwpCiE+JxZGgfnHrUva8U6PXKPUqA3WlsDQs9cSHxnFIr8MxJQ/4YXEJOMkScSEMN8zeslNr0U/whETq0vAkZ6D9tPeb2oGIFilzveVyDyAdHRMqEZQbBe//Cw7Tu3i27ZAwo91r0XRE805AgaAnKn8wOLwq/V1DMiusD/M2zoj4ROTqkCpwcW92SSqUUA2qsrirgiNNuOz463/qkFXQuarivzLYV8bgEJXkcnHH3r7s4ljylAN6qKIY7FQo5bhoHcsdMT67dahFn1MxZt7sQxRcknAMhaXQyzjFk6IsGOr9X81k6o58RhRPmnRNRda+el6H6PaLlcDaoLLN7Zauo2EAzVPln5VjALCH6h2XZP707XAXnozyzFXQQwCkT7jJyqog/iCgKM9B6yT2hT5n/QSLEzCqGfgDq3BCp7mecpQxpSiwM6pc/7gTI+3eQ3kczLIKAwjKIr9gkAOkzUriaVQKcUSxBB+44BebtJZ9M+tQNsGxhhqsnaNLwWNMVOoIC/vDhveQOIUcZgKBJwvC3mqlaw2BF+xCVQYLRi3TS8A/wNDEb6DtpDummh1eGJn0um7igAg5tJfAbwoHG37W7NxC/fvHh1vhVzuSfbXtrWdYqdLN4qWJTk+0B00/T2VEmwVMwXKtbXzTTgWsHnlGQ3EfFBa8OD9Y4YtWB83bQhyghM9TFlTKwHyH1NGYTrgW511P8HVz1GsEaaZFwAAAAASUVORK5CYII=","知识点":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAcCAYAAAB2+A+pAAAAAXNSR0IArs4c6QAAB/FJREFUSEuVV1uInVcV/vblv51z5nIyk2ScZJI0GfCCYttJAjYv+iS+2BfxoVoFNUwKxQsK5tLWiTH44A2hD+1QUExRtNUmTdpYseiLIqKGChVJ0lwmaZO5ZObMnPv5915L1v7PxKTSgjMc/nP+/e/17bXWt9a3fnWcT21+P0+8ulNtfJ9iNg4ERvGn+lcNBVLwS9xYvsQLs4+Yjz0mS9/hV7fsckPPblcjeytIMmJSJAvBQLHbQCOCRoPz9mu9+eP7B6aOh9Vf0l/PbUH13lW00EIPPXgQh+23wQ0MYlhkiFFCjPM0/7t52z5wnxs/V0Iy1OYcHXbImUBc4CqWj4aFRqIiVFSCTEXuT7ww+Y3s/qvqZXqtt4RGtMB1rKGNDnL42z4X57ZskCJGmRNUkKKMBG24xZjsxhb30OQcbXLoEYW9AigmFBtEMCghQlWVMGYGMOfWDj86vPu76mf0Z3+ZF/WbWMEKt9AOwHd4zECECAnFKAs4MpQ4hmELSUuLcjQpR4c8euTBrMIHpKHFYzYY1ClGVRkTZggO/OxXqnseVt+nV/ILfMPO8QqWVRMdlmAzlEIwoEnBcoSYIyQcoYQECUXQbOCZ0SVC2zv0mOAZIJKNKoAq0ojYoqJSjOkKtpsqMp385ODI3i+ob9HJ7nm+GV/lW1hBC12Vg9fJQWLAQJEKHlqyIdeWIhjWIFZwxAHQExeesgb7IszCSIsoRGqTqmCnrWJYp888sWnffnWQn2+d9zeza2oFdW4HcgmL108sIRMPJG9Mushf/0CFZwIg94vwyvr6M7IOMsgQYVSXsd0MY9SUZo9u3jetvkm/alykxfIN1NBUnR96Vv+ySJQmUsJmeNlrOc+ZmfiDuaevCnPFMy2hRPS6UfGPYxI4IZNV8BrkNXvy8lyUIP76ECe7tkVDqOps9tjYvml1kJ5fu8yLA4uoo63zzwPmnEWqbK5V3C8px5ZzeO7m/sNdl58Q9or3FhYpR3+MsvhrpV7Jyx4LHQrYwbJjYupQFCv9ZEWlH9liKhg0SQF8mH5du0bLQ5JfyW2GBBVOEbOFYRPy1mMfmLtGXaxRD02fh/xKiVU4QRUlDKg01HkEG8Iuue+SR8t75MSBG5t1BWUdzR4bf2BaPUYvLL/Fy9U17krPejJC/I+EYhPDak1KkdbscuYuO9fk3t6mcwfkAEwqsHxIZRcqSL+X6ZgyJLJHGzLwmqjjmbqOIsX6SMxm64jJUDbJ7MzY3gC8dJNqI03kqJnO5Fn15Tdut623ffnk6onJju9cqFMeWCylNaDSX5ze+NmH3mmP3H947rcnU9gHN+gUqY5nj44LsH9hYYHqG5vckzCtZpwuDnJqSipRmpUigjCdVn3Pr1J3dMm1hiXcEkrpYFVd5hGULw+rjCs6MoFc0tiJucnkGy7XXe/vEYZXdSZtc3Zm655p9bg/eWOR6mMNzhGTxSBKGJbuhCTkWBgsfbhGXSz5JhZ8G2uuG2o34xgjqozNegAjOsOAFm6YUH45Mxo+x5qTzialIcCFxzNbp6bVE+7Um/NUH69TFw54yiI+N4DUxlBakZFezz1P1IF3Te93N113/+pt4ATDunRxQCU/kIOWlTWGrAa0dDXqefIt8gakDlk2W4pQJ7MzE/dNq8fdi3MLvj4h4aup3uTZdPodc/yJ2k93+R4uiieOpAIiDKjSz8+Mf/oz75bjz136/cmY7YOjNkOq7ezMRPD49JUFV9++Sl0YmJUE8UJFJTqhSIuySC57RNTyOa1yb9OK61TrXsilAvCQLvEGnV0c4oRTFekYUVHHDO56oqZ3uut5lyGtRmyKzMR9j3un31jwjZ0r1IFmMZYE0qQsFWkDe4s6dlhxHaz4bqhNuZ8gwrDKsEGXMKRSlJTUsQl1LLXb8YSGE7kErNIYtQlKJio8PtJ98cK8b0wuUTN4J1tTTpBIA4GBsDoXBRJwIYvPgyJ5AiKyoXEM6v5hgyQIsA7r3T54OKQxGIukju3s0Yk90+pI5/S/3/Rr7533jSDmskmkTP5FgaQ1ivxJm+x6jzYRemKVjTwRIiMdK4VIpxy1EA3pgjkhOKOVEuJhPC5jKEpmj4rHhztnXp9ztQ+85dYgjcERIZgMclgokbRNKavch9yBPIcDBVGQKYPF02KPCIcoW7En1HPwdtjE2BqXscGmT89smzqgDrbP/POaq33oqqthlXrBM/YqnFzaohgXfRUgqc9g0Mt9EXoD0z/AumavS6LoMXHhbaq0AGJbUsFIlD39bQE+1Hrp3Jyr3XvVrWLZt9Hujy/ibWGkr7HB+7vv/VeXi2lDfhd6LE1Ehi7Ra6BsIoxECXbEAlwqgI80z/5tztWmrrgabvWBRWtFU4MRAYP8FqPFVHHbuIw5d4l/EWYZEZllfJJngYoA2wT3pINyferott2PqEP1l59bpNanJNS3XAdt7wOTJdgSvnUgIVOYevuHCTnuR0SukpLg9fp4K0NbmKuBsrYYjTLsSCoo22T62MTUrHq0eWqcHE4u+Ob9t/K2kWnRSy4F/A7DMsRJzkOO7xjohExCxkAqqOBlmOn7HhuoEOpRm3aqUfybH+14IHS59ZcFfJT/YAfQCEPH0vX2+svE/3TCUq52K9InQHq7hv6LUupLa2nnUvHgVgDX+1f5fR2jZmfAmHrPVGdGFS8adwG/W699+9pDV175YsLmmYb3u5+b/Pjf/5+968/+B+0PhllE845BAAAAAElFTkSuQmCC","资源":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAAXNSR0IArs4c6QAABflJREFUSEu1V2tsFUUUPmdmdu+j997SQp9AEULCDxNDCCAEQoqC0R/8IRSIVqIYH7GAT2JMNKlEo4bSFowEEyXBBJUS/5AYRB4lijxU4iMSE5CWh214lL7uo3t356Ezu/e2hVsSkrrJ7s7snJ35zjnfOXMG4bbr8rkvdsVLZ9UzKxZVSiKABFA5IQS8/YcRfX8skFBBCxEQiRJuOj108/zOitlr3hg5xaj5Lvz6SV35lEX7vGwSBXdASQ6g/NVHLp1vB8CGJxkhZf7TfQQkDKgVBmpH5eClU/OrFzx7dlilEXAu/b5nbzgx+XHu9Iv0rb+35lcHAAL0TuWV/k7MDP4TjMGI7iilpG6bQbsmWjr9CRYuhmxf53uV8556qyCAjt8+PcCs+AqeHfBmzHnOvou172mo83BjbShxXzsLJ0AMDXxcteDpDQUBXDy782tCQiuFl/Zmzt80fgAONtbaicp2YheBctPbqxe98HJBABfObN9PWHiVEp43c/6GcQNw6dt3llqximOEhUC5mZbqJQ2vjgGgtY3SSB0CeNPnPj9uAC4feX+ZFS07jEhAeemW6iUbxwBwurWNWbE6goRPm7PeuidH30W463jTchop+05HlHQGm6trN71WmAOnW9uoFa8j1OI1s9eNG4Duo82P0Hj5IZAChJNqqa4dwwUXtQXsRB0hNp86u35cAbB4xSElBSgn2VI5FoCO0zvaqB373wCAlNoFdwFwckcbDWkOMD51zvi6gMXKD4GSIJzB5qraDYU50Hlq+z7CoqsRCa+Z+8y4uaDryIfLraJKQ0LlZporal8sDKDjZGsbEluHoUJkV6xwMbVCMYYsTAgyk4oRUYHSLy1lvvg7glJKCyiQgDoNC66Ul+XCSXGZHaRKyhpEBsCdbRVLG14vnIpPNO8DIKulyAKlIWChBLBQHCiLACHM31yQmFsp4QB3U3oiyiLFCtHSPjZaamSCg/SGQA4lQThJAOEBsghQ4E1lSzduHgPAtq+U4Gu4M2g2VSQhoFYEKLUBkQaLUwPGS/VsDcPQriFFQ4zFtrDwhFVm99QgDBAJimdBuo5ZXINnkWJtr6aK5S8VBtD5Y/OX0nXXeplekJ6TX5Bq7ZEC0SCIBmADYXbeKkpwUNwzC2kQqLdiA0SA4twoQ6wwsKJJQAlrKnu4YQwLtH9Qz73MYukMZBV3OAihzN4qEAljABKRUIqUWoQQi4CiqLdbCUKhEFIKLlFyBUIpCQAMpDEKYRQpK2IYTYSRhA9UPfrKNwVdMF6p917mGVVkXDzeNM9C9iZ3Bz3luVwKVxFjT2IKDZ/72gUEASlhWn9lAsA8wdc+iAi/REEFSJmNYEUYsaMWKviobFlD+x0WUOca7evigauKO+U80wfCy/h+1TGncqVWEAWgI8Fvm8ovYD9qw8vRJRzqmoky0LUAjZZoLvQk7MxkvH+1awDmkHT/vOdzFpnwpJu6ATzTD0qHkPD8ksqPd3MHevm1XmABnQm0EXwJkxN8Sf0OiEvtKNBIMbB4ua6K9pYsXFufB/DPiZ0LQqXTfnCT15mbvA5iqB+ENwQohFncLy19ILkElP+mx3IVcCBr/si3dTjrojQCNJIAligHK17BMXltYdHidb+Yea/9sf+C8tyZTv9V4MmbILJJP361BkYbP+vlQRj9RpbfowHm5InJjbpIpYA05AOITQKrZLIGdD42d8Us7P7psy0sMvFtp+8KuANdwFO9INy0yWSGfwGAPAvMpMMaBr1cQvbfhraBQ3TbALCAWlGgsVKwJlQBK50CMtO3BXv+Oph2kzeiTm/Hn7L32mbwklnPlQqopvPoSydjHd25y7T4WDJ6YISsoAjERitcRDFR9i4rn/Egi08cxK4zu4+C4A95g90pN9XzPXpZT0rpaxCQL8fU3BkAdUgGLvDjIEfNHGFzFgik8ucDCykNUVpUspiVVBcjYcf+s3IjuXo0slspuVJm0yEwxFM65SHRjFN625OIavhgYowb+HcUP3InqBEENGcUqYFoPmlCMH1C6iOUHUg8dmv9v8OxoyB3PgAEAAAAAElFTkSuQmCC","总数":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAAAAXNSR0IArs4c6QAAAu5JREFUSEvlll1IU2EYx//PcW6JSuRFBRVB1I2Qtk3dh1JSXiVRF1bQXaFUBJ5tFFGCLLywTbTtUAwREoIKvIgI+iAqL3Jf0jYUpKsIiogkAsv8aOs8dWyT09zcZnrVe/m+/+f/4/2/7/ucQyhg1I+4ymeLdK0AtQHYQkT3E0LCPVbnmMjXhvIR1o72bvuZ0LSDuA2g9Wk1TIwHMsuuWL09mMtvWeAev6dWEMgBoAWAJpcZGC8Bdkct4kMQcSb9UiA7BUOo4gjAdgANOSEZBMQ0IUN2C9qSu5Ga03G1ZBFYNdZTWjSjPUUMGwg7VgJaWkPvwehLlM4PjFdf+K6sU+OwU/NVV2EH8SUAG1YHtMTlM5jcpNV5yBjwnmDC7TUCpds6qXL4RlmJLjHItHAx1nDw47m54mOLZ2gMS80sczeA3atIjYPxFIRmInRGzGLX37eUmYxBbwsTdQCo/gfwPAM3hQRflYuFMmKeyAxUEWpC3oMyQ7lIhTyNWQYPyCy7x6yOD4qdPiRV5gVMsfcEvFaBcB7AYQBCll3PMMinJbknbLZ9UmvyBur917fHrOfepTqGIdC3E6QRAT4JoDRpOkuALy5rXeP1ZyfBTPqwdJyYy6MW24CiMYQkM5iDOSM1Br0+APuZIJUk5m75Gy5+UwwahwfXTWmn6gTCJi3k50Gr48tCdEGpiQAXwAYmdMfM4uUqv2+jRvgxAmAXAW/lOJmy9lIFyMCZ5E6mwbhDJPdHLPaoOjJj8JqBIbgANKXmU0BjyNPATC8AFP9ulVMyUW2+QDXjNUAjAE8riQHYl36uKaAybwx6WxnoFwiHXpnFRysB5nwtauAfqMcUsdjCC700W3VapDkhakE6UL32PwMDUicTXykoy6SYQGLE0i5lqs0a6dGhoaI3Wz/2giAWAGUm7oqZRGf+vxhp7vqA9wAJ6ARj73JgBkYB6ohZ2p8tp8vrr00xSPZU5ZtpAmMzEbQMmgQQAfO9qFV8kk8SvwBkMTigdig/4QAAAABJRU5ErkJggg==","教材":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAHCFJREFUeF7tnQuUXVV5x//fvnfiK6wiUFnSaoNgYiHknjuDCgUUQXloaAUMVnyAAl1VYQGhEsOcmY5zz81LeSnEqsEHal0SAV0EQQooBQVfzLkYYjNCibLEUhFTSX3M3Hv+7bm5CZkwk9nnfe65+6zFmknyfd/e33/vH+e1z7cF5khEgSU3sPToZsz30FoAkfkA9gXUXMLbSyBzAexFYO7237kXgPbfdTrzDIBtgDxDcJu0f0fnd/UM4Pl//g3IcYXS5oMWYHz9GdJKJJEeDyo9nn/k9Bc6fFmfYD48zKf/E1wA+D9xUOTgwQI8CmAckM1CjENhfJIY32jL48HCGOtdFTCABJwP1RU8xPO845SoN5A8DsDeAUOkbb5VRO726H1bKXX32GWyKe0OdHN7BpBZRq9/JQ/2PBwLzzsGIscAOLCbBxzAYyDvhVL3KoXvPLhcHunyfBLtvgFkGnkrNZ4g4p0MqKMBHp7oCGQeXH4EePeR6rbGkNyReXdy1gEDSGdArNHJo6jUYoEsBrAwZ+OUVnc2EtwgnrfBHe77blqN5rmdngakOsoKS1gsxGKCR+R5oNLum0AeoGCDtLBhbFgaabefl/Z6DpDqah7AJpaQPEWA4/MyEHnuB4G7ROQWKWP92DJ5Is99jbtvPQOItZLz0PTOhci5APaPW8geifckyHUoq3XuctnSCzkXHpDKCs6XVhuMcwDs0wuDmkKOT4O8jiW1rnGZjKfQXmZNFBaQRXUuVN5OMPy31OaIX4FtPiieUuseGpSN8YfPPmLhAFlUZ78izgHoX0rNyV7inujBBCDrPMF1Dw3Kg0XKuDCAHDrCfeb04VKSy4o0QN2Wi4isnpjEmodH5Olu6/t0/S0EIJbDsyC4FOQhRRiUrs9BZBOINa4tX+j2XLoaEGslX80WlwlwercPRBH7T+BGKclqd7n8sFvz60pADhnh3Oc9ezll7jPyPfsm/MuuP01izaYR8Zfpd9XRdYBUHb6jfZ8hqHSV0r3eWaLhgzJmy1e6SYquAWTeCJ+/d9m7HJAPdJPApq+7K8C1W5vqki0j8sdu0KYrAOkfnRjwpHw5BK/vBlFNH2dRgLhHsXnJg8Nzfpx3rXIPSLXefA+pLgewX97FNP0LpMBTIt4lY4Pl6wN5pWyca0Asp7UakEtT1sQ0l6oCXOPapdy+u8olIO31Ux6vAPCWVMfKNJaVArdSydI8ruvKHSAVh6cK2nDMy2q0TLuZKLCFkKUNW27OpPUZGs0VIFadZ4P8XJ4EMn1JWQGR97qD8vmUW52xudwAUnF4voCfyIswph/ZKUDIBQ1brsmuB8+2nAtAqg4/THBlHgQxfciHAgJZPmbLqqx7kzkgVq11BUQuzloI034OFSCvdIdKS7PsWaaAWA5vAehXETGHUWCm2+QNri2nZCVPZoBYjre5U6Izq9xNu92jwLhrK7+ka+pHJoBYjsfUMzUNdr0Crq1Sn6+pN2g5fALgS7t+tEwCGSggv3JtOSDNhlMFxHI8/3vlapoJmrYKp8CYa6v+tLJKDRDL4a0A35xWYqadIisg33RtSWUZUiqAVJzWdQJ5X5GHzOSWrgIEP9uwS36ts0SPxAGxanQgHEw0CxO8NxWg1N0hsZNMPlFAKk7rfIGY5SNJjmCPxyZ4QcMuJbYsJTFAOqtyb+rx8TPpp6AAIacltQo4EUA633N8yyxZT2F2mCZ8BbZQyYlJfE+SCCCW420wHzuZmZuyAre6top92VLsgJjPZFOeFqa5XRSI//PdWAHpFFjo+nKTZs51rwIi3llxFoKIDZB2aR5Vvt1UH+neyVWQnj+lvOZJcZUUigWQdlG3Em83dasKMsW6PQ3inq0tOSmO4nSxAGI5rWtNxcNun1VF6z/Xunbpg1GzigxIu1Yu+K9RO2L8jQJxKyCQM6PWAo4EiF9lfU6J95lC0nEPrYkXiwJEY6IlR0epKh8JkGqdoySHYknGBDEKJKCAiNTGBmU4bOjQgPib16DF+8w+gGGlN34pKTCBkhwddhOf0IBUHO9rZmenlIbYNBNJAX+nq4at3hYmSChA2nsCgrmpfhcmcePTawrI2WH2TAwMiL+bbF8f7jUbZvbaBOvyfEU2TU7imKC77wYGpFrnKrPVcpdPlh7tfnsLuEH5cJD0AwGyqM5+ReZ+V6AgAhjb3lLAExl4aFD84iFaRyBALIfXAkx3j0DyI1qZZGBEYIGI+AXN/P9emEEXgjb5CICfkXxEgKeDOmvZK0V43rPzyv+zf/h/t+PfdrXZ/e9E/G32jtVqK5SRrHVt0X7Drg3IojoXds4eqW67nEWxsKC6V1c88+de64WnichpAE4I6p+oPTEGJTcqDzc9OCQ/TbStGIJbjvftZAHBROcsslGnu9qAWLXWVRC5UCdonDbdAMiu+bbfD3m4DORb49QhRCwX9D7iDpW/HsI3M5cUAAHIq92h0kU6SWoB0vmE1r/3mKsTNE6bbgNkR+6W07oIkH8GsHeceujFkqvQxEfcEdmqZ58fq1QAAbZRyYDOJ7pagFi11hqIfCgLGbsVEF8rq04LxJcAHpqednKGa8v69NqLt6WUAPHPIh91h0qzbhA7KyDWSs5Dq/3kap94pdCL1s2A+Bm+ZgX3nfBwTxqQUMkpjcvErwfQtUdqgPgPKUoy4C6XLXsSa3ZAai0HIpkVfut2QHZectW870FwZFIztyRywI8H5VdJxU8rboqA+GeRujtU2mPhuT0CUl3NAzhJ/5nx/mkJtHs7RQGkfcmV1BOaF8mL3Yu7735jujmVmEbTT+AnpU/6x5bJEzPN7z0CYtV5IcirsoLDb7dIgBw7wvLWMv8tzseYLEl/Y7mMZTlGcbadMiCAyEXuoFwdCpCK490pwPFxChA0VpEAaZ9FanwlpA3JXwXVYnd7Kjm9cZkUqnpl2oAQuKthqzcGBqQ6ygoV3aiDGNW/aIB0IDkPwk9H0ybYG+FobaXnnTYgfmbiiTU2LI3pspzxEsuqcxCkk54007dUREDakNS5HmSobxQAPCp98ro9XTtnPW5h288CEIjY7qDUAwFSdXg/wSPCJhqXX1EBqTo8nOAPw+gk4PvH7NK/hPHNu08WgAjkgTFbpn3COO0ZxBqdPAqq5H9Om/lRVEA6Z5EvgzwzoMjjL3ihWPcvlT8E9OsK8ywAaQvjtY52h/u+u7tI0wJScVorBcHWzSelfpEBqdR5opB+NUr9Q2i7g6VpLwf0g+TXMitACK5q2KXlWoBYjvcTAAvzIGORAfH1rTjeLwR4ma7W9KS/MVycx7q7550VIAA2urY6bFZAKjWeIEJ/b49cHEUHxHJ4B8A3aYr9e9dWL9K07UqzDAEBKSc2huSOXYV7ziWWVWtdAZGL86Ju0QGp1PkxIS/R0ZuCHzcG1eE6tt1qkyUgIK90h0pLZwHEewCC1+ZF4KIDUnU4TGh/Nfkd11ZvyMvYJNGPbAHB990hNeXJ7ZQziDXCeSjzsSQSDxuz8IDUOURyVFMfA4imUKHNmnKgO/LsCt+pgIw2z4RSXw4dPAHHogNScVq2QGqa0hlANIUKbeZ573SHyzuLsU8FpM5rQGp/0B66EwEciw6I5fAygLqPbQ0gAeZOKFORa91BOX+H71RAHG8zgPmhAifkVHhAaq3lEFmhKZ8BRFOoCGbjrq38KjXtYycglRHOlzJ9QHJ1FB2QSp3LhFylKboBRFOoKGZsyoLGiIxPAcSq81yQn4kSOAnfogNiOa1LAVmtqZ0BRFOoSGYi57mDsm4qILXWVyFyRqTACTgXHxD+E8CPakpnANEUKpIZeYM7VHr7VEAcz6+09+JIgRNwLjog1TovIfkxTekMIJpCRTT7rWurdpGS9j3IQocvK4O/iBg0EfeiA1JxWksFcrmmeAYQTaGimjUhL99oy+NtQKp1Hk/yzqhBk/AvOiCWw4sAXqmpnQFEU6ioZiLyxrFBuWs7IDW+n8K1UYMm4V94QGqtCyGiWxjDAJLEJJsmplA+MDYkn2wDYjn+/8H8/5Pl7yg6INU6LyD5cU3lDSCaQkU3k6tcWy7uAOJ9E8DJ0YPGH6HogFSc1vkC+YSmcgYQTaFiMLvNtdWbdwDi7xtxUAxBYw9RdEAsx99vxd93ReswgGjJFIvRo66tDpYlN7D0s3E2YwmZQJCiAxLw/s8AksAcmynkK+dLWfpr/GtPuCnFdgM1VXRAKk7rHwXySU1RDCCaQsVhpiiHiFVrvhWibo4jYBIxCg9Inf8g5Kc0tTOAaAoVixm9UyXgWqBY2g0SpOiAWLXmeRClW2XRABJk8kS25TIfkNWAzLqRSOS2QgYoOiDVGs+hsL0wTuMwgGiIFJ8J10gmO9cGyKDogFTqzfcJ1XWakhhANIWKx0zWSsVpXS+Qd8cTMP4oRQfEqvNskJ/TVO7brq2O07TtSrNMizbsphjBL4rleH75/FPzqmbhAXF4FsDP6+kvd7q26NbQ0guZM6s8AfL/df1u9gHx96qYcX+ErPUrOiBVh+8meL2OzgL51pgtJ+nYdqtNzgC5UyqOd78AmVdxn2lAiw5Ipc53CflFzQndXv6gaduVZnkChMAD/k36TwDmog7vdCNadEAsp/lOQH1JazYTG9whdYqWbZca5QkQQDb6l1j+NriRtwNLajyKDkjV4TsI7qzDNIuO33Bt9daktM5D3HwBgp/7gDwFYN88iNOLZ5DqaPPvqdRXdPQX4qaxIXW6jm232uQMkN/4gPwJwJy8Clr0M0ilzjOE/Kqm/utdW+WusIZm37XMcgbIhAFEa9iSM7IcLgF4g2YLBhBNoWIyawNiLrFiUjNMmKrD0wl+TdPXAKIpVExm7Ussc5Mek5phwlRqPE2EN2r6GkA0hYrJzL9JN495YxIzVJiK0zxVoPzVDDqHAURHpdhsZKN5URibmOECWQ7/DuDXNb0NIJpCxWHWeVFolprEIWbYGNVa828p6hua/gYQTaFiMrvTLFaMScmwYSo1LhbhLZr+BhBNoWIyu9ksd49JybBhrDrfAnKDpr8BRFOoOMw6y939kjN+6Zl8HkV/UVit82SSfl0yncMAoqNSbDay1nxyG5uY4QL113iSJ7xN09sAoilUPGbtT24DbeAST7sBohT9DFKpT54oLN2uKYkBRFOoeMz8og2m7E88WoaMYtX5JpB3aLobQDSFisXML/tjCsfFImXoINXa5BspJf+rTp3DAKKjUkw27cJxpvRoTGqGDLOoxuOU8C5NdwOIplBxmLVLj/qBLMczxavjUDREjEqdbxDybk1XA4imUDGYbS9e3QHEbH8Qg6JhQlRX8PX0+B1NXwOIplAxmO26/YHZQCcGQUOFqDp8HcF7NJ0NIJpCRTfbZQOdgCX4o7cdIELRH/MuGp08RqnSv2tKYgDRFCqq2ZQt2MwmnlHlDO9vreBR8HifZgQDiKZQUc2mbOJptoGOKmd4f8uZ/Bug9F3NCAYQTaGimk3ZBrpzo/40gBdHDRy3f9EvsfodHuGB92vqZgDRFCqi2W9dW+3jx2g/xWoDUmt9FSK5q5hRdEAWjfK1SvEBzQE1gGgKFcmMvMEdKr19KiB1ngvyM5ECJ+BcdECslXw1WvyBpnQGEE2hIpmJnOcOSnvPlp1nkMoI50uZmyMFTsC56IBUHR5O8Iea0hlANIWKYsamLGiMyPgUQDr3IT4g86MEj9u36ID0j04MeKr8I03dDCCaQkUwG3dttWCH/84zSBuQOq8B+cEIwWN3LToglVFWRfFBTeEMIJpChTYTudYdlPOnB2S0eSaU+nLo4Ak4Fh0Qqz5hgeUxTekMIJpChTbzvHe6w+WdxcSnnkFGOA9lPhY6eAKORQekv85FHtnQlM4AoilUaLOmHOiOiF9MsX1MAaR9mVXzHoDgtaEbiNmx6IAcNsrDSooPacpmANEUKpQZ8X13SE3ZTGoaQFpXQOTiUA0k4FR0QCqjPFQUN2pKZwDRFCqUGXmlO1RauqvvcwCp1HiCCL8VqoEEnIoOSHUFD6HHhzWlM4BoChXGjJQTG0My5fPn5wDSvsxyvJ8AyMW2bEUHZGAFX9Xy+FPNATWAaAoVwmyja6vDdvebFpCK01opkA+HaCR2l6IDsqjGBUr4H5rCGUA0hQpqRnBVwy4t1wLEGp08CqqkuwQ7aF8C2RcdkMrIH+dLeY7uCgYDSKDZE8DYax3tDvc9Z1X1tGcQP2zV4f0EM98euuiA9K/kwV6LP9McSgOIplBBzATywJgtR07nMyMgVp2DIJ0gDSVhW3RABmo8qCX0i2boHAYQHZWC2ojY7qDUAwFSHWWFim7QtuK2Lzogi2o8UAn/U1M3A4imUEHMxBNrbFimfVk74xnEb6DieHcKcHyQxuK2LTog1krOQ0t79YIBJOYJRuCuhq3eOFPYPQJi1XkhyKti7lOgcEUHZGAVX95q8ueaohhANIXSNhO5yB2Uq0MBUl3NAzjZXmm6v3aDMRsWHZCA9QAMIPHOryelT/rHlskToQDxnaxay4HIYLz90o9WdEAWjfz+L1X5+Y9rKmIA0RRKy4ysu0Mle0+2e7zEagOy/Rr5xwDaH7GnfRQdkM5Z+peauhpANIXSMHsaJRlwlz+7cnc6n1kB6ZxF1kDkQxqNxm5SdEAG6nxpi5zxFL+boAaQuGYY+VF3qHTpbOG0AKms4Hzx2meRubMFjPvfiw7Iwjr3L5P/pambAURTqFnMtlHJQOOy7d+dR7rE2uFs1VpXQeTC2QLG/e9FB2TRCF+iynxSUzcDiKZQezQjr3aHShfphNI6g/iBFtW5ULF9FpmjEzgum6IDMvAx7tf6I3+tqZcBRFOoPZhNeCIDDw2K1jc42oC070Wc9HfELTogr1nBfSc8PqU57gYQTaFmNpO1ri3ahUkCAbKozv7OWSRyN3UDFB2QQ0f+Z5++8l6/0dTDAKIp1ExmnbOHbhWZ536TPlv71TpXkVw2m11s/05+JLZYcQQSbAW5Baq0BZPY4o7I1ihhrRHujTJ/qxkjMiBLlrD0aD8O9DwcSM97hQAv1Ww7HTOR1wM4NonGRGT12GCw75wCnUH8Th86wn36+nAvyEOSSKILY/qAbAH4sIj6fqs1+YOHhud8XzePgVX8s1aTupAFAsR/+qg8DHiCASEHQLwCgpfr9q1QdiKbJidxzMMj4hdp1z4CA9K5FzkL4Oe1W+k5Q/E/gLpFgFvGbNnj5jgLVnOvF0zyd5oSzQpIe+kKcRoEpwF8nWbcHjCTs11bvhA00VCA+I1UHO9rApwetMEetP8BRK52B2VnMbJdNThkhHPnlPmMpi4zAuIXf/A87wKBvCuL91Wa/c/EjMCNDVu9LUzjoQHpVCX3P8tN9bFvmCTz4CPETZTW5a7d971d+zMwwhe2yvxfzT4+B5CKw78AcL6AfrnM1F/kavY7S7MJlORod7noFgif0tfQgPhRqnWOkhzKMvtua5v03tcYKn9uR7+PvIIv+MPv+XvNPKYAUl3BI0F8luSrNP17zkxEamODMhw28UiAtC8PSrwPgkrYDvSi364VNA7+OJ8393f8o6YOOwHpX8HTPI83avr1phnRmGjJ0ZtGZFtYASIB0j6LOHwHwWmvr8N2qkf8bnVttXjgU+xr/ZoTmjm3AbFqzfMg6tOaPj1rJpAzx2z5ShQBIgPiN245rWsB+UCUjvSkr8hIaT+sCAKIeFKnol+e5kU9qZl20lzr2iXtN+YzhY0FkHkjfP7eJd4Ogf+SxxwBFNi7KX1by5zUdFkP8JeAaC2004xZPDPinq0tOWnLiOheus6oQSyA+NE7OyXdDmC/4imeXEZuU0pWmS3NFtaDOBiCqqZ9L5o9pbzmSQ8Oz/EX1kY+YgOkfT9Sb76HVIFfxkTOoosD+GvNLMejZgrrASzRtO1JMxHvrLHB8vVxJR8rIJ37kdWAzPqlVlwJ9FgcA8geB5xrXLsU6zrB2AHZDom3AcBbemzyppGuAWRmldtPBeMehEQA6Xyi6+8xMi/uDvd0POK/IXhJT2swffJbqOREnU9og2qXCCB+JyoOTxXwpqAdMvZGgaAKEHJaw5abg/rp2CcGyHZIWucL5BM6HTE2RoEwChC8oGGXrgnjq+OTKCDt+5EaHQgzKzynI4Kx6VIFKHV3SPZY+C1qZokD0jmTXCeQ90XtrPE3CuxQgOBnG3bpnKQVSQWQ9pnE4a0A35x0QiZ+Lygg33RtSeUpaWqAbIfE8z+WN2+Be2EOJ5fjmGur/uTCT42cKiCdM8kTAPNVKCAttU07ERWQX7m2HBAxSCD31AHpnEl0l1YESsYYF1uBLEpAZQJIBxK/sMH8Yg+pyS4mBcZdWy2IKVagMJkB0rncugVg7MsDAilgjHOugGxwbTklq05mCkgbklrrCohcnJUApt0cK0Be6Q6VlmbZw8wB8ZOvOvwwwZVZCmHazpcCAlk+ZsuqrHuVC0B8ESoO/dI1ZllK1jMiB+0TckHDlsSWjwRJMTeAtC+36jwb5M6SOEESMbYFUUDkve6g5KZqZ64A6ZxJ/FXAV5il8gWZ8PppbCFkaVKrcvW7MdUyd4C0Idm+5ZsPSSrLCcKKZ/xiU+BWKlmaxPccUXuYS0B2JGU5LfP5btQRzr1//J/JxplyrgFpP+HaXgjiclMtJc5hz0Wsp0S8S+IssJBEVrkHxE+6XVJIypebultJTIEMYhL3KDYvias0T5IZdAUgvgDt4nRl73JTwTHJ6ZBGbK7d2lSXxFHULY3edg0gO8Ro1wL2t4AzBbPTmB/xtUE02lugRayVG1+H9CJ1HSB+Wn5V+ef14dLOXolmfxK9sc7KasIH40+TWBOlynpWne9KQHY+5VrJV7PFZWanq6ymz57b9Xd2kpKsDrt5TR6y6mpAnn0czLMguNRsLJqHKQVAZBOINWH2BMxJBju7UQhA/Gz83XfnPHvZlTede6Y//uXUxCTWBN1NNq8CFQaQHQIvqrNfEecAPNfsn5jatJsAZJ0nuO6hQfHrDhTmKBwgu4CyUHneuRDxS8OYzS2TmbLbQF7nKbXuoUHZmEwT2UYtLCA7ZG2v62rtBGWfbOUuTOtP+2CwpNblcf1UnCoXHpBdnnjNQ7MNin/ptX+cIvZQrCdBrkNZrXOXy5ZeyLtnANkxmNXVPIBNLCF5igDH98IgR82RwF0icouUsX5smTwRNV43+fccILsOTnWUFZawWIjFBI/opoFLuq8CeYCCDdLChrFhaSTdXl7j9zQguw6KNTp5FJVaLBC/ysrCvA5Ywv3aSHCDeN4Gd7jP30m35w8DyDRToFLjCSLeyYA6GuDhxZ4l8iPAu49UtzWG5I5i5xo8OwPILJr1r+TBnodj4XnHQOQYAAcGlzlXHo+BvBdK3asUvvPgcnkkV73LWWcMIAEHpLqCh3ied5wS9QaSxwHYO2CItM23isjdHr1vK6XuHrtMNqXdgW5uzwAScfQWOnxZn2A+PMyn/xP0S2T6JVUPihg6qPujAMYB2SzEOBTGJ4nxjbY8HjSQsX9WAQNIQrNhyQ0sPboZ8z20FkDEB2ZfQM0lvL0E4r/Z34vA3O2/c6/O237/p388A2AbIM8Q3Cbt39H5XT0DeP6ffwNyXKG0+aAFGF9/hrQSSqWnw/4f5GnaW9nfPLQAAAAASUVORK5CYII="},V=function(e){var t=e.type,n=e.ImgProps;return(0,C.jsx)("img",r()(r()({src:(null==H?void 0:H[t])||(null==H?void 0:H["课件"])},n),{},{width:"16rem",style:r()({width:"16rem"},(null==n?void 0:n.style)||{})}))},W=n(61422),Z=n(99534),K=function(e){var t=e.children,n=e.cout,i=void 0===n?1:n,r=(0,x.useRef)(null),a=(0,x.useState)(0),s=c()(a,2),o=s[0],l=s[1],u=(0,x.useState)(!1),d=c()(u,2),f=d[0],p=d[1];return(0,x.useEffect)((function(){r.current&&setTimeout((function(){var e=(0,h.ZR)(r.current,"rem",1);l(e)}),500)}),[r.current]),(0,C.jsxs)("div",{className:"relative flex item-end ",children:[(0,C.jsx)("div",{style:{height:f?"auto":"".concat(23.25*i,"rem"),overflow:"hidden"},children:(0,C.jsx)("div",{ref:r,style:{fontSize:"14rem"},children:t})}),o>=23.25*i&&(0,C.jsx)("div",{className:"current c-blue",style:{whiteSpace:"nowrap"},onClick:function(){p(!f)},children:f?"收起":"展示"})]})},q=function(e){var t,n,i,r,a=e.DataProps,o=e.pathsDetail,u=e.getUrl,h=o.detail,g=(0,x.useState)(!1),_=c()(g,2),v=_[0],y=_[1];return(0,C.jsxs)("div",{id:"".concat(null==a?void 0:a.id),className:"bg-white",style:{borderRadius:"4rem",padding:"15rem 30rem 30rem"},children:[(0,C.jsxs)("div",{style:{color:"#3061D0"},children:[(0,C.jsx)(V,{type:"子能力",ImgProps:{style:{marginRight:"5rem"}}}),"子能力"]}),(0,C.jsxs)("div",{className:"c-grey-333 flex item-center",style:{fontSize:"14rem",margin:"20rem 0 10rem 0",gap:"10rem"},children:[(0,C.jsx)(d.Z,{title:null==a?void 0:a.name,children:(0,C.jsx)("div",{className:"multi_ellipsis1 minW-0",children:null==a?void 0:a.name})}),(0,C.jsx)("div",{className:"flex item-center",style:{gap:"5rem"},children:null==a||null===(t=a.ability_tags)||void 0===t?void 0:t.map((function(e){return(0,C.jsx)(f.Z,{color:"orange",style:{fontSize:"12rem"},children:e})}))})]}),(null==a?void 0:a.description)&&(0,C.jsx)("div",{style:{padding:"12rem",background:"#F6F7F9"},children:(0,C.jsx)(K,{children:null==a?void 0:a.description})}),(0,C.jsxs)("div",{className:"flex item-center justify-center w-full",style:{margin:"20rem 0",padding:"12rem",background:"linear-gradient( 180deg, #ECF3FF 0%, rgba(255,255,255,0) 100%)"},children:["覆盖 ",(0,C.jsx)(V,{type:"知识点",ImgProps:{style:{margin:"0 5rem"}}})," ",null==a?void 0:a.knowledge_count,"个知识点",(0,C.jsxs)("span",{style:{marginLeft:"40rem"},children:[(0,C.jsx)(V,{type:"资源",ImgProps:{style:{marginRight:"5rem"}}}),null==a?void 0:a.resource_count,"个资源数"]})]}),(0,C.jsxs)("div",{style:{marginBottom:"10rem"},children:[(0,C.jsx)(V,{type:"知识点",ImgProps:{style:{marginRight:"5rem"}}}),"覆盖知识点",null==a?void 0:a.knowledge_count,"个"]}),(0,C.jsx)("div",{style:{height:"320rem",background:"#F6F7F9"},children:(0,C.jsx)(I,{loading:!1,nodes:null==a?void 0:a.nodes,relationships:null==a?void 0:a.relationships})}),(0,C.jsxs)("div",{style:{margin:"30rem 0 10rem"},children:[(0,C.jsx)(V,{type:"资源",ImgProps:{style:{marginRight:"5rem"}}}),"覆盖资源数",null==a?void 0:a.resource_count,"个"]}),(0,C.jsx)("div",{className:"flex-wrap",style:{gap:"10rem",display:"grid",gridTemplateColumns:"1fr 1fr"},children:null===(n=(null==a||null===(i=a.resource_knowledge_graphs)||void 0===i?void 0:i.length)>4&&!v?null==a||null===(r=a.resource_knowledge_graphs)||void 0===r?void 0:r.slice(0,4):null==a?void 0:a.resource_knowledge_graphs)||void 0===n?void 0:n.map((function(e){return(0,C.jsxs)("div",{className:"flex relative current",style:{gap:"10rem",padding:"25rem",background:"#f6f6f6",borderRadius:"10rem"},onClick:l()(s()().mark((function t(){return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,null==u?void 0:u(e);case 2:case"end":return t.stop()}}),t)}))),children:[!(null!=h&&h.can_managed)&&(0,C.jsx)("div",{className:"absolute c-white",style:{top:0,right:0,padding:"2rem 10rem",borderRadius:"0 10rem 0 10rem",color:100!=(null==e?void 0:e.complete_rate)&&"#7C3100",background:100!=(null==e?void 0:e.complete_rate)?"#FFC86B":"#37AD83"},children:100==(null==e?void 0:e.complete_rate)?"已完成":"未完成"}),(0,C.jsx)(p.Z,{type:"circle",percent:null==e?void 0:e.complete_rate,size:60,status:"success",format:function(e){return"".concat(e,"%")},strokeWidth:10}),(0,C.jsx)(V,{type:null==e?void 0:e.node_type,ImgProps:{style:{width:"16rem",height:"16rem",marginTop:"3rem"}}}),(0,C.jsxs)("div",{className:"flex-1 minW-0",children:[(0,C.jsx)(d.Z,{title:null==e?void 0:e.name,placement:"topLeft",children:(0,C.jsx)("div",{className:"multi_ellipsis1 c-grey-333 blod",style:{fontSize:"16rem"},children:null==e?void 0:e.name})}),(0,C.jsxs)("div",{className:"c-grey-333",style:{marginTop:"10rem",fontSize:"14rem"},children:["知识点:",(null==e?void 0:e.knowledge_text)||"--"]}),(null==h?void 0:h.can_managed)&&(0,C.jsxs)("div",{className:"flex flex-wrap item-center v-grey-666",style:{marginTop:"20rem",fontSize:"12rem",gap:"10rem"},children:[(0,C.jsxs)("div",{children:["学习人数:",null==e?void 0:e.study_count,"人"]}),(0,C.jsxs)("div",{children:["掌握人数:",null==e?void 0:e.complete_count,"人"]}),(0,C.jsxs)("div",{children:["掌握率:",null==e?void 0:e.complete_rate,"%"]})]})]})]},null==e?void 0:e.id)}))}),(null==a?void 0:a.resource_knowledge_graphs.length)>4&&(0,C.jsx)("div",{className:"flex item-center justify-center",style:{padding:"0 220rem"},onClick:function(){y(!v)},children:(0,C.jsx)(m.Z,{style:{borderColor:"#3061D0",marginBottom:"0rem",cursor:"pointer"},dashed:!0,children:(0,C.jsx)("span",{style:{color:"#3061D0"},children:v?"点击收起":"点击展开更多"})})})]})},X=(0,E.connect)((function(e){return{pathsDetail:e.pathsDetail,user:e.user}}))((function(e){var t,i,a,o,u,m,A,L,R,I,D,k,M,P,H,X,Y,Q,$,J,ee,te,ne,ie,re,ae,se,oe=e.pathsDetail,le=e.dispatch,ue=e.user,ce=oe.detail,he=(0,E.useParams)(),de=(0,E.useSearchParams)(),fe=c()(de,1)[0],pe=(0,x.useState)({}),me=c()(pe,2),ge=me[0],_e=me[1],ve=(0,x.useState)({id:null,open:!1,resourceUrl:""}),ye=c()(ve,2),be=ye[0],xe=ye[1],Ee=(0,T.U)(S.Ju,{subject_id:he.pathId,id:null==he?void 0:he.abilityId}),we=c()(Ee,4),Te=we[1],Se=we[2],Ae=we[3],Ce=(0,x.useState)([{name:"掌握率59%以下",value:0,itemStyle:{color:"rgb(6,110,247)"}},{name:"掌握率60%79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"掌握率80%100%",value:0,itemStyle:{color:"rgb(223,209,38)"}}]),Le=c()(Ce,2),Re=Le[0],Ie=Le[1],De=new URLSearchParams(window.location.search),ke=function(){var e=l()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Se({subject_id:null==he?void 0:he.pathId,id:null==he?void 0:he.abilityId});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function Me(e){return Pe.apply(this,arguments)}function Pe(){return(Pe=l()(s()().mark((function e(t){var n,i,r,a,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.ZP)("/api/knowledge/v2/get_container_type.json",{method:"get",params:{url:null==t?void 0:t.resourceUrl}});case 2:if(n=e.sent,localStorage.setItem("container_type_tupu",null==n?void 0:n.container_type),0!==(null==n?void 0:n.status)){e.next=12;break}if("试卷"!=(null==t?void 0:t.node_type)){e.next=11;break}return e.next=8,(0,Z.Mb)({categoryId:null==n?void 0:n.examination_bank_id});case 8:return null!=(i=e.sent)&&i.exercise_id&&(0,h.xg)("/classrooms/coursesId/exercise/".concat(i.exercise_id,"/").concat(null===(r=ue.userInfo)||void 0===r?void 0:r.login,"/initate_answer")),e.abrupt("return");case 11:"video"===(null==n?void 0:n.container_type)?xe({id:null==n?void 0:n.id,open:!0,resourceUrl:null==t?void 0:t.resourceUrl}):"att"===(null==n?void 0:n.container_type)?_e({url:B.Z.API_SERVER+(null==n||null===(a=n.attachment)||void 0===a?void 0:a.url),file_type:null==n||null===(o=n.attachment)||void 0===o?void 0:o.file_type}):window.open(null==t?void 0:t.resourceUrl);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Oe=function(){var e=l()(s()().mark((function e(t){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(3===(null==t?void 0:t.resourceOrigin)?(0,h.xg)(null==t?void 0:t.resourceUrl):Me(t),null==ce||!ce.can_managed){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,F.ZP)("/api/subject_knowledge/create_study.json",{method:"post",body:{subject_id:null==he?void 0:he.pathId,uuid:(null==t?void 0:t.last_knowledge_uuid)||(null==t?void 0:t.knowledge_uuid)}});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,x.useEffect)((function(){if(0==(null==Ae?void 0:Ae.status)&&null!=ce&&ce.can_managed){var e,t,n=null==Object||null===(e=Object.entries((null==Ae||null===(t=Ae.data)||void 0===t?void 0:t.study_grasp_hash)||{}))||void 0===e?void 0:e.map((function(e,t){var n=c()(e,2);return{name:n[0],value:n[1],itemStyle:Re[t].itemStyle}}));Ie(n)}}),[null==ce?void 0:ce.can_managed,Ae]),(0,x.useEffect)((function(){ke()}),[null==he?void 0:he.abilityId]),(0,x.useEffect)((function(){le({type:"pathsDetail/getKnowledgeGraphs",payload:{graphable_type:"classrooms"==fe.get("type")?"course":"subject",graphable_id:null==he?void 0:he.pathId}}),De.set("tabs","5")}),[]),(0,x.useEffect)((function(){return le({type:"globalSetting/footerToggle",payload:!1}),function(){le({type:"globalSetting/footerToggle",payload:!0})}}),[]),(0,C.jsxs)(g.Z,{spinning:Te,children:[(0,C.jsxs)("div",{className:"ml-auto mr-auto",style:{width:"1200rem",paddingTop:"15rem"},children:[(0,C.jsx)(_.Z,{style:{fontSize:"14rem",marginBottom:"20rem"},items:[{title:(0,C.jsxs)("a",{className:"flex item-center",style:{fontSize:"14rem"},onClick:function(){E.history.push("/knowledgegraph/".concat(he.pathId,"?").concat(De))},children:[(0,C.jsx)(d.Z,{title:"返回",children:(0,C.jsx)("i",{className:"iconfont icon-fanhui1",style:{fontSize:"14rem",marginRight:"20rem"}})}),"能力图谱"]})},{title:"能力详情"}]}),(0,C.jsxs)("div",{className:"w-full flex",children:[(0,C.jsxs)("div",{className:"sticky flex flex-col",style:{width:"250rem",borderRadius:"4rem 0 0 4rem",maxHeight:"100vh",overflowY:"auto",overflowX:"hidden",top:0,background:"#F6F7F9"},children:[(0,C.jsx)(O,{abilityGoalItem:null==Ae||null===(t=Ae.data)||void 0===t?void 0:t.ability_goals}),(0,C.jsxs)("div",{style:{padding:"10rem 20rem 20rem"},children:[(0,C.jsx)("div",{className:"c-grey-333",style:{fontSize:"16rem"},children:"目录导航"}),(0,C.jsx)(v.default,{className:"w-full",value:Number(null==he?void 0:he.abilityId),style:{marginTop:"10rem"},onChange:function(e){E.history.push("/knowledgegraph/".concat(he.pathId,"/abilityMap/detail/").concat(e,"?").concat(De))},options:(null==Ae||null===(i=Ae.data)||void 0===i||null===(i=i.ability_goals)||void 0===i?void 0:i.map((function(e){return{label:null==e?void 0:e.name,value:null==e?void 0:e.id}})))||[],size:"large"})]}),(0,C.jsx)(y.Z,{className:z,items:null==Ae||null===(a=Ae.data)||void 0===a||null===(a=a.children_ability_goals)||void 0===a?void 0:a.map((function(e){var t;return{key:null==e?void 0:e.id,href:"#".concat(null==e?void 0:e.id),title:(0,C.jsxs)("div",{className:"current relative ".concat(j),children:[(0,C.jsxs)("div",{className:"flex item-center",style:{gap:"10rem"},children:[(0,C.jsx)("div",{className:"flex-1 minW-0 multi_ellipsis1 c-grey-333",style:{fontSize:"14rem"},children:null==e?void 0:e.name}),(0,C.jsx)("span",{style:{color:"#464F66",fontSize:"12rem"},children:null!=ce&&ce.can_managed?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"iconfont icon-a-60-kejian",style:{marginRight:"5rem",fontSize:"12rem"}}),null==e?void 0:e.knowledge_count]}):(0,C.jsxs)("span",{style:{color:"#00C088"},children:[(0,C.jsx)("span",{className:"iconfont icon-xuesheng2",style:{marginRight:"5rem",fontSize:"12rem"}}),(null==e?void 0:e.grasp_rate)||0,"%"]})})]}),(0,C.jsx)("div",{className:"flex flex-wrap",style:{gap:"5rem",marginTop:"10rem"},children:null==e||null===(t=e.ability_tags)||void 0===t?void 0:t.map((function(e){return(0,C.jsx)(f.Z,{color:"orange",style:{fontSize:"12rem"},children:e},e)}))}),(0,C.jsx)("div",{className:"multi_ellipsis2",style:{marginTop:"20rem",color:"#464F66",fontSize:"12rem"},children:null==e?void 0:e.description})]})}}))})]}),(0,C.jsxs)("div",{className:"flex-1 minW-0 flex flex-col",style:{gap:"20rem"},children:[(0,C.jsxs)("div",{className:"bg-white relative",style:{borderRadius:"4rem",padding:"15rem 30rem 30rem"},children:[(null==Ae||null===(o=Ae.data)||void 0===o||null===(o=o.next_ability_goal)||void 0===o?void 0:o.id)&&(0,C.jsx)("div",{className:"absolute current",style:{right:0,top:0},onClick:function(){var e;E.history.push("/knowledgegraph/".concat(he.pathId,"/abilityMap/detail/").concat(null==Ae||null===(e=Ae.data)||void 0===e||null===(e=e.next_ability_goal)||void 0===e?void 0:e.id,"?").concat(De))},children:(0,C.jsxs)("div",{className:G,children:[(0,C.jsx)("div",{className:"multi_ellipsis1",children:null==Ae||null===(u=Ae.data)||void 0===u||null===(u=u.next_ability_goal)||void 0===u?void 0:u.name}),(0,C.jsx)("div",{children:(0,C.jsx)("span",{className:"iconfont icon-you2",style:{fontSize:"14rem"}})})]})}),(0,C.jsxs)("div",{style:{color:"#3061D0"},children:[(0,C.jsx)(V,{type:"主能力",ImgProps:{style:{marginRight:"5rem"}}}),"主能力"]}),(0,C.jsx)("div",{className:"c-grey-333 blod",style:{fontSize:"14rem",margin:"20rem 0 10rem 0"},children:null==Ae||null===(m=Ae.data)||void 0===m?void 0:m.name}),(null==Ae||null===(A=Ae.data)||void 0===A?void 0:A.description)&&(0,C.jsx)("div",{style:{padding:"12rem",background:"#F6F7F9"},children:(0,C.jsx)(K,{children:null==Ae||null===(L=Ae.data)||void 0===L?void 0:L.description})}),(null==ce?void 0:ce.can_managed)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"flex",style:{marginTop:"20rem",gap:"20rem"},children:[{title:"平均主能力掌握率",value:null==Ae||null===(R=Ae.data)||void 0===R?void 0:R.children_ability_goal_grasp_rate,unit:"%",img:n(46016),bg:"#E3F1FF"},{title:"覆盖知识点",value:null==Ae||null===(I=Ae.data)||void 0===I?void 0:I.total_knowledge_count,unit:"个",img:n(99755),bg:"#F1FDEF",ProgressTitle:"占总知识点",percent:null==Ae||null===(D=Ae.data)||void 0===D?void 0:D.knowledge_rate,trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"覆盖资源数",value:null==Ae||null===(k=Ae.data)||void 0===k?void 0:k.total_resource_count,unit:"个",img:n(92691),bg:"#FFF9F4",ProgressTitle:"占总资源数",percent:null==Ae||null===(M=Ae.data)||void 0===M?void 0:M.resource_rate,trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((function(e,t){return(0,C.jsxs)("div",{className:"flex-1 minW-0 relative",style:{borderRadius:"6rem",background:null==e?void 0:e.bg,padding:"20rem 30rem"},children:[(0,C.jsx)("img",{src:null==e?void 0:e.img,width:"43rem",height:"43rem",className:"absolute",style:{right:"30rem",top:"20rem"}}),(0,C.jsx)("div",{className:"c-grey-666",style:{fontSize:"14rem"},children:null==e?void 0:e.title}),(0,C.jsxs)("div",{className:"c-grey-333 blod",style:{marginTop:"10rem",fontSize:"26rem",lineHeight:"26rem"},children:[null==e?void 0:e.value,(0,C.jsx)("span",{style:{fontSize:"14rem"},children:null==e?void 0:e.unit})]}),(null==e?void 0:e.ProgressTitle)&&(0,C.jsxs)("div",{className:"c-grey-666",style:{fontSize:"12rem",marginTop:"20rem"},children:[(0,C.jsxs)("div",{children:[null==e?void 0:e.ProgressTitle,null==e?void 0:e.percent,"%"]}),(0,C.jsx)(p.Z,{percent:null==e?void 0:e.percent,showInfo:!1,trailColor:null==e?void 0:e.trailColor,strokeColor:null==e?void 0:e.strokeColor,style:{marginBottom:"0",marginLeft:"0"}})]})]},t)}))}),(0,C.jsx)("div",{className:"c-grey-333",style:{margin:"40rem 0 30rem 0",fontSize:"14rem"},children:"学习统计"}),(0,C.jsxs)("div",{className:"flex",children:[(0,C.jsx)("div",{className:"minW-0 flex flex-col",style:{gap:"13rem",width:"200rem"},children:[{title:"学习人数",value:null==Ae||null===(P=Ae.data)||void 0===P?void 0:P.study_count,unit:"",img:n(37426),bg:"rgba(68, 95, 232, 0.1)"},{title:"学习完成率",value:null==Ae||null===(H=Ae.data)||void 0===H?void 0:H.complete_rate,unit:"%",img:n(19150),bg:"rgba(182, 129, 0, .1)"},{title:"学习掌握率",value:null==Ae||null===(X=Ae.data)||void 0===X?void 0:X.grasp_rate,unit:"%",img:n(55303),bg:"rgba(6, 145, 127, .1)"}].map((function(e,t){return(0,C.jsxs)("div",{className:"relative",style:{borderRadius:"6rem",padding:"20rem",background:null==e?void 0:e.bg},children:[(0,C.jsx)("div",{style:{fontSize:"14rem"},children:null==e?void 0:e.title}),(0,C.jsxs)("div",{className:"blod",style:{fontSize:"26rem"},children:[null==e?void 0:e.value,(0,C.jsx)("span",{style:{fontSize:"14rem"},children:null==e?void 0:e.unit})]}),(0,C.jsx)("img",{className:"absolute",style:{right:"6rem",bottom:"6rem"},height:"35rem",src:null==e?void 0:e.img})]},t)}))}),(0,C.jsx)("div",{className:"flex-1 minW-0",children:(0,C.jsx)(w.Z,{dataSource:Re,legend:{top:null,icon:"roundRect",bottom:10,itemWidth:14,itemGap:50,left:"center",formatter:function(e){return e}}})})]})]}),!(null!=ce&&ce.can_managed)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"flex item-center",style:{gap:"20rem",marginTop:"20rem"},children:[{title:"覆盖知识点",value:null==Ae||null===(Y=Ae.data)||void 0===Y?void 0:Y.total_knowledge_count,unit:"个",percent:null==Ae||null===(Q=Ae.data)||void 0===Q?void 0:Q.knowledge_rate,percenttitle:"占总知识点",trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"覆盖资源数",value:null==Ae||null===($=Ae.data)||void 0===$?void 0:$.total_resource_count,unit:"个",percent:null==Ae||null===(J=Ae.data)||void 0===J?void 0:J.resource_rate,percenttitle:"占总资源数",trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((function(e,t){return(0,C.jsxs)("div",{className:"flex-1 minW-0 flex justify-between c-grey-333",style:{gap:"20rem",background:"#F6F7F9",borderRadius:"6rem",padding:"30rem 60rem"},children:[(0,C.jsxs)("div",{className:"flex flex-col justify-between",children:[(0,C.jsx)("div",{style:{fontSize:"14rem",whiteSpace:"nowrap"},children:null==e?void 0:e.title}),(0,C.jsxs)("div",{className:"blod",style:{fontSize:"26rem"},children:[null==e?void 0:e.value,(0,C.jsx)("span",{style:{fontSize:"14rem"},children:null==e?void 0:e.unit})]})]}),(0,C.jsx)("div",{className:"relative",style:{width:"133rem",height:"75rem"},children:(0,C.jsx)(p.Z,{type:"dashboard",percent:null==e?void 0:e.percent,gapDegree:178,strokeWidth:10,className:"absolute",style:{right:0,top:0},trailColor:null==e?void 0:e.trailColor,strokeColor:null==e?void 0:e.strokeColor,strokeLinecap:"round",format:function(t){return(0,C.jsxs)("div",{className:"c-grey-333",style:{fontSize:"12rem",textAlign:"center",marginTop:"-35rem"},children:[t,"%",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),null==e?void 0:e.percenttitle]})}})})]},t)}))}),(0,C.jsx)("div",{className:"c-grey-333 blod",style:{margin:"40rem 0 30rem 0",fontSize:"14rem"},children:"学习统计"}),(0,C.jsx)("div",{className:"flex",style:{marginTop:"20rem",gap:"20rem"},children:[{title:"主能力掌握率",value:null==Ae||null===(ee=Ae.data)||void 0===ee?void 0:ee.children_ability_goal_grasp_rate,unit:"%",img:n(46016),bg:"#E3F1FF"},{title:"已掌握知识点",value:(null==Ae||null===(te=Ae.data)||void 0===te?void 0:te.knowledge_grasp_count)||0,unit:"个",img:n(99755),bg:"#F1FDEF",ProgressTitle:"知识点掌握率",percent:(null==Ae||null===(ne=Ae.data)||void 0===ne?void 0:ne.knowledge_grasp_rate)||0,trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"已完成资源数",value:(null==Ae||null===(ie=Ae.data)||void 0===ie?void 0:ie.resource_complete_count)||0,unit:"个",img:n(92691),bg:"#FFF9F4",ProgressTitle:"完成资源率",percent:(null==Ae||null===(re=Ae.data)||void 0===re?void 0:re.resource_complete_rate)||0,trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((function(e,t){return(0,C.jsxs)("div",{className:"flex-1 minW-0 relative",style:{borderRadius:"6rem",background:null==e?void 0:e.bg,padding:"20rem 30rem"},children:[(0,C.jsx)("img",{src:null==e?void 0:e.img,width:"43rem",height:"43rem",className:"absolute",style:{right:"30rem",top:"20rem"}}),(0,C.jsx)("div",{className:"c-grey-666",style:{fontSize:"14rem"},children:null==e?void 0:e.title}),(0,C.jsxs)("div",{className:"c-grey-333 blod",style:{marginTop:"10rem",fontSize:"26rem",lineHeight:"26rem"},children:[null==e?void 0:e.value,(0,C.jsx)("span",{style:{fontSize:"14rem"},children:null==e?void 0:e.unit})]}),(null==e?void 0:e.ProgressTitle)&&(0,C.jsxs)("div",{className:"c-grey-666",style:{fontSize:"12rem",marginTop:"20rem"},children:[(0,C.jsxs)("div",{children:[null==e?void 0:e.ProgressTitle,null==e?void 0:e.percent,"%"]}),(0,C.jsx)(p.Z,{percent:null==e?void 0:e.percent,showInfo:!1,trailColor:null==e?void 0:e.trailColor,strokeColor:null==e?void 0:e.strokeColor,style:{marginBottom:"0",marginLeft:"0"}})]})]},t)}))}),(0,C.jsx)("div",{className:"c-grey-333 blod",style:{margin:"30rem 0 10rem 0",fontSize:"14rem"},children:"开始学习"}),(0,C.jsx)("div",{className:"flex flex-col",style:{gap:"10rem"},children:null==Ae||null===(ae=Ae.data)||void 0===ae||null===(ae=ae.children_ability_goals)||void 0===ae?void 0:ae.map((function(e){return(0,C.jsxs)("div",{className:"flex item-center",style:{gap:"20rem",padding:"20rem",background:"#F6F7F9",borderRadius:"6rem"},children:[(0,C.jsxs)("div",{className:"flex-1 minW-0 flex flex-col",children:[(0,C.jsxs)("div",{className:"flex",style:{gap:"10rem"},children:[(0,C.jsxs)("div",{style:{color:"#3061D0"},children:[(0,C.jsx)(V,{type:"子能力",ImgProps:{style:{marginRight:"5rem"}}}),"子能力"]}),(0,C.jsx)(d.Z,{title:null==e?void 0:e.name,placement:"topLeft",children:(0,C.jsx)("div",{className:"multi_ellipsis1",children:null==e?void 0:e.name})})]}),(0,C.jsxs)("div",{className:"flex item-center",style:{gap:"10rem",marginTop:"15rem",fontSize:"14rem"},children:[(0,C.jsx)(f.Z,{color:"orange",style:{fontSize:"12rem",lineHeight:"1.5"},children:"节点"}),(0,C.jsx)("span",{className:"c-grey-333",children:null==e?void 0:e.last_knowledge_name}),null!=e&&e.is_complete?(0,C.jsx)("span",{className:"c-green",children:"(已掌握)"}):(0,C.jsx)("span",{className:"c-grey-666",children:"(未掌握)"})]})]}),(0,C.jsx)(N.op,{onClick:l()(s()().mark((function t(){return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:case"end":return t.stop()}}),t)}))),children:0==(null==e?void 0:e.complete_rate)?"开始学习":"继续学习"})]},null==e?void 0:e.id)}))})]})]}),null==Ae||null===(se=Ae.data)||void 0===se||null===(se=se.children_ability_goals)||void 0===se?void 0:se.map((function(e){return(0,C.jsx)(q,{DataProps:e,pathsDetail:oe,getUrl:Oe},null==e?void 0:e.id)}))]})]})]}),(0,C.jsx)(b.Z,{open:null==be?void 0:be.open,title:"视频",width:800,centered:!0,onCancel:function(){xe(r()(r()({},be),{},{open:!1}))},onOk:function(){xe(r()(r()({},be),{},{open:!1}))},children:(0,C.jsx)(W.Z,{allow_skip:!0,videoId:be.id,toLog:!0,src:null==be?void 0:be.resourceUrl,logWatchHistory:function(e){return t=r()(r()({},e),{},{container_type:localStorage.getItem("container_type_tupu")}),le({type:"userDetail/logWatchHistory",payload:r()({},t)});var t}})}),(0,C.jsx)(U.Z,{close:!0,style:{zIndex:1300,background:"rgba(1, 10, 35, 0.5)"},data:null==ge?void 0:ge.url,type:null==ge?void 0:ge.file_type,disabledDownload:!0,onClose:function(){return _e({})}})]})}))},66860:function(e,t,n){"use strict";function i(e){try{e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}catch(e){console.log(e,":e")}}function r(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}n.d(t,{BU:function(){return r},Dj:function(){return i},gH:function(){return a},vp:function(){return s}});var a=function(){return document.webkitExitFullscreen?"webkitfullscreenchange":document.exitFullscreen?"fullscreenchange":document.msExitFullscreen?"msfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":void 0};function s(){var e=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement;document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",e),window.isFullScreen?window.isFullScreen:null!=e}},11046:function(e,t,n){"use strict";n.d(t,{U:function(){return d}});var i=n(7557),r=n.n(i),a=n(82242),s=n.n(a),o=n(41498),l=n.n(o),u=n(79800),c=n.n(u),h=n(59301);function d(e,t){var n=(0,h.useState)(t),i=c()(n,2),a=i[0],o=i[1],u=(0,h.useState)(!1),d=c()(u,2),f=d[0],p=d[1],m=(0,h.useState)(),g=c()(m,2),_=g[0],v=g[1],y=function(){var n=l()(r()().mark((function n(i){var l,u,c,h=arguments;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=h.length>1&&void 0!==h[1]&&h[1],u=l?t:s()(s()({},a),i),p(!0),o(u),n.next=6,e(u);case 6:return c=n.sent,p(!1),v(c),n.abrupt("return",c);case 10:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}();return[a,f,y,_,v]}},84201:function(e,t,n){"use strict";n.d(t,{Z:function(){return we}});var i=n(31468),r=n.n(i),a=n(82100),s=n.n(a),o=n(29186),l=n.n(o),u=function(){function e(){s()(this,e)}return l()(e,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t},"function"!=typeof self.Promise&&n(3867).polyfill()}}]),e}();u.install();var c=u,h=n(86204),d=n.n(h),f=function(){function e(){s()(this,e)}return l()(e,null,[{key:"e",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","error",i),e.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}},{key:"i",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}},{key:"w",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}},{key:"d",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",i),e.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}},{key:"v",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",i),e.ENABLE_VERBOSE&&console.log(i)}}]),e}();f.GLOBAL_TAG="flv.js",f.FORCE_GLOBAL_TAG=!1,f.ENABLE_ERROR=!0,f.ENABLE_INFO=!0,f.ENABLE_WARN=!0,f.ENABLE_DEBUG=!0,f.ENABLE_VERBOSE=!0,f.ENABLE_CALLBACK=!1,f.emitter=new(d());var p=f,m=function(){function e(){s()(this,e),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return l()(e,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}(),g=n(80619),_=n.n(g),v=n(47074),y=n.n(v),b=function(){function e(t){s()(this,e),this._message=t}return l()(e,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),e}(),x=function(e){_()(n,e);var t=y()(n);function n(e){return s()(this,n),t.call(this,e)}return l()(n,[{key:"name",get:function(){return"IllegalStateException"}}]),n}(b),E=function(e){_()(n,e);var t=y()(n);function n(e){return s()(this,n),t.call(this,e)}return l()(n,[{key:"name",get:function(){return"InvalidArgumentException"}}]),n}(b),w=function(e){_()(n,e);var t=y()(n);function n(e){return s()(this,n),t.call(this,e)}return l()(n,[{key:"name",get:function(){return"NotImplementedException"}}]),n}(b),T={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},S={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},A=function(){function e(t){s()(this,e),this._type=t||"undefined",this._status=T.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return l()(e,[{key:"destroy",value:function(){this._status=T.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===T.kConnecting||this._status===T.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"open",value:function(e,t){throw new w("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new w("Unimplemented abstract function!")}}]),e}(),C=n(4811),L=n.n(C),R=n(34577),I=n.n(R),D={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],i={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},r={};if(i.browser){r[i.browser]=!0;var a=i.majorVersion.split(".");r.version={major:parseInt(i.majorVersion,10),string:i.version},a.length>1&&(r.version.minor=parseInt(a[1],10)),a.length>2&&(r.version.build=parseInt(a[2],10))}if(i.platform&&(r[i.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;var s="msie";i.browser=s,r[s]=!0}if(r.edge){delete r.edge;var o="msedge";i.browser=o,r[o]=!0}if(r.opr){var l="opera";i.browser=l,r[l]=!0}if(r.safari&&r.android){var u="android";i.browser=u,r[u]=!0}for(var c in r.name=i.browser,r.platform=i.platform,D)D.hasOwnProperty(c)&&delete D[c];Object.assign(D,r)}();var k=D,M=function(e){_()(n,e);var t=y()(n);function n(e,i){var r;return s()(this,n),(r=t.call(this,"fetch-stream-loader")).TAG="FetchStreamLoader",r._seekHandler=e,r._config=i,r._needStash=!0,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return l()(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),L()(I()(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){var n=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(i=e.redirectedURL);var a=this._seekHandler.getConfig(i,t),s=new self.Headers;if("object"===r()(a.headers)){var o=a.headers;for(var l in o)o.hasOwnProperty(l)&&s.append(l,o[l])}var u={method:"GET",headers:s,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===r()(this._config.headers))for(var c in this._config.headers)s.append(c,this._config.headers[c]);!1===e.cors&&(u.mode="same-origin"),e.withCredentials&&(u.credentials="include"),e.referrerPolicy&&(u.referrerPolicy=e.referrerPolicy),this._status=T.kConnecting,self.fetch(a.url,u).then((function(e){if(n._requestAbort)return n._requestAbort=!1,void(n._status=T.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.url&&n._onURLRedirect){var t=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(t)}var i=e.headers.get("Content-Length");return null!=i&&(n._contentLength=parseInt(i),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=T.kError,!n._onError)throw new b("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(S.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(n._status=T.kError,!n._onError)throw e;n._onError(S.EXCEPTION,{code:-1,msg:e.message})}))}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(e){var t=this;return e.read().then((function(n){if(n.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=T.kError;var i=S.EARLY_EOF,r={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new b(r.msg);t._onError(i,r)}else t._status=T.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(!0===t._requestAbort)return t._requestAbort=!1,t._status=T.kComplete,e.cancel();t._status=T.kBuffering;var a=n.value.buffer,s=t._range.from+t._receivedLength;t._receivedLength+=a.byteLength,t._onDataArrival&&t._onDataArrival(a,s,t._receivedLength),t._pump(e)}})).catch((function(e){if(11!==e.code||!k.msedge){t._status=T.kError;var n=0,i=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(n=S.EXCEPTION,i={code:e.code,msg:e.message}):(n=S.EARLY_EOF,i={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new b(i.msg);t._onError(n,i)}}))}}],[{key:"isSupported",value:function(){try{var e=k.msedge&&k.version.minor>=15048,t=!k.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}}]),n}(A),P=function(e){_()(n,e);var t=y()(n);function n(e,i){var r;return s()(this,n),(r=t.call(this,"xhr-moz-chunked-loader")).TAG="MozChunkedLoader",r._seekHandler=e,r._config=i,r._needStash=!0,r._xhr=null,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return l()(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),L()(I()(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var i=this._seekHandler.getConfig(n,t);this._requestURL=i.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",i.url,!0),a.responseType="moz-chunked-arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onloadend=this._onLoadEnd.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"===r()(i.headers)){var s=i.headers;for(var o in s)s.hasOwnProperty(o)&&a.setRequestHeader(o,s[o])}if("object"===r()(this._config.headers)){var l=this._config.headers;for(var u in l)l.hasOwnProperty(u)&&a.setRequestHeader(u,l[u])}this._status=T.kConnecting,a.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=T.kComplete}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var n=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(n)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=T.kError,!this._onError)throw new b("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=T.kBuffering}}},{key:"_onProgress",value:function(e){if(this._status!==T.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}}},{key:"_onLoadEnd",value:function(e){!0!==this._requestAbort?this._status!==T.kError&&(this._status=T.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}},{key:"_onXhrError",value:function(e){this._status=T.kError;var t=0,n=null;if(this._contentLength&&e.loaded<this._contentLength?(t=S.EARLY_EOF,n={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=S.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new b(n.msg);this._onError(t,n)}}],[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return p.w("MozChunkedLoader",e.message),!1}}}]),n}(A),O=function(e){_()(n,e);var t=y()(n);function n(e,i){var r;return s()(this,n),(r=t.call(this,"xhr-range-loader")).TAG="RangeLoader",r._seekHandler=e,r._config=i,r._needStash=!1,r._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],r._currentChunkSizeKB=384,r._currentSpeedNormalized=0,r._zeroSpeedChunkCount=0,r._xhr=null,r._speedSampler=new m,r._requestAbort=!1,r._waitForTotalLength=!1,r._totalLengthReceived=!1,r._currentRequestURL=null,r._currentRedirectedURL=null,r._currentRequestRange=null,r._totalLength=null,r._contentLength=null,r._receivedLength=0,r._lastTimeLoaded=0,r}return l()(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),L()(I()(n.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t,this._status=T.kConnecting;var n=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(n=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||n?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}},{key:"_openSubRange",value:function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,n=t+e;null!=this._contentLength&&n-this._range.from>=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var i=this._seekHandler.getConfig(n,t);this._currentRequestURL=i.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",i.url,!0),a.responseType="arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onload=this._onLoad.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"===r()(i.headers)){var s=i.headers;for(var o in s)s.hasOwnProperty(o)&&a.setRequestHeader(o,s[o])}if("object"===r()(this._config.headers)){var l=this._config.headers;for(var u in l)l.hasOwnProperty(u)&&a.setRequestHeader(u,l[u])}a.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=T.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=T.kBuffering}else{if(this._status=T.kError,!this._onError)throw new b("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}},{key:"_onProgress",value:function(e){if(this._status!==T.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,i=0,r=0,a=n;if(e<t[0])return t[0];for(;r<=a;){if((i=r+Math.floor((a-r)/2))===n||e>=t[i]&&e<t[i+1])return t[i];t[i]<e?r=i+1:a=i-1}}},{key:"_onLoad",value:function(e){if(this._status!==T.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var i=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():a=!0,this._onDataArrival&&this._onDataArrival(i,r,this._receivedLength),a&&(this._status=T.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}}},{key:"_onXhrError",value:function(e){this._status=T.kError;var t=0,n=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=S.EARLY_EOF,n={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=S.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new b(n.msg);this._onError(t,n)}}],[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return p.w("RangeLoader",e.message),!1}}}]),n}(A),N=function(e){_()(n,e);var t=y()(n);function n(){var e;return s()(this,n),(e=t.call(this,"websocket-loader")).TAG="WebSocketLoader",e._needStash=!0,e._ws=null,e._requestAbort=!1,e._receivedLength=0,e}return l()(n,[{key:"destroy",value:function(){this._ws&&this.abort(),L()(I()(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=T.kConnecting}catch(e){this._status=T.kError;var n={code:e.code,msg:e.message};if(!this._onError)throw new b(n.msg);this._onError(S.EXCEPTION,n)}}},{key:"abort",value:function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=T.kComplete}},{key:"_onWebSocketOpen",value:function(e){this._status=T.kBuffering}},{key:"_onWebSocketClose",value:function(e){!0!==this._requestAbort?(this._status=T.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1}},{key:"_onWebSocketMessage",value:function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var n=new FileReader;n.onload=function(){t._dispatchArrayBuffer(n.result)},n.readAsArrayBuffer(e.data)}else{this._status=T.kError;var i={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new b(i.msg);this._onError(S.EXCEPTION,i)}}},{key:"_dispatchArrayBuffer",value:function(e){var t=e,n=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}},{key:"_onWebSocketError",value:function(e){this._status=T.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new b(t.msg);this._onError(S.EXCEPTION,t)}}],[{key:"isSupported",value:function(){try{return void 0!==self.WebSocket}catch(e){return!1}}}]),n}(A),F=function(){function e(t){s()(this,e),this._zeroStart=t||!1}return l()(e,[{key:"getConfig",value:function(e,t){var n,i={};0!==t.from||-1!==t.to?(n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),i.Range=n):this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}}},{key:"removeURLParameters",value:function(e){return e}}]),e}(),B=function(){function e(t,n){s()(this,e),this._startName=t,this._endName=n}return l()(e,[{key:"getConfig",value:function(e,t){var n=e;if(0!==t.from||-1!==t.to){var i=!0;-1===n.indexOf("?")&&(n+="?",i=!1),i&&(n+="&"),n+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(n+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:n,headers:{}}}},{key:"removeURLParameters",value:function(e){var t=e.split("?")[0],n=void 0,i=e.indexOf("?");-1!==i&&(n=e.substring(i+1));var r="";if(null!=n&&n.length>0)for(var a=n.split("&"),s=0;s<a.length;s++){var o=a[s].split("="),l=s>0;o[0]!==this._startName&&o[0]!==this._endName&&(l&&(r+="&"),r+=a[s])}return 0===r.length?t:t+"?"+r}}]),e}(),U=function(){function e(t,n,i){s()(this,e),this.TAG="IOController",this._config=n,this._extraData=i,this._stashInitialSize=393216,null!=n.stashInitialSize&&n.stashInitialSize>0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===n.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new m,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return l()(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(e){this._extraData=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(e){this._onSeeked=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(e){this._onRedirect=e}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===O?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new F(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new B(t,n)}else{if("custom"!==e.seekType)throw new E("Invalid seekType in config: ".concat(e.seekType));if("function"!=typeof e.customSeekHandler)throw new E("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=N;else if(M.isSupported())this._loaderClass=M;else if(P.isSupported())this._loaderClass=P;else{if(!O.isSupported())throw new b("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=O}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!=typeof e||0===e.length)throw new E("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var n=new ArrayBuffer(t);if(this._stashUsed>0){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(i,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,i=0,r=0,a=n;if(e<t[0])return t[0];for(;r<=a;){if((i=r+Math.floor((a-r)/2))===n||e>=t[i]&&e<t[i+1])return t[i];t[i]<e?r=i+1:a=i-1}}},{key:"_adjustStashSize",value:function(e){var t=0;(t=this._config.isLive||e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize<n&&this._expandBuffer(n),this._stashSize=1024*t}},{key:"_dispatchChunks",value:function(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)}},{key:"_onURLRedirect",value:function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}},{key:"_onContentLengthKnown",value:function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(e,t,n){if(!this._onDataArrival)throw new x("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var i=this._speedSampler.lastSecondKBps;if(0!==i){var r=this._normalizeSpeed(i);this._speedNormalized!==r&&(this._speedNormalized=r,this._adjustStashSize(r))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize){new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var a=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed),o=this._dispatchChunks(s,this._stashByteStart);if(o<s.byteLength){if(o>0){var l=new Uint8Array(s,o);a.set(l,0),this._stashUsed=l.byteLength,this._stashByteStart+=o}}else this._stashUsed=0,this._stashByteStart+=o;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var u=this._dispatchChunks(e,t);if(u<e.byteLength){var c=e.byteLength-u;c>this._bufferSize&&(this._expandBuffer(c),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,u),0),this._stashUsed+=c,this._stashByteStart=t+u}}}else if(0===this._stashUsed){var h=this._dispatchChunks(e,t);if(h<e.byteLength){var d=e.byteLength-h;d>this._bufferSize&&this._expandBuffer(d),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,h),0),this._stashUsed+=d,this._stashByteStart=t+h}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var f=new Uint8Array(this._stashBuffer,0,this._bufferSize);f.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p<this._stashUsed&&p>0){var m=new Uint8Array(this._stashBuffer,p);f.set(m,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),i=t.byteLength-n;if(n<t.byteLength){if(!e){if(n>0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,n);r.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=n}return 0}p.w(this.TAG,"".concat(i," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,i}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){if(p.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=S.UNRECOVERABLE_EARLY_EOF),e===S.EARLY_EOF){if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n<this._totalLength&&(p.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(n,!1)))}e=S.UNRECOVERABLE_EARLY_EOF}if(!this._onError)throw new b("IOException: "+t.msg);this._onError(e,t)}}]),e}(),G={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function z(){return Object.assign({},G)}var j=function(){function e(){s()(this,e)}return l()(e,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var e=new U({},z()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t}},{key:"getNetworkLoaderTypeName",value:function(){var e=new U({},z()),t=e.loaderType;return e.destroy(),t}},{key:"supportNativeMediaPlayback",value:function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var n=e.videoElement.canPlayType(t);return"probably"===n||"maybe"==n}},{key:"getFeatureList",value:function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t}}]),e}(),H=j,V={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},W=function(){function e(){s()(this,e)}return l()(e,null,[{key:"forceGlobalTag",get:function(){return p.FORCE_GLOBAL_TAG},set:function(t){p.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return p.GLOBAL_TAG},set:function(t){p.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return p.ENABLE_VERBOSE&&p.ENABLE_DEBUG&&p.ENABLE_INFO&&p.ENABLE_WARN&&p.ENABLE_ERROR},set:function(t){p.ENABLE_VERBOSE=t,p.ENABLE_DEBUG=t,p.ENABLE_INFO=t,p.ENABLE_WARN=t,p.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return p.ENABLE_DEBUG},set:function(t){p.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return p.ENABLE_VERBOSE},set:function(t){p.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return p.ENABLE_INFO},set:function(t){p.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return p.ENABLE_WARN},set:function(t){p.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return p.ENABLE_ERROR},set:function(t){p.ENABLE_ERROR=t,e._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:p.GLOBAL_TAG,forceGlobalTag:p.FORCE_GLOBAL_TAG,enableVerbose:p.ENABLE_VERBOSE,enableDebug:p.ENABLE_DEBUG,enableInfo:p.ENABLE_INFO,enableWarn:p.ENABLE_WARN,enableError:p.ENABLE_ERROR,enableCallback:p.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(e){p.GLOBAL_TAG=e.globalTag,p.FORCE_GLOBAL_TAG=e.forceGlobalTag,p.ENABLE_VERBOSE=e.enableVerbose,p.ENABLE_DEBUG=e.enableDebug,p.ENABLE_INFO=e.enableInfo,p.ENABLE_WARN=e.enableWarn,p.ENABLE_ERROR=e.enableError,p.ENABLE_CALLBACK=e.enableCallback}},{key:"_notifyChange",value:function(){var t=e.emitter;if(t.listenerCount("change")>0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"addLogListener",value:function(t){p.emitter.addListener("log",t),p.emitter.listenerCount("log")>0&&(p.ENABLE_CALLBACK=!0,e._notifyChange())}},{key:"removeLogListener",value:function(t){p.emitter.removeListener("log",t),0===p.emitter.listenerCount("log")&&(p.ENABLE_CALLBACK=!1,e._notifyChange())}}]),e}();W.emitter=new(d());var Z=W,K=function(){function e(){s()(this,e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return l()(e,[{key:"isComplete",value:function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}},{key:"isSeekable",value:function(){return!0===this.hasKeyframesIndex}},{key:"getNearestKeyframe",value:function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,n=this._search(t.times,e);return{index:n,milliseconds:t.times[n],fileposition:t.filepositions[n]}}},{key:"_search",value:function(e,t){var n=0,i=e.length-1,r=0,a=0,s=i;for(t<e[0]&&(n=0,a=s+1);a<=s;){if((r=a+Math.floor((s-a)/2))===i||t>=e[r]&&t<e[r+1]){n=r;break}e[r]<t?a=r+1:s=r-1}return n}}]),e}();function q(e,t,n){var i=e;if(t+n<i.length){for(;n--;)if(128!=(192&i[++t]))return!1;return!0}return!1}var X,Y=function(e){for(var t=[],n=e,i=0,r=e.length;i<r;)if(n[i]<128)t.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(q(n,i,1)){var a=(31&n[i])<<6|63&n[i+1];if(a>=128){t.push(String.fromCharCode(65535&a)),i+=2;continue}}}else if(n[i]<240){if(q(n,i,2)){var s=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(s>=2048&&55296!=(63488&s)){t.push(String.fromCharCode(65535&s)),i+=3;continue}}}else if(n[i]<248&&q(n,i,3)){var o=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(o>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),i+=4;continue}}t.push(String.fromCharCode(65533)),++i}return t.join("")},Q=(X=new ArrayBuffer(2),new DataView(X).setInt16(0,256,!0),256===new Int16Array(X)[0]),$=function(){function e(){s()(this,e)}return l()(e,null,[{key:"parseScriptData",value:function(t,n,i){var r={};try{var a=e.parseValue(t,n,i),s=e.parseValue(t,n+a.size,i-a.size);r[a.data]=s.data}catch(e){p.e("AMF",e.toString())}return r}},{key:"parseObject",value:function(t,n,i){if(i<3)throw new x("Data not enough when parse ScriptDataObject");var r=e.parseString(t,n,i),a=e.parseValue(t,n+r.size,i-r.size),s=a.objectEnd;return{data:{name:r.data,value:a.data},size:r.size+a.size,objectEnd:s}}},{key:"parseVariable",value:function(t,n,i){return e.parseObject(t,n,i)}},{key:"parseString",value:function(e,t,n){if(n<2)throw new x("Data not enough when parse String");var i=new DataView(e,t,n).getUint16(0,!Q);return{data:i>0?Y(new Uint8Array(e,t+2,i)):"",size:2+i}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new x("Data not enough when parse LongString");var i=new DataView(e,t,n).getUint32(0,!Q);return{data:i>0?Y(new Uint8Array(e,t+4,i)):"",size:4+i}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new x("Data size invalid when parse Date");var i=new DataView(e,t,n),r=i.getFloat64(0,!Q),a=i.getInt16(8,!Q);return{data:new Date(r+=60*a*1e3),size:10}}},{key:"parseValue",value:function(t,n,i){if(i<1)throw new x("Data not enough when parse Value");var r,a=new DataView(t,n,i),s=1,o=a.getUint8(0),l=!1;try{switch(o){case 0:r=a.getFloat64(1,!Q),s+=8;break;case 1:r=!!a.getUint8(1),s+=1;break;case 2:var u=e.parseString(t,n+1,i-1);r=u.data,s+=u.size;break;case 3:r={};var c=0;for(9==(16777215&a.getUint32(i-4,!Q))&&(c=3);s<i-4;){var h=e.parseObject(t,n+s,i-s-c);if(h.objectEnd)break;r[h.data.name]=h.data.value,s+=h.size}if(s<=i-3)9===(16777215&a.getUint32(s-1,!Q))&&(s+=3);break;case 8:r={},s+=4;var d=0;for(9==(16777215&a.getUint32(i-4,!Q))&&(d=3);s<i-8;){var f=e.parseVariable(t,n+s,i-s-d);if(f.objectEnd)break;r[f.data.name]=f.data.value,s+=f.size}if(s<=i-3)9===(16777215&a.getUint32(s-1,!Q))&&(s+=3);break;case 9:r=void 0,s=1,l=!0;break;case 10:r=[];var m=a.getUint32(1,!Q);s+=4;for(var g=0;g<m;g++){var _=e.parseValue(t,n+s,i-s);r.push(_.data),s+=_.size}break;case 11:var v=e.parseDate(t,n+1,i-1);r=v.data,s+=v.size;break;case 12:var y=e.parseString(t,n+1,i-1);r=y.data,s+=y.size;break;default:s=i,p.w("AMF","Unsupported AMF value type "+o)}}catch(e){p.e("AMF",e.toString())}return{data:r,size:s,objectEnd:l}}}]),e}(),J=function(){function e(t){s()(this,e),this.TAG="ExpGolomb",this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return l()(e,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new x("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),n=new Uint8Array(4);n.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}},{key:"readBits",value:function(e){if(e>32)throw new E("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var i=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,n=n<<r|a}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(0!=(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}(),ee=function(){function e(){s()(this,e)}return l()(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,n=t.byteLength,i=new Uint8Array(n),r=0,a=0;a<n;a++)a>=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(i[r]=t[a],r++);return new Uint8Array(i.buffer,0,r)}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),i=new J(n);i.readByte();var r=i.readByte();i.readByte();var a=i.readByte();i.readUEG();var s=e.getProfileString(r),o=e.getLevelString(a),l=1,u=420,c=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(3===(l=i.readUEG())&&i.readBits(1),l<=3&&(u=[0,420,422,444][l]),c=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool()))for(var h=3!==l?8:12,d=0;d<h;d++)i.readBool()&&(d<6?e._skipScalingList(i,16):e._skipScalingList(i,64));i.readUEG();var f=i.readUEG();if(0===f)i.readUEG();else if(1===f){i.readBits(1),i.readSEG(),i.readSEG();for(var p=i.readUEG(),m=0;m<p;m++)i.readSEG()}var g=i.readUEG();i.readBits(1);var _=i.readUEG(),v=i.readUEG(),y=i.readBits(1);0===y&&i.readBits(1),i.readBits(1);var b=0,x=0,E=0,w=0;i.readBool()&&(b=i.readUEG(),x=i.readUEG(),E=i.readUEG(),w=i.readUEG());var T=1,S=1,A=0,C=!0,L=0,R=0;if(i.readBool()){if(i.readBool()){var I=i.readByte();I>0&&I<16?(T=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][I-1],S=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][I-1]):255===I&&(T=i.readByte()<<8|i.readByte(),S=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){var D=i.readBits(32),k=i.readBits(32);C=i.readBool(),A=(L=k)/(R=2*D)}}var M=1;1===T&&1===S||(M=T/S);var P=0,O=0;0===l?(P=1,O=2-y):(P=3===l?1:2,O=(1===l?2:1)*(2-y));var N=16*(_+1),F=16*(v+1)*(2-y);N-=(b+x)*P,F-=(E+w)*O;var B=Math.ceil(N*M);return i.destroy(),i=null,{profile_string:s,level_string:o,bit_depth:c,ref_frames:g,chroma_format:u,chroma_format_string:e.getChromaFormatString(u),frame_rate:{fixed:C,fps:A,fps_den:R,fps_num:L},sar_ratio:{width:T,height:S},codec_size:{width:N,height:F},present_size:{width:B,height:F}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,i=8,r=0;r<t;r++)0!==i&&(i=(n+e.readSEG()+256)%256),n=0===i?n:i}},{key:"getProfileString",value:function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(e){return(e/10).toFixed(1)}},{key:"getChromaFormatString",value:function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),e}(),te={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};var ne=function(){function e(t,n){s()(this,e),this.TAG="FLVDemuxer",this._config=n,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new K,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return l()(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(e){return e.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new K}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}},{key:"parseChunks",value:function(t,n){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new x("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0,r=this._littleEndian;if(0===n){if(!(t.byteLength>13))return 0;i=e.probe(t).dataOffset}this._firstParse&&(this._firstParse=!1,n+i!==this._dataOffset&&p.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(t,i).getUint32(0,!r)&&p.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4);for(;i<t.byteLength;){this._dispatch=!0;var a=new DataView(t,i);if(i+11+4>t.byteLength)break;var s=a.getUint8(0),o=16777215&a.getUint32(0,!r);if(i+11+o+4>t.byteLength)break;if(8===s||9===s||18===s){var l=a.getUint8(4),u=a.getUint8(5),c=a.getUint8(6)|u<<8|l<<16|a.getUint8(7)<<24;0!==(16777215&a.getUint32(7,!r))&&p.w(this.TAG,"Meet tag which has StreamID != 0!");var h=i+11;switch(s){case 8:this._parseAudioData(t,h,o,c);break;case 9:this._parseVideoData(t,h,o,c,n+i);break;case 18:this._parseScriptData(t,h,o)}var d=a.getUint32(11+o,!r);d!==11+o&&p.w(this.TAG,"Invalid PrevTagSize ".concat(d)),i+=11+o+4}else p.w(this.TAG,"Unsupported tag type ".concat(s,", skipped")),i+=11+o+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}},{key:"_parseScriptData",value:function(e,t,n){var i=$.parseScriptData(e,t,n);if(i.hasOwnProperty("onMetaData")){if(null==i.onMetaData||"object"!==r()(i.onMetaData))return void p.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&p.w(this.TAG,"Found another onMetaData tag!"),this._metadata=i;var a=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},a)),"boolean"==typeof a.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=a.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof a.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=a.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof a.audiodatarate&&(this._mediaInfo.audioDataRate=a.audiodatarate),"number"==typeof a.videodatarate&&(this._mediaInfo.videoDataRate=a.videodatarate),"number"==typeof a.width&&(this._mediaInfo.width=a.width),"number"==typeof a.height&&(this._mediaInfo.height=a.height),"number"==typeof a.duration){if(!this._durationOverrided){var s=Math.floor(a.duration*this._timescale);this._duration=s,this._mediaInfo.duration=s}}else this._mediaInfo.duration=0;if("number"==typeof a.framerate){var o=Math.floor(1e3*a.framerate);if(o>0){var l=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=l,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=l}}if("object"===r()(a.keyframes)){this._mediaInfo.hasKeyframesIndex=!0;var u=a.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(u),a.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=a,p.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(i).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},i))}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],i=1;i<e.times.length;i++){var r=this._timestampBase+Math.floor(1e3*e.times[i]);t.push(r),n.push(e.filepositions[i])}return{times:t,filepositions:n}}},{key:"_parseAudioData",value:function(e,t,n,i){if(n<=1)p.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!0!==this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var r=new DataView(e,t,n).getUint8(0),a=r>>>4;if(2===a||10===a){var s=0,o=(12&r)>>>2;if(o>=0&&o<=4){s=this._flvSoundRateTable[o];var l=1&r,u=this._audioMetadata,c=this._audioTrack;if(u||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(u=this._audioMetadata={}).type="audio",u.id=c.id,u.timescale=this._timescale,u.duration=this._duration,u.audioSampleRate=s,u.channelCount=0===l?1:2),10===a){var h=this._parseAACAudioData(e,t+1,n-1);if(null==h)return;if(0===h.packetType){u.config&&p.w(this.TAG,"Found another AudioSpecificConfig!");var d=h.data;u.audioSampleRate=d.samplingRate,u.channelCount=d.channelCount,u.codec=d.codec,u.originalCodec=d.originalCodec,u.config=d.config,u.refSampleDuration=1024/u.audioSampleRate*u.timescale,p.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",u);var f=this._mediaInfo;f.audioCodec=u.originalCodec,f.audioSampleRate=u.audioSampleRate,f.audioChannelCount=u.channelCount,f.hasVideo?null!=f.videoCodec&&(f.mimeType='video/x-flv; codecs="'+f.videoCodec+","+f.audioCodec+'"'):f.mimeType='video/x-flv; codecs="'+f.audioCodec+'"',f.isComplete()&&this._onMediaInfo(f)}else if(1===h.packetType){var m=this._timestampBase+i,g={unit:h.data,length:h.data.byteLength,dts:m,pts:m};c.samples.push(g),c.length+=h.data.length}else p.e(this.TAG,"Flv: Unsupported AAC data type ".concat(h.packetType))}else if(2===a){if(!u.codec){var _=this._parseMP3AudioData(e,t+1,n-1,!0);if(null==_)return;u.audioSampleRate=_.samplingRate,u.channelCount=_.channelCount,u.codec=_.codec,u.originalCodec=_.originalCodec,u.refSampleDuration=1152/u.audioSampleRate*u.timescale,p.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",u);var v=this._mediaInfo;v.audioCodec=u.codec,v.audioSampleRate=u.audioSampleRate,v.audioChannelCount=u.channelCount,v.audioDataRate=_.bitRate,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&this._onMediaInfo(v)}var y=this._parseMP3AudioData(e,t+1,n-1,!1);if(null==y)return;var b=this._timestampBase+i,x={unit:y,length:y.byteLength,dts:b,pts:b};c.samples.push(x),c.length+=y.length}}else this._onError(te.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+o)}else this._onError(te.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+a)}}},{key:"_parseAACAudioData",value:function(e,t,n){if(!(n<=1)){var i={},r=new Uint8Array(e,t,n);return i.packetType=r[0],0===r[0]?i.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):i.data=r.subarray(1),i}p.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")}},{key:"_parseAACAudioSpecificConfig",value:function(e,t,n){var i,r,a=new Uint8Array(e,t,n),s=null,o=0,l=null;if(o=i=a[0]>>>3,(r=(7&a[0])<<1|a[1]>>>7)<0||r>=this._mpegSamplingRates.length)this._onError(te.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[r],c=(120&a[1])>>>3;if(!(c<0||c>=8)){5===o&&(l=(7&a[1])<<1|a[2]>>>7,(124&a[2])>>>2);var h=self.navigator.userAgent.toLowerCase();return-1!==h.indexOf("firefox")?r>=6?(o=5,s=new Array(4),l=r-3):(o=2,s=new Array(2),l=r):-1!==h.indexOf("android")?(o=2,s=new Array(2),l=r):(o=5,l=r,s=new Array(4),r>=6?l=r-3:1===c&&(o=2,s=new Array(2),l=r)),s[0]=o<<3,s[0]|=(15&r)>>>1,s[1]=(15&r)<<7,s[1]|=(15&c)<<3,5===o&&(s[1]|=(15&l)>>>1,s[2]=(1&l)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:u,channelCount:c,codec:"mp4a.40."+o,originalCodec:"mp4a.40."+i}}this._onError(te.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}}},{key:"_parseMP3AudioData",value:function(e,t,n,i){if(!(n<4)){this._littleEndian;var r=new Uint8Array(e,t,n),a=null;if(i){if(255!==r[0])return;var s=r[1]>>>3&3,o=(6&r[1])>>1,l=(240&r[2])>>>4,u=(12&r[2])>>>2,c=3!==(r[3]>>>6&3)?2:1,h=0,d=0;switch(s){case 0:h=this._mpegAudioV25SampleRateTable[u];break;case 2:h=this._mpegAudioV20SampleRateTable[u];break;case 3:h=this._mpegAudioV10SampleRateTable[u]}switch(o){case 1:34,l<this._mpegAudioL3BitRateTable.length&&(d=this._mpegAudioL3BitRateTable[l]);break;case 2:33,l<this._mpegAudioL2BitRateTable.length&&(d=this._mpegAudioL2BitRateTable[l]);break;case 3:32,l<this._mpegAudioL1BitRateTable.length&&(d=this._mpegAudioL1BitRateTable[l])}a={bitRate:d,samplingRate:h,channelCount:c,codec:"mp3",originalCodec:"mp3"}}else a=r;return a}p.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")}},{key:"_parseVideoData",value:function(e,t,n,i,r){if(n<=1)p.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!0!==this._hasVideoFlagOverrided||!1!==this._hasVideo){var a=new Uint8Array(e,t,n)[0],s=(240&a)>>>4,o=15&a;7===o?this._parseAVCVideoPacket(e,t+1,n-1,i,r,s):this._onError(te.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(o))}}},{key:"_parseAVCVideoPacket",value:function(e,t,n,i,r,a){if(n<4)p.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,o=new DataView(e,t,n),l=o.getUint8(0),u=(16777215&o.getUint32(0,!s))<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===l)this._parseAVCVideoData(e,t+4,n-4,i,r,a,u);else if(2!==l)return void this._onError(te.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(l))}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)p.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var i=this._videoMetadata,r=this._videoTrack,a=this._littleEndian,s=new DataView(e,t,n);i?void 0!==i.avcc&&p.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(i=this._videoMetadata={}).type="video",i.id=r.id,i.timescale=this._timescale,i.duration=this._duration);var o=s.getUint8(0),l=s.getUint8(1);s.getUint8(2),s.getUint8(3);if(1===o&&0!==l)if(this._naluLengthSize=1+(3&s.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var u=31&s.getUint8(5);if(0!==u){u>1&&p.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(u));for(var c=6,h=0;h<u;h++){var d=s.getUint16(c,!a);if(c+=2,0!==d){var f=new Uint8Array(e,t+c,d);c+=d;var m=ee.parseSPS(f);if(0===h){i.codecWidth=m.codec_size.width,i.codecHeight=m.codec_size.height,i.presentWidth=m.present_size.width,i.presentHeight=m.present_size.height,i.profile=m.profile_string,i.level=m.level_string,i.bitDepth=m.bit_depth,i.chromaFormat=m.chroma_format,i.sarRatio=m.sar_ratio,i.frameRate=m.frame_rate,!1!==m.frame_rate.fixed&&0!==m.frame_rate.fps_num&&0!==m.frame_rate.fps_den||(i.frameRate=this._referenceFrameRate);var g=i.frameRate.fps_den,_=i.frameRate.fps_num;i.refSampleDuration=i.timescale*(g/_);for(var v=f.subarray(1,4),y="avc1.",b=0;b<3;b++){var x=v[b].toString(16);x.length<2&&(x="0"+x),y+=x}i.codec=y;var E=this._mediaInfo;E.width=i.codecWidth,E.height=i.codecHeight,E.fps=i.frameRate.fps,E.profile=i.profile,E.level=i.level,E.refFrames=m.ref_frames,E.chromaFormat=m.chroma_format_string,E.sarNum=i.sarRatio.width,E.sarDen=i.sarRatio.height,E.videoCodec=y,E.hasAudio?null!=E.audioCodec&&(E.mimeType='video/x-flv; codecs="'+E.videoCodec+","+E.audioCodec+'"'):E.mimeType='video/x-flv; codecs="'+E.videoCodec+'"',E.isComplete()&&this._onMediaInfo(E)}}}var w=s.getUint8(c);if(0!==w){w>1&&p.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(w)),c++;for(var T=0;T<w;T++){var S=s.getUint16(c,!a);c+=2,0!==S&&(c+=S)}i.avcc=new Uint8Array(n),i.avcc.set(new Uint8Array(e,t,n),0),p.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",i)}else this._onError(te.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(te.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(te.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(te.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}}},{key:"_parseAVCVideoData",value:function(e,t,n,i,r,a,s){for(var o=this._littleEndian,l=new DataView(e,t,n),u=[],c=0,h=0,d=this._naluLengthSize,f=this._timestampBase+i,m=1===a;h<n;){if(h+4>=n){p.w(this.TAG,"Malformed Nalu near timestamp ".concat(f,", offset = ").concat(h,", dataSize = ").concat(n));break}var g=l.getUint32(h,!o);if(3===d&&(g>>>=8),g>n-d)return void p.w(this.TAG,"Malformed Nalus near timestamp ".concat(f,", NaluSize > DataSize!"));var _=31&l.getUint8(h+d);5===_&&(m=!0);var v=new Uint8Array(e,t+h,d+g),y={type:_,data:v};u.push(y),c+=v.byteLength,h+=d+g}if(u.length){var b=this._videoTrack,x={units:u,length:c,isKeyframe:m,dts:f,cts:s,pts:f+s};m&&(x.fileposition=r),b.samples.push(x),b.length+=c}}}],[{key:"probe",value:function(e){var t=new Uint8Array(e),n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var i,r,a=(4&t[4])>>>2!=0,s=0!=(1&t[4]),o=(i=t)[r=5]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3];return o<9?n:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:a,hasVideoTrack:s}}}]),e}(),ie=ne,re=function(){function e(){s()(this,e)}return l()(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=e.constants={};n.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),n.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),n.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),n.STSC=n.STCO=n.STTS,n.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),n.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),n.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),n.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,n=null,i=Array.prototype.slice.call(arguments,1),r=i.length,a=0;a<r;a++)t+=i[a].byteLength;(n=new Uint8Array(t))[0]=t>>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var s=8,o=0;o<r;o++)n.set(i[o],s),s+=i[o].byteLength;return n}},{key:"generateInitSegment",value:function(t){var n=e.box(e.types.ftyp,e.constants.FTYP),i=e.moov(t),r=new Uint8Array(n.byteLength+i.byteLength);return r.set(n,0),r.set(i,n.byteLength),r}},{key:"moov",value:function(t){var n=e.mvhd(t.timescale,t.duration),i=e.trak(t),r=e.mvex(t);return e.box(e.types.moov,n,i,r)}},{key:"mvhd",value:function(t,n){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,i=t.duration,r=t.presentWidth,a=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,r>>>8&255,255&r,0,0,a>>>8&255,255&a,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}},{key:"hdlr",value:function(t){var n=null;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n=null;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp3",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],r)}},{key:"mp4a",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,r,e.esds(t))}},{key:"esds",value:function(t){var n=t.config||[],i=n.length,r=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(n).concat([6,1,2]));return e.box(e.types.esds,r)}},{key:"avc1",value:function(t){var n=t.avcc,i=t.codecWidth,r=t.codecHeight,a=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,i>>>8&255,255&i,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,a,e.box(e.types.avcC,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,i=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var i=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),s=e.sdtp(t),o=e.trun(t,s.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,a,o,s)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],i=n.length,r=new Uint8Array(4+i),a=0;a<i;a++){var s=n[a].flags;r[a+4]=s.isLeading<<6|s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return e.box(e.types.sdtp,r)}},{key:"trun",value:function(t,n){var i=t.samples||[],r=i.length,a=12+16*r,s=new Uint8Array(a);n+=8+a,s.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var o=0;o<r;o++){var l=i[o].duration,u=i[o].size,c=i[o].flags,h=i[o].cts;s.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*o)}return e.box(e.types.trun,s)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();re.init();var ae=re,se=function(){function e(){s()(this,e)}return l()(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)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(2===t)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(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),e}(),oe=l()((function e(t,n,i,r,a){s()(this,e),this.dts=t,this.pts=n,this.duration=i,this.originalDts=r,this.isSyncPoint=a,this.fileposition=null})),le=function(){function e(){s()(this,e),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return l()(e,[{key:"appendSyncPoint",value:function(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}]),e}(),ue=function(){function e(){s()(this,e),this._list=[]}return l()(e,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}},{key:"getLastSyncPointBeforeDts",value:function(e){if(0==this._list.length)return null;var t=this._list,n=0,i=t.length-1,r=0,a=0,s=i;for(e<t[0].dts&&(n=0,a=s+1);a<=s;){if((r=a+Math.floor((s-a)/2))===i||e>=t[r].dts&&e<t[r+1].dts){n=r;break}t[r].dts<e?a=r+1:s=r-1}return this._list[n]}}]),e}(),ce=function(){function e(t){s()(this,e),this._type=t,this._list=[],this._lastAppendLocation=-1}return l()(e,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return 0===this._list.length}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(e){var t=this._list;if(0===t.length)return-2;var n=t.length-1,i=0,r=0,a=n,s=0;if(e<t[0].originalBeginDts)return s=-1;for(;r<=a;){if((i=r+Math.floor((a-r)/2))===n||e>t[i].lastSample.originalDts&&e<t[i+1].originalBeginDts){s=i;break}t[i].originalBeginDts<e?r=i+1:a=i-1}return s}},{key:"_searchNearestSegmentAfter",value:function(e){return this._searchNearestSegmentBefore(e)+1}},{key:"append",value:function(e){var t=this._list,n=e,i=this._lastAppendLocation,r=0;-1!==i&&i<t.length&&n.originalBeginDts>=t[i].lastSample.originalDts&&(i===t.length-1||i<t.length-1&&n.originalBeginDts<t[i+1].originalBeginDts)?r=i+1:t.length>0&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}}]),e}(),he=function(){function e(t){s()(this,e),this.TAG="MP4Remuxer",this._config=t,this._isLive=!0===t.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new ce("audio"),this._videoSegmentInfoList=new ce("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!k.chrome||!(k.version.major<50||50===k.version.major&&k.version.build<2661)),this._fillSilentAfterSeek=k.msedge||k.msie,this._mp3UseMpegAudio=!k.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return l()(e,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(e,t){if(!this._onMediaSegment)throw new x("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}},{key:"_onTrackMetadataReceived",value:function(e,t){var n=null,i="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(i="mpeg",r="",n=new Uint8Array):n=ae.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,n=ae.generateInitSegment(t)}if(!this._onInitSegment)throw new x("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:r,container:"".concat(e,"/").concat(i),mediaDuration:t.duration})}},{key:"_calculateDtsBase",value:function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}},{key:"flushStashedSamples",value:function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(n.samples.push(e),n.length=e.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(i.samples.push(t),i.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(i,!0)}},{key:"_remuxAudio",value:function(e,t){if(null!=this._audioMeta){var n,i=e,r=i.samples,a=void 0,s=-1,o=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,u=this._dtsBaseInited&&void 0===this._audioNextDts,c=!1;if(r&&0!==r.length&&(1!==r.length||t)){var h=0,d=null,f=0;l?(h=0,f=i.length):(h=8,f=8+i.length);var m=null;if(r.length>1&&(f-=(m=r.pop()).length),null!=this._audioStashedLastSample){var g=this._audioStashedLastSample;this._audioStashedLastSample=null,r.unshift(g),f+=g.length}null!=m&&(this._audioStashedLastSample=m);var _=r[0].dts-this._dtsBase;if(this._audioNextDts)a=_-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())a=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(c=!0);else{var v=this._audioSegmentInfoList.getLastSampleBefore(_);if(null!=v){var y=_-(v.originalDts+v.duration);y<=3&&(y=0),a=_-(v.dts+v.duration+y)}else a=0}if(c){var b=_-a,x=this._videoSegmentInfoList.getLastSegmentBefore(_);if(null!=x&&x.beginDts<b){var E=se.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(E){var w=x.beginDts,T=b-x.beginDts;p.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(w,", duration: ").concat(T)),r.unshift({unit:E,dts:w,pts:w}),f+=E.byteLength}}else c=!1}for(var S=[],A=0;A<r.length;A++){var C=r[A],L=C.unit,R=C.dts-this._dtsBase,I=R-a;-1===s&&(s=I);var D=0;if(A!==r.length-1)D=r[A+1].dts-this._dtsBase-a-I;else if(null!=m)D=m.dts-this._dtsBase-a-I;else D=S.length>=1?S[S.length-1].duration:Math.floor(o);var M=!1,P=null;if(D>1.5*o&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!k.safari){M=!0;var O=Math.abs(D-o),N=Math.ceil(O/o),F=I+o;p.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"dts: ".concat(I+D," ms, expected: ").concat(I+Math.round(o)," ms, ")+"delta: ".concat(Math.round(O)," ms, generate: ").concat(N," frames"));var B=se.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==B&&(p.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),B=L),P=[];for(var U=0;U<N;U++){var G=Math.round(F);if(P.length>0){var z=P[P.length-1];z.duration=G-z.dts}var j={dts:G,pts:G,cts:0,unit:B,size:B.byteLength,duration:0,originalDts:R,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};P.push(j),f+=j.size,F+=o}var H=P[P.length-1];H.duration=I+D-H.dts,D=Math.round(o)}S.push({dts:I,pts:I,cts:0,unit:C.unit,size:C.unit.byteLength,duration:D,originalDts:R,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),M&&S.push.apply(S,P)}l?d=new Uint8Array(f):((d=new Uint8Array(f))[0]=f>>>24&255,d[1]=f>>>16&255,d[2]=f>>>8&255,d[3]=255&f,d.set(ae.types.mdat,4));for(var V=0;V<S.length;V++){var W=S[V].unit;d.set(W,h),h+=W.byteLength}var Z=S[S.length-1];n=Z.dts+Z.duration,this._audioNextDts=n;var K=new le;K.beginDts=s,K.endDts=n,K.beginPts=s,K.endPts=n,K.originalBeginDts=S[0].originalDts,K.originalEndDts=Z.originalDts+Z.duration,K.firstSample=new oe(S[0].dts,S[0].pts,S[0].duration,S[0].originalDts,!1),K.lastSample=new oe(Z.dts,Z.pts,Z.duration,Z.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(K),i.samples=S,i.sequenceNumber++;var q=null;q=l?new Uint8Array:ae.moof(i,s),i.samples=[],i.length=0;var X={type:"audio",data:this._mergeBoxes(q,d).buffer,sampleCount:S.length,info:K};l&&u&&(X.timestampOffset=s),this._onMediaSegment("audio",X)}}}},{key:"_remuxVideo",value:function(e,t){if(null!=this._videoMeta){var n,i,r=e,a=r.samples,s=void 0,o=-1,l=-1;if(a&&0!==a.length&&(1!==a.length||t)){var u=8,c=null,h=8+e.length,d=null;if(a.length>1&&(h-=(d=a.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,a.unshift(f),h+=f.length}null!=d&&(this._videoStashedLastSample=d);var p=a[0].dts-this._dtsBase;if(this._videoNextDts)s=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())s=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=m){var g=p-(m.originalDts+m.duration);g<=3&&(g=0),s=p-(m.dts+m.duration+g)}else s=0}for(var _=new le,v=[],y=0;y<a.length;y++){var b=a[y],x=b.dts-this._dtsBase,E=b.isKeyframe,w=x-s,T=b.cts,S=w+T;-1===o&&(o=w,l=S);var A=0;if(y!==a.length-1)A=a[y+1].dts-this._dtsBase-s-w;else if(null!=d)A=d.dts-this._dtsBase-s-w;else A=v.length>=1?v[v.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(E){var C=new oe(w,S,A,b.dts,!0);C.fileposition=b.fileposition,_.appendSyncPoint(C)}v.push({dts:w,pts:S,cts:T,units:b.units,size:b.length,isKeyframe:E,duration:A,originalDts:x,flags:{isLeading:0,dependsOn:E?2:1,isDependedOn:E?1:0,hasRedundancy:0,isNonSync:E?0:1}})}(c=new Uint8Array(h))[0]=h>>>24&255,c[1]=h>>>16&255,c[2]=h>>>8&255,c[3]=255&h,c.set(ae.types.mdat,4);for(var L=0;L<v.length;L++)for(var R=v[L].units;R.length;){var I=R.shift().data;c.set(I,u),u+=I.byteLength}var D=v[v.length-1];if(n=D.dts+D.duration,i=D.pts+D.duration,this._videoNextDts=n,_.beginDts=o,_.endDts=n,_.beginPts=l,_.endPts=i,_.originalBeginDts=v[0].originalDts,_.originalEndDts=D.originalDts+D.duration,_.firstSample=new oe(v[0].dts,v[0].pts,v[0].duration,v[0].originalDts,v[0].isKeyframe),_.lastSample=new oe(D.dts,D.pts,D.duration,D.originalDts,D.isKeyframe),this._isLive||this._videoSegmentInfoList.append(_),r.samples=v,r.sequenceNumber++,this._forceFirstIDR){var k=v[0].flags;k.dependsOn=2,k.isNonSync=0}var M=ae.moof(r,o);r.samples=[],r.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(M,c).buffer,sampleCount:v.length,info:_})}}}},{key:"_mergeBoxes",value:function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}}]),e}(),de={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},fe=function(){function e(t,n){s()(this,e),this.TAG="TransmuxingController",this._emitter=new(d()),this._config=n,t.segments||(t.segments=[{duration:t.duration,filesize:t.filesize,url:t.url}]),"boolean"!=typeof t.cors&&(t.cors=!0),"boolean"!=typeof t.withCredentials&&(t.withCredentials=!1),this._mediaDataSource=t,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach((function(e){e.timestampBase=i,i+=e.duration,e.cors=t.cors,e.withCredentials=t.withCredentials,n.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy)})),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return l()(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(e,t){this._currentSegmentIndex=e;var n=this._mediaDataSource.segments[e],i=this._ioctl=new U(n,this._config,e);i.onError=this._onIOException.bind(this),i.onSeeked=this._onIOSeeked.bind(this),i.onComplete=this._onIOComplete.bind(this),i.onRedirect=this._onIORedirect.bind(this),i.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):i.onDataArrival=this._onInitChunkArrival.bind(this),i.open(t)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var n=this._mediaInfo.segments[t];if(null==n)this._pendingSeekTime=e;else{var i=n.getNearestKeyframe(e);this._remuxer.seek(i.milliseconds),this._ioctl.seek(i.fileposition),this._pendingResolveSeekPoint=i.milliseconds}}else{var r=this._mediaInfo.segments[t];if(null==r)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{var a=r.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,a.fileposition),this._pendingResolveSeekPoint=a.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}}},{key:"_searchSegmentIndexContains",value:function(e){for(var t=this._mediaDataSource.segments,n=t.length-1,i=0;i<t.length;i++)if(e<t[i].timestampBase){n=i-1;break}return n}},{key:"_onInitChunkArrival",value:function(e,t){var n=this,i=null,r=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((i=ie.probe(e)).match){this._demuxer=new ie(i,this._config),this._remuxer||(this._remuxer=new he(this._config));var a=this._mediaDataSource;null==a.duration||isNaN(a.duration)||(this._demuxer.overridedDuration=a.duration),"boolean"==typeof a.hasAudio&&(this._demuxer.overridedHasAudio=a.hasAudio),"boolean"==typeof a.hasVideo&&(this._demuxer.overridedHasVideo=a.hasVideo),this._demuxer.timestampBase=a.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else i=null,p.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){n._internalAbort()})),this._emitter.emit(de.DEMUX_ERROR,te.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,K.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,K.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))}},{key:"_onMetaDataArrived",value:function(e){this._emitter.emit(de.METADATA_ARRIVED,e)}},{key:"_onScriptDataArrived",value:function(e){this._emitter.emit(de.SCRIPTDATA_ARRIVED,e)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer.flushStashedSamples(),this._emitter.emit(de.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(e){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(de.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(e,t){p.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(de.IO_ERROR,e,t),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(e,t){p.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(de.DEMUX_ERROR,e,t)}},{key:"_onRemuxerInitSegmentArrival",value:function(e,t){this._emitter.emit(de.INIT_SEGMENT,e,t)}},{key:"_onRemuxerMediaSegmentArrival",value:function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(de.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var n=t.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,k.safari&&n.length>0&&n[0].originalDts===i&&(i=n[0].pts),this._emitter.emit(de.RECOMMEND_SEEKPOINT,i)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(de.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(de.STATISTICS_INFO,e)}}]),e}(),pe=function(e){var t=null,n=function(t,n){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:n}})}.bind(this);function i(t,n){var i={msg:de.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function r(t,n){var i={msg:de.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function a(){var t={msg:de.LOADING_COMPLETE};e.postMessage(t)}function s(){var t={msg:de.RECOVERED_EARLY_EOF};e.postMessage(t)}function o(t){var n={msg:de.MEDIA_INFO,data:t};e.postMessage(n)}function l(t){var n={msg:de.METADATA_ARRIVED,data:t};e.postMessage(n)}function u(t){var n={msg:de.SCRIPTDATA_ARRIVED,data:t};e.postMessage(n)}function h(t){var n={msg:de.STATISTICS_INFO,data:t};e.postMessage(n)}function d(t,n){e.postMessage({msg:de.IO_ERROR,data:{type:t,info:n}})}function f(t,n){e.postMessage({msg:de.DEMUX_ERROR,data:{type:t,info:n}})}function p(t){e.postMessage({msg:de.RECOMMEND_SEEKPOINT,data:t})}c.install(),e.addEventListener("message",(function(c){switch(c.data.cmd){case"init":(t=new fe(c.data.param[0],c.data.param[1])).on(de.IO_ERROR,d.bind(this)),t.on(de.DEMUX_ERROR,f.bind(this)),t.on(de.INIT_SEGMENT,i.bind(this)),t.on(de.MEDIA_SEGMENT,r.bind(this)),t.on(de.LOADING_COMPLETE,a.bind(this)),t.on(de.RECOVERED_EARLY_EOF,s.bind(this)),t.on(de.MEDIA_INFO,o.bind(this)),t.on(de.METADATA_ARRIVED,l.bind(this)),t.on(de.SCRIPTDATA_ARRIVED,u.bind(this)),t.on(de.STATISTICS_INFO,h.bind(this)),t.on(de.RECOMMEND_SEEKPOINT,p.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(c.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var m=c.data.param;Z.applyConfig(m),!0===m.enableCallback?Z.addLogListener(n):Z.removeLogListener(n)}}))},me=function(){function e(t,i){if(s()(this,e),this.TAG="Transmuxer",this._emitter=new(d()),i.enableWorker&&"undefined"!=typeof Worker)try{var r=n(82059);this._worker=r(pe),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[t,i]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Z.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Z.getConfig()})}catch(e){p.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new fe(t,i)}else this._controller=new fe(t,i);if(this._controller){var a=this._controller;a.on(de.IO_ERROR,this._onIOError.bind(this)),a.on(de.DEMUX_ERROR,this._onDemuxError.bind(this)),a.on(de.INIT_SEGMENT,this._onInitSegment.bind(this)),a.on(de.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),a.on(de.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),a.on(de.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),a.on(de.MEDIA_INFO,this._onMediaInfo.bind(this)),a.on(de.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),a.on(de.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),a.on(de.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),a.on(de.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return l()(e,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Z.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"hasWorker",value:function(){return null!=this._worker}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.INIT_SEGMENT,e,t)}))}},{key:"_onMediaSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.MEDIA_SEGMENT,e,t)}))}},{key:"_onLoadingComplete",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(de.LOADING_COMPLETE)}))}},{key:"_onRecoveredEarlyEof",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(de.RECOVERED_EARLY_EOF)}))}},{key:"_onMediaInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.MEDIA_INFO,e)}))}},{key:"_onMetaDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.METADATA_ARRIVED,e)}))}},{key:"_onScriptDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.SCRIPTDATA_ARRIVED,e)}))}},{key:"_onStatisticsInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.STATISTICS_INFO,e)}))}},{key:"_onIOError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.IO_ERROR,e,t)}))}},{key:"_onDemuxError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.DEMUX_ERROR,e,t)}))}},{key:"_onRecommendSeekpoint",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.RECOMMEND_SEEKPOINT,e)}))}},{key:"_onLoggingConfigChanged",value:function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}},{key:"_onWorkerMessage",value:function(e){var t=e.data,n=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case de.INIT_SEGMENT:case de.MEDIA_SEGMENT:this._emitter.emit(t.msg,n.type,n.data);break;case de.LOADING_COMPLETE:case de.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case de.MEDIA_INFO:Object.setPrototypeOf(n,K.prototype),this._emitter.emit(t.msg,n);break;case de.METADATA_ARRIVED:case de.SCRIPTDATA_ARRIVED:case de.STATISTICS_INFO:this._emitter.emit(t.msg,n);break;case de.IO_ERROR:case de.DEMUX_ERROR:this._emitter.emit(t.msg,n.type,n.info);break;case de.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,n);break;case"logcat_callback":p.emitter.emit("log",n.type,n.logcat)}}}]),e}(),ge={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},_e=function(){function e(t){s()(this,e),this.TAG="MSEController",this._config=t,this._emitter=new(d()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new ue}return l()(e,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaSource)throw new x("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var n=this._pendingSegments[t];n.splice(0,n.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var i=this._sourceBuffers[t];if(i){if("closed"!==e.readyState){try{e.removeSourceBuffer(i)}catch(e){p.e(this.TAG,e.message)}i.removeEventListener("error",this.e.onSourceBufferError),i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){p.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,i="".concat(n.container);n.codec&&n.codec.length>0&&(i+=";codecs=".concat(n.codec));var r=!1;if(p.v(this.TAG,"Received Initialization Segment, mimeType: "+i),this._lastInitSegments[n.type]=n,i!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])p.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type],", target: ").concat(i));else{r=!0;try{var a=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(i);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return p.e(this.TAG,e.message),void this._emitter.emit(ge.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=i}t||this._pendingSegments[n.type].push(n),r||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),k.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}},{key:"seek",value:function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var n=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{n.abort()}catch(e){p.e(this.TAG,e.message)}this._idrList.clear();var i=this._pendingSegments[t];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var r=0;r<n.buffered.length;r++){var a=n.buffered.start(r),s=n.buffered.end(r);this._pendingRemoveRanges[t].push({start:a,end:s})}if(n.updating||this._doRemoveRanges(),k.safari){var o=this._lastInitSegments[t];o&&(this._pendingSegments[t].push(o),n.updating||this._doAppendSegments())}}}}},{key:"endOfStream",value:function(){var e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}},{key:"getNearestKeyframe",value:function(e){return this._idrList.getLastSyncPointBeforeDts(e)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){var i=n.buffered;if(i.length>=1&&e-i.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){for(var i=n.buffered,r=!1,a=0;a<i.length;a++){var s=i.start(a),o=i.end(a);if(s<=e&&e<o+3){if(e-s>=this._config.autoCleanupMaxBackwardDuration){r=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:s,end:l})}}else o<e&&(r=!0,this._pendingRemoveRanges[t].push({start:s,end:o}))}r&&!n.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var e=this._sourceBuffers;if(0!==this._mediaElement.readyState&&"open"===this._mediaSource.readyState&&!(e.video&&e.video.updating||e.audio&&e.audio.updating)){var t=this._mediaSource.duration,n=this._pendingMediaDuration;n>0&&(isNaN(t)||n>t)&&(p.v(this.TAG,"Update MediaSource duration from ".concat(t," to ").concat(n)),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}}},{key:"_doRemoveRanges",value:function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],n=this._pendingRemoveRanges[e];n.length&&!t.updating;){var i=n.shift();t.remove(i.start,i.end)}}},{key:"_doAppendSegments",value:function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var n=e[t].shift();if(n.timestampOffset){var i=this._sourceBuffers[t].timestampOffset,r=n.timestampOffset/1e3;Math.abs(i-r)>.1&&(p.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(i," to ").concat(r)),this._sourceBuffers[t].timestampOffset=r),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(n),22===e.code?(this._isBufferFull||this._emitter.emit(ge.BUFFER_FULL),this._isBufferFull=!0):(p.e(this.TAG,e.message),this._emitter.emit(ge.ERROR,{code:e.code,msg:e.message}))}}}},{key:"_onSourceOpen",value:function(){if(p.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(ge.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){p.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){p.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(ge.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){p.e(this.TAG,"SourceBuffer Error: ".concat(e))}}]),e}(),ve={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},ye={NETWORK_EXCEPTION:S.EXCEPTION,NETWORK_STATUS_CODE_INVALID:S.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:S.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:S.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:te.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:te.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:te.CODEC_UNSUPPORTED},be=function(){function e(t,n){if(s()(this,e),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(d()),this._config=z(),"object"===r()(n)&&Object.assign(this._config,n),"flv"!==t.type.toLowerCase())throw new E("FlvPlayer requires an flv MediaDataSource input!");!0===t.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=t,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var i=k.chrome&&(k.version.major<50||50===k.version.major&&k.version.build<2661);this._alwaysSeekKeyframe=!!(i||k.msedge||k.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return l()(e,[{key:"destroy",value:function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===V.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){n._emitter.emit(V.MEDIA_INFO,n.mediaInfo)})):e===V.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){n._emitter.emit(V.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new _e(this._config),this._msectl.on(ge.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(ge.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(ge.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(ge.ERROR,(function(e){t._emitter.emit(V.ERROR,ve.MEDIA_ERROR,ye.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var e=this;if(!this._mediaElement)throw new x("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new x("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new me(this._mediaDataSource,this._config),this._transmuxer.on(de.INIT_SEGMENT,(function(t,n){e._msectl.appendInitSegment(n)})),this._transmuxer.on(de.MEDIA_SEGMENT,(function(t,n){if(e._msectl.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;n.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(p.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(de.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(V.LOADING_COMPLETE)})),this._transmuxer.on(de.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(V.RECOVERED_EARLY_EOF)})),this._transmuxer.on(de.IO_ERROR,(function(t,n){e._emitter.emit(V.ERROR,ve.NETWORK_ERROR,t,n)})),this._transmuxer.on(de.DEMUX_ERROR,(function(t,n){e._emitter.emit(V.ERROR,ve.MEDIA_ERROR,t,{code:-1,msg:n})})),this._transmuxer.on(de.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(V.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(de.METADATA_ARRIVED,(function(t){e._emitter.emit(V.METADATA_ARRIVED,t)})),this._transmuxer.on(de.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(V.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(de.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(V.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(de.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,i=0;i<e.length;i++){var r=e.start(i),a=e.end(i);if(r<=t&&t<a){r,n=a;break}}n>=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(p.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){p.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,i=0;i<t.length;i++){var r=t.start(i),a=t.end(i);if(e>=r&&e<a){e>=a-this._config.lazyLoadRecoverDuration&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(p.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n<t.length;n++){var i=t.start(n),r=t.end(n);if(e>=i&&e<r)return!0}return!1}},{key:"_internalSeek",value:function(e){var t=this._isTimepointBuffered(e),n=!1,i=0;if(e<1&&this._mediaElement.buffered.length>0){var r=this._mediaElement.buffered.start(0);(r<1&&e<r||k.safari)&&(n=!0,i=k.safari?.1:r)}if(n)this._requestSetTime=!0,this._mediaElement.currentTime=i;else if(t){if(this._alwaysSeekKeyframe){var a=this._msectl.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement.currentTime=null!=a?a.dts/1e3:e}else this._requestSetTime=!0,this._mediaElement.currentTime=e;null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var e=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var n=t.buffered;n.length>0&&t.currentTime<n.start(0)&&(p.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(n.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=n.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(e){var t=this._mediaElement.currentTime,n=this._mediaElement.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(t<1&&n.length>0){var i=n.start(0);if(i<1&&t<i||k.safari)return this._requestSetTime=!0,void(this._mediaElement.currentTime=k.safari?.1:i)}if(this._isTimepointBuffered(t)){if(this._alwaysSeekKeyframe){var r=this._msectl.getNearestKeyframe(Math.floor(1e3*t));null!=r&&(this._requestSetTime=!0,this._mediaElement.currentTime=r.dts/1e3)}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:t,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}},{key:"_onvCanPlay",value:function(e){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(e){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(e){this._checkAndResumeStuckPlayback()}}]),e}(),xe=function(){function e(t,n){if(s()(this,e),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(d()),this._config=z(),"object"===r()(n)&&Object.assign(this._config,n),"flv"===t.type.toLowerCase())throw new E("NativePlayer does't support flv MediaDataSource input!");if(t.hasOwnProperty("segments"))throw new E("NativePlayer(".concat(t.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=t,this._mediaElement=null}return l()(e,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===V.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(V.MEDIA_INFO,n.mediaInfo)})):e===V.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(V.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new x("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(V.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(V.STATISTICS_INFO,this.statisticsInfo)}}]),e}();c.install();var Ee={createPlayer:function(e,t){var n=e;if(null==n||"object"!==r()(n))throw new E("MediaDataSource must be an javascript object!");if(!n.hasOwnProperty("type"))throw new E("MediaDataSource must has type field to indicate video file type!");return"flv"===n.type?new be(n,t):new xe(n,t)},isSupported:function(){return H.supportMSEH264Playback()},getFeatureList:function(){return H.getFeatureList()}};Ee.BaseLoader=A,Ee.LoaderStatus=T,Ee.LoaderErrors=S,Ee.Events=V,Ee.ErrorTypes=ve,Ee.ErrorDetails=ye,Ee.FlvPlayer=be,Ee.NativePlayer=xe,Ee.LoggingControl=Z,Object.defineProperty(Ee,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var we=Ee},45685:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var i=n(94480),r=n(59301),a=n(92310),s=n.n(a),o=n(6089),l=n(16722),u=n(97224),c=n(83010),h=n(48608),d=n(48755),f=n(83397);var p=r.createContext(void 0);var m=e=>{const{href:t,title:n,prefixCls:i,children:a,className:o,target:l,replace:u}=e,c=r.useContext(p),{registerLink:h,unregisterLink:f,scrollTo:m,onClick:g,activeLink:_,direction:v}=c||{};r.useEffect((()=>(null==h||h(t),()=>{null==f||f(t)})),[t]);const{getPrefixCls:y}=r.useContext(d.E_),b=y("anchor",i),x=_===t,E=s()(`${b}-link`,o,{[`${b}-link-active`]:x}),w=s()(`${b}-link-title`,{[`${b}-link-title-active`]:x});return r.createElement("div",{className:E},r.createElement("a",{className:w,href:t,title:"string"==typeof n?n:"",target:l,onClick:e=>{null==g||g(e,{title:n,href:t}),null==m||m(t),u&&(e.preventDefault(),window.location.replace(t))}},n),"horizontal"!==v?a:null)},g=n(36237),_=n(63356),v=n(16931),y=n(51636);const b=e=>{const{componentCls:t,holderOffsetBlock:n,motionDurationSlow:i,lineWidthBold:r,colorPrimary:a,lineType:s,colorSplit:o,calc:l}=e;return{[`${t}-wrapper`]:{marginBlockStart:l(n).mul(-1).equal(),paddingBlockStart:n,[t]:Object.assign(Object.assign({},(0,_.Wf)(e)),{position:"relative",paddingInlineStart:r,[`${t}-link`]:{paddingBlock:e.linkPaddingBlock,paddingInline:`${(0,g.unit)(e.linkPaddingInlineStart)} 0`,"&-title":Object.assign(Object.assign({},_.vS),{position:"relative",display:"block",marginBlockEnd:e.anchorTitleBlock,color:e.colorText,transition:`all ${e.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${t}-link-title`]:{color:e.colorPrimary},[`${t}-link`]:{paddingBlock:e.anchorPaddingBlockSecondary}}}),[`&:not(${t}-wrapper-horizontal)`]:{[t]:{"&::before":{position:"absolute",insetInlineStart:0,top:0,height:"100%",borderInlineStart:`${(0,g.unit)(r)} ${s} ${o}`,content:'" "'},[`${t}-ink`]:{position:"absolute",insetInlineStart:0,display:"none",transform:"translateY(-50%)",transition:`top ${i} ease-in-out`,width:r,backgroundColor:a,[`&${t}-ink-visible`]:{display:"inline-block"}}}},[`${t}-fixed ${t}-ink ${t}-ink`]:{display:"none"}}}},x=e=>{const{componentCls:t,motionDurationSlow:n,lineWidthBold:i,colorPrimary:r}=e;return{[`${t}-wrapper-horizontal`]:{position:"relative","&::before":{position:"absolute",left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`${(0,g.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,content:'" "'},[t]:{overflowX:"scroll",position:"relative",display:"flex",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},[`${t}-link:first-of-type`]:{paddingInline:0},[`${t}-ink`]:{position:"absolute",bottom:0,transition:`left ${n} ease-in-out, width ${n} ease-in-out`,height:i,backgroundColor:r}}}}};var E=(0,v.I$)("Anchor",(e=>{const{fontSize:t,fontSizeLG:n,paddingXXS:i,calc:r}=e,a=(0,y.mergeToken)(e,{holderOffsetBlock:i,anchorPaddingBlockSecondary:r(i).div(2).equal(),anchorTitleBlock:r(t).div(14).mul(3).equal(),anchorBallSize:r(n).div(2).equal()});return[b(a),x(a)]}),(e=>({linkPaddingBlock:e.paddingXXS,linkPaddingInlineStart:e.padding})));function w(){return window}function T(e,t){if(!e.getClientRects().length)return 0;const n=e.getBoundingClientRect();return n.width||n.height?t===window?n.top-e.ownerDocument.documentElement.clientTop:n.top-t.getBoundingClientRect().top:n.top}const S=/#([\S ]+)$/;var A=e=>{var t;const{rootClassName:n,prefixCls:a,className:g,style:_,offsetTop:v,affix:y=!0,showInkInFixed:b=!1,children:x,items:A,direction:C="vertical",bounds:L,targetOffset:R,onClick:I,onChange:D,getContainer:k,getCurrentAnchor:M,replace:P}=e;const[O,N]=r.useState([]),[F,B]=r.useState(null),U=r.useRef(F),G=r.useRef(null),z=r.useRef(null),j=r.useRef(!1),{direction:H,getPrefixCls:V,className:W,style:Z}=(0,d.dj)("anchor"),{getTargetContainer:K}=r.useContext(d.E_),q=V("anchor",a),X=(0,f.Z)(q),[Y,Q,$]=E(q,X),J=null!==(t=null!=k?k:K)&&void 0!==t?t:w,ee=JSON.stringify(O),te=(0,o.Z)((e=>{O.includes(e)||N((t=>[].concat((0,i.Z)(t),[e])))})),ne=(0,o.Z)((e=>{O.includes(e)&&N((t=>t.filter((t=>t!==e))))})),ie=(0,o.Z)((e=>{if(U.current===e)return;const t="function"==typeof M?M(e):e;B(t),U.current=t,null==D||D(e)})),re=r.useCallback((()=>{if(j.current)return;const e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const i=[],r=J();if(e.forEach((e=>{const a=S.exec(null==e?void 0:e.toString());if(!a)return;const s=document.getElementById(a[1]);if(s){const a=T(s,r);a<=t+n&&i.push({link:e,top:a})}})),i.length)return i.reduce(((e,t)=>t.top>e.top?t:e)).link;return""}(O,void 0!==R?R:v||0,L);ie(e)}),[ee,R,v]),ae=r.useCallback((e=>{ie(e);const t=S.exec(e);if(!t)return;const n=document.getElementById(t[1]);if(!n)return;const i=J();let r=(0,u.Z)(i)+T(n,i);r-=void 0!==R?R:v||0,j.current=!0,(0,c.Z)(r,{getContainer:J,callback(){j.current=!1}})}),[R,v]),se=s()(Q,$,X,n,`${q}-wrapper`,{[`${q}-wrapper-horizontal`]:"horizontal"===C,[`${q}-rtl`]:"rtl"===H},g,W),oe=s()(q,{[`${q}-fixed`]:!y&&!b}),le=s()(`${q}-ink`,{[`${q}-ink-visible`]:F}),ue=Object.assign(Object.assign({maxHeight:v?`calc(100vh - ${v}px)`:"100vh"},Z),_),ce=e=>Array.isArray(e)?e.map((e=>r.createElement(m,Object.assign({replace:P},e,{key:e.key}),"vertical"===C&&ce(e.children)))):null,he=r.createElement("div",{ref:G,className:se,style:ue},r.createElement("div",{className:oe},r.createElement("span",{className:le,ref:z}),"items"in e?ce(A):x));r.useEffect((()=>{const e=J();return re(),null==e||e.addEventListener("scroll",re),()=>{null==e||e.removeEventListener("scroll",re)}}),[ee]),r.useEffect((()=>{"function"==typeof M&&ie(M(U.current||""))}),[M]),r.useEffect((()=>{(()=>{var e;const t=null===(e=G.current)||void 0===e?void 0:e.querySelector(`.${q}-link-title-active`);if(t&&z.current){const{style:e}=z.current,n="horizontal"===C;e.top=n?"":`${t.offsetTop+t.clientHeight/2}px`,e.height=n?"":`${t.clientHeight}px`,e.left=n?`${t.offsetLeft}px`:"",e.width=n?`${t.clientWidth}px`:"",n&&(0,l.Z)(t,{scrollMode:"if-needed",block:"nearest"})}})()}),[C,M,ee,F]);const de=r.useMemo((()=>({registerLink:te,unregisterLink:ne,scrollTo:ae,activeLink:F,onClick:I,direction:C})),[F,I,ae,C]),fe=y&&"object"==typeof y?y:void 0;return Y(r.createElement(p.Provider,{value:de},y?r.createElement(h.Z,Object.assign({offsetTop:v,target:J},fe),he):he))};const C=A;C.Link=m;var L=C},25769:function(e,t,n){"use strict";var i=n(98040),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,s,o,l,u,c=!1;t||(t={}),n=t.debug||!1;try{if(s=i(),o=document.createRange(),l=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(i){if(i.stopPropagation(),t.format)if(i.preventDefault(),void 0===i.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=r[t.format]||r.default;window.clipboardData.setData(a,e)}else i.clipboardData.clearData(),i.clipboardData.setData(t.format,e);t.onCopy&&(i.preventDefault(),t.onCopy(i.clipboardData))})),document.body.appendChild(u),o.selectNodeContents(u),l.addRange(o),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(i){n&&console.error("unable to copy using execCommand: ",i),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(i){n&&console.error("unable to copy using clipboardData: ",i),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(o):l.removeAllRanges()),u&&document.body.removeChild(u),s()}return c}},97774:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(59301),s=h(a),o=h(n(12708)),l=h(n(53291)),u=n(47242),c=n(65429);function h(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getEchartsInstance=function(){return n.echartsLib.getInstanceByDom(n.echartsElement)||n.echartsLib.init(n.echartsElement,n.props.theme,n.props.opts)},n.dispose=function(){if(n.echartsElement){try{(0,u.clear)(n.echartsElement)}catch(e){console.warn(e)}n.echartsLib.dispose(n.echartsElement)}},n.rerender=function(){var e=n.props,t=e.onEvents,i=e.onChartReady,r=n.renderEchartDom();n.bindEvents(r,t||{}),"function"==typeof i&&n.props.onChartReady(r),n.echartsElement&&(0,u.bind)(n.echartsElement,(function(){try{r.resize()}catch(e){console.warn(e)}}))},n.bindEvents=function(e,t){var n=function(t,n){"string"==typeof t&&"function"==typeof n&&e.on(t,(function(t){n(t,e)}))};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n(i,t[i])},n.renderEchartDom=function(){var e=n.getEchartsInstance();return e.setOption(n.props.option,n.props.notMerge||!1,n.props.lazyUpdate||!1),n.props.showLoading?e.showLoading(n.props.loadingOption||null):e.hideLoading(),e},n.echartsLib=e.echarts,n.echartsElement=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.rerender()}},{key:"componentDidUpdate",value:function(e){if("function"!=typeof this.props.shouldSetOption||this.props.shouldSetOption(e,this.props)){if(!(0,l.default)(e.theme,this.props.theme)||!(0,l.default)(e.opts,this.props.opts)||!(0,l.default)(e.onEvents,this.props.onEvents))return this.dispose(),void this.rerender();var t=["option","notMerge","lazyUpdate","showLoading","loadingOption"];if(!(0,l.default)((0,c.pick)(this.props,t),(0,c.pick)(e,t))){var n=this.renderEchartDom();if(!(0,l.default)(e.style,this.props.style)||!(0,l.default)(e.className,this.props.className))try{n.resize()}catch(e){console.warn(e)}}}}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"render",value:function(){var e=this,t=this.props,n=t.style,r=t.className,a=i({height:300},n);return s.default.createElement("div",{ref:function(t){e.echartsElement=t},style:a,className:"echarts-for-react "+r})}}]),t}(a.Component);t.default=d,d.propTypes={option:o.default.object.isRequired,echarts:o.default.object,notMerge:o.default.bool,lazyUpdate:o.default.bool,style:o.default.object,className:o.default.string,theme:o.default.oneOfType([o.default.string,o.default.object]),onChartReady:o.default.func,showLoading:o.default.bool,loadingOption:o.default.object,onEvents:o.default.object,opts:o.default.shape({devicePixelRatio:o.default.number,renderer:o.default.oneOf(["canvas","svg"]),width:o.default.oneOfType([o.default.number,o.default.oneOf([null,void 0,"auto"])]),height:o.default.oneOfType([o.default.number,o.default.oneOf([null,void 0,"auto"])])}),shouldSetOption:o.default.func},d.defaultProps={echarts:{},notMerge:!1,lazyUpdate:!1,style:{},className:"",theme:null,onChartReady:function(){},showLoading:!1,loadingOption:null,onEvents:{},opts:{},shouldSetOption:function(){return!0}}},42441:function(e,t,n){"use strict";t.Z=void 0;var i=r(n(76411));function r(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.echartsLib=i.default,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(r(n(97774)).default);t.Z=a},65429:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.pick=function(e,t){var n={};return t.forEach((function(t){n[t]=e[t]})),n}},48961:function(e,t,n){var i;i=function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=87)}([function(t,n){t.exports=e},function(e,t,n){!function(e){"use strict";var n={};n.exports=t,function(e){if(!t)var t=1e-6;if(!n)var n="undefined"!=typeof Float32Array?Float32Array:Array;if(!i)var i=Math.random;var r={setMatrixArrayType:function(e){n=e}};void 0!==e&&(e.glMatrix=r);var a=Math.PI/180;r.toRadian=function(e){return e*a};var s,o={create:function(){var e=new n(2);return e[0]=0,e[1]=0,e},clone:function(e){var t=new n(2);return t[0]=e[0],t[1]=e[1],t},fromValues:function(e,t){var i=new n(2);return i[0]=e,i[1]=t,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}};o.sub=o.subtract,o.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},o.mul=o.multiply,o.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},o.div=o.divide,o.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},o.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},o.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},o.scaleAndAdd=function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},o.distance=function(e,t){var n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)},o.dist=o.distance,o.squaredDistance=function(e,t){var n=t[0]-e[0],i=t[1]-e[1];return n*n+i*i},o.sqrDist=o.squaredDistance,o.length=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},o.len=o.length,o.squaredLength=function(e){var t=e[0],n=e[1];return t*t+n*n},o.sqrLen=o.squaredLength,o.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},o.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},o.normalize=function(e,t){var n=t[0],i=t[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r),e},o.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},o.cross=function(e,t,n){var i=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=i,e},o.lerp=function(e,t,n,i){var r=t[0],a=t[1];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e},o.random=function(e,t){t=t||1;var n=2*i()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},o.transformMat2=function(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[2]*r,e[1]=n[1]*i+n[3]*r,e},o.transformMat2d=function(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[2]*r+n[4],e[1]=n[1]*i+n[3]*r+n[5],e},o.transformMat3=function(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[3]*r+n[6],e[1]=n[1]*i+n[4]*r+n[7],e},o.transformMat4=function(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[4]*r+n[12],e[1]=n[1]*i+n[5]*r+n[13],e},o.forEach=(s=o.create(),function(e,t,n,i,r,a){var o,l;for(t||(t=2),n||(n=0),l=i?Math.min(i*t+n,e.length):e.length,o=n;o<l;o+=t)s[0]=e[o],s[1]=e[o+1],r(s,s,a),e[o]=s[0],e[o+1]=s[1];return e}),o.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},void 0!==e&&(e.vec2=o);var l={create:function(){var e=new n(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new n(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,i){var r=new n(3);return r[0]=e,r[1]=t,r[2]=i,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,n,i){return e[0]=t,e[1]=n,e[2]=i,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}};l.sub=l.subtract,l.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},l.mul=l.multiply,l.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},l.div=l.divide,l.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},l.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},l.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},l.scaleAndAdd=function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e[2]=t[2]+n[2]*i,e},l.distance=function(e,t){var n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+i*i+r*r)},l.dist=l.distance,l.squaredDistance=function(e,t){var n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r},l.sqrDist=l.squaredDistance,l.length=function(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)},l.len=l.length,l.squaredLength=function(e){var t=e[0],n=e[1],i=e[2];return t*t+n*n+i*i},l.sqrLen=l.squaredLength,l.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},l.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},l.normalize=function(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},l.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},l.cross=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=r*l-a*o,e[1]=a*s-i*l,e[2]=i*o-r*s,e},l.lerp=function(e,t,n,i){var r=t[0],a=t[1],s=t[2];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=s+i*(n[2]-s),e},l.random=function(e,t){t=t||1;var n=2*i()*Math.PI,r=2*i()-1,a=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*a,e[1]=Math.sin(n)*a,e[2]=r*t,e},l.transformMat4=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=n[3]*i+n[7]*r+n[11]*a+n[15];return s=s||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/s,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/s,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/s,e},l.transformMat3=function(e,t,n){var i=t[0],r=t[1],a=t[2];return e[0]=i*n[0]+r*n[3]+a*n[6],e[1]=i*n[1]+r*n[4]+a*n[7],e[2]=i*n[2]+r*n[5]+a*n[8],e},l.transformQuat=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=n[0],o=n[1],l=n[2],u=n[3],c=u*i+o*a-l*r,h=u*r+l*i-s*a,d=u*a+s*r-o*i,f=-s*i-o*r-l*a;return e[0]=c*u+f*-s+h*-l-d*-o,e[1]=h*u+f*-o+d*-s-c*-l,e[2]=d*u+f*-l+c*-o-h*-s,e},l.rotateX=function(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e},l.rotateY=function(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e},l.rotateZ=function(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e},l.forEach=function(){var e=l.create();return function(t,n,i,r,a,s){var o,l;for(n||(n=3),i||(i=0),l=r?Math.min(r*n+i,t.length):t.length,o=i;o<l;o+=n)e[0]=t[o],e[1]=t[o+1],e[2]=t[o+2],a(e,e,s),t[o]=e[0],t[o+1]=e[1],t[o+2]=e[2];return t}}(),l.angle=function(e,t){var n=l.fromValues(e[0],e[1],e[2]),i=l.fromValues(t[0],t[1],t[2]);l.normalize(n,n),l.normalize(i,i);var r=l.dot(n,i);return r>1?0:Math.acos(r)},l.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},void 0!==e&&(e.vec3=l);var u={create:function(){var e=new n(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new n(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,i,r){var a=new n(4);return a[0]=e,a[1]=t,a[2]=i,a[3]=r,a},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},subtract:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}};u.sub=u.subtract,u.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},u.mul=u.multiply,u.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e},u.div=u.divide,u.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e},u.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e},u.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},u.scaleAndAdd=function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e[2]=t[2]+n[2]*i,e[3]=t[3]+n[3]*i,e},u.distance=function(e,t){var n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(n*n+i*i+r*r+a*a)},u.dist=u.distance,u.squaredDistance=function(e,t){var n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+i*i+r*r+a*a},u.sqrDist=u.squaredDistance,u.length=function(e){var t=e[0],n=e[1],i=e[2],r=e[3];return Math.sqrt(t*t+n*n+i*i+r*r)},u.len=u.length,u.squaredLength=function(e){var t=e[0],n=e[1],i=e[2],r=e[3];return t*t+n*n+i*i+r*r},u.sqrLen=u.squaredLength,u.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},u.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},u.normalize=function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=n*n+i*i+r*r+a*a;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s),e},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.lerp=function(e,t,n,i){var r=t[0],a=t[1],s=t[2],o=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=s+i*(n[2]-s),e[3]=o+i*(n[3]-o),e},u.random=function(e,t){return t=t||1,e[0]=i(),e[1]=i(),e[2]=i(),e[3]=i(),u.normalize(e,e),u.scale(e,e,t),e},u.transformMat4=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*s,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*s,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*s,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*s,e},u.transformQuat=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=n[0],o=n[1],l=n[2],u=n[3],c=u*i+o*a-l*r,h=u*r+l*i-s*a,d=u*a+s*r-o*i,f=-s*i-o*r-l*a;return e[0]=c*u+f*-s+h*-l-d*-o,e[1]=h*u+f*-o+d*-s-c*-l,e[2]=d*u+f*-l+c*-o-h*-s,e},u.forEach=function(){var e=u.create();return function(t,n,i,r,a,s){var o,l;for(n||(n=4),i||(i=0),l=r?Math.min(r*n+i,t.length):t.length,o=i;o<l;o+=n)e[0]=t[o],e[1]=t[o+1],e[2]=t[o+2],e[3]=t[o+3],a(e,e,s),t[o]=e[0],t[o+1]=e[1],t[o+2]=e[2],t[o+3]=e[3];return t}}(),u.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},void 0!==e&&(e.vec4=u);var c={create:function(){var e=new n(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new n(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},transpose:function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},invert:function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=n*a-r*i;return s?(s=1/s,e[0]=a*s,e[1]=-i*s,e[2]=-r*s,e[3]=n*s,e):null},adjoint:function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=n[0],l=n[1],u=n[2],c=n[3];return e[0]=i*o+a*l,e[1]=r*o+s*l,e[2]=i*u+a*c,e[3]=r*u+s*c,e}};c.mul=c.multiply,c.rotate=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=Math.sin(n),l=Math.cos(n);return e[0]=i*l+a*o,e[1]=r*l+s*o,e[2]=i*-o+a*l,e[3]=r*-o+s*l,e},c.scale=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=n[0],l=n[1];return e[0]=i*o,e[1]=r*o,e[2]=a*l,e[3]=s*l,e},c.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},c.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))},c.LDU=function(e,t,n,i){return e[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-e[2]*n[1],[e,t,n]},void 0!==e&&(e.mat2=c);var h={create:function(){var e=new n(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},clone:function(e){var t=new n(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},invert:function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=t[4],o=t[5],l=n*a-i*r;return l?(l=1/l,e[0]=a*l,e[1]=-i*l,e[2]=-r*l,e[3]=n*l,e[4]=(r*o-a*s)*l,e[5]=(i*s-n*o)*l,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=n[0],c=n[1],h=n[2],d=n[3],f=n[4],p=n[5];return e[0]=i*u+a*c,e[1]=r*u+s*c,e[2]=i*h+a*d,e[3]=r*h+s*d,e[4]=i*f+a*p+o,e[5]=r*f+s*p+l,e}};h.mul=h.multiply,h.rotate=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=i*c+a*u,e[1]=r*c+s*u,e[2]=i*-u+a*c,e[3]=r*-u+s*c,e[4]=o,e[5]=l,e},h.scale=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=n[0],c=n[1];return e[0]=i*u,e[1]=r*u,e[2]=a*c,e[3]=s*c,e[4]=o,e[5]=l,e},h.translate=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=n[0],c=n[1];return e[0]=i,e[1]=r,e[2]=a,e[3]=s,e[4]=i*u+a*c+o,e[5]=r*u+s*c+l,e},h.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},h.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+1)},void 0!==e&&(e.mat2d=h);var d={create:function(){var e=new n(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new n(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){if(e===t){var n=t[1],i=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=i,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=c*s-o*u,d=-c*a+o*l,f=u*a-s*l,p=n*h+i*d+r*f;return p?(p=1/p,e[0]=h*p,e[1]=(-c*i+r*u)*p,e[2]=(o*i-r*s)*p,e[3]=d*p,e[4]=(c*n-r*l)*p,e[5]=(-o*n+r*a)*p,e[6]=f*p,e[7]=(-u*n+i*l)*p,e[8]=(s*n-i*a)*p,e):null},adjoint:function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8];return e[0]=s*c-o*u,e[1]=r*u-i*c,e[2]=i*o-r*s,e[3]=o*l-a*c,e[4]=n*c-r*l,e[5]=r*a-n*o,e[6]=a*u-s*l,e[7]=i*l-n*u,e[8]=n*s-i*a,e},determinant:function(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8];return t*(u*a-s*l)+n*(-u*r+s*o)+i*(l*r-a*o)},multiply:function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],f=n[1],p=n[2],m=n[3],g=n[4],_=n[5],v=n[6],y=n[7],b=n[8];return e[0]=d*i+f*s+p*u,e[1]=d*r+f*o+p*c,e[2]=d*a+f*l+p*h,e[3]=m*i+g*s+_*u,e[4]=m*r+g*o+_*c,e[5]=m*a+g*l+_*h,e[6]=v*i+y*s+b*u,e[7]=v*r+y*o+b*c,e[8]=v*a+y*l+b*h,e}};d.mul=d.multiply,d.translate=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=n[0],f=n[1];return e[0]=i,e[1]=r,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=d*i+f*s+u,e[7]=d*r+f*o+c,e[8]=d*a+f*l+h,e},d.rotate=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=Math.sin(n),f=Math.cos(n);return e[0]=f*i+d*s,e[1]=f*r+d*o,e[2]=f*a+d*l,e[3]=f*s-d*i,e[4]=f*o-d*r,e[5]=f*l-d*a,e[6]=u,e[7]=c,e[8]=h,e},d.scale=function(e,t,n){var i=n[0],r=n[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},d.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},d.fromQuat=function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=n+n,o=i+i,l=r+r,u=n*s,c=i*s,h=i*o,d=r*s,f=r*o,p=r*l,m=a*s,g=a*o,_=a*l;return e[0]=1-h-p,e[3]=c-_,e[6]=d+g,e[1]=c+_,e[4]=1-u-p,e[7]=f-m,e[2]=d-g,e[5]=f+m,e[8]=1-u-h,e},d.normalFromMat4=function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=n*o-i*s,y=n*l-r*s,b=n*u-a*s,x=i*l-r*o,E=i*u-a*o,w=r*u-a*l,T=c*m-h*p,S=c*g-d*p,A=c*_-f*p,C=h*g-d*m,L=h*_-f*m,R=d*_-f*g,I=v*R-y*L+b*C+x*A-E*S+w*T;return I?(I=1/I,e[0]=(o*R-l*L+u*C)*I,e[1]=(l*A-s*R-u*S)*I,e[2]=(s*L-o*A+u*T)*I,e[3]=(r*L-i*R-a*C)*I,e[4]=(n*R-r*A+a*S)*I,e[5]=(i*A-n*L-a*T)*I,e[6]=(m*w-g*E+_*x)*I,e[7]=(g*b-p*w-_*y)*I,e[8]=(p*E-m*b+_*v)*I,e):null},d.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},d.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))},void 0!==e&&(e.mat3=d);var f={create:function(){var e=new n(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new n(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],s=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=s,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=n*o-i*s,y=n*l-r*s,b=n*u-a*s,x=i*l-r*o,E=i*u-a*o,w=r*u-a*l,T=c*m-h*p,S=c*g-d*p,A=c*_-f*p,C=h*g-d*m,L=h*_-f*m,R=d*_-f*g,I=v*R-y*L+b*C+x*A-E*S+w*T;return I?(I=1/I,e[0]=(o*R-l*L+u*C)*I,e[1]=(r*L-i*R-a*C)*I,e[2]=(m*w-g*E+_*x)*I,e[3]=(d*E-h*w-f*x)*I,e[4]=(l*A-s*R-u*S)*I,e[5]=(n*R-r*A+a*S)*I,e[6]=(g*b-p*w-_*y)*I,e[7]=(c*w-d*b+f*y)*I,e[8]=(s*L-o*A+u*T)*I,e[9]=(i*A-n*L-a*T)*I,e[10]=(p*E-m*b+_*v)*I,e[11]=(h*b-c*E-f*v)*I,e[12]=(o*S-s*C-l*T)*I,e[13]=(n*C-i*S+r*T)*I,e[14]=(m*y-p*x-g*v)*I,e[15]=(c*x-h*y+d*v)*I,e):null},adjoint:function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15];return e[0]=o*(d*_-f*g)-h*(l*_-u*g)+m*(l*f-u*d),e[1]=-(i*(d*_-f*g)-h*(r*_-a*g)+m*(r*f-a*d)),e[2]=i*(l*_-u*g)-o*(r*_-a*g)+m*(r*u-a*l),e[3]=-(i*(l*f-u*d)-o*(r*f-a*d)+h*(r*u-a*l)),e[4]=-(s*(d*_-f*g)-c*(l*_-u*g)+p*(l*f-u*d)),e[5]=n*(d*_-f*g)-c*(r*_-a*g)+p*(r*f-a*d),e[6]=-(n*(l*_-u*g)-s*(r*_-a*g)+p*(r*u-a*l)),e[7]=n*(l*f-u*d)-s*(r*f-a*d)+c*(r*u-a*l),e[8]=s*(h*_-f*m)-c*(o*_-u*m)+p*(o*f-u*h),e[9]=-(n*(h*_-f*m)-c*(i*_-a*m)+p*(i*f-a*h)),e[10]=n*(o*_-u*m)-s*(i*_-a*m)+p*(i*u-a*o),e[11]=-(n*(o*f-u*h)-s*(i*f-a*h)+c*(i*u-a*o)),e[12]=-(s*(h*g-d*m)-c*(o*g-l*m)+p*(o*d-l*h)),e[13]=n*(h*g-d*m)-c*(i*g-r*m)+p*(i*d-r*h),e[14]=-(n*(o*g-l*m)-s*(i*g-r*m)+p*(i*l-r*o)),e[15]=n*(o*d-l*h)-s*(i*d-r*h)+c*(i*l-r*o),e},determinant:function(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*s-n*a)*(h*g-d*m)-(t*o-i*a)*(c*g-d*p)+(t*l-r*a)*(c*m-h*p)+(n*o-i*s)*(u*g-d*f)-(n*l-r*s)*(u*m-h*f)+(i*l-r*o)*(u*p-c*f)},multiply:function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],E=n[3];return e[0]=y*i+b*o+x*h+E*m,e[1]=y*r+b*l+x*d+E*g,e[2]=y*a+b*u+x*f+E*_,e[3]=y*s+b*c+x*p+E*v,y=n[4],b=n[5],x=n[6],E=n[7],e[4]=y*i+b*o+x*h+E*m,e[5]=y*r+b*l+x*d+E*g,e[6]=y*a+b*u+x*f+E*_,e[7]=y*s+b*c+x*p+E*v,y=n[8],b=n[9],x=n[10],E=n[11],e[8]=y*i+b*o+x*h+E*m,e[9]=y*r+b*l+x*d+E*g,e[10]=y*a+b*u+x*f+E*_,e[11]=y*s+b*c+x*p+E*v,y=n[12],b=n[13],x=n[14],E=n[15],e[12]=y*i+b*o+x*h+E*m,e[13]=y*r+b*l+x*d+E*g,e[14]=y*a+b*u+x*f+E*_,e[15]=y*s+b*c+x*p+E*v,e},multiplyAffine:function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[4],o=t[5],l=t[6],u=t[8],c=t[9],h=t[10],d=t[12],f=t[13],p=t[14],m=n[0],g=n[1],_=n[2];return e[0]=m*i+g*s+_*u,e[1]=m*r+g*o+_*c,e[2]=m*a+g*l+_*h,m=n[4],g=n[5],_=n[6],e[4]=m*i+g*s+_*u,e[5]=m*r+g*o+_*c,e[6]=m*a+g*l+_*h,m=n[8],g=n[9],_=n[10],e[8]=m*i+g*s+_*u,e[9]=m*r+g*o+_*c,e[10]=m*a+g*l+_*h,m=n[12],g=n[13],_=n[14],e[12]=m*i+g*s+_*u+d,e[13]=m*r+g*o+_*c+f,e[14]=m*a+g*l+_*h+p,e}};f.mul=f.multiply,f.mulAffine=f.multiplyAffine,f.translate=function(e,t,n){var i,r,a,s,o,l,u,c,h,d,f,p,m=n[0],g=n[1],_=n[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(i=t[0],r=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=i*m+o*g+h*_+t[12],e[13]=r*m+l*g+d*_+t[13],e[14]=a*m+u*g+f*_+t[14],e[15]=s*m+c*g+p*_+t[15]),e},f.scale=function(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},f.rotate=function(e,n,i,r){var a,s,o,l,u,c,h,d,f,p,m,g,_,v,y,b,x,E,w,T,S,A,C,L,R=r[0],I=r[1],D=r[2],k=Math.sqrt(R*R+I*I+D*D);return Math.abs(k)<t?null:(R*=k=1/k,I*=k,D*=k,a=Math.sin(i),o=1-(s=Math.cos(i)),l=n[0],u=n[1],c=n[2],h=n[3],d=n[4],f=n[5],p=n[6],m=n[7],g=n[8],_=n[9],v=n[10],y=n[11],b=R*R*o+s,x=I*R*o+D*a,E=D*R*o-I*a,w=R*I*o-D*a,T=I*I*o+s,S=D*I*o+R*a,A=R*D*o+I*a,C=I*D*o-R*a,L=D*D*o+s,e[0]=l*b+d*x+g*E,e[1]=u*b+f*x+_*E,e[2]=c*b+p*x+v*E,e[3]=h*b+m*x+y*E,e[4]=l*w+d*T+g*S,e[5]=u*w+f*T+_*S,e[6]=c*w+p*T+v*S,e[7]=h*w+m*T+y*S,e[8]=l*A+d*C+g*L,e[9]=u*A+f*C+_*L,e[10]=c*A+p*C+v*L,e[11]=h*A+m*C+y*L,n!==e&&(e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15]),e)},f.rotateX=function(e,t,n){var i=Math.sin(n),r=Math.cos(n),a=t[4],s=t[5],o=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+u*i,e[5]=s*r+c*i,e[6]=o*r+h*i,e[7]=l*r+d*i,e[8]=u*r-a*i,e[9]=c*r-s*i,e[10]=h*r-o*i,e[11]=d*r-l*i,e},f.rotateY=function(e,t,n){var i=Math.sin(n),r=Math.cos(n),a=t[0],s=t[1],o=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-u*i,e[1]=s*r-c*i,e[2]=o*r-h*i,e[3]=l*r-d*i,e[8]=a*i+u*r,e[9]=s*i+c*r,e[10]=o*i+h*r,e[11]=l*i+d*r,e},f.rotateZ=function(e,t,n){var i=Math.sin(n),r=Math.cos(n),a=t[0],s=t[1],o=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+u*i,e[1]=s*r+c*i,e[2]=o*r+h*i,e[3]=l*r+d*i,e[4]=u*r-a*i,e[5]=c*r-s*i,e[6]=h*r-o*i,e[7]=d*r-l*i,e},f.fromRotationTranslation=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=i+i,l=r+r,u=a+a,c=i*o,h=i*l,d=i*u,f=r*l,p=r*u,m=a*u,g=s*o,_=s*l,v=s*u;return e[0]=1-(f+m),e[1]=h+v,e[2]=d-_,e[3]=0,e[4]=h-v,e[5]=1-(c+m),e[6]=p+g,e[7]=0,e[8]=d+_,e[9]=p-g,e[10]=1-(c+f),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},f.fromQuat=function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=n+n,o=i+i,l=r+r,u=n*s,c=i*s,h=i*o,d=r*s,f=r*o,p=r*l,m=a*s,g=a*o,_=a*l;return e[0]=1-h-p,e[1]=c+_,e[2]=d-g,e[3]=0,e[4]=c-_,e[5]=1-u-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},f.frustum=function(e,t,n,i,r,a,s){var o=1/(n-t),l=1/(r-i),u=1/(a-s);return e[0]=2*a*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(n+t)*o,e[9]=(r+i)*l,e[10]=(s+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*a*2*u,e[15]=0,e},f.perspective=function(e,t,n,i,r){var a=1/Math.tan(t/2),s=1/(i-r);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+i)*s,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*i*s,e[15]=0,e},f.ortho=function(e,t,n,i,r,a,s){var o=1/(t-n),l=1/(i-r),u=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*o,e[13]=(r+i)*l,e[14]=(s+a)*u,e[15]=1,e},f.lookAt=function(e,n,i,r){var a,s,o,l,u,c,h,d,p,m,g=n[0],_=n[1],v=n[2],y=r[0],b=r[1],x=r[2],E=i[0],w=i[1],T=i[2];return Math.abs(g-E)<t&&Math.abs(_-w)<t&&Math.abs(v-T)<t?f.identity(e):(h=g-E,d=_-w,p=v-T,a=b*(p*=m=1/Math.sqrt(h*h+d*d+p*p))-x*(d*=m),s=x*(h*=m)-y*p,o=y*d-b*h,(m=Math.sqrt(a*a+s*s+o*o))?(a*=m=1/m,s*=m,o*=m):(a=0,s=0,o=0),l=d*o-p*s,u=p*a-h*o,c=h*s-d*a,(m=Math.sqrt(l*l+u*u+c*c))?(l*=m=1/m,u*=m,c*=m):(l=0,u=0,c=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=s,e[5]=u,e[6]=d,e[7]=0,e[8]=o,e[9]=c,e[10]=p,e[11]=0,e[12]=-(a*g+s*_+o*v),e[13]=-(l*g+u*_+c*v),e[14]=-(h*g+d*_+p*v),e[15]=1,e)},f.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},f.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))},void 0!==e&&(e.mat4=f);var p,m,g,_,v={create:function(){var e=new n(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}};v.rotationTo=(p=l.create(),m=l.fromValues(1,0,0),g=l.fromValues(0,1,0),function(e,t,n){var i=l.dot(t,n);return i<-.999999?(l.cross(p,m,t),l.length(p)<1e-6&&l.cross(p,g,t),l.normalize(p,p),v.setAxisAngle(e,p,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(l.cross(p,t,n),e[0]=p[0],e[1]=p[1],e[2]=p[2],e[3]=1+i,v.normalize(e,e))}),v.setAxes=(_=d.create(),function(e,t,n,i){return _[0]=n[0],_[3]=n[1],_[6]=n[2],_[1]=i[0],_[4]=i[1],_[7]=i[2],_[2]=-t[0],_[5]=-t[1],_[8]=-t[2],v.normalize(e,v.fromMat3(e,_))}),v.clone=u.clone,v.fromValues=u.fromValues,v.copy=u.copy,v.set=u.set,v.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},v.setAxisAngle=function(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e},v.add=u.add,v.multiply=function(e,t,n){var i=t[0],r=t[1],a=t[2],s=t[3],o=n[0],l=n[1],u=n[2],c=n[3];return e[0]=i*c+s*o+r*u-a*l,e[1]=r*c+s*l+a*o-i*u,e[2]=a*c+s*u+i*l-r*o,e[3]=s*c-i*o-r*l-a*u,e},v.mul=v.multiply,v.scale=u.scale,v.rotateX=function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],s=t[3],o=Math.sin(n),l=Math.cos(n);return e[0]=i*l+s*o,e[1]=r*l+a*o,e[2]=a*l-r*o,e[3]=s*l-i*o,e},v.rotateY=function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],s=t[3],o=Math.sin(n),l=Math.cos(n);return e[0]=i*l-a*o,e[1]=r*l+s*o,e[2]=a*l+i*o,e[3]=s*l-r*o,e},v.rotateZ=function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],s=t[3],o=Math.sin(n),l=Math.cos(n);return e[0]=i*l+r*o,e[1]=r*l-i*o,e[2]=a*l+s*o,e[3]=s*l-a*o,e},v.calculateW=function(e,t){var n=t[0],i=t[1],r=t[2];return e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),e},v.dot=u.dot,v.lerp=u.lerp,v.slerp=function(e,t,n,i){var r,a,s,o,l,u=t[0],c=t[1],h=t[2],d=t[3],f=n[0],p=n[1],m=n[2],g=n[3];return(a=u*f+c*p+h*m+d*g)<0&&(a=-a,f=-f,p=-p,m=-m,g=-g),1-a>1e-6?(r=Math.acos(a),s=Math.sin(r),o=Math.sin((1-i)*r)/s,l=Math.sin(i*r)/s):(o=1-i,l=i),e[0]=o*u+l*f,e[1]=o*c+l*p,e[2]=o*h+l*m,e[3]=o*d+l*g,e},v.invert=function(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],s=n*n+i*i+r*r+a*a,o=s?1/s:0;return e[0]=-n*o,e[1]=-i*o,e[2]=-r*o,e[3]=a*o,e},v.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},v.length=u.length,v.len=v.length,v.squaredLength=u.squaredLength,v.sqrLen=v.squaredLength,v.normalize=u.normalize,v.fromMat3=function(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,s=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*s+s]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+s]-t[3*s+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[s]=(t[3*s+r]+t[3*r+s])*n}return e},v.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},void 0!==e&&(e.quat=v)}(n.exports)}()},function(e,t,n){"use strict";var i=n(24),r=n(46),a=n(5),s=n(6),o=n(7),l=n(17),u=n(28),c=n(13),h=n(0),d=n.n(h),f=n(29),p=n(53),m=n.n(p),g=n(54),_=n(106),v=n(107),y=n(113),b=n(114),x=n(3),E=n(68),w=n(37),T=n(69),S=n(116),A=n(70),C=n(71),L=n(72),R=n(36),I=n(30),D=n(23),k=n(4),M=n(117),P=n(50),O=n(118),N=n(119),F=n(120),B=n(9),U=n(67),G=n(49),z=n(15),j=n(52),H=n(121),V=n(126),W=n(63),Z=n(127),K=n(128),q=n(129),X=n(130),Y=n(131),Q=n(132);function $(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}d.a.util.extend(u.a.prototype,H.a),o.a.import(V.a),o.a.import(W.a),o.a.import(Z.a),o.a.import(K.a),o.a.import(q.a),o.a.import(X.a),o.a.import(Y.a),o.a.import(Q.a);var J=f.a.prototype.addToScene,ee=f.a.prototype.removeFromScene;f.a.prototype.addToScene=function(e){if(J.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},f.a.prototype.removeFromScene=function(e){ee.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},l.a.prototype.setTextureImage=function(e,t,n,i){if(this.shader){var r,a,s=n.getZr(),o=this;return o.autoUpdateTextureStatus=!1,o.disableTexture(e),(a=t)&&"none"!==a&&(r=te.loadTexture(t,n,i,(function(t){o.enableTexture(e),s&&s.refresh()})),o.set(e,r)),r}};var te={};te.Renderer=r.a,te.Node=u.a,te.Mesh=i.a,te.Shader=o.a,te.Material=l.a,te.Texture=s.a,te.Texture2D=a.a,te.Geometry=c.a,te.SphereGeometry=E.a,te.PlaneGeometry=w.a,te.CubeGeometry=T.a,te.AmbientLight=S.a,te.DirectionalLight=A.a,te.PointLight=C.a,te.SpotLight=L.a,te.PerspectiveCamera=R.a,te.OrthographicCamera=I.a,te.Vector2=D.a,te.Vector3=k.a,te.Vector4=M.a,te.Quaternion=P.a,te.Matrix2=O.a,te.Matrix2d=N.a,te.Matrix3=F.a,te.Matrix4=B.a,te.Plane=U.a,te.Ray=G.a,te.BoundingBox=z.a,te.Frustum=j.a;var ne=g.a.createBlank("rgba(255,255,255,0)").image;function ie(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function re(e){if((e.wrapS===s.a.REPEAT||e.wrapT===s.a.REPEAT)&&e.image){var t=ie(e.width),n=ie(e.height);if(t!==e.width||n!==e.height){var i=document.createElement("canvas");i.width=t,i.height=n,i.getContext("2d").drawImage(e.image,0,0,t,n),e.image=i}}}te.loadTexture=function(e,t,n,i){"function"==typeof n&&(i=n,n={}),n=n||{};for(var r=Object.keys(n).sort(),a="",s=0;s<r.length;s++)a+=r[s]+"_"+n[r[s]]+"_";var o,l=t.__textureCache=t.__textureCache||new m.a(20);if((o=e).getZr&&o.setOption){var u=e.__textureid__;if(h=l.get(a+u))h.texture.surface.setECharts(e),i&&i(h.texture);else{var c=new _.a(e);for(c.onupdate=function(){t.getZr().refresh()},h={texture:c.getTexture()},s=0;s<r.length;s++)h.texture[r[s]]=n[r[s]];u=e.__textureid__||"__ecgl_ec__"+h.texture.__uid__,e.__textureid__=u,l.put(a+u,h),i&&i(h.texture)}return h.texture}if($(e)){var h;if(u=e.__textureid__,!(h=l.get(a+u))){for(h={texture:new te.Texture2D({image:e})},s=0;s<r.length;s++)h.texture[r[s]]=n[r[s]];u=e.__textureid__||"__ecgl_image__"+h.texture.__uid__,e.__textureid__=u,l.put(a+u,h),re(h.texture),i&&i(h.texture)}return h.texture}if(h=l.get(a+e))h.callbacks?h.callbacks.push(i):i&&i(h.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){h={callbacks:[i]};var d=g.a.loadTexture(e,{exposure:n.exposure,fileType:"hdr"},(function(){d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null}));h.texture=d,l.put(a+e,h)}else{for(d=new te.Texture2D({image:new Image}),s=0;s<r.length;s++)d[r[s]]=n[r[s]];h={texture:d,callbacks:[i]};var f=d.image;f.onload=function(){d.image=f,re(d),d.dirty(),h.callbacks.forEach((function(e){e&&e(d)})),h.callbacks=null},f.src=e,d.image=ne,l.put(a+e,h)}return h.texture},te.createAmbientCubemap=function(e,t,n,i){var r=(e=e||{}).texture,a=x.a.firstNotNull(e.exposure,1),s=new v.a({intensity:x.a.firstNotNull(e.specularIntensity,1)}),o=new y.a({intensity:x.a.firstNotNull(e.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return s.cubemap=te.loadTexture(r,n,{exposure:a},(function(){s.cubemap.flipY=!1,s.prefilter(t,32),o.coefficients=b.a.projectEnvironmentMap(t,s.cubemap,{lod:1}),i&&i()})),{specular:s,diffuse:o}},te.createBlankTexture=g.a.createBlank,te.isImage=$,te.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},te.parseColor=function(e,t){return e instanceof Array?(t||(t=[]),t[0]=e[0],t[1]=e[1],t[2]=e[2],e.length>3?t[3]=e[3]:t[3]=1,t):((t=d.a.color.parse(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255,t)},te.directionFromAlphaBeta=function(e,t){var n=e/180*Math.PI+Math.PI/2,i=-t/180*Math.PI+Math.PI/2,r=[],a=Math.sin(n);return r[0]=a*Math.cos(i),r[1]=-Math.cos(n),r[2]=a*Math.sin(i),r},te.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096}return t},te.COMMON_SHADERS=["lambert","color","realistic","hatching"],te.createShader=function(e){var t=o.a.source(e+".vertex"),n=o.a.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),n||console.error("Fragment shader of '%s' not exits",e);var i=new o.a(t,n);return i.name=e,i},te.createMaterial=function(e,t){t instanceof Array||(t=[t]);var n=te.createShader(e),i=new l.a({shader:n});return t.forEach((function(e){"string"==typeof e&&i.define(e)})),i},te.setMaterialFromModel=function(e,t,n,i){t.autoUpdateTextureStatus=!1;var r=n.getModel(e+"Material"),a=r.get("detailTexture"),s=x.a.firstNotNull(r.get("textureTiling"),1),o=x.a.firstNotNull(r.get("textureOffset"),0);"number"==typeof s&&(s=[s,s]),"number"==typeof o&&(o=[o,o]);var l=s[0]>1||s[1]>1?te.Texture.REPEAT:te.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var c=r.get("roughness"),h=r.get("metalness");null!=h?isNaN(h)&&(t.setTextureImage("metalnessMap",h,i,u),h=x.a.firstNotNull(r.get("metalnessAdjust"),.5)):h=0,null!=c?isNaN(c)&&(t.setTextureImage("roughnessMap",c,i,u),c=x.a.firstNotNull(r.get("roughnessAdjust"),.5)):c=.5;var d=r.get("normalTexture");t.setTextureImage("detailMap",a,i,u),t.setTextureImage("normalMap",d,i,u),t.set({roughness:c,metalness:h,detailUvRepeat:s,detailUvOffset:o})}else if("lambert"===e)t.setTextureImage("detailMap",a,i,u),t.set({detailUvRepeat:s,detailUvOffset:o});else if("color"===e)t.setTextureImage("detailMap",a,i,u),t.set({detailUvRepeat:s,detailUvOffset:o});else if("hatching"===e){var f=r.get("hatchingTextures")||[];f.length<6&&console.error("Invalid hatchingTextures.");for(var p=0;p<6;p++)t.setTextureImage("hatch"+(p+1),f[p],i,{anisotropic:8,wrapS:te.Texture.REPEAT,wrapT:te.Texture.REPEAT});t.set({detailUvRepeat:s,detailUvOffset:o})}},te.updateVertexAnimation=function(e,t,n,i){var r=i.get("animation"),a=i.get("animationDurationUpdate"),s=i.get("animationEasingUpdate"),o=n.shadowDepthMaterial;if(r&&t&&a>0&&t.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,o&&o.define("vertex","VERTEX_ANIMATION");for(var l=0;l<e.length;l++)n.geometry.attributes[e[l][0]].value=t.geometry.attributes[e[l][1]].value;n.geometry.dirty(),n.__percent=0,n.material.set("percent",0),n.stopAnimation(),n.animate().when(a,{__percent:1}).during((function(){n.material.set("percent",n.__percent),o&&o.set("percent",n.__percent)})).done((function(){n.ignorePreZ=!1,n.material.undefine("vertex","VERTEX_ANIMATION"),o&&o.undefine("vertex","VERTEX_ANIMATION")})).start(s)}else n.material.undefine("vertex","VERTEX_ANIMATION"),o&&o.undefine("vertex","VERTEX_ANIMATION")},t.a=te},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a={firstNotNull:function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},queryDataIndex:function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?r.a.util.isArray(t.dataIndex)?r.a.util.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?r.a.util.isArray(t.name)?r.a.util.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}};t.a=a},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.vec3,a=function(e,t,n){e=e||0,t=t||0,n=n||0,this.array=r.fromValues(e,t,n),this._dirty=!0};a.prototype={constructor:a,add:function(e){return r.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new a(this.x,this.y,this.z)},copy:function(e){return r.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return r.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return r.dist(this.array,e.array)},distance:function(e){return r.distance(this.array,e.array)},div:function(e){return r.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return r.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return r.dot(this.array,e.array)},len:function(){return r.len(this.array)},length:function(){return r.length(this.array)},lerp:function(e,t,n){return r.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return r.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return r.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return r.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return r.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return r.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return r.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return r.random(this.array,e),this._dirty=!0,this},scale:function(e){return r.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return r.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return r.sqrDist(this.array,e.array)},squaredDistance:function(e){return r.squaredDistance(this.array,e.array)},sqrLen:function(){return r.sqrLen(this.array)},squaredLength:function(){return r.squaredLength(this.array)},sub:function(e){return r.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return r.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return r.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return r.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return r.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t=this.array;if(0===(e=e.array)[15]){var n=-1/t[2];t[0]=e[0]*t[0]*n,t[1]=e[5]*t[1]*n,t[2]=(e[10]*t[2]+e[14])*n}else t[0]=e[0]*t[0]+e[12],t[1]=e[5]*t[1]+e[13],t[2]=e[10]*t[2]+e[14];return this._dirty=!0,this},eulerFromQuat:function(e,t){a.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){a.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var o=a.prototype;s(o,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),s(o,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),s(o,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function l(e,t,n){return e<t?t:e>n?n:e}a.add=function(e,t,n){return r.add(e.array,t.array,n.array),e._dirty=!0,e},a.set=function(e,t,n,i){r.set(e.array,t,n,i),e._dirty=!0},a.copy=function(e,t){return r.copy(e.array,t.array),e._dirty=!0,e},a.cross=function(e,t,n){return r.cross(e.array,t.array,n.array),e._dirty=!0,e},a.distance=a.dist=function(e,t){return r.distance(e.array,t.array)},a.divide=a.div=function(e,t,n){return r.divide(e.array,t.array,n.array),e._dirty=!0,e},a.dot=function(e,t){return r.dot(e.array,t.array)},a.len=function(e){return r.length(e.array)},a.lerp=function(e,t,n,i){return r.lerp(e.array,t.array,n.array,i),e._dirty=!0,e},a.min=function(e,t,n){return r.min(e.array,t.array,n.array),e._dirty=!0,e},a.max=function(e,t,n){return r.max(e.array,t.array,n.array),e._dirty=!0,e},a.multiply=a.mul=function(e,t,n){return r.multiply(e.array,t.array,n.array),e._dirty=!0,e},a.negate=function(e,t){return r.negate(e.array,t.array),e._dirty=!0,e},a.normalize=function(e,t){return r.normalize(e.array,t.array),e._dirty=!0,e},a.random=function(e,t){return r.random(e.array,t),e._dirty=!0,e},a.scale=function(e,t,n){return r.scale(e.array,t.array,n),e._dirty=!0,e},a.scaleAndAdd=function(e,t,n,i){return r.scaleAndAdd(e.array,t.array,n.array,i),e._dirty=!0,e},a.squaredDistance=a.sqrDist=function(e,t){return r.sqrDist(e.array,t.array)},a.squaredLength=a.sqrLen=function(e){return r.sqrLen(e.array)},a.subtract=a.sub=function(e,t,n){return r.subtract(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat3=function(e,t,n){return r.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat4=function(e,t,n){return r.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},a.transformQuat=function(e,t,n){return r.transformQuat(e.array,t.array,n.array),e._dirty=!0,e};var u=Math.atan2,c=Math.asin,h=Math.abs;a.eulerFromQuat=function(e,t,n){e._dirty=!0,t=t.array;var i=e.array,r=t[0],a=t[1],s=t[2],o=t[3],h=r*r,d=a*a,f=s*s,p=o*o;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=u(2*(r*o-a*s),p-h-d+f),i[1]=c(l(2*(r*s+a*o),-1,1)),i[2]=u(2*(s*o-r*a),p+h-d-f);break;case"YXZ":i[0]=c(l(2*(r*o-a*s),-1,1)),i[1]=u(2*(r*s+a*o),p-h-d+f),i[2]=u(2*(r*a+s*o),p-h+d-f);break;case"ZXY":i[0]=c(l(2*(r*o+a*s),-1,1)),i[1]=u(2*(a*o-s*r),p-h-d+f),i[2]=u(2*(s*o-r*a),p-h+d-f);break;case"ZYX":i[0]=u(2*(r*o+s*a),p-h-d+f),i[1]=c(l(2*(a*o-r*s),-1,1)),i[2]=u(2*(r*a+s*o),p+h-d-f);break;case"YZX":i[0]=u(2*(r*o-s*a),p-h+d-f),i[1]=u(2*(a*o-r*s),p+h-d-f),i[2]=c(l(2*(r*a+s*o),-1,1));break;case"XZY":i[0]=u(2*(r*o+a*s),p-h+d-f),i[1]=u(2*(r*s+a*o),p+h-d-f),i[2]=c(l(2*(s*o-r*a),-1,1));break;default:console.warn("Unkown order: "+n)}return e},a.eulerFromMat3=function(e,t,n){var i=t.array,r=i[0],a=i[3],s=i[6],o=i[1],d=i[4],f=i[7],p=i[2],m=i[5],g=i[8],_=e.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":_[1]=c(l(s,-1,1)),h(s)<.99999?(_[0]=u(-f,g),_[2]=u(-a,r)):(_[0]=u(m,d),_[2]=0);break;case"YXZ":_[0]=c(-l(f,-1,1)),h(f)<.99999?(_[1]=u(s,g),_[2]=u(o,d)):(_[1]=u(-p,r),_[2]=0);break;case"ZXY":_[0]=c(l(m,-1,1)),h(m)<.99999?(_[1]=u(-p,g),_[2]=u(-a,d)):(_[1]=0,_[2]=u(o,r));break;case"ZYX":_[1]=c(-l(p,-1,1)),h(p)<.99999?(_[0]=u(m,g),_[2]=u(o,r)):(_[0]=0,_[2]=u(-a,d));break;case"YZX":_[2]=c(l(o,-1,1)),h(o)<.99999?(_[0]=u(-f,d),_[1]=u(-p,r)):(_[0]=0,_[1]=u(s,g));break;case"XZY":_[2]=c(-l(a,-1,1)),h(a)<.99999?(_[0]=u(m,d),_[1]=u(s,r)):(_[0]=u(-f,g),_[1]=0);break;default:console.warn("Unkown order: "+n)}return e._dirty=!0,e},a.POSITIVE_X=new a(1,0,0),a.NEGATIVE_X=new a(-1,0,0),a.POSITIVE_Y=new a(0,1,0),a.NEGATIVE_Y=new a(0,-1,0),a.POSITIVE_Z=new a(0,0,1),a.NEGATIVE_Z=new a(0,0,-1),a.UP=new a(0,1,0),a.ZERO=new a(0,0,0),t.a=a},function(e,t,n){"use strict";var i=n(6),r=n(11),a=n(66).a.isPowerOfTwo,s=i.a.extend((function(){return{image:null,pixels:null,mipmaps:[]}}),{update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,i=this.type;t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i&&(e.getGLExtension("OES_texture_half_float")||(i=r.a.FLOAT)),this.mipmaps.length)for(var s=this.width,o=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,s,o,n,i),s/=2,o/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,i),this.useMipmap&&!this.NPOT&&t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,n,r,a,s,o){t.image?e.texImage2D(e.TEXTURE_2D,n,s,s,o,t.image):s<=i.a.COMPRESSED_RGBA_S3TC_DXT5_EXT&&s>=i.a.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,n,s,r,a,0,t.pixels):e.texImage2D(e.TEXTURE_2D,n,s,r,a,0,s,o,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){var e,t;return this.image?(e=this.image.width,t=this.image.height):(e=this.width,t=this.height),a(e)&&a(t)},isRenderable:function(){return this.image?"CANVAS"===this.image.nodeName||"VIDEO"===this.image.nodeName||this.image.complete:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var n=new Image;t&&(n.crossOrigin=t);var i=this;return n.onload=function(){i.dirty(),i.trigger("success",i),n.onload=null},n.onerror=function(){i.trigger("error",i),n.onerror=null},n.src=e,this.image=n,this}});Object.defineProperty(s.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(s.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t.a=s},function(e,t,n){"use strict";var i=n(8),r=n(11),a=n(48),s=i.a.extend({width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.REPEAT,wrapT:r.a.REPEAT,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1},(function(){this._cache=new a.a}),{getWebGLTexture:function(e){var t=e.gl,n=this._cache;return n.use(e.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):n.isDirty()&&(this.update(e),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(e){},updateCommon:function(e){var t=e.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===r.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var n=e.getGLExtension("EXT_sRGB");this.format!==s.SRGB||n||(this.format=s.RGB),this.format!==s.SRGB_ALPHA||n||(this.format=s.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e==r.a.NEAREST_MIPMAP_NEAREST||e==r.a.NEAREST_MIPMAP_LINEAR?r.a.NEAREST:e==r.a.LINEAR_MIPMAP_LINEAR||e==r.a.LINEAR_MIPMAP_NEAREST?r.a.LINEAR:e:e},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("webgl_texture");n&&e.gl.deleteTexture(n),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(s.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(s.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),s.BYTE=r.a.BYTE,s.UNSIGNED_BYTE=r.a.UNSIGNED_BYTE,s.SHORT=r.a.SHORT,s.UNSIGNED_SHORT=r.a.UNSIGNED_SHORT,s.INT=r.a.INT,s.UNSIGNED_INT=r.a.UNSIGNED_INT,s.FLOAT=r.a.FLOAT,s.HALF_FLOAT=36193,s.UNSIGNED_INT_24_8_WEBGL=34042,s.DEPTH_COMPONENT=r.a.DEPTH_COMPONENT,s.DEPTH_STENCIL=r.a.DEPTH_STENCIL,s.ALPHA=r.a.ALPHA,s.RGB=r.a.RGB,s.RGBA=r.a.RGBA,s.LUMINANCE=r.a.LUMINANCE,s.LUMINANCE_ALPHA=r.a.LUMINANCE_ALPHA,s.SRGB=35904,s.SRGB_ALPHA=35906,s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,s.NEAREST=r.a.NEAREST,s.LINEAR=r.a.LINEAR,s.NEAREST_MIPMAP_NEAREST=r.a.NEAREST_MIPMAP_NEAREST,s.LINEAR_MIPMAP_NEAREST=r.a.LINEAR_MIPMAP_NEAREST,s.NEAREST_MIPMAP_LINEAR=r.a.NEAREST_MIPMAP_LINEAR,s.LINEAR_MIPMAP_LINEAR=r.a.LINEAR_MIPMAP_LINEAR,s.REPEAT=r.a.REPEAT,s.CLAMP_TO_EDGE=r.a.CLAMP_TO_EDGE,s.MIRRORED_REPEAT=r.a.MIRRORED_REPEAT,t.a=s},function(e,t,n){"use strict";var i=n(21),r=n(18),a=n(1),s=n.n(a),o=s.a.mat2,l=s.a.mat3,u=s.a.mat4,c=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\w\,]+)?(\[.*?\])?\s*(:\s*([\S\s]+?))?;/g,h=/attribute\s+(float|int|vec2|vec3|vec4)\s+(\w*)\s*(:\s*(\w+))?;/g,d=/#define\s+(\w+)?(\s+[\w-.]+)?\s*;?\s*\n/g,f={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"},p={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return[0,0]},vec3:function(){return[0,0,0]},vec4:function(){return[0,0,0,0]},ivec2:function(){return[0,0]},ivec3:function(){return[0,0,0]},ivec4:function(){return[0,0,0,0]},mat2:function(){return o.create()},mat3:function(){return l.create()},mat4:function(){return u.create()},array:function(){return[]}},m=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],g=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],_=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],v={},y={};function b(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),this._shaderID=function(e,t){var n="vertex:"+e+"fragment:"+t;if(v[n])return v[n];var r=i.a.genGUID();return v[n]=r,y[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=b.parseImport(e),this._fragmentCode=b.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}b.prototype={constructor:b,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var n=this.uniformTemplates[t];e[t]={type:n.type,value:n.value()}}return e},_parseImport:function(){this._vertexCode=b.parseImport(this.vertex),this._fragmentCode=b.parseImport(this.fragment)},_parseUniforms:function(){var e={},t=this;function n(n,i,r,a,s,o){if(i&&r){var l,u=f[i],c=!0;if(u){if(t._uniformList.push(r),"sampler2D"!==i&&"samplerCube"!==i||(t.textures[r]={shaderType:"fragment",type:i}),a&&(u+="v"),o)if(m.indexOf(o)>=0)t.attributeSemantics[o]={symbol:r,type:u},c=!1;else if(_.indexOf(o)>=0){var h=!1,d=o;o.match(/TRANSPOSE$/)&&(h=!0,d=o.slice(0,-9)),t.matrixSemantics[o]={symbol:r,type:u,isTranspose:h,semanticNoTranspose:d},c=!1}else if(g.indexOf(o)>=0)t.uniformSemantics[o]={symbol:r,type:u},c=!1;else if("unconfigurable"===o)c=!1;else{if(!(l=t._parseDefaultValue(i,o)))throw new Error('Unkown semantic "'+o+'"');o=""}c&&(e[r]={type:u,value:a?p.array:l||p[i],semantic:o||null})}return["uniform",i,r,a].join(" ")+";\n"}}this._uniformList=[],this._vertexCode=this._vertexCode.replace(c,n),this._fragmentCode=this._fragmentCode.replace(c,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseDefaultValue:function(e,t){if("vec2"!==e&&"vec3"!==e&&"vec4"!==e)return"bool"===e?function(){return"true"===t.toLowerCase()}:"float"===e?function(){return parseFloat(t)}:"int"===e?function(){return parseInt(t)}:void 0;var n=/\[\s*(.*)\s*\]/.exec(t)[1];if(n){var i=n.split(/\s*,\s*/);return function(){return new r.a.Float32Array(i)}}},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(h,(function(n,i,r,a,s){if(i&&r){var o=1;switch(i){case"vec4":o=4;break;case"vec3":o=3;break;case"vec2":o=2;break;case"float":o=1}if(e[r]={type:"float",size:o,semantic:s||null},s){if(m.indexOf(s)<0)throw new Error('Unkown semantic "'+s+'"');t.attributeSemantics[s]={symbol:r,type:i}}}return["attribute",i,r].join(" ")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this;function t(t,n,i){var r=e.fragmentDefines;return r[n]||(r[n]="false"!=i&&("true"==i||(i?isNaN(parseFloat(i))?i.trim():parseFloat(i):null))),""}this._vertexCode=this._vertexCode.replace(d,t),this._fragmentCode=this._fragmentCode.replace(d,t)},clone:function(){var e=y[this._shaderID];return new b(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(b.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(b.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(b.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(b.prototype,"uniforms",{get:function(){return this._uniformList}}));var x=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;b.parseImport=function(e){return e=e.replace(x,(function(e,t,n){return(e=b.source(n))?b.parseImport(e):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var E=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;b.import=function(e){e.replace(E,(function(e,t,n,i){if(i=i.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,a=n.split("."),s=b.codes,o=0;o<a.length-1;)s[r=a[o++]]||(s[r]={}),s=s[r];s[r=a[o]]=i}return i}))},b.codes={},b.source=function(e){for(var t=e.split("."),n=b.codes,i=0;n&&i<t.length;)n=n[t[i++]];return"string"!=typeof n?(console.error('Shader "'+e+'" not existed in library'),""):n},t.a=b},function(e,t,n){"use strict";var i=n(91),r=n(47),a=n(21),s=function(){this.__uid__=a.a.genGUID()};s.__initializers__=[function(e){a.a.extend(this,e)}],a.a.extend(s,i.a),a.a.extend(s.prototype,r.a),t.a=s},function(e,t,n){"use strict";var i,r,a,s,o=n(1),l=n.n(o),u=n(4),c=l.a.mat4,h=l.a.vec3,d=l.a.mat3,f=l.a.quat,p=function(){this._axisX=new u.a,this._axisY=new u.a,this._axisZ=new u.a,this.array=c.create(),this._dirty=!0};p.prototype={constructor:p,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return c.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new p).copy(this)},copy:function(e){return c.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return c.determinant(this.array)},fromQuat:function(e){return c.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return c.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return p.fromMat2d(this,e),this},frustum:function(e,t,n,i,r,a){return c.frustum(this.array,e,t,n,i,r,a),this._dirty=!0,this},identity:function(){return c.identity(this.array),this._dirty=!0,this},invert:function(){return c.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,n){return c.lookAt(this.array,e.array,t.array,n.array),this._dirty=!0,this},mul:function(e){return c.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return c.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return c.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return c.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,n,i,r,a){return c.ortho(this.array,e,t,n,i,r,a),this._dirty=!0,this},perspective:function(e,t,n,i){return c.perspective(this.array,e,t,n,i),this._dirty=!0,this},rotate:function(e,t){return c.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return c.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return c.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return c.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return c.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return c.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return c.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:(i=h.create(),r=h.create(),a=h.create(),s=d.create(),function(e,t,n){var o=this.array;h.set(i,o[0],o[1],o[2]),h.set(r,o[4],o[5],o[6]),h.set(a,o[8],o[9],o[10]);var l=h.length(i),u=h.length(r),c=h.length(a);this.determinant()<0&&(l=-l),e&&e.set(l,u,c),n.set(o[12],o[13],o[14]),d.fromMat4(s,o),s[0]/=l,s[1]/=l,s[2]/=l,s[3]/=u,s[4]/=u,s[5]/=u,s[6]/=c,s[7]/=c,s[8]/=c,f.fromMat3(t.array,s),f.normalize(t.array,t.array),t._dirty=!0,n._dirty=!0}),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var m=Object.defineProperty;if(m){var g=p.prototype;m(g,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),m(g,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),m(g,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})}p.adjoint=function(e,t){return c.adjoint(e.array,t.array),e._dirty=!0,e},p.copy=function(e,t){return c.copy(e.array,t.array),e._dirty=!0,e},p.determinant=function(e){return c.determinant(e.array)},p.identity=function(e){return c.identity(e.array),e._dirty=!0,e},p.ortho=function(e,t,n,i,r,a,s){return c.ortho(e.array,t,n,i,r,a,s),e._dirty=!0,e},p.perspective=function(e,t,n,i,r){return c.perspective(e.array,t,n,i,r),e._dirty=!0,e},p.lookAt=function(e,t,n,i){return c.lookAt(e.array,t.array,n.array,i.array),e._dirty=!0,e},p.invert=function(e,t){return c.invert(e.array,t.array),e._dirty=!0,e},p.multiply=p.mul=function(e,t,n){return c.mul(e.array,t.array,n.array),e._dirty=!0,e},p.fromQuat=function(e,t){return c.fromQuat(e.array,t.array),e._dirty=!0,e},p.fromRotationTranslation=function(e,t,n){return c.fromRotationTranslation(e.array,t.array,n.array),e._dirty=!0,e},p.fromMat2d=function(e,t){return e._dirty=!0,t=t.array,(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},p.rotate=function(e,t,n,i){return c.rotate(e.array,t.array,n,i.array),e._dirty=!0,e},p.rotateX=function(e,t,n){return c.rotateX(e.array,t.array,n),e._dirty=!0,e},p.rotateY=function(e,t,n){return c.rotateY(e.array,t.array,n),e._dirty=!0,e},p.rotateZ=function(e,t,n){return c.rotateZ(e.array,t.array,n),e._dirty=!0,e},p.scale=function(e,t,n){return c.scale(e.array,t.array,n.array),e._dirty=!0,e},p.transpose=function(e,t){return c.transpose(e.array,t.array),e._dirty=!0,e},p.translate=function(e,t,n){return c.translate(e.array,t.array,n.array),e._dirty=!0,e},t.a=p},function(e,t,n){"use strict";var i=n(8),r=n(6),a=n(25),s=n(11),o=n(48),l="framebuffer",u="renderbuffer",c=u+"_width",h=u+"_height",d=u+"_attached",f="depthtexture_attached",p=s.a.FRAMEBUFFER,m=s.a.RENDERBUFFER,g=s.a.DEPTH_ATTACHMENT,_=s.a.COLOR_ATTACHMENT0,v=i.a.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new o.a,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(p,this._getFrameBufferGL(e)),this._boundRenderer=e;var n=this._cache;n.put("viewport",e.viewport);var i,r,a=!1;for(var s in this._textures){a=!0;var o=this._textures[s];o&&(i=o.texture.width,r=o.texture.height,this._doAttach(e,o.texture,s,o.target))}this._width=i,this._height=r,!a&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,i,r,1);var l=n.get("attached_textures");if(l)for(var s in l)if(!this._textures[s]){var _=l[s];this._doDetach(t,s,_)}if(!n.get(f)&&this.depthBuffer){n.miss(u)&&n.put(u,t.createRenderbuffer());var v=n.get(u);i===n.get(c)&&r===n.get(h)||(t.bindRenderbuffer(m,v),t.renderbufferStorage(m,t.DEPTH_COMPONENT16,i,r),n.put(c,i),n.put(h,r),t.bindRenderbuffer(m,null)),n.get(d)||(t.framebufferRenderbuffer(p,g,m,v),n.put(d,!0))}},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer(p,null),this._boundRenderer=null,this._cache.use(e.__uid__);var t=this._cache.get("viewport");t&&e.setViewport(t),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var n in this._textures){var i=this._textures[n];if(i){var o=i.texture;if(!o.NPOT&&o.useMipmap&&o.minFilter===r.a.LINEAR_MIPMAP_LINEAR){var l=o instanceof a.a?s.a.TEXTURE_CUBE_MAP:s.a.TEXTURE_2D;t.bindTexture(l,o.getWebGLTexture(e)),t.generateMipmap(l),t.bindTexture(l,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(p)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(l)&&t.put(l,e.gl.createFramebuffer()),t.get(l)},attach:function(e,t,n){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||_,n=n||s.a.TEXTURE_2D;var i,r=this._boundRenderer;if(r&&r.gl){var a=this._cache;a.use(r.__uid__),i=a.get("attached_textures")}var o=this._textures[t];if(!o||o.target!==n||o.texture!==e||!i||null==i[t]){var l=!0;r&&(l=this._doAttach(r,e,t,n),this.viewport||r.setViewport(0,0,e.width,e.height,1)),l&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=n)}},_doAttach:function(e,t,n,i){var r=e.gl,a=t.getWebGLTexture(e),o=this._cache.get("attached_textures");if(o&&o[n]){var l=o[n];if(l.texture===t&&l.target===i)return}var c=!0;if(((n=+n)===g||n===s.a.DEPTH_STENCIL_ATTACHMENT)&&(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),c=!1),t.format!==s.a.DEPTH_COMPONENT&&t.format!==s.a.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),c=!1),c)){var h=this._cache.get(u);h&&(r.framebufferRenderbuffer(p,g,m,null),r.deleteRenderbuffer(h),this._cache.put(u,!1)),this._cache.put(d,!1),this._cache.put(f,!0)}return r.framebufferTexture2D(p,n,i,a,0),o||(o={},this._cache.put("attached_textures",o)),o[n]=o[n]||{},o[n].texture=t,o[n].target=i,c},_doDetach:function(e,t,n){e.framebufferTexture2D(p,t,n,null,0);var i=this._cache.get("attached_textures");i&&i[t]&&(i[t]=null),t!==g&&t!==s.a.DEPTH_STENCIL_ATTACHMENT||this._cache.put(f,!1)},detach:function(e,t){this._textures[e]=null,this._boundRenderer&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t))},dispose:function(e){var t=e.gl,n=this._cache;n.use(e.__uid__);var i=n.get(u);i&&t.deleteRenderbuffer(i);var r=n.get(l);r&&t.deleteFramebuffer(r),n.deleteContext(e.__uid__),this._textures={}}});v.DEPTH_ATTACHMENT=g,v.COLOR_ATTACHMENT0=_,v.STENCIL_ATTACHMENT=s.a.STENCIL_ATTACHMENT,v.DEPTH_STENCIL_ATTACHMENT=s.a.DEPTH_STENCIL_ATTACHMENT,t.a=v},function(e,t,n){"use strict";t.a={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444}},function(e,t){var n={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},i={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,a=Array.prototype,s=a.forEach,o=a.filter,l=a.slice,u=a.map,c=a.reduce,h={};function d(e){if(null==e||"object"!=typeof e)return e;var t=e,a=r.call(e);if("[object Array]"===a){if(!T(e)){t=[];for(var s=0,o=e.length;s<o;s++)t[s]=d(e[s])}}else if(i[a]){if(!T(e)){var l=e.constructor;if(e.constructor.from)t=l.from(e);else for(t=new l(e.length),s=0,o=e.length;s<o;s++)t[s]=d(e[s])}}else if(!n[a]&&!T(e)&&!E(e))for(var u in t={},e)e.hasOwnProperty(u)&&(t[u]=d(e[u]));return t}function f(e,t,n){if(!b(t)||!b(e))return n?d(t):e;for(var i in t)if(t.hasOwnProperty(i)){var r=e[i],a=t[i];!b(a)||!b(r)||y(a)||y(r)||E(a)||E(r)||x(a)||x(r)||T(a)||T(r)?!n&&i in e||(e[i]=d(t[i])):f(r,a,n)}return e}function p(e,t,n){for(var i in t)t.hasOwnProperty(i)&&(n?null!=t[i]:null==e[i])&&(e[i]=t[i]);return e}var m,g=function(){return h.createCanvas()};function _(e,t,n){if(e&&t)if(e.forEach&&e.forEach===s)e.forEach(t,n);else if(e.length===+e.length)for(var i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(n,e[a],a,e)}function v(e,t){var n=l.call(arguments,2);return function(){return e.apply(t,n.concat(l.call(arguments)))}}function y(e){return"[object Array]"===r.call(e)}function b(e){var t=typeof e;return"function"===t||!!e&&"object"==t}function x(e){return!!n[r.call(e)]}function E(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}h.createCanvas=function(){return document.createElement("canvas")};var w="__ec_primitive__";function T(e){return e[w]}function S(e){var t=y(e);e&&_(e,(function(e,n){t?this.set(e,1):this.set(n,e)}),this)}var A="_ec_";S.prototype={constructor:S,get:function(e){return this[A+e]},set:function(e,t){return this[A+e]=t,t},each:function(e,t){for(var n in void 0!==t&&(e=v(e,t)),this)this.hasOwnProperty(n)&&e(this[n],n.slice(4))},removeKey:function(e){delete this[A+e]}},t.$override=function(e,t){h[e]=t},t.clone=d,t.merge=f,t.mergeAll=function(e,t){for(var n=e[0],i=1,r=e.length;i<r;i++)n=f(n,e[i],t);return n},t.extend=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t.defaults=p,t.createCanvas=g,t.getContext=function(){return m||(m=g().getContext("2d")),m},t.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n}return-1},t.inherits=function(e,t){var n=e.prototype;function i(){}for(var r in i.prototype=t.prototype,e.prototype=new i,n)e.prototype[r]=n[r];e.prototype.constructor=e,e.superClass=t},t.mixin=function(e,t,n){p(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,n)},t.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},t.each=_,t.map=function(e,t,n){if(e&&t){if(e.map&&e.map===u)return e.map(t,n);for(var i=[],r=0,a=e.length;r<a;r++)i.push(t.call(n,e[r],r,e));return i}},t.reduce=function(e,t,n,i){if(e&&t){if(e.reduce&&e.reduce===c)return e.reduce(t,n,i);for(var r=0,a=e.length;r<a;r++)n=t.call(i,n,e[r],r,e);return n}},t.filter=function(e,t,n){if(e&&t){if(e.filter&&e.filter===o)return e.filter(t,n);for(var i=[],r=0,a=e.length;r<a;r++)t.call(n,e[r],r,e)&&i.push(e[r]);return i}},t.find=function(e,t,n){if(e&&t)for(var i=0,r=e.length;i<r;i++)if(t.call(n,e[i],i,e))return e[i]},t.bind=v,t.curry=function(e){var t=l.call(arguments,1);return function(){return e.apply(this,t.concat(l.call(arguments)))}},t.isArray=y,t.isFunction=function(e){return"function"==typeof e},t.isString=function(e){return"[object String]"===r.call(e)},t.isObject=b,t.isBuiltInObject=x,t.isTypedArray=function(e){return!!i[r.call(e)]},t.isDom=E,t.eqNaN=function(e){return e!=e},t.retrieve=function(e){for(var t=0,n=arguments.length;t<n;t++)if(null!=arguments[t])return arguments[t]},t.retrieve2=function(e,t){return null!=e?e:t},t.retrieve3=function(e,t,n){return null!=e?e:null!=t?t:n},t.slice=function(){return Function.call.apply(l,arguments)},t.normalizeCssArray=function(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e},t.assert=function(e,t){if(!e)throw new Error(t)},t.setAsPrimitive=function(e){e[w]=!0},t.isPrimitive=T,t.createHashMap=function(e){return new S(e)},t.concatArray=function(e,t){for(var n=new e.constructor(e.length+t.length),i=0;i<e.length;i++)n[i]=e[i];var r=e.length;for(i=0;i<t.length;i++)n[i+r]=t[i];return n},t.noop=function(){}},function(e,t,n){"use strict";var i=n(8),r=n(11),a=n(48),s=n(18),o=n(1),l=n.n(o),u=n(15),c=l.a.vec3,h=l.a.mat4,d=c.create,f=c.add,p=c.set;function m(e){return{byte:s.a.Int8Array,ubyte:s.a.Uint8Array,short:s.a.Int16Array,ushort:s.a.Uint16Array}[e]||s.a.Float32Array}function g(e){return"attr_"+e}function _(e,t,n,i){switch(this.name=e,this.type=t,this.size=n,this.semantic=i||"",this.value=null,n){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var n=this.value;return t[0]=n[2*e],t[1]=n[2*e+1],t},this.set=function(e,t){var n=this.value;n[2*e]=t[0],n[2*e+1]=t[1]},this.copy=function(e,t){var n=this.value;t*=2,n[e*=2]=n[t],n[e+1]=n[t+1]};break;case 3:this.get=function(e,t){var n=3*e,i=this.value;return t[0]=i[n],t[1]=i[n+1],t[2]=i[n+2],t},this.set=function(e,t){var n=3*e,i=this.value;i[n]=t[0],i[n+1]=t[1],i[n+2]=t[2]},this.copy=function(e,t){var n=this.value;t*=3,n[e*=3]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2]};break;case 4:this.get=function(e,t){var n=this.value,i=4*e;return t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t[3]=n[i+3],t},this.set=function(e,t){var n=this.value,i=4*e;n[i]=t[0],n[i+1]=t[1],n[i+2]=t[2],n[i+3]=t[3]},this.copy=function(e,t){var n=this.value;t*=4,n[e*=4]=n[t],n[e+1]=n[t+1],n[e+2]=n[t+2],n[e+3]=n[t+3]}}}function v(e,t,n,i,r){this.name=e,this.type=t,this.buffer=n,this.size=i,this.semantic=r,this.symbol="",this.needsRemove=!1}function y(e){this.buffer=e,this.count=0}_.prototype.init=function(e){if(!this.value||this.value.length!=e*this.size){var t=m(this.type);this.value=new t(e*this.size)}},_.prototype.fromArray=function(e){var t,n=m(this.type);if(e[0]&&e[0].length){var i=0,r=this.size;t=new n(e.length*r);for(var a=0;a<e.length;a++)for(var s=0;s<r;s++)t[i++]=e[a][s]}else t=new n(e);this.value=t},_.prototype.clone=function(e){var t=new _(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var b=i.a.extend((function(){return{attributes:{position:new _("position","float",3,"POSITION"),texcoord0:new _("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new _("texcoord1","float",2,"TEXCOORD_1"),normal:new _("normal","float",3,"NORMAL"),tangent:new _("tangent","float",4,"TANGENT"),color:new _("color","float",4,"COLOR"),weight:new _("weight","float",3,"WEIGHT"),joint:new _("joint","float",4,"JOINT"),barycentric:new _("barycentric","float",3,null)},boundingBox:null,indices:null,dynamic:!0,_enabledAttributes:null}}),(function(){this._cache=new a.a,this._attributeList=Object.keys(this.attributes)}),{mainAttribute:"position",pick:null,pickByRay:null,updateBoundingBox:function(){var e=this.boundingBox;e||(e=this.boundingBox=new u.a);var t=this.attributes.position.value;if(t&&t.length){var n=e.min,i=e.max,r=n.array,a=i.array;c.set(r,t[0],t[1],t[2]),c.set(a,t[0],t[1],t[2]);for(var s=3;s<t.length;){var o=t[s++],l=t[s++],h=t[s++];o<r[0]&&(r[0]=o),l<r[1]&&(r[1]=l),h<r[2]&&(r[2]=h),o>a[0]&&(a[0]=o),l>a[1]&&(a[1]=l),h>a[2]&&(a[2]=h)}n._dirty=!0,i._dirty=!0}},dirty:function(){for(var e=this.getEnabledAttributes(),t=0;t<e.length;t++)this.dirtyAttribute(e[t]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(e){this._cache.dirtyAll(g(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&e>=0){t||(t=d());var n=this.indices;return t[0]=n[3*e],t[1]=n[3*e+1],t[2]=n[3*e+2],t}},setTriangleIndices:function(e,t){var n=this.indices;n[3*e]=t[0],n[3*e+1]=t[1],n[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,n=this.vertexCount>65535?s.a.Uint32Array:s.a.Uint16Array;if(e[0]&&e[0].length){var i=0;t=new n(3*e.length);for(var r=0;r<e.length;r++)for(var a=0;a<3;a++)t[i++]=e[r][a]}else t=new n(e);this.indices=t},createAttribute:function(e,t,n,i){var r=new _(e,t,n,i);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=r,this._attributeList.push(e),r},removeAttribute:function(e){var t=this._attributeList,n=t.indexOf(e);return n>=0&&(t.splice(n,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var n=[],i=this.vertexCount,r=0;r<t.length;r++){var a=t[r],s=this.attributes[a];s.value&&s.value.length===i*s.size&&n.push(a)}return this._enabledAttributes=n,n},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var n=t.isDirty("attributes"),i=t.isDirty("indices");if(n||i){this._updateBuffer(e.gl,n,i);for(var r=this.getEnabledAttributes(),a=0;a<r.length;a++)t.fresh(g(r[a]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,n){var i=this._cache,a=i.get("chunks"),s=!1;a||((a=[])[0]={attributeBuffers:[],indicesBuffer:null},i.put("chunks",a),s=!0);var o=a[0],l=o.attributeBuffers,u=o.indicesBuffer;if(t||s){var c=this.getEnabledAttributes(),h={};if(!s)for(var d=0;d<l.length;d++)h[l[d].name]=l[d];for(var f=0;f<c.length;f++){var p,m,_=c[f],b=this.attributes[_];s||(p=h[_]),m=p?p.buffer:e.createBuffer(),i.isDirty(g(_))&&(e.bindBuffer(e.ARRAY_BUFFER,m),e.bufferData(e.ARRAY_BUFFER,b.value,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW)),l[f]=new v(_,b.type,m,b.size,b.semantic)}for(d=f;d<l.length;d++)e.deleteBuffer(l[d].buffer);l.length=f}this.isUseIndices()&&(n||s)&&(u||(u=new y(e.createBuffer()),o.indicesBuffer=u),u.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,u.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW))},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,n=t.position.value,i=t.normal.value;if(i&&i.length===n.length)for(var r=0;r<i.length;r++)i[r]=0;else i=t.normal.value=new s.a.Float32Array(n.length);for(var a,o,l,u=d(),h=d(),f=d(),m=d(),g=d(),_=d(),v=e?e.length:this.vertexCount,y=0;y<v;)for(e?(a=e[y++],o=e[y++],l=e[y++]):(a=y++,o=y++,l=y++),p(u,n[3*a],n[3*a+1],n[3*a+2]),p(h,n[3*o],n[3*o+1],n[3*o+2]),p(f,n[3*l],n[3*l+1],n[3*l+2]),c.sub(m,u,h),c.sub(g,h,f),c.cross(_,m,g),r=0;r<3;r++)i[3*a+r]=i[3*a+r]+_[r],i[3*o+r]=i[3*o+r]+_[r],i[3*l+r]=i[3*l+r]+_[r];for(r=0;r<i.length;)p(_,i[r],i[r+1],i[r+2]),c.normalize(_,_),i[r++]=_[0],i[r++]=_[1],i[r++]=_[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.indices,t=this.attributes,n=t.position.value,i=t.normal.value,r=d(),a=d(),s=d(),o=d(),l=d(),u=d();i||(i=t.normal.value=new Float32Array(n.length));for(var h,f,m,g=e?e.length:this.vertexCount,_=0;_<g;){e?(h=e[_++],f=e[_++],m=e[_++]):(h=_++,f=_++,m=_++),p(r,n[3*h],n[3*h+1],n[3*h+2]),p(a,n[3*f],n[3*f+1],n[3*f+2]),p(s,n[3*m],n[3*m+1],n[3*m+2]),c.sub(o,r,a),c.sub(l,a,s),c.cross(u,o,l),c.normalize(u,u);for(var v=0;v<3;v++)i[3*h+v]=u[v],i[3*f+v]=u[v],i[3*m+v]=u[v]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var e=this.vertexCount,t=this.attributes;t.tangent.value||(t.tangent.value=new Float32Array(4*e));var n=t.texcoord0.value,i=t.position.value,r=t.tangent.value,a=t.normal.value;if(n){for(var s=[],o=[],l=0;l<e;l++)s[l]=[0,0,0],o[l]=[0,0,0];var u,h,p,m=[0,0,0],g=[0,0,0],_=this.indices,v=_?_.length:this.vertexCount;for(l=0;l<v;){_?(u=_[l++],h=_[l++],p=_[l++]):(u=l++,h=l++,p=l++);var y=n[2*u],b=n[2*h],x=n[2*p],E=n[2*u+1],w=n[2*h+1],T=n[2*p+1],S=i[3*u],A=i[3*h],C=i[3*p],L=i[3*u+1],R=i[3*h+1],I=i[3*p+1],D=i[3*u+2],k=A-S,M=C-S,P=R-L,O=I-L,N=i[3*h+2]-D,F=i[3*p+2]-D,B=b-y,U=x-y,G=w-E,z=T-E,j=1/(B*z-G*U);m[0]=(z*k-G*M)*j,m[1]=(z*P-G*O)*j,m[2]=(z*N-G*F)*j,g[0]=(B*M-U*k)*j,g[1]=(B*O-U*P)*j,g[2]=(B*F-U*N)*j,f(s[u],s[u],m),f(s[h],s[h],m),f(s[p],s[p],m),f(o[u],o[u],g),f(o[h],o[h],g),f(o[p],o[p],g)}var H=d(),V=d(),W=d();for(l=0;l<e;l++){W[0]=a[3*l],W[1]=a[3*l+1],W[2]=a[3*l+2];var Z=s[l];c.scale(H,W,c.dot(W,Z)),c.sub(H,Z,H),c.normalize(H,H),c.cross(V,W,Z),r[4*l]=H[0],r[4*l+1]=H[1],r[4*l+2]=H[2],r[4*l+3]=c.dot(V,o[l])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new s.a.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,n=this.getEnabledAttributes(),i={},r=0;r<n.length;r++)i[u=n[r]]=e[u].value,e[u].init(this.indices.length);for(var a=0,o=0;o<t.length;o++){var l=t[o];for(r=0;r<n.length;r++)for(var u,c=e[u=n[r]].value,h=e[u].size,d=0;d<h;d++)c[a*h+d]=i[u][l*h+d];t[o]=a,a++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,n=this.indices;if(!t||t.length!==3*n.length){t=e.barycentric.value=new Float32Array(3*n.length);for(var i=0;i<(n?n.length:this.vertexCount/3);)for(var r=0;r<3;r++)t[3*(n?n[i++]:3*i+r)+r]=1;this.dirty()}}},applyTransform:function(e){var t=this.attributes,n=t.position.value,i=t.normal.value,r=t.tangent.value;e=e.array;var a=h.create();h.invert(a,e),h.transpose(a,a);var s=c.transformMat4,o=c.forEach;o(n,3,0,null,s,e),i&&o(i,3,0,null,s,a),r&&o(r,4,0,null,s,a),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var n=t.get("chunks");if(n)for(var i=0;i<n.length;i++){for(var r=n[i],a=0;a<r.attributeBuffers.length;a++){var s=r.attributeBuffers[a];e.gl.deleteBuffer(s.buffer)}r.indicesBuffer&&e.gl.deleteBuffer(r.indicesBuffer.buffer)}t.deleteContext(e.__uid__)}});Object.defineProperty&&(Object.defineProperty(b.prototype,"vertexCount",{enumerable:!1,get:function(){var e=this.attributes[this.mainAttribute];return e&&e.value?e.value.length/e.size:0}}),Object.defineProperty(b.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),b.STATIC_DRAW=r.a.STATIC_DRAW,b.DYNAMIC_DRAW=r.a.DYNAMIC_DRAW,b.STREAM_DRAW=r.a.STREAM_DRAW,b.AttributeBuffer=v,b.IndicesBuffer=y,b.Attribute=_,t.a=b},function(e,t,n){"use strict";var i=n(8),r=n(30),a=n(37),s=n(7),o=n(17),l=n(24),u=n(11),c=n(109);s.a.import(c.a);var h=new a.a,d=new l.a({geometry:h,frustumCulling:!1}),f=new r.a,p=i.a.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new s.a(s.a.source("clay.compositor.vertex"),this.fragment),t=new o.a({shader:e});t.enableTexturesAll(),this.material=t}),{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||u.a.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var n in this.outputs){var i=this.outputs[n];i&&t.attach(i,n)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var n=e.gl;if(t){this.bind(e,t);var i=e.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var r=[];for(var a in this.outputs)(a=+a)>=n.COLOR_ATTACHMENT0&&a<=n.COLOR_ATTACHMENT0+8&&r.push(a);i.drawBuffersEXT(r)}}this.trigger("beforerender",this,e);var s=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){s|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var o=this.clearColor;Array.isArray(o)&&n.clearColor(o[0],o[1],o[2],o[3])}n.clear(s),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){d.material=this.material,e.renderPass([d],f)},dispose:function(e){}});t.a=p},function(e,t,n){"use strict";var i,r,a,s,o,l,u=n(4),c=n(1),h=n.n(c).a.vec3,d=h.copy,f=h.set,p=function(e,t){this.min=e||new u.a(1/0,1/0,1/0),this.max=t||new u.a(-1/0,-1/0,-1/0)};p.prototype={constructor:p,updateFromVertices:function(e){if(e.length>0){var t=this.min,n=this.max,i=t.array,r=n.array;d(i,e[0]),d(r,e[0]);for(var a=1;a<e.length;a++){var s=e[a];s[0]<i[0]&&(i[0]=s[0]),s[1]<i[1]&&(i[1]=s[1]),s[2]<i[2]&&(i[2]=s[2]),s[0]>r[0]&&(r[0]=s[0]),s[1]>r[1]&&(r[1]=s[1]),s[2]>r[2]&&(r[2]=s[2])}t._dirty=!0,n._dirty=!0}},union:function(e){var t=this.min,n=this.max;return h.min(t.array,t.array,e.min.array),h.max(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersection:function(e){var t=this.min,n=this.max;return h.max(t.array,t.array,e.min.array),h.min(n.array,n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,n=this.max.array,i=e.min.array,r=e.max.array;return!(t[0]>r[0]||t[1]>r[1]||t[2]>r[2]||n[0]<i[0]||n[1]<i[1]||n[2]<i[2])},containBoundingBox:function(e){var t=this.min.array,n=this.max.array,i=e.min.array,r=e.max.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&n[0]>=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},containPoint:function(e){var t=this.min.array,n=this.max.array,i=e.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:(i=h.create(),r=h.create(),a=h.create(),s=h.create(),o=h.create(),l=h.create(),function(e){var t=this.min.array,n=this.max.array,u=e.array;return i[0]=u[0]*t[0],i[1]=u[1]*t[0],i[2]=u[2]*t[0],r[0]=u[0]*n[0],r[1]=u[1]*n[0],r[2]=u[2]*n[0],a[0]=u[4]*t[1],a[1]=u[5]*t[1],a[2]=u[6]*t[1],s[0]=u[4]*n[1],s[1]=u[5]*n[1],s[2]=u[6]*n[1],o[0]=u[8]*t[2],o[1]=u[9]*t[2],o[2]=u[10]*t[2],l[0]=u[8]*n[2],l[1]=u[9]*n[2],l[2]=u[10]*n[2],t[0]=Math.min(i[0],r[0])+Math.min(a[0],s[0])+Math.min(o[0],l[0])+u[12],t[1]=Math.min(i[1],r[1])+Math.min(a[1],s[1])+Math.min(o[1],l[1])+u[13],t[2]=Math.min(i[2],r[2])+Math.min(a[2],s[2])+Math.min(o[2],l[2])+u[14],n[0]=Math.max(i[0],r[0])+Math.max(a[0],s[0])+Math.max(o[0],l[0])+u[12],n[1]=Math.max(i[1],r[1])+Math.max(a[1],s[1])+Math.max(o[1],l[1])+u[13],n[2]=Math.max(i[2],r[2])+Math.max(a[2],s[2])+Math.max(o[2],l[2])+u[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,n=this.max.array,i=e.array,r=t[0],a=t[1],s=t[2],o=n[0],l=n[1],u=t[2],c=n[0],h=n[1],d=n[2];if(1===i[15])t[0]=i[0]*r+i[12],t[1]=i[5]*a+i[13],n[2]=i[10]*s+i[14],n[0]=i[0]*c+i[12],n[1]=i[5]*h+i[13],t[2]=i[10]*d+i[14];else{var f=-1/s;t[0]=i[0]*r*f,t[1]=i[5]*a*f,n[2]=(i[10]*s+i[14])*f,f=-1/u,n[0]=i[0]*o*f,n[1]=i[5]*l*f,f=-1/d,t[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){if(!(e=this.vertices)){for(var e=[],t=0;t<8;t++)e[t]=h.fromValues(0,0,0);this.vertices=e}var n=this.min.array,i=this.max.array;return f(e[0],n[0],n[1],n[2]),f(e[1],n[0],i[1],n[2]),f(e[2],i[0],n[1],n[2]),f(e[3],i[0],i[1],n[2]),f(e[4],n[0],n[1],i[2]),f(e[5],n[0],i[1],i[2]),f(e[6],i[0],n[1],i[2]),f(e[7],i[0],i[1],i[2]),this},copy:function(e){var t=this.min,n=this.max;return d(t.array,e.min.array),d(n.array,e.max.array),t._dirty=!0,n._dirty=!0,this},clone:function(){var e=new p;return e.copy(this),e}},t.a=p},function(e,t,n){"use strict";t.a=function(e,t,n){return{seriesType:e,reset:function(e,t){var n=e.getData(),i=e.visualColorAccessPath.split(".");i[i.length-1]="opacity";var r=e.get(i);return n.setVisual("opacity",null==r?1:r),{dataEach:n.hasItemOption?function(e){var t=n.getItemModel(e).get(i);null!=t&&n.setItemVisual(e,"opacity",t)}:null}}}}},function(e,t,n){"use strict";var i=n(8),r=n(6),a=n(21),s=n(93).a.parseToFloat,o={};function l(e,t,n){var i=Object.keys(e);i.sort();for(var r=[],a=0;a<i.length;a++){var s=i[a],o=e[s];null===o?r.push(s):r.push(s+" "+o.toString())}return r.join("\n")}var u=i.a.extend((function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}}),(function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)}),{precision:"highp",bind:function(e,t,n,i){for(var a=e.gl,s=t.currentTextureSlot(),o=0;o<this._enabledUniforms.length;o++){var l=this._enabledUniforms[o];if((c=this.uniforms[l].value)instanceof r.a)c.__slot=-1;else if(Array.isArray(c))for(var u=0;u<c.length;u++)c[u]instanceof r.a&&(c[u].__slot=-1)}for(o=0;o<this._enabledUniforms.length;o++){l=this._enabledUniforms[o];var c,h=this.uniforms[l];if(null!==(c=h.value))if(c instanceof r.a)if(c.__slot<0){if(p=t.currentTextureSlot(),!t.setUniform(a,"1i",l,p))continue;t.takeCurrentTextureSlot(e,c),c.__slot=p}else t.setUniform(a,"1i",l,c.__slot);else if(Array.isArray(c)){if(0===c.length)continue;if(c[0]instanceof r.a){if(!t.hasUniform(l))continue;var d=[];for(u=0;u<c.length;u++){var f=c[u];f.__slot<0?(p=t.currentTextureSlot(),d.push(p),t.takeCurrentTextureSlot(e,f),f.__slot=p):d.push(f.__slot)}t.setUniform(a,"1iv",l,d)}else t.setUniform(a,h.type,l,c)}else t.setUniform(a,h.type,l,c);else if("t"===h.type){var p=t.currentTextureSlot();t.setUniform(a,"1i",l,p)&&t.takeCurrentTextureSlot(e,null)}}t.resetTextureSlot(s)},setUniform:function(e,t){void 0===t&&console.warn('Uniform value "'+e+'" is undefined');var n=this.uniforms[e];n&&("string"==typeof t&&(t=s(t)||t),n.value=t,this.autoUpdateTextureStatus&&"t"===n.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var n=e[t];this.setUniform(t,n)}},isUniformEnabled:function(e){return this._enabledUniforms.indexOf(e)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==typeof e)for(var n in e){var i=e[n];this.setUniform(n,i)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var n=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var r=this.vertexDefines,s=this.fragmentDefines;if(this.vertexDefines=a.a.clone(e.vertexDefines),this.fragmentDefines=a.a.clone(e.fragmentDefines),t){for(var o in n)i[o]&&(i[o].value=n[o].value);a.a.defaults(this.vertexDefines,r),a.a.defaults(this.fragmentDefines,s)}var l={};for(var u in e.textures)l[u]={shaderType:e.textures[u].shaderType,type:e.textures[u].type,enabled:!(!t||!this._textureStatus[u])&&this._textureStatus[u].enabled};this._textureStatus=l,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=a.a.clone(this.vertexDefines),e.fragmentDefines=a.a.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,n){var i=this.vertexDefines,r=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(n=t,t=e,e="both"),n=null!=n?n:null,"vertex"!==e&&"both"!==e||i[t]!==n&&(i[t]=n,this._programKey=""),"fragment"!==e&&"both"!==e||r[t]!==n&&(r[t]=n,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.enableTexture(e[t]);else{var n=this._textureStatus[e];n&&(n.enabled||(n.enabled=!0,this._programKey=""))}},enableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!0;this._programKey=""},disableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.disableTexture(e[t]);else{var n=this._textureStatus[e];n&&(!n.enabled||(n.enabled=!1,this._programKey=""))}},disableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!1;this._programKey=""},isTextureEnabled:function(e){var t=this._textureStatus;return!!t[e]&&t[e].enabled},getEnabledTextures:function(){var e=[],t=this._textureStatus;for(var n in t)t[n].enabled&&e.push(n);return e},dirtyDefines:function(){this._programKey=""}});Object.defineProperty&&(Object.defineProperty(u.prototype,"shader",{get:function(){return this._shader||null},set:function(e){this._shader=e}}),Object.defineProperty(u.prototype,"programKey",{get:function(){return this._programKey||(this._programKey=function(e,t,n){n.sort();for(var i=[],r=0;r<n.length;r++){var s=n[r];i.push(s)}var u=l(e)+"\n"+l(t)+"\n"+i.join("\n");if(o[u])return o[u];var c=a.a.genGUID();return o[u]=c,c}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}})),t.a=u},function(e,t,n){"use strict";var i=!0;try{var r=document.createElement("canvas");if(!r.getContext("webgl")&&!r.getContext("experimental-webgl"))throw new Error}catch(e){i=!1}var a={supportWebGL:function(){return i}};a.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,a.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,a.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,a.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,a.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,a.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,a.Float64Array="undefined"==typeof Float64Array?Array:Float64Array,t.a=a},function(e,t,n){"use strict";var i=n(28),r=i.a.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var e=i.a.prototype.clone.call(this);return e.color=Array.prototype.slice.call(this.color),e.intensity=this.intensity,e.castShadow=this.castShadow,e.shadowResolution=this.shadowResolution,e}});t.a=r},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(29),s=n(152),o=n(36),l=n(30),u=n(9),c=n(4),h=n(23),d=n(47),f=n(155),p=n(182),m=n(43);function g(e){e=e||"perspective",this.layer=null,this.scene=new a.a,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new f.a,this._temporalSS=new p.a,this._shadowMapPass=new s.a;for(var t=[],n=0,i=0;i<30;i++){for(var r=[],o=0;o<6;o++)r.push(4*Object(m.a)(n,2)-2),r.push(4*Object(m.a)(n,3)-2),n++;t.push(r)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n)}),this)}g.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof o.a||(this.camera=new o.a,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof l.a||(this.camera=new l.a,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},g.prototype.setViewport=function(e,t,n,i,r){this.camera instanceof o.a&&(this.camera.aspect=n/i),r=r||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=n,this.viewport.height=i,this.viewport.devicePixelRatio=r,this._compositor.resize(n*r,i*r),this._temporalSS.resize(n*r,i*r)},g.prototype.containPoint=function(e,t){var n=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=n.x&&t>=n.y&&e<=n.x+n.width&&t<=n.y+n.height};var _=new h.a;g.prototype.castRay=function(e,t,n){var i=this.layer.renderer,r=i.viewport;return i.viewport=this.viewport,i.screenToNDC(e,t,_),this.camera.castRay(_,n),i.viewport=r,n},g.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this._needsSortProgressively=!1;for(var e=0;e<this.scene.transparentList.length;e++){var t=this.scene.transparentList[e].geometry;t.needsSortVerticesProgressively&&t.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),t.needsSortTrianglesProgressively&&t.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},g.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},g.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},g.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"==e&&(e=this._enablePostEffect),e},g.prototype.hasDOF=function(){return this._enableDOF},g.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},g.prototype._doRender=function(e,t,n){var i,r=this.scene,a=this.camera;n=n||0,this._updateTransparent(e,r,a,n),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,r,a,!0)),this._updateShadowPCFKernel(n),e.gl.clearColor(0,0,0,0),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,a),this._compositor.updateNormal(e,r,a,this._temporalSS.getFrame())),this._updateSSAO(e,r,a,this._temporalSS.getFrame()),this._enablePostEffect?((i=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(r,a,!0,!0),i.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,a,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,a,null,0))):this.needsTemporalSS()&&t?((i=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(r,a,!0,!0),e.restoreClear(),i.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(r,a,!0,!0))},g.prototype._updateTransparent=function(e,t,n,i){for(var r=new c.a,a=new u.a,s=n.getWorldPosition(),o=0;o<t.transparentList.length;o++){var l=t.transparentList[o],h=l.geometry;u.a.invert(a,l.worldTransform),c.a.transformMat4(r,s,a),h.needsSortTriangles&&h.needsSortTriangles()&&h.doSortTriangles(r,i),h.needsSortVertices&&h.needsSortVertices()&&h.doSortVertices(r,i)}},g.prototype._updateSSAO=function(e,t,n,i){var r=this._enableSSAO&&this._enablePostEffect;r&&this._compositor.updateSSAO(e,t,n,this._temporalSS.getFrame());for(var a=0;a<t.opaqueList.length;a++){var s=t.opaqueList[a];s.renderNormal&&s.material[r?"enableTexture":"disableTexture"]("ssaoMap"),r&&s.material.set("ssaoMap",this._compositor.getSSAOTexture())}},g.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],n=this.scene.opaqueList,i=0;i<n.length;i++)n[i].receiveShadow&&(n[i].material.set("pcfKernel",t),n[i].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},g.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},g.prototype.setPostEffect=function(e,t){var n=this._compositor;this._enablePostEffect=e.get("enable");var i=e.getModel("bloom"),r=e.getModel("edge"),a=e.getModel("DOF",e.getModel("depthOfField")),s=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),o=e.getModel("SSR",e.getModel("screenSpaceReflection")),l=e.getModel("FXAA"),u=e.getModel("colorCorrection");i.get("enable")?n.enableBloom():n.disableBloom(),a.get("enable")?n.enableDOF():n.disableDOF(),o.get("enable")?n.enableSSR():n.disableSSR(),u.get("enable")?n.enableColorCorrection():n.disableColorCorrection(),r.get("enable")?n.enableEdge():n.disableEdge(),l.get("enable")?n.enableFXAA():n.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=s.get("enable"),this._enableSSAO?n.enableSSAO():n.disableSSAO(),n.setBloomIntensity(i.get("intensity")),n.setEdgeColor(r.get("color")),n.setColorLookupTexture(u.get("lookupTexture"),t),n.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(e){n.setSSAOParameter(e,s.get(e))})),["quality","maxRoughness"].forEach((function(e){n.setSSRParameter(e,o.get(e))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(e){n.setDOFParameter(e,a.get(e))})),["brightness","contrast","saturation"].forEach((function(e){n.setColorCorrection(e,u.get(e))}))},g.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},g.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},g.prototype.isLinearSpace=function(){return this._enablePostEffect},g.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),n=0;n<t.length;n++)e.add(t[n]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},g.prototype.add=function(e){this.rootNode.add(e)},g.prototype.remove=function(e){this.rootNode.remove(e)},g.prototype.removeAll=function(e){this.rootNode.removeAll(e)},r.a.util.extend(g.prototype,d.a),t.a=g},function(e,t,n){"use strict";var i=0,r=Array.prototype.forEach,a={genGUID:function(){return++i},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var n=e.split("/"),i=t.split("/"),r=n[0];"."===r||".."===r;)".."===r&&i.pop(),n.shift(),r=n[0];return i.join("/")+"/"+n.join("/")},extend:function(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},extendWithPropList:function(e,t,n){if(t)for(var i=0;i<n.length;i++){var r=n[i];e[r]=t[r]}return e},defaultsWithPropList:function(e,t,n){if(t)for(var i=0;i<n.length;i++){var r=n[i];null==e[r]&&(e[r]=t[r])}return e},each:function(e,t,n){if(e&&t)if(e.forEach&&e.forEach===r)e.forEach(t,n);else if(e.length===+e.length)for(var i=0,a=e.length;i<a;i++)t.call(n,e[i],i,e);else for(var s in e)e.hasOwnProperty(s)&&t.call(n,e[s],s,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(a.isObject(e)){if(a.isArray(e))return e.slice();if(a.isArrayLike(e)){for(var t=new e.constructor(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}return a.extend({},e)}return e}};t.a=a},function(e,t,n){"use strict";var i=n(13),r=n(0),a=n.n(r),s=n(33),o=n(1),l=n.n(o).a.vec3,u=[[0,0],[1,1]],c=i.a.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new i.a.Attribute("position","float",3,"POSITION"),positionPrev:new i.a.Attribute("positionPrev","float",3),positionNext:new i.a.Attribute("positionNext","float",3),prevPositionPrev:new i.a.Attribute("prevPositionPrev","float",3),prevPosition:new i.a.Attribute("prevPosition","float",3),prevPositionNext:new i.a.Attribute("prevPositionNext","float",3),offset:new i.a.Attribute("offset","float",1),color:new i.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,i){return 1/(l.dist(e,t)+l.dist(n,t)+l.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,i){var r=this._getCubicCurveApproxStep(e,t,n,i),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,n,i){var r=this._getCubicCurveApproxStep(e,t,n,i),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(u)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(u)},getPolylineVertexCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3,this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3,this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,n,i,r,a){null==a&&(a=1);var s=e[0],o=e[1],l=e[2],u=t[0],c=t[1],h=t[2],d=n[0],f=n[1],p=n[2],m=i[0],g=i[1],_=i[2],v=this._getCubicCurveApproxStep(e,t,n,i),y=v*v,b=y*v,x=3*v,E=3*y,w=6*y,T=6*b,S=s-2*u+d,A=o-2*c+f,C=l-2*h+p,L=3*(u-d)-s+m,R=3*(c-f)-o+g,I=3*(h-p)-l+_,D=s,k=o,M=l,P=(u-s)*x+S*E+L*b,O=(c-o)*x+A*E+R*b,N=(h-l)*x+C*E+I*b,F=S*w+L*T,B=A*w+R*T,U=C*w+I*T,G=L*T,z=R*T,j=I*T,H=0,V=0,W=Math.ceil(1/v),Z=new Float32Array(3*(W+1)),K=(Z=[],0);for(V=0;V<W+1;V++)Z[K++]=D,Z[K++]=k,Z[K++]=M,D+=P,k+=O,M+=N,P+=F,O+=B,N+=U,F+=G,B+=z,U+=j,(H+=v)>1&&(D=P>0?Math.min(D,m):Math.max(D,m),k=O>0?Math.min(k,g):Math.max(k,g),M=N>0?Math.min(M,_):Math.max(M,_));return this.addPolyline(Z,r,a)},addLine:function(e,t,n,i){return this.addPolyline([e,t],n,i)},addPolyline:function(e,t,n,i,r){if(e.length){var a="number"!=typeof e[0];if(null==r&&(r=a?e.length:e.length/3),!(r<2)){null==i&&(i=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var s,o,l=(a="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===r,u=this.attributes.position,c=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,m=this._vertexOffset;n=Math.max(n,.01);for(var g=i;g<r;g++){if(a)s=e[g],o=l?t[g]:t;else{var _=3*g;if((s=s||[])[0]=e[_],s[1]=e[_+1],s[2]=e[_+2],l){var v=4*g;(o=o||[])[0]=t[v],o[1]=t[v+1],o[2]=t[v+2],o[3]=t[v+3]}else o=t}if(this.useNativeLine?g>1&&(u.copy(m,m-1),d.copy(m,m-1),m++):(g<r-1&&(c.set(m+2,s),c.set(m+3,s)),g>0&&(h.set(m-2,s),h.set(m-1,s)),u.set(m,s),u.set(m+1,s),d.set(m,o),d.set(m+1,o),f.set(m,n/2),f.set(m+1,-n/2),m+=2),this.useNativeLine)d.set(m,o),u.set(m,s),m++;else if(g>0){var y=3*this._triangleOffset;(p=this.indices)[y]=m-4,p[y+1]=m-3,p[y+2]=m-2,p[y+3]=m-3,p[y+4]=m-1,p[y+5]=m-2,this._triangleOffset+=2}}if(!this.useNativeLine){var b=this._vertexOffset,x=this._vertexOffset+2*r;c.copy(b,b+2),c.copy(b+1,b+3),h.copy(x-1,x-3),h.copy(x-2,x-4)}return this._vertexOffset=m,this._vertexOffset}}},setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],i=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,r=n;r<i;r++)this.attributes.color.set(r,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});a.a.util.defaults(c.prototype,s.a),t.a=c},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.vec2,a=function(e,t){e=e||0,t=t||0,this.array=r.fromValues(e,t),this._dirty=!0};if(a.prototype={constructor:a,add:function(e){return r.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t){return this.array[0]=e,this.array[1]=t,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this._dirty=!0,this},clone:function(){return new a(this.x,this.y)},copy:function(e){return r.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return r.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return r.dist(this.array,e.array)},distance:function(e){return r.distance(this.array,e.array)},div:function(e){return r.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return r.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return r.dot(this.array,e.array)},len:function(){return r.len(this.array)},length:function(){return r.length(this.array)},lerp:function(e,t,n){return r.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return r.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return r.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return r.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return r.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return r.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return r.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return r.random(this.array,e),this._dirty=!0,this},scale:function(e){return r.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return r.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return r.sqrDist(this.array,e.array)},squaredDistance:function(e){return r.squaredDistance(this.array,e.array)},sqrLen:function(){return r.sqrLen(this.array)},squaredLength:function(){return r.squaredLength(this.array)},sub:function(e){return r.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return r.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return r.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return r.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return r.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return r.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var s=a.prototype;Object.defineProperty(s,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty(s,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}})}a.add=function(e,t,n){return r.add(e.array,t.array,n.array),e._dirty=!0,e},a.set=function(e,t,n){return r.set(e.array,t,n),e._dirty=!0,e},a.copy=function(e,t){return r.copy(e.array,t.array),e._dirty=!0,e},a.cross=function(e,t,n){return r.cross(e.array,t.array,n.array),e._dirty=!0,e},a.distance=a.dist=function(e,t){return r.distance(e.array,t.array)},a.divide=a.div=function(e,t,n){return r.divide(e.array,t.array,n.array),e._dirty=!0,e},a.dot=function(e,t){return r.dot(e.array,t.array)},a.len=function(e){return r.length(e.array)},a.lerp=function(e,t,n,i){return r.lerp(e.array,t.array,n.array,i),e._dirty=!0,e},a.min=function(e,t,n){return r.min(e.array,t.array,n.array),e._dirty=!0,e},a.max=function(e,t,n){return r.max(e.array,t.array,n.array),e._dirty=!0,e},a.multiply=a.mul=function(e,t,n){return r.multiply(e.array,t.array,n.array),e._dirty=!0,e},a.negate=function(e,t){return r.negate(e.array,t.array),e._dirty=!0,e},a.normalize=function(e,t){return r.normalize(e.array,t.array),e._dirty=!0,e},a.random=function(e,t){return r.random(e.array,t),e._dirty=!0,e},a.scale=function(e,t,n){return r.scale(e.array,t.array,n),e._dirty=!0,e},a.scaleAndAdd=function(e,t,n,i){return r.scaleAndAdd(e.array,t.array,n.array,i),e._dirty=!0,e},a.squaredDistance=a.sqrDist=function(e,t){return r.sqrDist(e.array,t.array)},a.squaredLength=a.sqrLen=function(e){return r.sqrLen(e.array)},a.subtract=a.sub=function(e,t,n){return r.subtract(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat2=function(e,t,n){return r.transformMat2(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat2d=function(e,t,n){return r.transformMat2d(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat3=function(e,t,n){return r.transformMat3(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat4=function(e,t,n){return r.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},t.a=a},function(e,t,n){"use strict";var i=n(64),r=n(11),a=n(5),s=i.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},(function(){this.joints||(this.joints=[])}),{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},render:function(e,t,n){var r=e.gl;if(this.skeleton){this.skeleton.update();var a=this.skeleton.getSubSkinMatrices(this.__uid__,this.joints);n.setUniformOfSemantic(r,"SKIN_MATRIX",a)}return i.a.prototype.render.call(this,e,t,n)},getSkinMatricesTexture:function(){return this._skinMatricesTexture=this._skinMatricesTexture||new a.a({type:r.a.FLOAT,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST,useMipmap:!1,flipY:!1}),this._skinMatricesTexture}});s.POINTS=r.a.POINTS,s.LINES=r.a.LINES,s.LINE_LOOP=r.a.LINE_LOOP,s.LINE_STRIP=r.a.LINE_STRIP,s.TRIANGLES=r.a.TRIANGLES,s.TRIANGLE_STRIP=r.a.TRIANGLE_STRIP,s.TRIANGLE_FAN=r.a.TRIANGLE_FAN,s.BACK=r.a.BACK,s.FRONT=r.a.FRONT,s.FRONT_AND_BACK=r.a.FRONT_AND_BACK,s.CW=r.a.CW,s.CCW=r.a.CCW,t.a=s},function(e,t,n){"use strict";var i=n(6),r=n(11),a=n(21),s=n(66).a.isPowerOfTwo,o=["px","nx","py","ny","pz","nz"],l=i.a.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(e);var n=this.format,i=this.type;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_CUBE_MAP,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i&&(e.getGLExtension("OES_texture_half_float")||(i=r.a.FLOAT)),this.mipmaps.length)for(var s=this.width,o=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,s,o,n,i),s/=2,o/=2}else this._updateTextureData(t,this,0,this.width,this.height,n,i),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,n,i,r,a,s){for(var l=0;l<6;l++){var u=o[l],c=t.image&&t.image[u];c?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+l,n,a,a,s,c):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+l,n,a,i,r,0,a,s,t.pixels&&t.pixels[u])}},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_CUBE_MAP))},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?s(this.image.px.width)&&s(this.image.px.height):s(this.width)&&s(this.height)},isRenderable:function(){return this.image.px?u(this.image.px)&&u(this.image.nx)&&u(this.image.py)&&u(this.image.ny)&&u(this.image.pz)&&u(this.image.nz):!(!this.width||!this.height)},load:function(e,t){var n=0,i=this;return a.a.each(e,(function(e,r){var a=new Image;t&&(a.crossOrigin=t),a.onload=function(){0==--n&&(i.dirty(),i.trigger("success",i)),a.onload=null},a.onerror=function(){n--,a.onerror=null},n++,a.src=e,i.image[r]=a})),this}});function u(e){return"CANVAS"===e.nodeName||"VIDEO"===e.nodeName||e.complete}Object.defineProperty(l.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(l.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t.a=l},function(e,t,n){"use strict";t.a={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a={getFormattedLabel:function(e,t,n,i,a){n=n||"normal";var s=e.getData(i).getItemModel(t),o=e.getDataParams(t,i);null!=a&&o.value instanceof Array&&(o.value=o.value[a]);var l,u=s.get("normal"===n?["label","formatter"]:["emphasis","label","formatter"]);return null==u&&(u=s.get(["label","formatter"])),"function"==typeof u?(o.status=n,l=u(o)):"string"==typeof u&&(l=r.a.format.formatTpl(u,o)),l},normalizeToArray:function(e){return e instanceof Array?e:null==e?[]:[e]}};t.a=a},function(e,t,n){"use strict";var i,r,a,s,o=n(8),l=n(4),u=n(50),c=n(9),h=n(1),d=n.n(h),f=n(15),p=d.a.mat4,m=0,g=o.a.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+m++),this.position||(this.position=new l.a),this.rotation||(this.rotation=new u.a),this.scale||(this.scale=new l.a(1,1,1)),this.worldTransform=new c.a,this.localTransform=new c.a,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var n=t._nodeRepository;delete n[this.name],n[e]=this}this.name=e},add:function(e){this._inIterating&&console.warn("Add operation can cause unpredictable error when in iterating");var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var n=this._scene;n&&n!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){this._inIterating&&console.warn("Remove operation can cause unpredictable error when in iterating");var t=this._children,n=t.indexOf(e);n<0||(t.splice(n,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},getDescendantByName:function(e){for(var t=this._children,n=0;n<t.length;n++){var i=t[n];if(i.name===e)return i;var r=i.getDescendantByName(e);if(r)return r}},queryNode:function(e){if(e){for(var t=e.split("/"),n=this,i=0;i<t.length;i++){var r=t[i];if(r){for(var a=!1,s=n._children,o=0;o<s.length;o++){var l=s[o];if(l.name===r){n=l,a=!0;break}}if(!a)return}}return n}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,n=this.name;t._parent&&(n=t.name+"/"+n,t._parent!=e);)t=t._parent;return!t._parent&&e?null:n},traverse:function(e,t,n){this._inIterating=!0,n&&!n.call(t,this)||e.call(t,this);for(var i=this._children,r=0,a=i.length;r<a;r++)i[r].traverse(e,t,n);this._inIterating=!1},eachChild:function(e,t,n){this._inIterating=!0;for(var i=this._children,r=null==n,a=0,s=i.length;a<s;a++){var o=i[a];(r||o.constructor===n)&&e.call(t,o,a)}this._inIterating=!1},setLocalTransform:function(e){p.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){p.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(s=p.create(),function(e){var t=this.localTransform,n=this.worldTransform;this._parent?(p.invert(s,this._parent.worldTransform.array),p.multiply(t.array,s,n.array)):p.copy(t.array,n.array);var i=e?null:this.scale;t.decomposeMatrix(i,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e=this.position,t=this.rotation,n=this.scale;if(this.transformNeedsUpdate()){var i=this.localTransform.array;p.fromRotationTranslation(i,t.array,e.array),p.scale(i,i,n.array),t._dirty=!1,n._dirty=!1,e._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?p.multiplyAffine(t,this._parent.worldTransform.array,e):p.copy(t,e)},updateWorldTransform:function(){for(var e=this;e&&e.getParent()&&e.getParent().transformNeedsUpdate();)e=e.getParent();e.update()},update:function(e){this.autoUpdateLocalTransform?this.updateLocalTransform():e=!0,(e||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),e=!0,this._needsUpdateWorldTransform=!1);for(var t=this._children,n=0,i=t.length;n<i;n++)t[n].update(e)},getBoundingBox:function(){function e(e){return!e.invisible&&e.geometry}var t=new f.a,n=new c.a,i=new c.a;return function(r,a){return a=a||new f.a,r=r||e,this._parent?c.a.invert(i,this._parent.worldTransform):c.a.identity(i),this.traverse((function(e){e.geometry&&e.geometry.boundingBox&&(t.copy(e.geometry.boundingBox),c.a.multiply(n,i,e.worldTransform),t.applyTransform(n),a.union(t))}),this,e),a}}(),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var n=e.array;return n[0]=t[12],n[1]=t[13],n[2]=t[14],e}return new l.a(t[12],t[13],t[14])},clone:function(){var e=new this.constructor,t=this._children;e.setName(this.name),e.position.copy(this.position),e.rotation.copy(this.rotation),e.scale.copy(this.scale);for(var n=0;n<t.length;n++)e.add(t[n].clone());return e},rotateAround:(r=new l.a,a=new c.a,function(e,t,n){r.copy(this.position).subtract(e);var i=this.localTransform;i.identity(),i.translate(e),i.rotate(n,t),a.fromRotationTranslation(this.rotation,r),i.multiply(a),i.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}),lookAt:(i=new c.a,function(e,t){i.lookAt(this.position,e,t||this.localTransform.y).invert(),this.setLocalTransform(i),this.target=e})});t.a=g},function(e,t,n){"use strict";var i=n(28),r=n(19),a=n(51),s=n(15),o=n(21),l={};function u(e){var t=[],n=Object.keys(e);n.sort();for(var i=0;i<n.length;i++){var r=e[i];t.push(r+" "+e[r])}var a=t.join("\n");if(l[a])return l[a];var s=o.a.genGUID();return l[a]=s,s}var c=i.a.extend((function(){return{material:null,autoUpdate:!0,opaqueList:[],transparentList:[],lights:[],viewBoundingBoxLastFrame:new s.a,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_opaqueObjectCount:0,_transparentObjectCount:0,_nodeRepository:{}}}),(function(){this._scene=this}),{addToScene:function(e){e instanceof a.a&&(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){if(e instanceof a.a){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1)}e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},cloneNode:function(e){var t=e.clone(),n={},i=function(r,a){r.skeleton&&(a.skeleton=r.skeleton.clone(e,t),a.joints=r.joints.slice()),r.material&&(n[r.material.__uid__]={oldMat:r.material});for(var s=0;s<r._children.length;s++)i(r._children[s],a._children[s])};for(var r in i(e,t),n)n[r].newMat=n[r].oldMat.clone();return t.traverse((function(e){e.material&&(e.material=n[e.material.__uid__].newMat)})),t},update:function(e,t){if(this.autoUpdate||e){i.a.prototype.update.call(this,e);var n=this.lights,r=this.material&&this.material.transparent;if(this._opaqueObjectCount=0,this._transparentObjectCount=0,n.length=0,this._updateRenderList(this,r),this.opaqueList.length=this._opaqueObjectCount,this.transparentList.length=this._transparentObjectCount,!t){this._previousLightNumber=this._lightNumber;for(var a={},s=0;s<n.length;s++){var o=n[s],l=o.group;a[l]||(a[l]={}),a[l][o.type]=a[l][o.type]||0,a[l][o.type]++}for(var c in this._lightNumber=a,a)this._lightProgramKeys[c]=u(a[c]);this._updateLightUniforms()}}},getMainCamera:function(){return this._cameraList[0]},_updateRenderList:function(e,t){if(!e.invisible)for(var n=0;n<e._children.length;n++){var i=e._children[n];i instanceof r.a?this.lights.push(i):i.isRenderable()&&(i.material.transparent||t?this.transparentList[this._transparentObjectCount++]=i:this.opaqueList[this._opaqueObjectCount++]=i),i._children.length>0&&this._updateRenderList(i)}},_updateLightUniforms:function(){var e=this.lights;e.sort(h);var t=this._lightUniforms;for(var n in t)for(var i in t[n])t[n][i].value.length=0;for(var r=0;r<e.length;r++){var a=e[r];for(var i in n=a.group,a.uniformTemplates){var s=a.uniformTemplates[i],o=s.value(a);if(null!=o){t[n]||(t[n]={}),t[n][i]||(t[n][i]={type:"",value:[]});var l=t[n][i];switch(l.type=s.type+"v",s.type){case"1i":case"1f":case"t":l.value.push(o);break;case"2f":case"3f":case"4f":for(var u=0;u<o.length;u++)l.value.push(o[u]);break;default:console.error("Unkown light uniform type "+s.type)}}}}},getLightGroups:function(){var e=[];for(var t in this._lightNumber)e.push(t);return e},getNumberChangedLightGroups:function(){var e=[];for(var t in this._lightNumber)this.isLightNumberChanged(t)&&e.push(t);return e},isLightNumberChanged:function(e){var t=this._previousLightNumber,n=this._lightNumber;for(var i in n[e]){if(!t[e])return!0;if(n[e][i]!==t[e][i])return!0}for(var i in t[e]){if(!n[e])return!0;if(n[e][i]!==t[e][i])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(){function e(e,t,n){for(var i in e){var r=e[i];if("tv"===r.type){if(!t.hasUniform(i))continue;for(var a=[],s=0;s<r.value.length;s++){var o=r.value[s],l=t.takeCurrentTextureSlot(n,o);a.push(l)}t.setUniform(n.gl,"1iv",i,a)}else t.setUniform(n.gl,r.type,i,r.value)}}return function(t,n,i){e(this._lightUniforms[n],t,i),e(this.shadowUniforms,t,i)}}(),dispose:function(){this.material=null,this.opaqueList=[],this.transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function h(e,t){if(t.castShadow&&!e.castShadow)return!0}t.a=c},function(e,t,n){"use strict";var i=n(51),r=i.a.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=i.a.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});t.a=r},function(e,t,n){"use strict";t.a={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}}},function(e,t,n){"use strict";t.a={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}}},function(e,t,n){"use strict";t.a={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var n in t)e||!t[n].value?t[n].value=[]:t[n].value=Array.prototype.slice.call(t[n].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}}},function(e,t,n){"use strict";var i=n(2),r=n(57),a=n(56),s=n(0),o=n.n(s);function l(){}l.prototype={constructor:l,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new i.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new i.a.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,n=this.ambientLight,r=e.getModel("light"),a=r.getModel("main"),s=r.getModel("ambient");t.intensity=a.get("intensity"),n.intensity=s.get("intensity"),t.color=i.a.parseColor(a.get("color")).slice(0,3),n.color=i.a.parseColor(s.get("color")).slice(0,3);var o=a.get("alpha")||0,l=a.get("beta")||0;t.position.setArray(i.a.directionFromAlphaBeta(o,l)),t.lookAt(i.a.Vector3.ZERO),t.castShadow=a.get("shadow"),t.shadowResolution=i.a.getShadowResolution(a.get("shadowQuality"))},updateAmbientCubemap:function(e,t,n){var a=t.getModel("light.ambientCubemap"),s=a.get("texture");if(s){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[s];if(!o){var l=this;o=this._cubemapLightsCache[s]=i.a.createAmbientCubemap(a.option,e,n,(function(){l._skybox instanceof r.a&&l._skybox.setEnvironmentMap(o.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,n){var s=t.get("environment"),l=this;function u(){return l._skybox instanceof a.a||(l._skybox&&l._skybox.dispose(e),l._skybox=new a.a),l._skybox}if(s&&"none"!==s)if("auto"===s)if(this._currentCubemapLights){var c=(l._skybox instanceof r.a||(l._skybox&&l._skybox.dispose(e),l._skybox=new r.a),l._skybox),h=this._currentCubemapLights.specular.cubemap;c.setEnvironmentMap(h),this._scene&&c.attachScene(this._scene),c.material.set("lod",2)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof s&&s.colorStops||"string"==typeof s&&o.a.color.parse(s)){var d=u(),f=new i.a.Texture2D({anisotropic:8,flipY:!1});d.setEnvironmentMap(f);var p=f.image=document.createElement("canvas");p.width=p.height=16;var m=p.getContext("2d");new o.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:s}}).brush(m),d.attachScene(this._scene)}else d=u(),f=i.a.loadTexture(s,n,{anisotropic:8,flipY:!1}),d.setEnvironmentMap(f),d.attachScene(this._scene);else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var g=t.coordinateSystem;if(this._skybox)if(!g||!g.viewGL||"auto"===s||s.match&&s.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var _=g.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[_]("fragment","SRGB_DECODE")}}},t.a=l},function(e,t,n){"use strict";var i=n(0),r=n.n(i);t.a=function(e,t,n){var i=e.getData(),a=e.getRawValue(t),s=r.a.util.isArray(a)?function(e){var a=[],s=function(e,t){var n=[];return r.a.util.each(e.dimensions,(function(i){var r=e.getDimensionInfo(i),a=r.otherDims[t];null!=a&&!1!==a&&(n[a]=r.name)})),n}(i,"tooltip");function o(e,t){var s=i.getDimensionInfo(t);if(s&&!1!==s.otherDims.tooltip){var o=s.type,l="- "+(s.tooltipName||s.name)+": "+("ordinal"===o?e+"":"time"===o?n?"":r.a.format.formatTime("yyyy/MM/dd hh:mm:ss",e):r.a.format.addCommas(e));l&&a.push(r.a.format.encodeHTML(l))}}return s.length?r.a.util.each(s,(function(e){o(i.get(e,t),e)})):r.a.util.each(e,o),"<br/>"+a.join("<br/>")}(a):r.a.format.encodeHTML(r.a.format.addCommas(a)),o=i.getName(t),l=i.getItemVisual(t,"color");r.a.util.isObject(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=r.a.format.getTooltipMarker(l),c=e.name;return"\0-"===c&&(c=""),c=c?r.a.format.encodeHTML(c)+(n?": ":"<br/>"):"",n?u+c+s:c+u+(o?r.a.format.encodeHTML(o)+": "+s:s)}},function(e,t,n){"use strict";var i=n(51),r=i.a.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=i.a.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}});t.a=r},function(e,t,n){"use strict";var i=n(13),r=n(15),a=i.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,n=this.attributes,i=[],a=[],s=[],o=[],l=0;l<=e;l++)for(var u=l/e,c=0;c<=t;c++){var h=c/t;if(i.push([2*h-1,2*u-1,0]),a&&a.push([h,u]),s&&s.push([0,0,1]),c<t&&l<e){var d=c+l*(t+1);o.push([d,d+1,d+t+1]),o.push([d+t+1,d+1,d+t+2])}}n.position.fromArray(i),n.texcoord0.fromArray(a),n.normal.fromArray(s),this.initIndicesFromArray(o),this.boundingBox=new r.a,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});t.a=a},function(e,t,n){"use strict";t.a={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(e){e=e||{},this.option.viewControl=this.option.viewControl||{},null!=e.alpha&&(this.option.viewControl.alpha=e.alpha),null!=e.beta&&(this.option.viewControl.beta=e.beta),null!=e.distance&&(this.option.viewControl.distance=e.distance),null!=e.center&&(this.option.viewControl.center=e.center)}}},function(e,t,n){"use strict";var i=n(8),r=n(23),a=n(4),s=(n(50),n(3).a.firstNotNull),o={left:0,middle:1,right:2};function l(e){return e instanceof Array||(e=[e,e]),e}var u=i.a.extend((function(){return{zr:null,viewGL:null,_center:new a.a,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new r.a,_panVelocity:new r.a,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(e){this[e]=this[e].bind(this)}),this)}),{init:function(){var e=this.zr;e&&(e.on("mousedown",this._mouseDownHandler),e.on("globalout",this._mouseUpHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("pinch",this._pinchHandler),e.animation.on("frame",this._update),e.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var e=this.zr;e&&(e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("pinch",this._pinchHandler),e.off("globalout",this._mouseUpHandler),e.dom.removeEventListener("contextmenu",this._contextMenuHandler),e.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(e){this._distance=e,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(e){this._orthoSize=e,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(e){e=Math.max(Math.min(this.maxAlpha,e),this.minAlpha),this._theta=e/180*Math.PI,this._needsUpdate=!0},setBeta:function(e){e=Math.max(Math.min(this.maxBeta,e),this.minBeta),this._phi=-e/180*Math.PI,this._needsUpdate=!0},setCenter:function(e){this._center.setArray(e)},setViewGL:function(e){this.viewGL=e},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(e,t){var n=(t=t||{}).baseDistance||0,i=t.baseOrthoSize||1,r=e.get("projection");"perspective"!==r&&"orthographic"!==r&&"isometric"!==r&&(console.error("Unkown projection type %s, use perspective projection instead.",r),r="perspective"),this._projection=r,this.viewGL.setProjection(r);var a=e.get("distance")+n,o=e.get("orthographicSize")+i;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(t){this[t[0]]=s(e.get(t[0]),t[1])}),this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=i,this.maxOrthographicSize+=i;var l=e.ecModel,u={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(t){u[t]=s(e.get(t),l&&l.get(t))}));var c=s(t.alpha,e.get("alpha"))||0,h=s(t.beta,e.get("beta"))||0,d=s(t.center,e.get("center"))||[0,0,0];u.animation&&u.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:c,beta:h,center:d,distance:a,targetOrthographicSize:o,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(c),this.setBeta(h),this.setCenter(d),this.setOrthographicSize(o)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==o[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==o[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection)},animateTo:function(e){var t=this.zr,n=this,i={},r={};return null!=e.distance&&(i.distance=this.getDistance(),r.distance=e.distance),null!=e.orthographicSize&&(i.orthographicSize=this.getOrthographicSize(),r.orthographicSize=e.orthographicSize),null!=e.alpha&&(i.alpha=this.getAlpha(),r.alpha=e.alpha),null!=e.beta&&(i.beta=this.getBeta(),r.beta=e.beta),null!=e.center&&(i.center=this.getCenter(),r.center=e.center),this._addAnimator(t.animation.animate(i).when(e.duration||1e3,r).during((function(){null!=i.alpha&&n.setAlpha(i.alpha),null!=i.beta&&n.setBeta(i.beta),null!=i.distance&&n.setDistance(i.distance),null!=i.center&&n.setCenter(i.center),null!=i.orthographicSize&&n.setOrthographicSize(i.orthographicSize),n._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e<this._animators.length;e++)this._animators[e].stop();this._animators.length=0},_isAnimating:function(){return this._animators.length>0},_update:function(e){if(this._rotating){var t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),n=this._orthoSize,i=n/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-i/2,t.right=i/2,t.top=n/2,t.bottom=-n/2},_updatePan:function(e){var t=this._panVelocity,n=this._distance,i=this.getCamera(),r=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-t.x*n/200).scaleAndAdd(r,-t.y*n/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new a.a,n=this._theta+Math.PI/2,i=this._phi+Math.PI/2,r=Math.sin(n);t.x=r*Math.cos(i),t.y=-Math.cos(n),t.z=r*Math.sin(i),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout((function(){t._rotating=!0}),1e3*e))},_vectorDamping:function(e,t){var n=e.len();(n*=t)<1e-4&&(n=0),e.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),n=Math.atan2(e.x,e.z);this._theta=t,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,n=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===o[this.rotateMouseButton]?this._mode="rotate":e.event.button===o[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy||this._isAnimating())){var t=l(this.panSensitivity),n=l(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(0!==t){var n,i=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(i,r)||(n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault())}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done((function(){var n=t.indexOf(e);n>=0&&t.splice(n,1)})),e}});Object.defineProperty(u.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}}),t.a=u},function(e,t,n){"use strict";t.a="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,n){var i=n(12),r=n(75),a=n(78).parsePercent,s=n(149),o=i.each,l=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function c(e,t,n,i,r){var a=0,s=0;null==i&&(i=1/0),null==r&&(r=1/0);var o=0;t.eachChild((function(l,u){var c,h,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),m=p&&p.getBoundingRect();if("horizontal"===e){var g=f.width+(m?-m.x+f.x:0);(c=a+g)>i||l.newline?(a=0,c=g,s+=o+n,o=f.height):o=Math.max(o,f.height)}else{var _=f.height+(m?-m.y+f.y:0);(h=s+_)>r||l.newline?(a+=o+n,s=0,h=_,o=f.width):o=Math.max(o,f.width)}l.newline||(d[0]=a,d[1]=s,"horizontal"===e?a=c+n:s=h+n)}))}var h=c,d=i.curry(c,"vertical"),f=i.curry(c,"horizontal");function p(e,t,n){n=s.normalizeCssArray(n||0);var i=t.width,o=t.height,l=a(e.left,i),u=a(e.top,o),c=a(e.right,i),h=a(e.bottom,o),d=a(e.width,i),f=a(e.height,o),p=n[2]+n[0],m=n[1]+n[3],g=e.aspect;switch(isNaN(d)&&(d=i-c-m-l),isNaN(f)&&(f=o-h-p-u),null!=g&&(isNaN(d)&&isNaN(f)&&(g>i/o?d=.8*i:f=.8*o),isNaN(d)&&(d=g*f),isNaN(f)&&(f=d/g)),isNaN(l)&&(l=i-c-d-m),isNaN(u)&&(u=o-h-f-p),e.left||e.right){case"center":l=i/2-d/2-n[3];break;case"right":l=i-d-m}switch(e.top||e.bottom){case"middle":case"center":u=o/2-f/2-n[0];break;case"bottom":u=o-f-p}l=l||0,u=u||0,isNaN(d)&&(d=i-m-l-(c||0)),isNaN(f)&&(f=o-p-u-(h||0));var _=new r(l+n[3],u+n[0],d,f);return _.margin=n,_}function m(e,t){return t&&e&&o(l,(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}t.LOCATION_PARAMS=l,t.HV_NAMES=u,t.box=h,t.vbox=d,t.hbox=f,t.getAvailableSize=function(e,t,n){var i=t.width,r=t.height,o=a(e.x,i),l=a(e.y,r),u=a(e.x2,i),c=a(e.y2,r);return(isNaN(o)||isNaN(parseFloat(e.x)))&&(o=0),(isNaN(u)||isNaN(parseFloat(e.x2)))&&(u=i),(isNaN(l)||isNaN(parseFloat(e.y)))&&(l=0),(isNaN(c)||isNaN(parseFloat(e.y2)))&&(c=r),n=s.normalizeCssArray(n||0),{width:Math.max(u-o-n[1]-n[3],0),height:Math.max(c-l-n[0]-n[2],0)}},t.getLayoutRect=p,t.positionElement=function(e,t,n,a,s){var o=!s||!s.hv||s.hv[0],l=!s||!s.hv||s.hv[1],u=s&&s.boundingMode||"all";if(o||l){var c;if("raw"===u)c="group"===e.type?new r(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(c=e.getBoundingRect(),e.needLocalTransform()){var h=e.getLocalTransform();(c=c.clone()).applyTransform(h)}t=p(i.defaults({width:c.width,height:c.height},t),n,a);var d=e.position,f=o?t.x-c.x:0,m=l?t.y-c.y:0;e.attr("position","raw"===u?[f,m]:[d[0]+f,d[1]+m])}},t.sizeCalculable=function(e,t){return null!=e[u[t][0]]||null!=e[u[t][1]]&&null!=e[u[t][2]]},t.mergeLayoutParam=function(e,t,n){!i.isObject(n)&&(n={});var r=n.ignoreSize;!i.isArray(r)&&(r=[r,r]);var a=l(u[0],0),s=l(u[1],1);function l(n,i){var a={},s=0,l={},u=0;if(o(n,(function(t){l[t]=e[t]})),o(n,(function(e){c(t,e)&&(a[e]=l[e]=t[e]),h(a,e)&&s++,h(l,e)&&u++})),r[i])return h(t,n[1])?l[n[2]]=null:h(t,n[2])&&(l[n[1]]=null),l;if(2!==u&&s){if(s>=2)return a;for(var d=0;d<n.length;d++){var f=n[d];if(!c(a,f)&&c(e,f)){a[f]=e[f];break}}return a}return l}function c(e,t){return e.hasOwnProperty(t)}function h(e,t){return null!=e[t]&&"auto"!==e[t]}function d(e,t,n){o(e,(function(e){t[e]=n[e]}))}d(u[0],e,a),d(u[1],e,s)},t.getLayoutParams=function(e){return m({},e)},t.copyLayoutParams=m},function(e,t,n){"use strict";var i=n(8).a.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(e,t){var n,i,r=this.outputs[e],a=r.parameters,s=r._parametersCopy;if(s||(s=r._parametersCopy={}),a)for(var o in a)"width"!==o&&"height"!==o&&(s[o]=a[o]);return n=a.width instanceof Function?a.width.call(this,t):a.width,i=a.height instanceof Function?a.height.call(this,t):a.height,s.width===n&&s.height===i||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),s.width=n,s.height=i,s},setParameter:function(e,t){},getParameter:function(e){},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},render:function(){},getOutput:function(e,t){if(null==t)return t=e,this._outputTextures[t];var n=this.outputs[t];return n?this._rendered?n.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(n.parameters||{})),this._prevOutputTextures[t]):(this.render(e),this._outputTextures[t]):void 0},removeReference:function(e){this._outputReferences[e]--,0===this._outputReferences[e]&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},link:function(e,t,n){this.inputLinks[e]={node:t,pin:n},t.outputLinks[n]||(t.outputLinks[n]=[]),t.outputLinks[n].push({node:this,pin:e}),this.pass.material.enableTexture(e)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(e){if(!this._rendering){for(var t in this._rendering=!0,this.inputLinks){var n=this.inputLinks[t];n.node.updateReference(n.pin)}this._rendering=!1}e&&this._outputReferences[e]++},beforeFrame:function(){for(var e in this._rendered=!1,this.outputLinks)this._outputReferences[e]=0},afterFrame:function(){for(var e in this.outputLinks)this._outputReferences[e]>0&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))}});t.a=i},function(e,t,n){"use strict";t.a=function(e,t){for(var n=0,i=1/t,r=e;r>0;)n+=i*(r%t),r=Math.floor(r/t),i/=t;return n}},function(e,t,n){"use strict";var i=n(0),r=n.n(i);t.a=function(e,t,n){n=n||e.getSource();var i=t||r.a.getCoordinateSystemDimensions(e.get("coordinateSystem"))||["x","y","z"],a=r.a.helper.createDimensions(n,{dimensionsDefine:n.dimensionsDefine||e.get("dimensions"),encodeDefine:n.encodeDefine||e.get("encode"),coordDimensions:i.map((function(t){var n=e.getReferringComponents(t+"Axis3D")[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:t,stackable:"z"===t}}))});"cartesian3D"===e.get("coordinateSystem")&&a.forEach((function(t){if(i.indexOf(t.coordDim)>=0){var n=e.getReferringComponents(t.coordDim+"Axis3D")[0];n&&"category"===n.get("type")&&(t.ordinalMeta=n.getOrdinalMeta())}}));var s=new r.a.List(a,e);return s.initData(n),s}},function(e,t){e.exports=function(e,t,n){return{seriesType:e,performRawSeries:!0,reset:function(e,i,r){var a=e.getData(),s=e.get("symbol")||t,o=e.get("symbolSize");if(a.setVisual({legendSymbol:n||s,symbol:s,symbolSize:o}),!i.isSeriesFiltered(e)){var l="function"==typeof o;return{dataEach:a.hasItemOption||l?function(t,n){if("function"==typeof o){var i=e.getRawValue(n),r=e.getDataParams(n);t.setItemVisual(n,"symbolSize",o(i,r))}if(t.hasItemOption){var a=t.getItemModel(n),s=a.getShallow("symbol",!0),l=a.getShallow("symbolSize",!0);null!=s&&t.setItemVisual(n,"symbol",s),null!=l&&t.setItemVisual(n,"symbolSize",l)}}:null}}}}}},function(e,t,n){"use strict";var i=n(8),r=n(92),a=n(11),s=(n(18),n(15)),o=n(9),l=n(17),u=n(23),c=n(96),h=n(7),d=n(98),f=n(63),p=n(1),m=n.n(p);h.a.import(d.a),h.a.import(f.a);var g=m.a.mat4,_=m.a.vec3,v=g.create,y={};function b(e){return e.material}function x(){}var E,w,T=i.a.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=document.createElement("canvas"));var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new r.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(e){throw"Error creating WebGL Context "+e}this._programMgr=new c.a(this)}),{resize:function(e,t){var n=this.canvas,i=this.devicePixelRatio;null!=e?(n.style.width=e+"px",n.style.height=t+"px",n.width=e*i,n.height=t*i,this._width=e,this._height=t):(this._width=n.width/i,this._height=n.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,n,i,r){if("object"==typeof e){var a=e;e=a.x,t=a.y,n=a.width,i=a.height,r=a.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(e*r,t*r,n*r,i*r),this.viewport={x:e,y:t,width:n,height:i,devicePixelRatio:r}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,n,i){var r=this.gl,a=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var s=this.viewport,o=!1,l=s.devicePixelRatio;(s.width!==this._width||s.height!==this._height||l&&l!==this.devicePixelRatio||s.x||s.y)&&(o=!0,r.enable(r.SCISSOR_TEST),r.scissor(s.x*l,s.y*l,s.width*l,s.height*l)),r.clearColor(a[0],a[1],a[2],a[3]),r.clear(this.clearBit),o&&r.disable(r.SCISSOR_TEST)}if(n||e.update(!1),t=t||e.getMainCamera()){t.getScene()||t.update(!0),this._sceneRendering=e,e.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),e.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0);var u=this.cullRenderList(e.opaqueList,e,t),c=this.cullRenderList(e.transparentList,e,t),h=e.material;e.trigger("beforerender",this,e,t),i?(this.renderPreZ(u,e,t),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var d=v(),f=_.create(),p=0;p<c.length;p++){var m=c[p];g.multiplyAffine(d,t.viewMatrix.array,m.worldTransform.array),_.transformMat4(f,m.position.array,d),m.__depth=f[2]}var y=this.renderPass(u,t,{getMaterial:function(e){return h||e.material},sortCompare:this.opaqueSortCompare}),b=this.renderPass(c,t,{getMaterial:function(e){return h||e.material},sortCompare:this.transparentSortCompare}),x={};for(var E in y)x[E]=y[E]+b[E];return e.trigger("afterrender",this,e,t,x),this._sceneRendering=null,x}console.error("Can't find camera in the scene.")},getProgram:function(e,t,n){return t=t||e.material,this._programMgr.getProgram(e,t,n)},validateProgram:function(e){if(e.__error){var t=e.__error;if(y[e.__uid__])return;if(y[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,n){var i=n&&n.getMaterial||b;t=t||null;for(var r=0;r<e.length;r++){var a=e[r],s=i.call(this,a);if(r>0){var o=e[r-1],l=o.joints?o.joints.length:0;if((a.joints.length?a.joints.length:0)===l&&a.material===o.material&&a.lightGroup===o.lightGroup){a.__program=o.__program;continue}}var u=this._programMgr.getProgram(a,s,t);this.validateProgram(u),a.__program=u}},cullRenderList:function(e,t,n){for(var i=[],r=0;r<e.length;r++){var a=e[r],s=a.isSkinnedMesh()?S.IDENTITY:a.worldTransform.array,o=a.geometry;g.multiplyAffine(S.WORLDVIEW,n.viewMatrix.array,s),o.boundingBox&&this.isFrustumCulled(a,t,n,S.WORLDVIEW,n.projectionMatrix.array)||i.push(a)}return i},renderPass:function(e,t,n){this.trigger("beforerenderpass",this,e,t,n);var i={triangleCount:0,vertexCount:0,drawCallCount:0,meshCount:e.length,renderedMeshCount:0};(n=n||{}).getMaterial=n.getMaterial||b,n.beforeRender=n.beforeRender||x,n.afterRender=n.afterRender||x,this.updatePrograms(e,this._sceneRendering,n),n.sortCompare&&e.sort(n.sortCompare);var r=this.viewport,a=r.devicePixelRatio,s=[r.x*a,r.y*a,r.width*a,r.height*a],o=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*o,this._height*o],u=[s[2],s[3]],c=Date.now();g.copy(S.VIEW,t.viewMatrix.array),g.copy(S.PROJECTION,t.projectionMatrix.array),g.multiply(S.VIEWPROJECTION,t.projectionMatrix.array,S.VIEW),g.copy(S.VIEWINVERSE,t.worldTransform.array),g.invert(S.PROJECTIONINVERSE,S.PROJECTION),g.invert(S.VIEWPROJECTIONINVERSE,S.VIEWPROJECTION);for(var h,d,f,p,m,_,v,y,E=this.gl,w=this._sceneRendering,T=0;T<e.length;T++){var A=e[T];if(!n.ifRender||n.ifRender(A)){var C=A.isSkinnedMesh()?S.IDENTITY:A.worldTransform.array,L=n.getMaterial.call(this,A),R=A.__program,I=L.shader;g.copy(S.WORLD,C),g.multiply(S.WORLDVIEWPROJECTION,S.VIEWPROJECTION,C),(I.matrixSemantics.WORLDINVERSE||I.matrixSemantics.WORLDINVERSETRANSPOSE)&&g.invert(S.WORLDINVERSE,C),(I.matrixSemantics.WORLDVIEWINVERSE||I.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&g.invert(S.WORLDVIEWINVERSE,S.WORLDVIEW),(I.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||I.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&g.invert(S.WORLDVIEWPROJECTIONINVERSE,S.WORLDVIEWPROJECTION),A.beforeRender(this),n.beforeRender.call(this,A,L,h);var D=R!==d;D?(R.bind(this),R.setUniformOfSemantic(E,"VIEWPORT",s),R.setUniformOfSemantic(E,"WINDOW_SIZE",l),R.setUniformOfSemantic(E,"NEAR",t.near),R.setUniformOfSemantic(E,"FAR",t.far),R.setUniformOfSemantic(E,"DEVICEPIXELRATIO",a),R.setUniformOfSemantic(E,"TIME",c),R.setUniformOfSemantic(E,"VIEWPORT_SIZE",u),w&&w.setLightUniforms(R,A.lightGroup,this)):R=d,(h!==L||D)&&(L.depthTest!==f&&(L.depthTest?E.enable(E.DEPTH_TEST):E.disable(E.DEPTH_TEST),f=L.depthTest),L.depthMask!==p&&(E.depthMask(L.depthMask),p=L.depthMask),L.transparent!==y&&(L.transparent?E.enable(E.BLEND):E.disable(E.BLEND),y=L.transparent),L.transparent&&(L.blend?L.blend(E):(E.blendEquationSeparate(E.FUNC_ADD,E.FUNC_ADD),E.blendFuncSeparate(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA,E.ONE,E.ONE_MINUS_SRC_ALPHA))),L.bind(this,R,h,d),h=L);for(var k=I.matrixSemanticKeys,M=0;M<k.length;M++){var P=k[M],O=I.matrixSemantics[P],N=S[P];if(O.isTranspose){var F=S[O.semanticNoTranspose];g.transpose(N,F)}R.setUniform(E,O.type,O.symbol,N)}A.cullFace!==_&&(_=A.cullFace,E.cullFace(_)),A.frontFace!==v&&(v=A.frontFace,E.frontFace(v)),A.culling!==m&&((m=A.culling)?E.enable(E.CULL_FACE):E.disable(E.CULL_FACE));var B=A.render(this,L,R);B&&(i.triangleCount+=B.triangleCount,i.vertexCount+=B.vertexCount,i.drawCallCount+=B.drawCallCount,i.renderedMeshCount++),n.afterRender.call(this,A,B),A.afterRender(this,B),d=R}}for(T=0;T<e.length;T++)e[T].__program=null;return this.trigger("afterrenderpass",this,e,t,n),i},renderPreZ:function(e,t,n){var i=this.gl,r=this._prezMaterial||new l.a({shader:new h.a(h.a.source("clay.prez.vertex"),h.a.source("clay.prez.fragment"))});this._prezMaterial=r,i.colorMask(!1,!1,!1,!1),i.depthMask(!0),this.renderPass(e,n,{ifRender:function(e){return!e.ignorePreZ},getMaterial:function(){return r},sort:this.opaqueSortCompare}),i.colorMask(!0,!0,!0,!0),i.depthMask(!0)},isFrustumCulled:(E=new s.a,w=new o.a,function(e,t,n,i,r){var a=e.boundingBox||e.geometry.boundingBox;if(w.array=i,E.copy(a),E.applyTransform(w),t&&e.isRenderable()&&e.castShadow&&t.viewBoundingBoxLastFrame.union(E),e.frustumCulling&&!e.isSkinnedMesh()){if(!E.intersectBoundingBox(n.frustum.boundingBox))return!0;w.array=r,E.max.array[2]>0&&E.min.array[2]<0&&(E.max.array[2]=-1e-20),E.applyProjection(w);var s=E.min.array,o=E.max.array;if(o[0]<-1||s[0]>1||o[1]<-1||s[1]>1||o[2]<-1||s[2]>1)return!0}return!1}),disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,t,n){e.getParent()&&e.getParent().remove(e),e.traverse((function(e){e.geometry&&t&&e.geometry.dispose(this),e.dispose&&e.dispose(this)}),this)},disposeGeometry:function(e){e.dispose(this)},disposeTexture:function(e){e.dispose(this)},disposeFrameBuffer:function(e){e.dispose(this)},dispose:function(){},screenToNDC:function(e,t,n){n||(n=new u.a),t=this._height-t;var i=this.viewport,r=n.array;return r[0]=(e-i.x)/i.width,r[0]=2*r[0]-1,r[1]=(t-i.y)/i.height,r[1]=2*r[1]-1,n}});T.opaqueSortCompare=T.prototype.opaqueSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.renderOrder-t.renderOrder},T.transparentSortCompare=T.prototype.transparentSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__depth===t.__depth?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.__depth-t.__depth:e.renderOrder-t.renderOrder};var S={IDENTITY:v(),WORLD:v(),VIEW:v(),PROJECTION:v(),WORLDVIEW:v(),VIEWPROJECTION:v(),WORLDVIEWPROJECTION:v(),WORLDINVERSE:v(),VIEWINVERSE:v(),PROJECTIONINVERSE:v(),WORLDVIEWINVERSE:v(),VIEWPROJECTIONINVERSE:v(),WORLDVIEWPROJECTIONINVERSE:v(),WORLDTRANSPOSE:v(),VIEWTRANSPOSE:v(),PROJECTIONTRANSPOSE:v(),WORLDVIEWTRANSPOSE:v(),VIEWPROJECTIONTRANSPOSE:v(),WORLDVIEWPROJECTIONTRANSPOSE:v(),WORLDINVERSETRANSPOSE:v(),VIEWINVERSETRANSPOSE:v(),PROJECTIONINVERSETRANSPOSE:v(),WORLDVIEWINVERSETRANSPOSE:v(),VIEWPROJECTIONINVERSETRANSPOSE:v(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:v()};T.COLOR_BUFFER_BIT=a.a.COLOR_BUFFER_BIT,T.DEPTH_BUFFER_BIT=a.a.DEPTH_BUFFER_BIT,T.STENCIL_BUFFER_BIT=a.a.STENCIL_BUFFER_BIT,t.a=T},function(e,t,n){"use strict";function i(e,t){this.action=e,this.context=t}var r={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],n=t.length,i=-1,r=arguments;switch(r.length){case 1:for(;++i<n;)t[i].action.call(t[i].context);return;case 2:for(;++i<n;)t[i].action.call(t[i].context,r[1]);return;case 3:for(;++i<n;)t[i].action.call(t[i].context,r[1],r[2]);return;case 4:for(;++i<n;)t[i].action.call(t[i].context,r[1],r[2],r[3]);return;case 5:for(;++i<n;)t[i].action.call(t[i].context,r[1],r[2],r[3],r[4]);return;default:for(;++i<n;)t[i].action.apply(t[i].context,Array.prototype.slice.call(r,1));return}}},on:function(e,t,n){if(e&&t){var r=this.__handlers__||(this.__handlers__={});if(r[e]){if(this.has(e,t))return}else r[e]=[];var a=new i(t,n||this);return r[e].push(a),this}},once:function(e,t,n){if(e&&t){var i=this;return this.on(e,(function n(){i.off(e,n),t.apply(this,arguments)}),n)}},before:function(e,t,n){if(e&&t)return e="before"+e,this.on(e,t,n)},after:function(e,t,n){if(e&&t)return e="after"+e,this.on(e,t,n)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var n=this.__handlers__||(this.__handlers__={});if(t){if(n[e]){for(var i=n[e],r=[],a=0;a<i.length;a++)t&&i[a].action!==t&&r.push(i[a]);n[e]=r}return this}n[e]=[]},has:function(e,t){var n=this.__handlers__;if(!n||!n[e])return!1;for(var i=n[e],r=0;r<i.length;r++)if(i[r].action===t)return!0}};t.a=r},function(e,t,n){"use strict";var i="__dt__",r=function(){this._contextId=0,this._caches=[],this._context={}};(r.prototype={use:function(e,t){var n=this._caches;n[e]||(n[e]={},t&&(n[e]=t())),this._contextId=e,this._context=n[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=i+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=i+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!0)},fresh:function(e){var t=i+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t=i+(e=e||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][t]=!1)},isDirty:function(e){var t=i+(e=e||""),n=this._context;return!n.hasOwnProperty(t)||!0===n[t]},deleteContext:function(e){delete this._caches[e],this._context={}},delete:function(e){delete this._context[e]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(e,t){Object.keys(this._caches).forEach((function(n){e&&e.call(t,n)}))},miss:function(e){return!this._context.hasOwnProperty(e)}}).constructor=r,t.a=r},function(e,t,n){"use strict";var i,r,a,s,o,l=n(4),u=n(1),c=n.n(u).a.vec3,h=1e-5,d=function(e,t){this.origin=e||new l.a,this.direction=t||new l.a};d.prototype={constructor:d,intersectPlane:function(e,t){var n=e.normal.array,i=e.distance,r=this.origin.array,a=this.direction.array,s=c.dot(n,a);if(0===s)return null;t||(t=new l.a);var o=(c.dot(n,r)-i)/s;return c.scaleAndAdd(t.array,r,a,-o),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=c.dot(e.normal.array,this.direction.array);c.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:(o=c.create(),function(e){c.sub(o,e,this.origin.array);var t=c.dot(o,this.direction.array);if(t<0)return c.distance(this.origin.array,e);var n=c.lenSquared(o);return Math.sqrt(n-t*t)}),intersectSphere:function(){var e=c.create();return function(t,n,i){var r=this.origin.array,a=this.direction.array;t=t.array,c.sub(e,t,r);var s=c.dot(e,a),o=c.squaredLength(e)-s*s,u=n*n;if(!(o>u)){var h=Math.sqrt(u-o),d=s-h,f=s+h;return i||(i=new l.a),d<0?f<0?null:(c.scaleAndAdd(i.array,r,a,f),i):(c.scaleAndAdd(i.array,r,a,d),i)}}}(),intersectBoundingBox:function(e,t){var n,i,r,a,s,o,u=this.direction.array,h=this.origin.array,d=e.min.array,f=e.max.array,p=1/u[0],m=1/u[1],g=1/u[2];if(p>=0?(n=(d[0]-h[0])*p,i=(f[0]-h[0])*p):(i=(d[0]-h[0])*p,n=(f[0]-h[0])*p),m>=0?(r=(d[1]-h[1])*m,a=(f[1]-h[1])*m):(a=(d[1]-h[1])*m,r=(f[1]-h[1])*m),n>a||r>i)return null;if((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),g>=0?(s=(d[2]-h[2])*g,o=(f[2]-h[2])*g):(o=(d[2]-h[2])*g,s=(f[2]-h[2])*g),n>o||s>i)return null;if((s>n||n!=n)&&(n=s),(o<i||i!=i)&&(i=o),i<0)return null;var _=n>=0?n:i;return t||(t=new l.a),c.scaleAndAdd(t.array,h,u,_),t},intersectTriangle:(i=c.create(),r=c.create(),a=c.create(),s=c.create(),function(e,t,n,o,u,d){var f=this.direction.array,p=this.origin.array;e=e.array,t=t.array,n=n.array,c.sub(i,t,e),c.sub(r,n,e),c.cross(s,r,f);var m=c.dot(i,s);if(o){if(m>-1e-5)return null}else if(m>-1e-5&&m<h)return null;c.sub(a,p,e);var g=c.dot(s,a)/m;if(g<0||g>1)return null;c.cross(s,i,a);var _=c.dot(f,s)/m;if(_<0||_>1||g+_>1)return null;c.cross(s,i,r);var v=-c.dot(a,s)/m;return v<0?null:(u||(u=new l.a),d&&l.a.set(d,1-g-_,g,_),c.scaleAndAdd(u.array,p,f,v),u)}),applyTransform:function(e){l.a.add(this.direction,this.direction,this.origin),l.a.transformMat4(this.origin,this.origin,e),l.a.transformMat4(this.direction,this.direction,e),l.a.sub(this.direction,this.direction,this.origin),l.a.normalize(this.direction,this.direction)},copy:function(e){l.a.copy(this.origin,e.origin),l.a.copy(this.direction,e.direction)},clone:function(){var e=new d;return e.copy(this),e}},t.a=d},function(e,t,n){"use strict";var i,r,a=n(1),s=n.n(a),o=s.a.quat,l=function(e,t,n,i){e=e||0,t=t||0,n=n||0,i=void 0===i?1:i,this.array=o.fromValues(e,t,n,i),this._dirty=!0};l.prototype={constructor:l,add:function(e){return o.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return o.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,n,i){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=i,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new l(this.x,this.y,this.z,this.w)},conjugate:function(){return o.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return o.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return o.dot(this.array,e.array)},fromMat3:function(e){return o.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(i=s.a.mat3,r=i.create(),function(e){return i.fromMat4(r,e.array),i.transpose(r,r),o.fromMat3(this.array,r),this._dirty=!0,this}),identity:function(){return o.identity(this.array),this._dirty=!0,this},invert:function(){return o.invert(this.array,this.array),this._dirty=!0,this},len:function(){return o.len(this.array)},length:function(){return o.length(this.array)},lerp:function(e,t,n){return o.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},mul:function(e){return o.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return o.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return o.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return o.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return o.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return o.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return o.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return o.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return o.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,n){return o.setAxes(this.array,e.array,t.array,n.array),this._dirty=!0,this},setAxisAngle:function(e,t){return o.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,n){return o.slerp(this.array,e.array,t.array,n),this._dirty=!0,this},sqrLen:function(){return o.sqrLen(this.array)},squaredLength:function(){return o.squaredLength(this.array)},fromEuler:function(e,t){return l.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var u=Object.defineProperty;if(u){var c=l.prototype;u(c,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),u(c,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),u(c,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),u(c,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}l.add=function(e,t,n){return o.add(e.array,t.array,n.array),e._dirty=!0,e},l.set=function(e,t,n,i,r){o.set(e.array,t,n,i,r),e._dirty=!0},l.copy=function(e,t){return o.copy(e.array,t.array),e._dirty=!0,e},l.calculateW=function(e,t){return o.calculateW(e.array,t.array),e._dirty=!0,e},l.conjugate=function(e,t){return o.conjugate(e.array,t.array),e._dirty=!0,e},l.identity=function(e){return o.identity(e.array),e._dirty=!0,e},l.invert=function(e,t){return o.invert(e.array,t.array),e._dirty=!0,e},l.dot=function(e,t){return o.dot(e.array,t.array)},l.len=function(e){return o.length(e.array)},l.lerp=function(e,t,n,i){return o.lerp(e.array,t.array,n.array,i),e._dirty=!0,e},l.slerp=function(e,t,n,i){return o.slerp(e.array,t.array,n.array,i),e._dirty=!0,e},l.multiply=l.mul=function(e,t,n){return o.multiply(e.array,t.array,n.array),e._dirty=!0,e},l.rotateX=function(e,t,n){return o.rotateX(e.array,t.array,n),e._dirty=!0,e},l.rotateY=function(e,t,n){return o.rotateY(e.array,t.array,n),e._dirty=!0,e},l.rotateZ=function(e,t,n){return o.rotateZ(e.array,t.array,n),e._dirty=!0,e},l.setAxisAngle=function(e,t,n){return o.setAxisAngle(e.array,t.array,n),e._dirty=!0,e},l.normalize=function(e,t){return o.normalize(e.array,t.array),e._dirty=!0,e},l.squaredLength=l.sqrLen=function(e){return o.sqrLen(e.array)},l.fromMat3=function(e,t){return o.fromMat3(e.array,t.array),e._dirty=!0,e},l.setAxes=function(e,t,n,i){return o.setAxes(e.array,t.array,n.array,i.array),e._dirty=!0,e},l.rotationTo=function(e,t,n){return o.rotationTo(e.array,t.array,n.array),e._dirty=!0,e},l.fromEuler=function(e,t,n){e._dirty=!0,t=t.array;var i=e.array,r=Math.cos(t[0]/2),a=Math.cos(t[1]/2),s=Math.cos(t[2]/2),o=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=o*a*s+r*l*u,i[1]=r*l*s-o*a*u,i[2]=r*a*u+o*l*s,i[3]=r*a*s-o*l*u;break;case"YXZ":i[0]=o*a*s+r*l*u,i[1]=r*l*s-o*a*u,i[2]=r*a*u-o*l*s,i[3]=r*a*s+o*l*u;break;case"ZXY":i[0]=o*a*s-r*l*u,i[1]=r*l*s+o*a*u,i[2]=r*a*u+o*l*s,i[3]=r*a*s-o*l*u;break;case"ZYX":i[0]=o*a*s-r*l*u,i[1]=r*l*s+o*a*u,i[2]=r*a*u-o*l*s,i[3]=r*a*s+o*l*u;break;case"YZX":i[0]=o*a*s+r*l*u,i[1]=r*l*s+o*a*u,i[2]=r*a*u-o*l*s,i[3]=r*a*s-o*l*u;break;case"XZY":i[0]=o*a*s-r*l*u,i[1]=r*l*s-o*a*u,i[2]=r*a*u+o*l*s,i[3]=r*a*s+o*l*u}},t.a=l},function(e,t,n){"use strict";var i,r=n(28),a=n(9),s=n(52),o=n(49),l=n(1),u=n.n(l),c=u.a.vec3,h=u.a.vec4,d=r.a.extend((function(){return{projectionMatrix:new a.a,invProjectionMatrix:new a.a,viewMatrix:new a.a,frustum:new s.a}}),(function(){this.update(!0)}),{update:function(e){r.a.prototype.update.call(this,e),a.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),a.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){a.a.copy(this.viewMatrix,e),a.a.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){a.a.copy(this.projectionMatrix,e),a.a.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(i=h.create(),function(e,t){var n=void 0!==t?t:new o.a,r=e.array[0],a=e.array[1];return h.set(i,r,a,-1,1),h.transformMat4(i,i,this.invProjectionMatrix.array),h.transformMat4(i,i,this.worldTransform.array),c.scale(n.origin.array,i,1/i[3]),h.set(i,r,a,1,1),h.transformMat4(i,i,this.invProjectionMatrix.array),h.transformMat4(i,i,this.worldTransform.array),c.scale(i,i,1/i[3]),c.sub(n.direction.array,i,n.origin.array),c.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})});t.a=d},function(e,t,n){"use strict";n(4);var i,r=n(15),a=n(67),s=n(1),o=n.n(s).a.vec3,l=o.set,u=o.copy,c=o.transformMat4,h=Math.min,d=Math.max,f=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new a.a);for(this.boundingBox=new r.a,this.vertices=[],e=0;e<8;e++)this.vertices[e]=o.fromValues(0,0,0)};f.prototype={setFromProjection:function(e){var t=this.planes,n=e.array,i=n[0],r=n[1],a=n[2],s=n[3],o=n[4],u=n[5],c=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],g=n[12],_=n[13],v=n[14],y=n[15];l(t[0].normal.array,s-i,h-o,m-d),t[0].distance=-(y-g),t[0].normalize(),l(t[1].normal.array,s+i,h+o,m+d),t[1].distance=-(y+g),t[1].normalize(),l(t[2].normal.array,s+r,h+u,m+f),t[2].distance=-(y+_),t[2].normalize(),l(t[3].normal.array,s-r,h-u,m-f),t[3].distance=-(y-_),t[3].normalize(),l(t[4].normal.array,s-a,h-c,m-p),t[4].distance=-(y-v),t[4].normalize(),l(t[5].normal.array,s+a,h+c,m+p),t[5].distance=-(y+v),t[5].normalize();var b=this.boundingBox;if(0===y){var x=u/i,E=-v/(p-1),w=-v/(p+1),T=-w/u,S=-E/u;b.min.set(-T*x,-T,w),b.max.set(T*x,T,E);var A=this.vertices;l(A[0],-T*x,-T,w),l(A[1],-T*x,T,w),l(A[2],T*x,-T,w),l(A[3],T*x,T,w),l(A[4],-S*x,-S,E),l(A[5],-S*x,S,E),l(A[6],S*x,-S,E),l(A[7],S*x,S,E)}else{var C=(-1-g)/i,L=(1-g)/i,R=(1-_)/u,I=(-1-_)/u,D=(-1-v)/p,k=(1-v)/p;b.min.set(Math.min(C,L),Math.min(I,R),Math.min(k,D)),b.max.set(Math.max(L,C),Math.max(R,I),Math.max(D,k));var M=b.min.array,P=b.max.array;A=this.vertices,l(A[0],M[0],M[1],M[2]),l(A[1],M[0],P[1],M[2]),l(A[2],P[0],M[1],M[2]),l(A[3],P[0],P[1],M[2]),l(A[4],M[0],M[1],P[2]),l(A[5],M[0],P[1],P[2]),l(A[6],P[0],M[1],P[2]),l(A[7],P[0],P[1],P[2])}},getTransformedBoundingBox:(i=o.create(),function(e,t){var n=this.vertices,r=t.array,a=e.min,s=e.max,o=a.array,l=s.array,f=n[0];c(i,f,r),u(o,i),u(l,i);for(var p=1;p<8;p++)f=n[p],c(i,f,r),o[0]=h(i[0],o[0]),o[1]=h(i[1],o[1]),o[2]=h(i[2],o[2]),l[0]=d(i[0],l[0]),l[1]=d(i[1],l[1]),l[2]=d(i[2],l[2]);return a._dirty=!0,s._dirty=!0,e})},t.a=f},function(e,t){var n=function(){this.head=null,this.tail=null,this._len=0},i=n.prototype;i.insert=function(e){var t=new r(e);return this.insertEntry(t),t},i.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},i.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},i.len=function(){return this._len},i.clear=function(){this.head=this.tail=null,this._len=0};var r=function(e){this.value=e,this.next,this.prev},a=function(e){this._list=new n,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},s=a.prototype;s.put=function(e,t){var n=this._list,i=this._map,a=null;if(null==i[e]){var s=n.len(),o=this._lastRemovedEntry;if(s>=this._maxSize&&s>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}o?o.value=t:o=new r(t),o.key=e,n.insertEntry(o),i[e]=o}return a},s.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},s.clear=function(){this._list.clear(),this._map={}};var o=a;e.exports=o},function(e,t,n){"use strict";var i=n(5),r=n(25),a=n(102),s=n(55),o=n(56),l=n(29),u=n(104),c=n(105),h={loadTexture:function(e,t,n,a){if("function"==typeof t?(a=n=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return s=new i.a({width:0,height:0,sRGB:!1}),h._fetchTexture(e,(function(e){c.a.parseRGBE(e,s,t.exposure),s.dirty(),n&&n(s)}),a),s;e.match(/.dds$/)||"dds"===t.fileType?(s=new i.a({width:0,height:0}),h._fetchTexture(e,(function(e){u.a.parse(e,s),s.dirty(),n&&n(s)}),a)):((s=new i.a).load(e),s.success(n),s.error(a))}else if("object"==typeof e&&void 0!==e.px){var s;(s=new r.a).load(e),s.success(n),s.error(a)}return s},loadPanorama:function(e,t,n,i,r,a){var s=this;"function"==typeof i?(a=r=i,i={}):i=i||{},h.loadTexture(t,i,(function(t){t.flipY=i.flipY||!1,s.panoramaToCubeMap(e,t,n,i),t.dispose(e),r&&r(n)}),a)},panoramaToCubeMap:function(e,t,n,i){var r=new s.a,a=new o.a({scene:new l.a});return a.material.set("diffuseMap",t),(i=i||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),n.sRGB=t.sRGB,r.texture=n,r.render(e,a.scene),r.texture=null,r.dispose(e),n},heightToNormal:function(e,t){var n=document.createElement("canvas"),i=n.width=e.width,r=n.height=e.height,a=n.getContext("2d");a.drawImage(e,0,0,i,r),t=t||!1;for(var s=a.getImageData(0,0,i,r),o=a.createImageData(i,r),l=0;l<s.data.length;l+=4){if(t){var u=s.data[l],c=s.data[l+1],h=s.data[l+2];if(Math.abs(u-c)+Math.abs(c-h)>20)return console.warn("Given image is not a height map"),e}var d,f,p,m;l%(4*i)==0?(d=s.data[l],p=s.data[l+4]):l%(4*i)==4*(i-1)?(d=s.data[l-4],p=s.data[l]):(d=s.data[l-4],p=s.data[l+4]),l<4*i?(f=s.data[l],m=s.data[l+4*i]):l>i*(r-1)*4?(f=s.data[l-4*i],m=s.data[l]):(f=s.data[l-4*i],m=s.data[l+4*i]),o.data[l]=d-p+127,o.data[l+1]=f-m+127,o.data[l+2]=255,o.data[l+3]=255}return a.putImageData(o,0,0),n},isHeightImage:function(e,t,n){if(!e||!e.width||!e.height)return!1;var i=document.createElement("canvas"),r=i.getContext("2d"),a=t||32;n=n||20,i.width=i.height=a,r.drawImage(e,0,0,a,a);for(var s=r.getImageData(0,0,a,a),o=0;o<s.data.length;o+=4){var l=s.data[o],u=s.data[o+1],c=s.data[o+2];if(Math.abs(l-u)+Math.abs(u-c)>n)return!1}return!0},_fetchTexture:function(e,t,n){a.a.get({url:e,responseType:"arraybuffer",onload:t,onerror:n})},createChessboard:function(e,t,n,r){e=e||512,t=t||64,n=n||"black",r=r||"white";var a=Math.ceil(e/t),s=document.createElement("canvas");s.width=e,s.height=e;var o=s.getContext("2d");o.fillStyle=r,o.fillRect(0,0,e,e),o.fillStyle=n;for(var l=0;l<a;l++)for(var u=0;u<a;u++)(u%2?l%2:l%2-1)&&o.fillRect(l*t,u*t,t,t);return new i.a({image:s,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),new i.a({image:t})}};t.a=h},function(e,t,n){"use strict";var i=n(8),r=n(4),a=n(36),s=n(10),o=["px","nx","py","ny","pz","nz"],l=i.a.extend((function(){var e={position:new r.a,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new a.a({fov:90}),nx:new a.a({fov:90}),py:new a.a({fov:90}),ny:new a.a({fov:90}),pz:new a.a({fov:90}),nz:new a.a({fov:90})};return t.px.lookAt(r.a.POSITIVE_X,r.a.NEGATIVE_Y),t.nx.lookAt(r.a.NEGATIVE_X,r.a.NEGATIVE_Y),t.py.lookAt(r.a.POSITIVE_Y,r.a.POSITIVE_Z),t.ny.lookAt(r.a.NEGATIVE_Y,r.a.NEGATIVE_Z),t.pz.lookAt(r.a.POSITIVE_Z,r.a.NEGATIVE_Y),t.nz.lookAt(r.a.NEGATIVE_Z,r.a.NEGATIVE_Y),e._frameBuffer=new s.a,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,n){var i=e.gl;n||t.update();for(var a=this.texture.width,s=2*Math.atan(a/(a-.5))/Math.PI*180,l=0;l<6;l++){var u=o[l],c=this._cameras[u];if(r.a.copy(c.position,this.position),c.far=this.far,c.near=this.near,c.fov=s,this.shadowMapPass){c.update();var h=t.getBoundingBox();h.applyTransform(c.viewMatrix),t.viewBoundingBoxLastFrame.copy(h),this.shadowMapPass.render(e,t,c,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+l),this._frameBuffer.bind(e),e.render(t,c,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}});t.a=l},function(e,t,n){"use strict";var i=n(24),r=n(68),a=n(7),s=n(17),o=n(103);a.a.import(o.a);var l=i.a.extend((function(){var e=new a.a(a.a.source("clay.basic.vertex"),a.a.source("clay.basic.fragment")),t=new s.a({shader:e,depthMask:!1});return t.enableTexture("diffuseMap"),{scene:null,geometry:new r.a({widthSegments:30,heightSegments:30}),material:t,environmentMap:null,culling:!1}}),(function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(e){this.scene&&this.detachScene(),e.skydome=this,this.scene=e,e.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skydome=null),this.scene=null},_beforeRenderScene:function(e,t,n){this.position.copy(n.getWorldPosition()),this.update(),e.renderPass([this],n)},setEnvironmentMap:function(e){this.material.set("diffuseMap",e)},getEnvironmentMap:function(){return this.material.get("diffuseMap")},dispose:function(e){this.detachScene(),this.geometry.dispose(e)}});t.a=l},function(e,t,n){"use strict";var i=n(24),r=n(69),a=n(7),s=n(17),o=n(110);a.a.import(o.a);var l=i.a.extend((function(){var e=new a.a({vertex:a.a.source("clay.skybox.vertex"),fragment:a.a.source("clay.skybox.fragment")}),t=new s.a({shader:e,depthMask:!1});return{scene:null,geometry:new r.a,material:t,environmentMap:null,culling:!1}}),(function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(e){this.scene&&this.detachScene(),e.skybox=this,this.scene=e,e.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(e){this.detachScene(),this.geometry.dispose(e)},setEnvironmentMap:function(e){this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,n){this.renderSkybox(e,n)},renderSkybox:function(e,t){this.position.copy(t.getWorldPosition()),this.update(),e.gl.disable(e.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],t)}});t.a=l},function(e,t,n){"use strict";var i=n(2),r=n(143),a=n(144);i.a.Shader.import(a.a),t.a=i.a.Mesh.extend((function(){return{geometry:new r.a({dynamic:!0}),material:new i.a.Material({shader:i.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(186),o=n(22),l=n(3),u=n(1),c=n.n(u),h=n(60),d=n(61),f=n(40),p=c.a.vec3;function m(e){this.rootNode=new a.a.Node,this._triangulationResults={},this._shadersMap=a.a.COMMON_SHADERS.reduce((function(e,t){return e[t]=a.a.createShader("ecgl."+t),e}),{}),this._linesShader=a.a.createShader("ecgl.meshLines3D");var t={};a.a.COMMON_SHADERS.forEach((function(e){t[e]=new a.a.Material({shader:a.a.createShader("ecgl."+e)})})),this._groundMaterials=t,this._groundMesh=new a.a.Mesh({geometry:new a.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new d.a(512,512,e),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=e}a.a.Shader.import(f.a),m.prototype={constructor:m,extrudeY:!0,update:function(e,t,n,i,r){var a=e.getData();null==i&&(i=0),null==r&&(r=a.count()),this._startIndex=i,this._endIndex=r-1,this._triangulation(e,i,r);var s=this._getShader(e.get("shading"));this._prepareMesh(e,s,n,i,r),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,n,i,r);var o=e.coordinateSystem;"geo3D"===o.type&&this._updateGroundPlane(e,o,n);var l=this;this._labelsBuilder.updateData(a,i,r),this._labelsBuilder.getLabelPosition=function(e,t,n){var i=a.getName(e),r=n;if("geo3D"===o.type)return u=o.getRegion(i).center,o.dataToPoint([u[0],u[1],r]);var s=l._triangulationResults[e-l._startIndex],u=l.extrudeY?[(s.max[0]+s.min[0])/2,s.max[1]+r,(s.max[2]+s.min[2])/2]:[(s.max[0]+s.min[0])/2,(s.max[1]+s.min[1])/2,s.max[2]+r]},this._data=a,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){this.rootNode.removeAll();var e,t=this,n=(e=new a.a.Mesh({name:"Polygon",material:new a.a.Material({shader:t._shadersMap.lambert}),culling:!1,geometry:new a.a.Geometry({sortTriangles:!0,dynamic:!0}),ignorePicking:!0,renderNormal:!0}),r.a.util.extend(e.geometry,h.a),e),i=new a.a.Mesh({material:new a.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new o.a({useNativeLine:!1})});this.rootNode.add(n),this.rootNode.add(i),n.material.define("both","VERTEX_COLOR"),n.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=n,this._linesMesh=i,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return t||(console.warn("Unkown shading "+e),t=this._shadersMap.lambert),t.__shading=e,t},_prepareMesh:function(e,t,n,i,r){for(var s=0,o=0,l=0,u=0,c=i;c<r;c++){var h=this._getRegionPolygonInfo(c),d=this._getRegionLinesInfo(c,e,this._linesMesh.geometry);s+=h.vertexCount,o+=h.triangleCount,l+=d.vertexCount,u+=d.triangleCount}var f=this._polygonMesh,p=f.geometry;["position","normal","texcoord0","color"].forEach((function(e){p.attributes[e].init(s)})),p.indices=s>65535?new Uint32Array(3*o):new Uint16Array(3*o),f.material.shader!==t&&f.material.attachShader(t,!0),a.a.setMaterialFromModel(t.__shading,f.material,e,n),l>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(l),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(s),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-i))},_updateRegionMesh:function(e,t,n,i){for(var r=e.getData(),s=0,o=0,u=!1,c=this._polygonMesh,h=this._linesMesh,d=n;d<i;d++){var f=e.getRegionModel(d),p=f.getModel("itemStyle"),m=p.get("color"),g=l.a.firstNotNull(p.get("opacity"),1),_=r.getItemVisual(d,"color",!0);null!=_&&r.hasValue(d)&&(m=_),r.setItemVisual(d,"color",m),r.setItemVisual(d,"opacity",g),m=a.a.parseColor(m);var v=a.a.parseColor(p.get("borderColor"));m[3]*=g,v[3]*=g;var y=m[3]<.99;c.material.set("color",[1,1,1,1]),u=u||y;for(var b=l.a.firstNotNull(f.get("height",!0),e.get("regionHeight")),x=this._updatePolygonGeometry(e,c.geometry,d,b,s,o,m),E=s;E<x.vertexOffset;E++)this._dataIndexOfVertex[E]=d;this._vertexRangeOfDataIndex[2*(d-n)]=s,this._vertexRangeOfDataIndex[2*(d-n)+1]=x.vertexOffset,s=x.vertexOffset,o=x.triangleOffset;var w=p.get("borderWidth"),T=w>0;T&&(w*=t.getDevicePixelRatio(),this._updateLinesGeometry(h.geometry,e,d,b,w,e.coordinateSystem.transform)),h.invisible=!T,h.material.set({color:v})}(c=this._polygonMesh).material.transparent=u,c.material.depthMask=!u,c.geometry.updateBoundingBox(),c.material.get("normalMap")&&c.geometry.generateTangents(),c.seriesIndex=e.seriesIndex,c.on("mousemove",this._onmousemove,this),c.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var n=a.a.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),i=l.a.firstNotNull(t.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",n),r.material.set("wireframeLineWidth",i)}},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t)),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseover:function(e){if(e.target){var t=e.target.eventData?this._data.indexOfName(e.target.eventData.name):e.target.dataIndex;null!=t&&(this.highlight(t),this._labelsBuilder.updateLabels([t]))}},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1)},_updateGroundPlane:function(e,t,n){var i=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!i.get("show",!0),!this._groundMesh.invisible){var r=e.get("shading"),s=this._groundMaterials[r];s||(console.warn("Unkown shading "+r),s=this._groundMaterials.lambert),a.a.setMaterialFromModel(r,s,i,n),s.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=s,this._groundMesh.material.set("color",a.a.parseColor(i.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,n){this._triangulationResults=[];for(var i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],a=e.coordinateSystem,o=t;o<n;o++){for(var l=[],u=e.getRegionPolygonCoords(o),c=0;c<u.length;c++){var h=u[c].exterior,d=u[c].interiors,f=[],m=[];if(!(h.length<3)){for(var g=0,_=0;_<h.length;_++){var v=h[_];f[g++]=v[0],f[g++]=v[1]}for(_=0;_<d.length;_++)if(!(d[_].length<3)){for(var y=f.length/2,b=0;b<d[_].length;b++)v=d[_][b],f.push(v[0]),f.push(v[1]);m.push(y)}var x=Object(s.a)(f,m),E=new Float64Array(f.length/2*3),w=[],T=[1/0,1/0,1/0],S=[-1/0,-1/0,-1/0],A=0;for(_=0;_<f.length;)p.set(w,f[_++],0,f[_++]),a&&a.transform&&p.transformMat4(w,w,a.transform),p.min(T,T,w),p.max(S,S,w),E[A++]=w[0],E[A++]=w[1],E[A++]=w[2];p.min(i,i,T),p.max(r,r,S),l.push({points:E,indices:x,min:T,max:S})}}this._triangulationResults.push(l)}this._geoBoundingBox=[i,r]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],n=0,i=0,r=0;r<t.length;r++)n+=t[r].points.length/3,i+=t[r].indices.length/3;return{vertexCount:2*n+4*n,triangleCount:2*i+2*n}},_updatePolygonGeometry:function(e,t,n,i,r,a,s){var o=e.get("projectUVOnGround"),l=t.attributes.position,u=t.attributes.normal,c=t.attributes.texcoord0,h=t.attributes.color,d=this._triangulationResults[n-this._startIndex],f=h.value&&s,m=t.indices,g=this.extrudeY?1:2,_=this.extrudeY?2:1,v=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],y=p.mul([],this._geoBoundingBox[0],v),b=p.mul([],this._geoBoundingBox[1],v),x=Math.max(b[0]-y[0],b[2]-y[2]);function E(e,t,n){var i=r;!function(e,t,n){for(var i=e.points,a=i.length,o=[],u=[],d=0;d<a;d+=3)o[0]=i[d],o[g]=t,o[_]=i[d+2],u[0]=(i[d]*v[0]-y[0])/x,u[1]=(i[d+2]*v[_]-y[2])/x,l.set(r,o),f&&h.set(r,s),c.set(r++,u)}(e,t);for(var o=0;o<e.indices.length;o++)m[3*a+o]=e.indices[o]+i;a+=e.indices.length/3}for(var w=this.extrudeY?[0,1,0]:[0,0,1],T=p.negate([],w),S=0;S<d.length;S++){var A=r,C=d[S];E(C,0),E(C,i);for(var L=C.points.length/3,R=0;R<L;R++)u.set(A+R,T),u.set(A+R+L,w);var I=[0,3,1,1,3,2],D=[[],[],[],[]],k=[],M=[],P=[],O=[],N=0;for(R=0;R<L;R++){for(var F=(R+1)%L,B=(C.points[3*F]-C.points[3*R])*v[0],U=(C.points[3*F+2]-C.points[3*R+2])*v[_],G=Math.sqrt(B*B+U*U),z=0;z<4;z++){var j=0===z||3===z,H=3*(j?R:F);D[z][0]=C.points[H],D[z][g]=z>1?i:0,D[z][_]=C.points[H+2],l.set(r+z,D[z]),o?(O[0]=(C.points[H]*v[0]-y[0])/x,O[1]=(C.points[H+2]*v[_]-y[_])/x):(O[0]=(j?N:N+G)/x,O[1]=(D[z][g]*v[g]-y[g])/x),c.set(r+z,O)}for(p.sub(k,D[1],D[0]),p.sub(M,D[3],D[0]),p.cross(P,k,M),p.normalize(P,P),z=0;z<4;z++)u.set(r+z,P),f&&h.set(r+z,s);for(z=0;z<6;z++)m[3*a+z]=I[z]+r;r+=4,a+=2,N+=G}}return t.dirty(),{vertexOffset:r,triangleOffset:a}},_getRegionLinesInfo:function(e,t,n){var i=0,r=0;return t.getRegionModel(e).getModel("itemStyle").get("borderWidth")>0&&t.getRegionPolygonCoords(e).forEach((function(e){var t=e.exterior,a=e.interiors;i+=n.getPolylineVertexCount(t),r+=n.getPolylineTriangleCount(t);for(var s=0;s<a.length;s++)i+=n.getPolylineVertexCount(a[s]),r+=n.getPolylineTriangleCount(a[s])}),this),{vertexCount:i,triangleCount:r}},_updateLinesGeometry:function(e,t,n,i,r,a){function s(e){for(var t=new Float64Array(3*e.length),n=0,r=[],s=0;s<e.length;s++)r[0]=e[s][0],r[1]=i+.1,r[2]=e[s][1],a&&p.transformMat4(r,r,a),t[n++]=r[0],t[n++]=r[1],t[n++]=r[2];return t}var o=[1,1,1,1];t.getRegionPolygonCoords(n).forEach((function(t){var n=t.exterior,i=t.interiors;e.addPolyline(s(n),o,r);for(var a=0;a<i.length;a++)e.addPolyline(s(i[a]),o,r)}))},highlight:function(e){var t=this._data;if(t){var n=t.getItemModel(e).getModel("emphasis.itemStyle"),i=n.get("color"),s=l.a.firstNotNull(n.get("opacity"),t.getItemVisual(e,"opacity"),1);if(null==i){var o=t.getItemVisual(e,"color");i=r.a.color.lift(o,-.4)}null==s&&(s=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(i);u[3]*=s,this._setColorOfDataIndex(t,e,u)}},downplay:function(e){var t=this._data;if(t){var n=t.getItemVisual(e,"color"),i=l.a.firstNotNull(t.getItemVisual(e,"opacity"),1),r=a.a.parseColor(n);r[3]*=i,this._setColorOfDataIndex(t,e,r)}},_setColorOfDataIndex:function(e,t,n){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var i=this._vertexRangeOfDataIndex[2*t];i<this._vertexRangeOfDataIndex[2*t+1];i++)this._polygonMesh.geometry.attributes.color.set(i,n);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}},t.a=m},function(e,t,n){"use strict";var i=n(81),r=n(1),a=n.n(r).a.vec3,s=a.create(),o=a.create(),l=a.create();t.a={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(e,t){var n=this.indices;if(0===t){var i=this.attributes.position;e=e.array,this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var r,u=0,c=0;c<n.length;){i.get(n[c++],s),i.get(n[c++],o),i.get(n[c++],l);var h=a.sqrDist(s,e),d=a.sqrDist(o,e),f=a.sqrDist(l,e),p=Math.min(h,d);p=Math.min(p,f),3===c?(r=p,p=0):p-=r,this._triangleZList[u++]=p}}var m=this._sortedTriangleIndices;for(c=0;c<m.length;c++)m[c]=c;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(c=0;c<3;c++)this._progressiveQuickSort(3*t+c);var g=this._indicesTmp,_=this._triangleZListTmp,v=this._triangleZList;for(c=0;c<this.triangleCount;c++){var y=3*m[c],b=3*c;g[b++]=n[y++],g[b++]=n[y++],g[b]=n[y],_[c]=v[m[c]]}var x=this._indicesTmp;this._indicesTmp=this.indices,this.indices=x,x=this._triangleZListTmp,this._triangleZListTmp=this._triangleZList,this._triangleZList=x,this.dirtyIndices()},_simpleSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):i.a.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._triangleZList,n=this._sortedTriangleIndices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(73),s=n(58),o=n(3);function l(e,t,n){this._labelsMesh=new s.a,this._labelTextureSurface=new a.a({width:512,height:512,devicePixelRatio:n.getDevicePixelRatio(),onupdate:function(){n.getZr().refresh()}}),this._api=n,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}l.prototype.getLabelPosition=function(e,t,n){return[0,0,0]},l.prototype.getLabelDistance=function(e,t,n){return 0},l.prototype.getMesh=function(){return this._labelsMesh},l.prototype.updateData=function(e,t,n){null==t&&(t=0),null==n&&(n=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===n-t||(this._labelsVisibilitiesBits=new Uint8Array(n-t));for(var i=["label","show"],r=["emphasis","label","show"],a=t;a<n;a++){var s=e.getItemModel(a),o=s.get(i),l=s.get(r);null==l&&(l=o);var u=(o?1:0)|(l?2:0);this._labelsVisibilitiesBits[a-t]=u}this._start=t,this._end=n,this._data=e},l.prototype.updateLabels=function(e){if(this._data){for(var t=(e=e||[]).length>0,n={},i=0;i<e.length;i++)n[e[i]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var a=["label"],s=["emphasis","label"],l=this._data.hostModel,u=this._data,c=l.getModel(a),h=l.getModel(s,c),d={left:"right",right:"left",top:"center",bottom:"center"},f={left:"middle",right:"middle",top:"bottom",bottom:"top"},p=this._start;p<this._end;p++){var m=!1;if(t&&n[p]&&(m=!0),this._labelsVisibilitiesBits[p-this._start]&(m?2:1)){var g=u.getItemModel(p).getModel(m?s:a,m?h:c),_=g.get("distance")||0,v=g.get("position"),y=g.getModel("textStyle"),b=this._api.getDevicePixelRatio(),x=l.getFormattedLabel(p,m?"emphasis":"normal");if(null==x||""===x)return;var E=new r.a.graphic.Text;r.a.graphic.setTextStyle(E.style,y,{text:x,textFill:y.get("color")||u.getItemVisual(p,"color")||"#000",textAlign:"left",textVerticalAlign:"top",opacity:o.a.firstNotNull(y.get("opacity"),u.getItemVisual(p,"opacity"),1)});var w=E.getBoundingRect();w.height*=1.2;var T=this._labelTextureSurface.add(E),S=d[v]||"center",A=f[v]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(p,v,_),[w.width*b,w.height*b],T,S,A,this.getLabelDistance(p,v,_)*b)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},t.a=l},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(216),o=n(217),l=n(61),u=n(9),c=n(3);function h(e,t){this.rootNode=new a.a.Node,this.is2D=e,this._labelsBuilder=new l.a(256,256,t),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=t,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}h.prototype={constructor:h,highlightOnMouseover:!0,update:function(e,t,n,i,r){var s=this._prevMesh;this._prevMesh=this._mesh,this._mesh=s;var l=e.getData();if(null==i&&(i=0),null==r&&(r=l.count()),this._startDataIndex=i,this._endDataIndex=r-1,!this._mesh){var u=this._prevMesh&&this._prevMesh.material;this._mesh=new o.a({renderOrder:10,frustumCulling:!1}),u&&(this._mesh.material=u)}u=this._mesh.material;var c=this._mesh.geometry,h=c.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var d=this._getSymbolInfo(e,i,r),f=n.getDevicePixelRatio(),p=e.getModel("itemStyle").getItemStyle(),m=e.get("large"),g=1;d.maxSize>2?(g=this._updateSymbolSprite(e,p,d,f),u.enableTexture("sprite")):u.disableTexture("sprite"),h.position.init(r-i);var _=[];if(m){u.undefine("VERTEX_SIZE"),u.undefine("VERTEX_COLOR");var v=l.getVisual("color"),y=l.getVisual("opacity");a.a.parseColor(v,_),_[3]*=y,u.set({color:_,u_Size:d.maxSize*this._sizeScale})}else u.set({color:[1,1,1,1]}),u.define("VERTEX_SIZE"),u.define("VERTEX_COLOR"),h.size.init(r-i),h.color.init(r-i),this._originalOpacity=new Float32Array(r-i);for(var b=l.getLayout("points"),x=h.position.value,E=0;E<r-i;E++){var w=3*E,T=2*E;if(this.is2D?(x[w]=b[T],x[w+1]=b[T+1],x[w+2]=-10):(x[w]=b[w],x[w+1]=b[w+1],x[w+2]=b[w+2]),!m){v=l.getItemVisual(E,"color"),y=l.getItemVisual(E,"opacity"),a.a.parseColor(v,_),_[3]*=y,h.color.set(E,_),_[3];var S=l.getItemVisual(E,"symbolSize");S=S instanceof Array?Math.max(S[0],S[1]):S,isNaN(S)&&(S=0),h.size.value[E]=S*g*this._sizeScale,this._originalOpacity[E]=_[3]}}this._mesh.sizeScale=g,c.updateBoundingBox(),c.dirty(),this._updateMaterial(e,p);var A=e.coordinateSystem;A&&A.viewGL&&u[A.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE"),m||this._updateLabelBuilder(e,i,r),this._updateHandler(e,t,n),this._updateAnimation(e),this._api=n},getPointsMesh:function(){return this._mesh},updateLabels:function(e){this._labelsBuilder.updateLabels(e)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},_updateSymbolSprite:function(e,t,n,i){n.maxSize=Math.min(2*n.maxSize,200);var r,a,o=[];return n.aspect>1?(o[0]=n.maxSize,o[1]=n.maxSize/n.aspect):(o[1]=n.maxSize,o[0]=n.maxSize*n.aspect),o[0]=o[0]||1,o[1]=o[1]||1,this._symbolType===n.type&&(r=this._symbolSize,a=o,r&&a&&r[0]===a[0]&&r[1]===a[1])&&this._lineWidth===t.lineWidth||(s.a.createSymbolSprite(n.type,o,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(o[0]/2,10)},this._spriteImageCanvas),s.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=o,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/n.maxSize*i},_updateMaterial:function(e,t){var n="lighter"===e.get("blendMode")?a.a.additiveBlend:null,i=this._mesh.material;i.blend=n,i.set("lineWidth",t.lineWidth/20);var r=a.a.parseColor(t.stroke);i.set("strokeColor",r),i.transparent=!0,i.depthMask=!1,i.depthTest=!this.is2D,i.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,n){var i=e.getData(),r=this._mesh.geometry,a=r.attributes.position.value,s=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(i,t,n),this._labelsBuilder.getLabelPosition=function(e,n,i){var r=3*(e-t);return[a[r],a[r+1],a[r+2]]},this._labelsBuilder.getLabelDistance=function(e,n,i){return r.attributes.size.get(e-t)/s/2+i},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,n){var i,r=e.getData(),a=this._mesh,s=this,o=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(i=e.coordinateSystem.model),a.seriesIndex=e.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(t){var u=t.vertexIndex+s._startDataIndex;u!==o&&(this.highlightOnMouseover&&(this.downplay(r,o),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get(e.coordDimToDataDim("x")[0],u),r.get(e.coordDimToDataDim("y")[0],u),r.get(e.coordDimToDataDim("z")[0],u)],grid3DIndex:i.componentIndex})),a.dataIndex=u,o=u}),this),a.on("mouseout",(function(e){var t=e.vertexIndex+s._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,t),this._labelsBuilder.updateLabels()),o=-1,a.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:i.componentIndex})}),this)},updateLayout:function(e,t,n){var i=e.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=i.getLayout("points");if(this.is2D)for(var s=0;s<a.length/2;s++){var o=3*s,l=2*s;r[o]=a[l],r[o+1]=a[l+1],r[o+2]=-10}else for(s=0;s<a.length;s++)r[s]=a[s];this._mesh.geometry.dirty(),n.getZr().refresh()}},updateView:function(e){if(this._mesh){var t=new u.a;u.a.mul(t,e.viewMatrix,this._mesh.worldTransform),u.a.mul(t,e.projectionMatrix,t),this._mesh.updateNDCPosition(t,this.is2D,this._api)}},highlight:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=e.getItemModel(t).getModel("emphasis.itemStyle"),i=n.get("color"),s=n.get("opacity");if(null==i){var o=e.getItemVisual(t,"color");i=r.a.color.lift(o,-.4)}null==s&&(s=e.getItemVisual(t,"opacity"));var l=a.a.parseColor(i);l[3]*=s,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,l),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var n=e.getItemVisual(t,"color"),i=e.getItemVisual(t,"opacity"),r=a.a.parseColor(n);r[3]*=i,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,r),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,n=0;n<t.vertexCount;n++){var i=this._originalOpacity[n]*e;t.attributes.color.value[4*n+3]=i}t.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(e){this._mesh&&this._setPositionTextureToMesh(this._mesh,e),this._positionTexture=e},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(e){if(e!==this._sizeScale){if(this._mesh){var t=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",t/this._sizeScale*e);var n=this._mesh.geometry.attributes;if(n.size.value)for(var i=0;i<n.size.value.length;i++)n.size.value[i]=n.size.value[i]/this._sizeScale*e}this._sizeScale=e}},_setPositionTextureToMesh:function(e,t){t&&e.material.set("positionTexture",t),e.material[t?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(e,t,n){if(e.get("large"))return(d=c.a.firstNotNull(e.get("symbolSize"),1))instanceof Array?(l=Math.max(d[0],d[1]),i=d[0]/d[1]):(l=d,i=1),{maxSize:d,type:e.get("symbol"),aspect:i};for(var i,r=e.getData(),a=!1,s=r.getItemVisual(0,"symbol")||"circle",o=!1,l=0,u=t;u<n;u++){var h,d=r.getItemVisual(u,"symbolSize"),f=r.getItemVisual(u,"symbol");if(d instanceof Array)h=d[0]/d[1],l=Math.max(Math.max(d[0],d[1]),l);else{if(isNaN(d))return;h=1,l=Math.max(d,l)}null!=i&&Math.abs(h-i)>.05&&(a=!0),f!==s&&(o=!0),s=f,i=h}return a&&console.warn("Different symbol width / height ratio will be ignored."),o&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:s,aspect:i}}},t.a=h},function(e,t,n){"use strict";t.a="@export clay.prez.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvoid main()\n{\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);\n}\n@end\n@export clay.prez.fragment\nvoid main()\n{\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n@end"},function(e,t,n){"use strict";var i,r=n(28),a=n(11),s=0,o=null,l=!0,u=function(){this.triangleCount=0,this.vertexCount=0,this.drawCallCount=0};function c(e,t,n){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=n,this.vao=null}var h,d=r.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_drawCache:null,_renderInfo:null},(function(){this._drawCache={},this._renderInfo=new u}),{__program:null,lightGroup:0,renderOrder:0,lineWidth:1,culling:!0,cullFace:a.a.BACK,frontFace:a.a.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=r.a.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},render:function(e,t,n){var r=e.gl,u=(t=t||this.material).shader,h=this.geometry,d=this.mode,f=h.vertexCount,p=(h.isUseIndices(),e.getGLExtension("OES_element_index_uint")&&f>65535?r.UNSIGNED_INT:r.UNSIGNED_SHORT),m=e.getGLExtension("OES_vertex_array_object"),g=!h.dynamic,_=this._renderInfo;_.vertexCount=f,_.triangleCount=0,_.drawCallCount=0;var v=!1;if(((i=e.__uid__+"-"+h.__uid__+"-"+n.__uid__)!==s||m&&g||h._cache.isDirty("any"))&&(v=!0),s=i,v){var y=this._drawCache[i];if(!y){var b=h.getBufferChunks(e);if(!b)return;y=[];for(var x=0;x<b.length;x++){for(var E=b[x],w=E.attributeBuffers,T=E.indicesBuffer,S=[],A=[],C=0;C<w.length;C++){var L,R=(F=w[C]).name,I=F.semantic;if(I){var D=u.attributeSemantics[I];L=D&&D.symbol}else L=R;L&&n.attributes[L]&&(S.push(F),A.push(L))}var k=new c(S,A,T);y.push(k)}g&&(this._drawCache[i]=y)}for(var M=0;M<y.length;M++){k=y[M];var P=!0;if(m&&g&&(null==k.vao?k.vao=m.createVertexArrayOES():P=!1,m.bindVertexArrayOES(k.vao)),S=k.availableAttributes,T=k.indicesBuffer,P){var O=n.enableAttributes(e,k.availableAttributeSymbols,m&&g&&k.vao);for(C=0;C<S.length;C++){var N=O[C];if(-1!==N){var F,B,U=(F=S[C]).buffer,G=F.size;switch(F.type){case"float":default:B=r.FLOAT;break;case"byte":B=r.BYTE;break;case"ubyte":B=r.UNSIGNED_BYTE;break;case"short":B=r.SHORT;break;case"ushort":B=r.UNSIGNED_SHORT}r.bindBuffer(r.ARRAY_BUFFER,U),r.vertexAttribPointer(N,G,B,!1,0,0)}}}d!=a.a.LINES&&d!=a.a.LINE_STRIP&&d!=a.a.LINE_LOOP||r.lineWidth(this.lineWidth),o=T,(l=h.isUseIndices())?(P&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,T.buffer),r.drawElements(d,T.count,p,0),_.triangleCount+=T.count/3):r.drawArrays(d,0,f),m&&g&&m.bindVertexArrayOES(null),_.drawCallCount++}}else l?(r.drawElements(d,o.count,p,0),_.triangleCount=o.count/3):r.drawArrays(d,0,f),_.drawCallCount=1;return _},clone:(h=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=r.a.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<h.length;t++){var n=h[t];e[n]!==this[n]&&(e[n]=this[n])}return e})});d.POINTS=a.a.POINTS,d.LINES=a.a.LINES,d.LINE_LOOP=a.a.LINE_LOOP,d.LINE_STRIP=a.a.LINE_STRIP,d.TRIANGLES=a.a.TRIANGLES,d.TRIANGLE_STRIP=a.a.TRIANGLE_STRIP,d.TRIANGLE_FAN=a.a.TRIANGLE_FAN,d.BACK=a.a.BACK,d.FRONT=a.a.FRONT,d.FRONT_AND_BACK=a.a.FRONT_AND_BACK,d.CW=a.a.CW,d.CCW=a.a.CCW,d.RenderInfo=u,t.a=d},function(e,t){var n="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)};e.exports=n},function(e,t,n){"use strict";var i={isPowerOfTwo:function(e){return 0==(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}};t.a=i},function(e,t,n){"use strict";var i,r,a,s,o=n(4),l=n(1),u=n.n(l),c=u.a.vec3,h=u.a.mat4,d=u.a.vec4,f=function(e,t){this.normal=e||new o.a(0,1,0),this.distance=t||0};f.prototype={constructor:f,distanceToPoint:function(e){return c.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new o.a);var n=this.distanceToPoint(e);return c.scaleAndAdd(t.array,e.array,this.normal.array,-n),t._dirty=!0,t},normalize:function(){var e=1/c.len(this.normal.array);c.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,n=this.normal.array,i=c.dot(t[0].array,n)>this.distance,r=1;r<8;r++)if(c.dot(t[r].array,n)>this.distance!=i)return!0},intersectLine:(s=c.create(),function(e,t,n){var i=this.distanceToPoint(e),r=this.distanceToPoint(t);if(i>0&&r>0||i<0&&r<0)return null;var a=this.normal.array,l=this.distance,u=e.array;c.sub(s,t.array,e.array),c.normalize(s,s);var h=c.dot(a,s);if(0===h)return null;n||(n=new o.a);var d=(c.dot(a,u)-l)/h;return c.scaleAndAdd(n.array,u,s,-d),n._dirty=!0,n}),applyTransform:(i=h.create(),r=d.create(),a=d.create(),a[3]=1,function(e){e=e.array,c.scale(a,this.normal.array,this.distance),d.transformMat4(a,a,e),this.distance=c.dot(a,this.normal.array),h.invert(i,e),h.transpose(i,i),r[3]=0,c.copy(r,this.normal.array),d.transformMat4(r,r,i),c.copy(this.normal.array,r)}),copy:function(e){c.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new f;return e.copy(this),e}},t.a=f},function(e,t,n){"use strict";var i=n(13),r=n(15),a=i.a.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var e=this.heightSegments,t=this.widthSegments,n=this.attributes.position,i=this.attributes.texcoord0,a=this.attributes.normal,s=(t+1)*(e+1);n.init(s),i.init(s),a.init(s);var o,l,u,c,h,d,f,p,m,g,_,v=s>65535?Uint32Array:Uint16Array,y=this.indices=new v(t*e*6),b=this.radius,x=this.phiStart,E=this.phiLength,w=this.thetaStart,T=this.thetaLength,S=[],A=[],C=0,L=1/(b=this.radius);for(f=0;f<=e;f++)for(d=0;d<=t;d++)c=d/t,h=f/e,o=-b*Math.cos(x+c*E)*Math.sin(w+h*T),l=b*Math.cos(w+h*T),u=b*Math.sin(x+c*E)*Math.sin(w+h*T),S[0]=o,S[1]=l,S[2]=u,A[0]=c,A[1]=h,n.set(C,S),i.set(C,A),S[0]*=L,S[1]*=L,S[2]*=L,a.set(C,S),C++;var R=t+1,I=0;for(f=0;f<e;f++)for(d=0;d<t;d++)m=f*R+d,p=f*R+d+1,_=(f+1)*R+d+1,g=(f+1)*R+d,y[I++]=p,y[I++]=m,y[I++]=_,y[I++]=m,y[I++]=g,y[I++]=_;this.boundingBox=new r.a,this.boundingBox.max.set(b,b,b),this.boundingBox.min.set(-b,-b,-b)}});t.a=a},function(e,t,n){"use strict";var i=n(13),r=n(37),a=n(9),s=n(4),o=n(15),l=n(18),u=new a.a,c=i.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:h("px",this.depthSegments,this.heightSegments),nx:h("nx",this.depthSegments,this.heightSegments),py:h("py",this.widthSegments,this.depthSegments),ny:h("ny",this.widthSegments,this.depthSegments),pz:h("pz",this.widthSegments,this.heightSegments),nz:h("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],n=0,i=0;for(var r in e)n+=e[r].vertexCount,i+=e[r].indices.length;for(var a=0;a<t.length;a++)this.attributes[t[a]].init(n);this.indices=new l.a.Uint16Array(i);var s=0,u=0;for(var r in e){var c=e[r];for(a=0;a<t.length;a++)for(var d=t[a],f=c.attributes[d].value,p=c.attributes[d].size,m="normal"===d,g=0;g<f.length;g++){var _=f[g];this.inside&&m&&(_=-_),this.attributes[d].value[g+p*u]=_}var v=c.indices.length;for(g=0;g<c.indices.length;g++)this.indices[g+s]=u+c.indices[this.inside?v-g-1:g];s+=c.indices.length,u+=c.vertexCount}this.boundingBox=new o.a,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function h(e,t,n){u.identity();var i=new r.a({widthSegments:t,heightSegments:n});switch(e){case"px":a.a.translate(u,u,s.a.POSITIVE_X),a.a.rotateY(u,u,Math.PI/2);break;case"nx":a.a.translate(u,u,s.a.NEGATIVE_X),a.a.rotateY(u,u,-Math.PI/2);break;case"py":a.a.translate(u,u,s.a.POSITIVE_Y),a.a.rotateX(u,u,-Math.PI/2);break;case"ny":a.a.translate(u,u,s.a.NEGATIVE_Y),a.a.rotateX(u,u,Math.PI/2);break;case"pz":a.a.translate(u,u,s.a.POSITIVE_Z);break;case"nz":a.a.translate(u,u,s.a.NEGATIVE_Z),a.a.rotateY(u,u,Math.PI)}return i.applyTransform(u),i}t.a=c},function(e,t,n){"use strict";var i=n(19),r=n(4),a=i.a.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new r.a,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=i.a.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,n){"use strict";var i=n(19),r=i.a.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(e){return e.range}},pointLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=i.a.prototype.clone.call(this);return e.range=this.range,e}});t.a=r},function(e,t,n){"use strict";var i=n(19),r=n(4),a=i.a.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:2e-4,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(e){return e.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(e){return e.falloffFactor}},spotLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new r.a,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}},clone:function(){var e=i.a.prototype.clone.call(this);return e.range=this.range,e.umbraAngle=this.umbraAngle,e.penumbraAngle=this.penumbraAngle,e.falloffFactor=this.falloffFactor,e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(5);function s(e,t,n,i,r,a,s){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=i,this.height=r,this.offsetX=t,this.offsetY=n,this.dpr=s,this.gap=a}function o(e){(e=e||{}).width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=null==e.gap?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new a.a({image:t,flipY:!1});var n=this;this._zr=r.a.zrender.init(t);var i=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){i.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new s(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}s.prototype={constructor:s,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,n){var i=e.getBoundingRect();null==t&&(t=i.width),null==n&&(n=i.height),t*=this.dpr,n*=this.dpr,this._fitElement(e,t,n);var r=this._x,a=this._y,s=this.width*this.dpr,o=this.height*this.dpr,l=this.gap;if(r+t+l>s&&(r=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,n),a+n+l>o)return null;e.position[0]+=this.offsetX*this.dpr+r,e.position[1]+=this.offsetY*this.dpr+a,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[r/s+u[0],a/o+u[1]],[(r+t)/s+u[0],(a+n)/o+u[1]]]},_fitElement:function(e,t,n){var i=e.getBoundingRect(),r=t/i.width,a=n/i.height;e.position=[-i.x*r,-i.y*a],e.scale=[r,a],e.update()}},o.prototype={clear:function(){for(var e=0;e<this._textureAtlasNodes.length;e++)this._textureAtlasNodes[e].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var e=4096/this._dpr,t=this._textureAtlasNodes.length,n=t*this._nodeWidth%e,i=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(i>=e)){var r=(n+this._nodeWidth)*this._dpr,a=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:a})}catch(e){this._canvas.width=r,this._canvas.height=a}var o=new s(this._zr,n,i,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(o),o}console.error("Too much labels. Some will be ignored.")},add:function(e,t,n){if(this._coords[e.id])return console.warn("Element already been add"),this._coords[e.id];var i=this._getCurrentNode().add(e,t,n);if(!i){var r=this._expand();if(!r)return;i=r.add(e,t,n)}return this._coords[e.id]=i,i},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]}},t.a=o},function(e,t,n){"use strict";t.a=function(e,t,n){var i,r=e.scale;return"ordinal"===r.type&&("function"==typeof n?(i=r.getTicks()[t],!n(i,r.getLabel(i))):t%(n+1))}},function(e,t,n){var i,r,a,s,o=n(76),l=n(77),u=o.applyTransform,c=Math.min,h=Math.max;function d(e,t,n,i){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}d.prototype={constructor:d,union:function(e){var t=c(e.x,this.x),n=c(e.y,this.y);this.width=h(e.x+e.width,this.x+this.width)-t,this.height=h(e.y+e.height,this.y+this.height)-n,this.x=t,this.y=n},applyTransform:(i=[],r=[],a=[],s=[],function(e){if(e){i[0]=a[0]=this.x,i[1]=s[1]=this.y,r[0]=s[0]=this.x+this.width,r[1]=a[1]=this.y+this.height,u(i,i,e),u(r,r,e),u(a,a,e),u(s,s,e),this.x=c(i[0],r[0],a[0],s[0]),this.y=c(i[1],r[1],a[1],s[1]);var t=h(i[0],r[0],a[0],s[0]),n=h(i[1],r[1],a[1],s[1]);this.width=t-this.x,this.height=n-this.y}}),calculateTransform:function(e){var t=this,n=e.width/t.width,i=e.height/t.height,r=l.create();return l.translate(r,r,[-t.x,-t.y]),l.scale(r,r,[n,i]),l.translate(r,r,[e.x,e.y]),r},intersect:function(e){if(!e)return!1;e instanceof d||(e=d.create(e));var t=this,n=t.x,i=t.x+t.width,r=t.y,a=t.y+t.height,s=e.x,o=e.x+e.width,l=e.y,u=e.y+e.height;return!(i<s||o<n||a<l||u<r)},contain:function(e,t){var n=this;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},clone:function(){return new d(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},d.create=function(e){return new d(e.x,e.y,e.width,e.height)};var f=d;e.exports=f},function(e,t){var n="undefined"==typeof Float32Array?Array:Float32Array;function i(e){return Math.sqrt(a(e))}var r=i;function a(e){return e[0]*e[0]+e[1]*e[1]}var s=a;function o(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var l=o;function u(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var c=u;t.create=function(e,t){var i=new n(2);return null==e&&(e=0),null==t&&(t=0),i[0]=e,i[1]=t,i},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},t.clone=function(e){var t=new n(2);return t[0]=e[0],t[1]=e[1],t},t.set=function(e,t,n){return e[0]=t,e[1]=n,e},t.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},t.scaleAndAdd=function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},t.sub=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},t.len=i,t.length=r,t.lenSquare=a,t.lengthSquare=s,t.mul=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},t.div=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},t.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},t.normalize=function(e,t){var n=i(t);return 0===n?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e},t.distance=o,t.dist=l,t.distanceSquare=u,t.distSquare=c,t.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},t.lerp=function(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e},t.applyTransform=function(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[2]*r+n[4],e[1]=n[1]*i+n[3]*r+n[5],e},t.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},t.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}},function(e,t){var n="undefined"==typeof Float32Array?Array:Float32Array;function i(){var e=new n(6);return r(e),e}function r(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}t.create=i,t.identity=r,t.copy=a,t.mul=function(e,t,n){var i=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],s=t[1]*n[2]+t[3]*n[3],o=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=r,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e},t.translate=function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},t.rotate=function(e,t,n){var i=t[0],r=t[2],a=t[4],s=t[1],o=t[3],l=t[5],u=Math.sin(n),c=Math.cos(n);return e[0]=i*c+s*u,e[1]=-i*u+s*c,e[2]=r*c+o*u,e[3]=-r*u+c*o,e[4]=c*a+u*l,e[5]=c*l-u*a,e},t.scale=function(e,t,n){var i=n[0],r=n[1];return e[0]=t[0]*i,e[1]=t[1]*r,e[2]=t[2]*i,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*r,e},t.invert=function(e,t){var n=t[0],i=t[2],r=t[4],a=t[1],s=t[3],o=t[5],l=n*s-a*i;return l?(l=1/l,e[0]=s*l,e[1]=-a*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*o-s*r)*l,e[5]=(a*r-n*o)*l,e):null},t.clone=function(e){var t=i();return a(t,e),t}},function(e,t,n){var i=n(12),r=1e-4,a=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function s(e){return Math.floor(Math.log(e)/Math.LN10)}t.linearMap=function(e,t,n,i){var r=t[1]-t[0],a=n[1]-n[0];if(0===r)return 0===a?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(e<=t[0])return n[0];if(e>=t[1])return n[1]}else{if(e>=t[0])return n[0];if(e<=t[1])return n[1]}else{if(e===t[0])return n[0];if(e===t[1])return n[1]}return(e-t[0])/r*a+n[0]},t.parsePercent=function(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?(n=e,n.replace(/^\s+/,"").replace(/\s+$/,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var n},t.round=function(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e},t.asc=function(e){return e.sort((function(e,t){return e-t})),e},t.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n},t.getPrecisionSafe=function(e){var t=e.toString(),n=t.indexOf("e");if(n>0){var i=+t.slice(n+1);return i<0?-i:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},t.getPixelPrecision=function(e,t){var n=Math.log,i=Math.LN10,r=Math.floor(n(e[1]-e[0])/i),a=Math.round(n(Math.abs(t[1]-t[0]))/i),s=Math.min(Math.max(-r+a,0),20);return isFinite(s)?s:20},t.getPercentWithPrecision=function(e,t,n){if(!e[t])return 0;var r=i.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===r)return 0;for(var a=Math.pow(10,n),s=i.map(e,(function(e){return(isNaN(e)?0:e)/r*a*100})),o=100*a,l=i.map(s,(function(e){return Math.floor(e)})),u=i.reduce(l,(function(e,t){return e+t}),0),c=i.map(s,(function(e,t){return e-l[t]}));u<o;){for(var h=Number.NEGATIVE_INFINITY,d=null,f=0,p=c.length;f<p;++f)c[f]>h&&(h=c[f],d=f);++l[d],c[d]=0,++u}return l[t]/a},t.MAX_SAFE_INTEGER=9007199254740991,t.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},t.isRadianAroundZero=function(e){return e>-1e-4&&e<r},t.parseDate=function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=a.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(n-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))},t.quantity=function(e){return Math.pow(10,s(e))},t.nice=function(e,t){var n=s(e),i=Math.pow(10,n),r=e/i;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e},t.reformIntervals=function(e){e.sort((function(e,t){return o(e,t,0)?-1:1}));for(var t=-1/0,n=1,i=0;i<e.length;){for(var r=e[i].interval,a=e[i].close,s=0;s<2;s++)r[s]<=t&&(r[s]=t,a[s]=s?1:1-n),t=r[s],n=a[s];r[0]===r[1]&&a[0]*a[1]!=1?e.splice(i,1):i++}return e;function o(e,t,n){return e.interval[n]<t.interval[n]||e.interval[n]===t.interval[n]&&(e.close[n]-t.close[n]==(n?-1:1)||!n&&o(e,t,1))}},t.isNumeric=function(e){return e-parseFloat(e)>=0}},function(e,t,n){"use strict";var i=n(5),r=n(11),a=n(21),s=function(){this._pool={},this._allocatedTextures=[]};s.prototype={constructor:s,get:function(e){var t=u(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var n=this._pool[t];if(!n.length){var r=new i.a(e);return this._allocatedTextures.push(r),r}return n.pop()},put:function(e){var t=u(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]),this._pool[t].push(e)},clear:function(e){for(var t=0;t<this._allocatedTextures.length;t++)this._allocatedTextures[t].dispose(e);this._pool={},this._allocatedTextures=[]}};var o={width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.CLAMP_TO_EDGE,wrapT:r.a.CLAMP_TO_EDGE,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},l=Object.keys(o);function u(e){var t,n,i,s;a.a.defaultsWithPropList(e,o,l),n=(t=e).width,i=t.height,s=0==(n&n-1)&&0==(i&i-1),t.format===r.a.DEPTH_COMPONENT&&(t.useMipmap=!1),s&&t.useMipmap||(t.minFilter==r.a.NEAREST_MIPMAP_NEAREST||t.minFilter==r.a.NEAREST_MIPMAP_LINEAR?t.minFilter=r.a.NEAREST:t.minFilter!=r.a.LINEAR_MIPMAP_LINEAR&&t.minFilter!=r.a.LINEAR_MIPMAP_NEAREST||(t.minFilter=r.a.LINEAR)),s||(t.wrapS=r.a.CLAMP_TO_EDGE,t.wrapT=r.a.CLAMP_TO_EDGE);for(var u="",c=0;c<l.length;c++)u+=e[l[c]].toString();return u}t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i);t.a={getFilledRegions:function(e,t){var n,i=(e||[]).slice();if("string"==typeof t?n=(t=r.a.getMap(t))&&t.geoJson:t&&t.features&&(n=t),!n)return console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),n.features||console.error("Invalid GeoJSON for map3D"),[];for(var a={},s=n.features,o=0;o<i.length;o++)a[i[o].name]=i[o];for(o=0;o<s.length;o++){var l=s[o].properties.name;a[l]||i.push({name:l})}return i},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}}},function(e,t,n){"use strict";function i(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function r(e,t,n,r,a){var s=n,o=e[t];i(e,t,r);for(var l=n;l<r;l++)a(e[l],o)<0&&(i(e,l,s),s++);return i(e,r,s),s}function a(e,t,n,i){if(n<i){var s=r(e,Math.floor((n+i)/2),n,i,t);a(e,t,n,s-1),a(e,t,s+1,i)}}function s(){this._parts=[]}s.prototype.step=function(e,t,n){var i=e.length;if(0===n){this._parts=[],this._sorted=!1;var s=Math.floor(i/2);this._parts.push({pivot:s,left:0,right:i-1}),this._currentSortPartIdx=0}if(!this._sorted){var o=this._parts;if(0===o.length)return this._sorted=!0,!0;if(o.length<512){for(var l=0;l<o.length;l++)o[l].pivot=r(e,o[l].pivot,o[l].left,o[l].right,t);var u=[];for(l=0;l<o.length;l++){var c,h=o[l].left;(c=o[l].pivot-1)>h&&u.push({pivot:Math.floor((c+h)/2),left:h,right:c}),h=o[l].pivot+1,(c=o[l].right)>h&&u.push({pivot:Math.floor((c+h)/2),left:h,right:c})}o=this._parts=u}else for(l=0;l<Math.floor(o.length/10);l++){var d=o.length-1-this._currentSortPartIdx;if(a(e,t,o[d].left,o[d].right),this._currentSortPartIdx++,this._currentSortPartIdx===o.length)return this._sorted=!0,!0}return!1}},s.sort=a,t.a=s},function(e,t,n){"use strict";var i=n(83),r=n(0),a=n.n(r),s=n(41),o=n.n(s),l=n(20),u=n(3);function c(e,t){var n=e.getBoxLayoutParams(),i=o.a.getLayoutRect(n,{width:t.getWidth(),height:t.getHeight()});i.y=t.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,t.getDevicePixelRatio());var r=this.getGeoBoundingRect(),a=r.width/r.height*(e.get("aspectScale")||.75),s=e.get("boxWidth"),l=e.get("boxDepth"),u=e.get("boxHeight");null==u&&(u=5),isNaN(s)&&isNaN(l)&&(s=100),isNaN(l)?l=s/a:isNaN(s)&&(s=l/a),this.setSize(s,u,l),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(u-this.regionHeight,0))}function h(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this&&"series.map3D"!==e.type){var t=e.getData(),i=e.coordDimToDataDim("alt")[0];if(i){var r=t.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])){var i=a.a.helper.createScale(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",i),this.resize(this.model,t)}}var d=function(e){console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")},f=0,p={dimensions:i.a.prototype.dimensions,create:function(e,t){var n=[];if(!a.a.getMap)throw new Error("geo3D component depends on geo component");function i(e,i){var r=p.createGeo3D(e);e.__viewGL=e.__viewGL||new l.a,r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,n.push(r),r.resize=c,r.resize(e,t),r.update=h}return e.eachComponent("geo3D",(function(e,t){i(e)})),e.eachSeriesByType("map3D",(function(e,t){var n=e.get("coordinateSystem");null==n&&(n="geo3D"),"geo3D"===n&&i(e)})),e.eachSeries((function(t){if("geo3D"===t.get("coordinateSystem")){if("series.map3D"===t.type)return;var n=t.getReferringComponents("geo3D")[0];if(n||(n=e.getComponent("geo3D")),!n)throw new Error('geo "'+u.a.firstNotNull(t.get("geo3DIndex"),t.get("geo3DId"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n},createGeo3D:function(e){var t,n=e.get("map");if("string"==typeof n?(t=n,n=a.a.getMap(n)):n&&n.features&&(n={geoJson:n}),n||d(n),!n.geoJson.features)throw new Error("Invalid GeoJSON for map3D");return null==t&&(t="GEO_ANONYMOUS_"+f++),new i.a(t+f++,t,n&&n.geoJson,n&&n.specialAreas,e.get("nameMap"))}};a.a.registerCoordinateSystem("geo3D",p),t.a=p},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(1),s=n.n(a),o=n(187),l=n.n(o),u=n(188),c=n.n(u),h=s.a.vec3,d=s.a.mat4,f=[l.a,c.a];function p(e,t,n,i,r){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(n,i,r),this.transform=d.identity(new Float64Array(16)),this.invTransform=d.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}p.prototype={constructor:p,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,n){var i=r.a.parseGeoJSON||r.a.parseGeoJson;try{this.regions=e?i(e):[]}catch(e){throw"Invalid geoJson format\n"+e}t=t||{},n=n||{};for(var a=this.regions,s={},o=0;o<a.length;o++){var l=a[o].name;l=n[l]||l,a[o].name=l,s[l]=a[o],this.addGeoCoord(l,a[o].center);var u=t[l];u&&a[o].transformTo(u.left,u.top,u.width,u.height)}this._regionsMap=s,this._geoRect=null,f.forEach((function(e){e(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e,t=this.regions,n=0;n<t.length;n++){var i=t[n].getBoundingRect();(e=e||i.clone()).union(i)}return this._geoRect=e||new r.a.graphic.BoundingRect(0,0,0,0)},addGeoCoord:function(e,t){this._nameCoordMap[e]=t},getRegion:function(e){return this._regionsMap[e]},getRegionByCoord:function(e){for(var t=this.regions,n=0;n<t.length;n++)if(t[n].contain(e))return t[n]},setSize:function(e,t,n){this.size=[e,t,n];var i=this.getGeoBoundingRect(),r=e/i.width,a=-n/i.height,s=-e/2-i.x*r,o=n/2-i.y*a,l=this.extrudeY?[s,0,o]:[s,o,0],u=this.extrudeY?[r,1,a]:[r,a,1],c=this.transform;d.identity(c),d.translate(c,c,l),d.scale(c,c,u),d.invert(this.invTransform,c)},dataToPoint:function(e,t){t=t||[];var n=this.extrudeY?1:2,i=this.extrudeY?2:1,r=e[2];return isNaN(r)&&(r=0),t[0]=e[0],t[i]=e[1],this.altitudeAxis?t[n]=this.altitudeAxis.dataToCoord(r):t[n]=0,t[n]+=this.regionHeight,h.transformMat4(t,t,this.transform),t},pointToData:function(e,t){}},t.a=p},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(76),s=n.n(a);function o(e){this.viewGL=e}o.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=r.a.create(),this.updateTransform(e,t)},o.prototype.updateTransform=function(e,t){var n=e.coordinateSystem;n.getRoamTransform&&(r.a.invert(this._viewTransform,n.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},o.prototype.dataToPoint=function(e,t,n){n=e.dataToPoint(t,null,n);var i=this._viewTransform;i&&s.a.applyTransform(n,n,i)},o.prototype.removeTransformInPoint=function(e){return this._viewTransform&&s.a.applyTransform(e,e,this._viewTransform),e},o.prototype.getZoom=function(){if(this._viewTransform){var e=this._viewTransform;return 1/Math.max(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]))}return 1},o.prototype._setCameraTransform=function(e){var t=this.viewGL.camera;t.position.set(e[4],e[5],0),t.scale.set(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]),1)},o.prototype._updateCamera=function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var i=this.viewGL.camera;i.left=i.top=0,i.bottom=t,i.right=e,i.near=0,i.far=100},t.a=o},function(e,t,n){(function(e){var n;"undefined"!=typeof window?n=window.__DEV__:void 0!==e&&(n=e.__DEV__),void 0===n&&(n=!0);var i=n;t.__DEV__=i}).call(t,n(243))},function(e,t,n){"use strict";var i,r,a,s,o,l,u,c=n(13),h=n(0),d=n.n(h),f=n(33),p=n(1),m=n.n(p).a.vec2,g=[[0,0],[1,1]],_=c.a.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new c.a.Attribute("position","float",2,"POSITION"),normal:new c.a.Attribute("normal","float",2),offset:new c.a.Attribute("offset","float",1),color:new c.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.offset.init(e),t.normal.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,n,i){return 1/(m.dist(e,t)+m.dist(n,t)+m.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,n,i){var r=this._getCubicCurveApproxStep(e,t,n,i),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,n,i){var r=this._getCubicCurveApproxStep(e,t,n,i),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(g)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(g)},getPolylineVertexCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2,this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2,this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,n,i,r,a){null==a&&(a=1);var s=e[0],o=e[1],l=t[0],u=t[1],c=n[0],h=n[1],d=i[0],f=i[1],p=this._getCubicCurveApproxStep(e,t,n,i),m=p*p,g=m*p,_=3*p,v=3*m,y=6*m,b=6*g,x=s-2*l+c,E=o-2*u+h,w=3*(l-c)-s+d,T=3*(u-h)-o+f,S=s,A=o,C=(l-s)*_+x*v+w*g,L=(u-o)*_+E*v+T*g,R=x*y+w*b,I=E*y+T*b,D=w*b,k=T*b,M=0,P=0,O=Math.ceil(1/p),N=new Float32Array(3*(O+1)),F=(N=[],0);for(P=0;P<O+1;P++)N[F++]=S,N[F++]=A,S+=C,A+=L,C+=R,L+=I,R+=D,I+=k,(M+=p)>1&&(S=C>0?Math.min(S,d):Math.max(S,d),A=L>0?Math.min(A,f):Math.max(A,f));this.addPolyline(N,r,a)},addLine:function(e,t,n,i){this.addPolyline([e,t],n,i)},addPolyline:(i=m.create(),r=m.create(),a=m.create(),s=m.create(),o=[],l=[],u=[],function(e,t,n,c,h){if(e.length){var d="number"!=typeof e[0];if(null==h&&(h=d?e.length:e.length/2),!(h<2)){null==c&&(c=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,p=d?"number"!=typeof t[0]:t.length/4===h,g=this.attributes.position,_=this.attributes.color,v=this.attributes.offset,y=this.attributes.normal,b=this.indices,x=this._vertexOffset,E=0;E<h;E++){if(d)o=e[E+c],f=p?t[E+c]:t;else{var w=2*E+c;if((o=o||[])[0]=e[w],o[1]=e[w+1],p){var T=4*E+c;(f=f||[])[0]=t[T],f[1]=t[T+1],f[2]=t[T+2],f[3]=t[T+3]}else f=t}if(this.useNativeLine)E>1&&(g.copy(x,x-1),_.copy(x,x-1),x++);else{var S;if(E<h-1)if(d?m.copy(l,e[E+1]):(w=2*(E+1)+c,(l=l||[])[0]=e[w],l[1]=e[w+1]),E>0){m.sub(i,o,u),m.sub(r,l,o),m.normalize(i,i),m.normalize(r,r),m.add(s,i,r),m.normalize(s,s);var A=n/2*Math.min(1/m.dot(i,s),2);a[0]=-s[1],a[1]=s[0],S=A}else m.sub(i,l,o),m.normalize(i,i),a[0]=-i[1],a[1]=i[0],S=n/2;else m.sub(i,o,u),m.normalize(i,i),a[0]=-i[1],a[1]=i[0],S=n/2;y.set(x,a),y.set(x+1,a),v.set(x,S),v.set(x+1,-S),m.copy(u,o),g.set(x,o),g.set(x+1,o),_.set(x,f),_.set(x+1,f),x+=2}if(this.useNativeLine)_.set(x,f),g.set(x,o),x++;else if(E>0){var C=3*this._faceOffset;(b=this.indices)[C]=x-4,b[C+1]=x-3,b[C+2]=x-2,b[C+3]=x-3,b[C+4]=x-1,b[C+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}),setItemColor:function(e,t){for(var n=this._itemVertexOffsets[e],i=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,r=n;r<i;r++)this.attributes.color.set(r,t);this.dirty("color")}});d.a.util.defaults(_.prototype,f.a),t.a=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(88),n(133),n(183),n(189),n(195),n(202),n(209),n(213),n(220),n(226),n(229),n(233),n(236),n(239),n(253),n(259)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(89),s=n(90),o=n(101),l=n(2),u={echarts:"4.0.0",claygl:"1.0.0"};function c(e,t){e.replace(".","")-0<u[t].replace(".","")-0&&function(e){throw new Error(e+" version is too old, needs "+u[e]+" or higher")}(t),console.log("Loaded "+t+", version "+e)}function h(e){this._layers={},this._zr=e}c(a.a,"claygl"),c(r.a.version,"echarts"),h.prototype.update=function(e,t){var n=this,i=t.getZr();if(i.getWidth()&&i.getHeight()){for(var a in this._layers)this._layers[a].removeViewsAll();e.eachComponent((function(n,i){if("series"!==n){var r=t.getViewOfComponentModel(i),a=i.coordinateSystem;if(r.__ecgl__){if(a){if(!a.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+i.id);s=a.viewGL}else{if(!i.viewGL)return void console.error("Can't find viewGL of component "+i.id);s=a.viewGL}var s=a.viewGL,u=o(i);u.addView(s),r.afterRender&&r.afterRender(i,e,t,u),l(r.groupGL,i.get("silent"))}}})),e.eachSeries((function(n){var i=t.getViewOfSeriesModel(n),r=n.coordinateSystem;if(i.__ecgl__){if(r&&!r.viewGL&&!i.viewGL)return void console.error("Can't find viewGL of series "+i.id);var a=r&&r.viewGL||i.viewGL,s=o(n);s.addView(a),i.afterRender&&i.afterRender(n,e,t,s),l(i.groupGL,n.get("silent"))}}))}else console.warn("Dom has no width or height");function o(e){var t;e.coordinateSystem&&e.coordinateSystem.model,t=e.get("zlevel");var a=n._layers,o=a[t];if(!o){if(o=a[t]=new s.a("gl-"+t,i),i.painter.isSingleCanvas()){o.virtual=!0;var l=new r.a.graphic.Image({z:1e4,style:{image:o.renderer.canvas},silent:!0});o.__hostImage=l,i.add(l)}i.painter.insertLayer(t,o)}return o.__hostImage&&o.__hostImage.setStyle({width:o.renderer.getWidth(),height:o.renderer.getHeight()}),o}function l(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}};var d=r.a.init;r.a.init=function(){var e=d.apply(this,arguments);return e.getZr().painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),n=e.pixelRatio||this.dpr;t.width=this.getWidth()*n,t.height=this.getHeight()*n;var i=t.getContext("2d");i.dpr=n,i.clearRect(0,0,t.width,t.height),e.backgroundColor&&(i.fillStyle=e.backgroundColor,i.fillRect(0,0,t.width,t.height));var r,a=this.storage.getDisplayList(!0),s={},o=this;function l(e,t){var n,r=o._zlevelList;null==e&&(e=-1/0);for(var a=0;a<r.length;a++){var s=r[a],l=o._layers[s];if(!l.__builtin__&&s>e&&s<t){n=l;break}}n&&n.renderToCanvas&&(i.save(),n.renderToCanvas(i),i.restore())}for(var u={ctx:i},c=0;c<a.length;c++){var h=a[c];h.zlevel!==r&&(l(r,h.zlevel),r=h.zlevel),this._doPaintEl(h,u,!0,s)}return l(r,1/0),t},e},r.a.registerPostUpdate((function(e,t){var n=t.getZr();(n.__egl=n.__egl||new h(n)).update(e,t)})),r.a.registerPreprocessor(o.a),r.a.graphicGL=l.a},function(e,t,n){"use strict";t.a="1.0.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(46),s=n(100),o=n(6),l=n(47),u=n(65),c=n.n(u),h=function(e,t){this.id=e,this.zr=t;try{this.renderer=new a.a({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(e){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does support WebGL",void console.error(e)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var n=this.dom.style;n.position="absolute",n.left="0",n.top="0",this.views=[],this._picking=new s.a({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new r.a.graphic.Rect({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0})};function d(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}h.prototype.addView=function(e){if(e.layer!==this){var t=this._viewsToDispose.indexOf(e);t>=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var n=this.zr;e.scene.traverse((function(e){e.__zr=n,e.addAnimatorsToZr&&e.addAnimatorsToZr(n)}))}},h.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(d,this),e.layer=null,this._viewsToDispose.push(e))}},h.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(d,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},h.prototype.resize=function(e,t){this.renderer.resize(e,t)},h.prototype.clear=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},h.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},h.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},h.prototype.needsRefresh=function(){this.zr.refresh()},h.prototype.refresh=function(){for(var e=0;e<this.views.length;e++)this.views[e].prepareRender();for(this._doRender(!1),this._trackAndClean(),e=0;e<this._viewsToDispose.length;e++)this._viewsToDispose[e].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},h.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},h.prototype._doRender=function(e){this.clear(),this.renderer.saveViewport();for(var t=0;t<this.views.length;t++)this.views[t].render(this.renderer,e);this.renderer.restoreViewport()},h.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var f=1;function p(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function m(e,t){for(var n=0;n<t.length;n++)t[n].__used__||t[n].dispose(e)}function g(e,t){e.__used__=e.__used__||0,e.__used__++,1===e.__used__&&t.push(e)}function _(e,t,n){function i(e){for(var i,r,a=0;a<e.length;a++){var s=e[a],l=s.geometry,u=s.material;if(u!==i)for(var c=u.getTextureUniforms(),h=0;h<c.length;h++){var d=c[h],f=u.uniforms[d].value;if(f)if(f instanceof o.a)g(f,t);else if(f instanceof Array)for(var p=0;p<f.length;p++)f[p]instanceof o.a&&g(f[p],t)}l!==r&&g(l,n),i=u,r=l}}i(e.opaqueList),i(e.transparentList);for(var r=0;r<e.lights.length;r++)e.lights[r].cubemap&&g(e.lights[r].cubemap,t)}h.prototype._startAccumulating=function(e){var t=this;this._stopAccumulating();for(var n=!1,i=0;i<this.views.length;i++)n=this.views[i].needsAccumulate()||n;function r(i){if(t._accumulatingId&&i===t._accumulatingId){for(var a=!0,s=0;s<t.views.length;s++)a=t.views[s].isAccumulateFinished()&&n;a||(t._doRender(!0),e?r(i):c()((function(){r(i)})))}}n&&(this._accumulatingId=f++,e?r(t._accumulatingId):this._accumulatingTimeout=setTimeout((function(){r(t._accumulatingId)}),50))},h.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(p(this._textureList),p(this._geometriesList));for(var n=0;n<this.views.length;n++)_(this.views[n].scene,e,t);this._textureList&&(m(this.renderer,this._textureList),m(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},h.prototype.dispose=function(){this._stopAccumulating(),this.renderer.disposeScene(this.scene),this.zr.off("globalout",this.onglobalout)},h.prototype.onmousedown=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mousedown",e,t),this._dispatchDataEvent("mousedown",e,t)),this._downX=e.offsetX,this._downY=e.offsetY}},h.prototype.onmousemove=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY),n=t&&t.target,i=this._hovered;this._hovered=t,i&&n!==i.target&&(i.relatedTarget=n,this._dispatchEvent("mouseout",e,i),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),i&&n===i.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t)}},h.prototype.onmouseup=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mouseup",e,t),this._dispatchDataEvent("mouseup",e,t)),this._upX=e.offsetX,this._upY=e.offsetY}},h.prototype.onclick=h.prototype.dblclick=function(e){if(!e.target||!e.target.__isGLToZRProxy){var t=this._upX-this._downX,n=this._upY-this._downY;if(!(Math.sqrt(t*t+n*n)>20)){e=e.event;var i=this.pickObject(e.offsetX,e.offsetY);i&&(this._dispatchEvent(e.type,e,i),this._dispatchDataEvent(e.type,e,i));var r=this._clickToSetFocusPoint(e);r&&r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},h.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,n=t.viewport,i=this.views.length-1;i>=0;i--){var r=this.views[i];if(r.hasDOF()&&r.containPoint(e.offsetX,e.offsetY)){this._picking.scene=r.scene,this._picking.camera=r.camera,t.viewport=r.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=r,a}}t.viewport=n},h.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},h.prototype.pickObject=function(e,t){for(var n=[],i=this.renderer,r=i.viewport,a=0;a<this.views.length;a++){var s=this.views[a];s.containPoint(e,t)&&(this._picking.scene=s.scene,this._picking.camera=s.camera,i.viewport=s.viewport,this._picking.pickAll(e,t,n))}return i.viewport=r,n.sort((function(e,t){return e.distance-t.distance})),n[0]},h.prototype._dispatchEvent=function(e,t,n){n||(n={});var i=n.target;for(n.cancelBubble=!1,n.event=t,n.type=e,n.offsetX=t.offsetX,n.offsetY=t.offsetY;i&&(i.trigger(e,n),i=i.getParent(),!n.cancelBubble););this._dispatchToView(e,n)},h.prototype._dispatchDataEvent=function(e,t,n){var i=n&&n.target,r=i&&i.dataIndex,a=i&&i.seriesIndex,s=i&&i.eventData,o=!1,l=this._zrEventProxy;l.position=[t.offsetX,t.offsetY],l.update();var u={target:l};"mousemove"===e&&(null!=r?r!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(l.dataIndex=this._lastDataIndex,l.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),o=!0):null!=s&&s!==this._lastEventData&&(null!=this._lastEventData&&(l.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),o=!0),this._lastEventData=s,this._lastDataIndex=r,this._lastSeriesIndex=a),l.eventData=s,l.dataIndex=r,l.seriesIndex=a,(null!=s||parseInt(r,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),o&&this.zr.handler.dispatchToElement(u,"mouseover",t))},h.prototype._dispatchToView=function(e,t){for(var n=0;n<this.views.length;n++)this.views[n].containPoint(t.offsetX,t.offsetY)&&this.views[n].trigger(e,t)},r.a.util.extend(h.prototype,l.a),t.a=h},function(e,t,n){"use strict";function i(e,t,n){"object"==typeof t&&(n=t,t=null);var i,s=this;if(!(e instanceof Function))for(var o in i=[],e)e.hasOwnProperty(o)&&i.push(o);var l=function(t){if(s.apply(this,arguments),e instanceof Function?r(this,e.call(this,t)):a(this,e,i),this.constructor===l)for(var n=l.__initializers__,o=0;o<n.length;o++)n[o].apply(this,arguments)};l.__super__=s,s.__initializers__?l.__initializers__=s.__initializers__.slice():l.__initializers__=[],t&&l.__initializers__.push(t);var u=function(){};return u.prototype=s.prototype,l.prototype=new u,l.prototype.constructor=l,r(l.prototype,n),l.extend=s.extend,l.derive=s.extend,l}function r(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function a(e,t,n){for(var i=0;i<n.length;i++){var r=n[i];e[r]=t[r]}}t.a={extend:i,derive:i}},function(e,t,n){"use strict";var i=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB"],r=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];t.a=function(e){for(var t={},n={},a=0;a<i.length;a++)o(i[a]);for(a=0;a<r.length;a++){var s=r[a];n[s]=e.getParameter(e[s])}function o(n){var i=e.getExtension(n);i||(i=e.getExtension("MOZ_"+n)),i||(i=e.getExtension("WEBKIT_"+n)),t[n]=i}this.getExtension=function(e){return e in t||o(e),t[e]},this.getParameter=function(e){return n[e]}}},function(e,t,n){"use strict";var i=n(94),r={},a={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function s(e){return(e=Math.round(e))<0?0:e>255?255:e}function o(e){return e<0?0:e>1?1:e}function l(e){return e.length&&"%"===e.charAt(e.length-1)?s(parseFloat(e)/100*255):s(parseInt(e,10))}function u(e){return e.length&&"%"===e.charAt(e.length-1)?o(parseFloat(e)/100):o(parseFloat(e))}function c(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function h(e,t,n){return e+(t-e)*n}function d(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var p=new i.a(20),m=null;function g(e,t){m&&f(m,t),m=p.put(e,m||t.slice())}function _(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=u(e[1]),r=u(e[2]),a=r<=.5?r*(i+1):r+i-r*i,o=2*r-a;return d(t=t||[],s(255*c(o,a,n+1/3)),s(255*c(o,a,n)),s(255*c(o,a,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}r.parse=function(e,t){if(e){t=t||[];var n=p.get(e);if(n)return f(t,n);var i,r=(e+="").replace(/ /g,"").toLowerCase();if(r in a)return f(t,a[r]),g(e,t),t;if("#"===r.charAt(0))return 4===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=4095?(d(t,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),g(e,t),t):void d(t,0,0,0,1):7===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=16777215?(d(t,(16711680&i)>>16,(65280&i)>>8,255&i,1),g(e,t),t):void d(t,0,0,0,1):void 0;var s=r.indexOf("("),o=r.indexOf(")");if(-1!==s&&o+1===r.length){var c=r.substr(0,s),h=r.substr(s+1,o-(s+1)).split(","),m=1;switch(c){case"rgba":if(4!==h.length)return void d(t,0,0,0,1);m=u(h.pop());case"rgb":return 3!==h.length?void d(t,0,0,0,1):(d(t,l(h[0]),l(h[1]),l(h[2]),m),g(e,t),t);case"hsla":return 4!==h.length?void d(t,0,0,0,1):(h[3]=u(h[3]),_(h,t),g(e,t),t);case"hsl":return 3!==h.length?void d(t,0,0,0,1):(_(h,t),g(e,t),t);default:return}}d(t,0,0,0,1)}},r.parseToFloat=function(e,t){if(t=r.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},r.lift=function(e,t){var n=r.parse(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0;return r.stringify(n,4===n.length?"rgba":"rgb")}},r.toHex=function(e){var t=r.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},r.fastLerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),r=Math.floor(i),a=Math.ceil(i),l=t[r],u=t[a],c=i-r;return n[0]=s(h(l[0],u[0],c)),n[1]=s(h(l[1],u[1],c)),n[2]=s(h(l[2],u[2],c)),n[3]=o(h(l[3],u[3],c)),n}},r.fastMapToColor=r.fastLerp,r.lerp=function(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),a=Math.floor(i),l=Math.ceil(i),u=r.parse(t[a]),c=r.parse(t[l]),d=i-a,f=r.stringify([s(h(u[0],c[0],d)),s(h(u[1],c[1],d)),s(h(u[2],c[2],d)),o(h(u[3],c[3],d))],"rgba");return n?{color:f,leftIndex:a,rightIndex:l,value:i}:f}},r.mapToColor=r.lerp,r.modifyHSL=function(e,t,n,i){if(e=r.parse(e))return e=function(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.min(i,r,a),o=Math.max(i,r,a),l=o-s,u=(o+s)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(o+s):l/(2-o-s);var c=((o-i)/6+l/2)/l,h=((o-r)/6+l/2)/l,d=((o-a)/6+l/2)/l;i===o?t=d-h:r===o?t=1/3+c-d:a===o&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,n,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=(a=t,(a=Math.round(a))<0?0:a>360?360:a)),null!=n&&(e[1]=u(n)),null!=i&&(e[2]=u(i)),r.stringify(_(e),"rgba");var a},r.modifyAlpha=function(e,t){if((e=r.parse(e))&&null!=t)return e[3]=o(t),r.stringify(e,"rgba")},r.stringify=function(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}},t.a=r},function(e,t,n){"use strict";var i=n(95),r=function(e){this._list=new i.a,this._map={},this._maxSize=e||10};r.prototype.setMaxSize=function(e){this._maxSize=e},r.prototype.put=function(e,t){if(void 0===this._map[e]){var n=this._list.length();if(n>=this._maxSize&&n>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var r=this._list.insert(t);r.key=e,this._map[e]=r}},r.prototype.get=function(e){var t=this._map[e];if(void 0!==t)return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},r.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},r.prototype.clear=function(){this._list.clear(),this._map={}},t.a=r},function(e,t,n){"use strict";var i=function(){this.head=null,this.tail=null,this._length=0};i.prototype.insert=function(e){var t=new i.Entry(e);return this.insertEntry(t),t},i.prototype.insertAt=function(e,t){if(!(e<0)){for(var n=this.head,r=0;n&&r!=e;)n=n.next,r++;if(n){var a=new i.Entry(t),s=n.prev;s?(s.next=a,a.prev=s):this.head=a,a.next=n,n.prev=a}else this.insert(t)}},i.prototype.insertBeforeEntry=function(e,t){var n=new i.Entry(e),r=t.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=t,t.prev=n,this._length++},i.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},i.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._length--},i.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t?(this.remove(t),t.value):void 0}},i.prototype.getHead=function(){if(this.head)return this.head.value},i.prototype.getTail=function(){if(this.tail)return this.tail.value},i.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,n=0;t&&n!=e;)t=t.next,n++;return t.value}},i.prototype.indexOf=function(e){for(var t=this.head,n=0;t;){if(t.value===e)return n;t=t.next,n++}},i.prototype.length=function(){return this._length},i.prototype.isEmpty=function(){return 0===this._length},i.prototype.forEach=function(e,t){for(var n=this.head,i=0,r=void 0!==t;n;)r?e.call(t,n.value,i):e(n.value,i),n=n.next,i++},i.prototype.clear=function(){this.tail=this.head=null,this._length=0},i.Entry=function(e){this.value=e,this.next=null,this.prev=null},t.a=i},function(e,t,n){"use strict";var i=n(97),r=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function a(e,t,n){var i={};for(var a in n)i[a+"_COUNT"]=n[a];return e.replace(r,(function(e,n,r,a){var s="";isNaN(n)&&(n=n in t?t[n]:i[n]),isNaN(r)&&(r=r in t?t[r]:i[r]);for(var o=parseInt(n);o<parseInt(r);o++)s+="{"+a.replace(/float\s*\(\s*_idx_\s*\)/g,o.toFixed(1)).replace(/_idx_/g,o)+"}";return s}))}function s(e,t,n){var i=[];if(t)for(var r in t){var a=t[r];a>0&&i.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(n)for(var s=0;s<n.length;s++){var o=n[s];i.push("#define "+o.toUpperCase()+"_ENABLED")}for(var o in e){var l=e[o];null===l?i.push("#define "+o):i.push("#define "+o+" "+l.toString())}return i.join("\n")}function o(e){this._renderer=e,this._cache={}}o.prototype.getProgram=function(e,t,n){var r=this._cache,o="s"+t.shader.shaderID+"m"+t.programKey;if(n&&(o+="se"+n.getProgramKey(e.lightGroup)),e.isSkinnedMesh()&&(o+=","+e.joints.length),f=r[o])return f;var l=n?n.getLightsNumbers(e.lightGroup):{},u=this._renderer.gl,c=t.getEnabledTextures(),h="";e.isSkinnedMesh()&&(h="\n"+s({SKINNING:null,JOINT_COUNT:e.joints.length})+"\n");var d,f,p=h+s(t.vertexDefines,l,c),m=h+s(t.fragmentDefines,l,c),g=p+"\n"+t.shader.vertex,_=function(e){for(var t=[],n=0;n<e.length;n++)t.push("#extension GL_"+e[n]+" : enable");return t.join("\n")}(["OES_standard_derivatives","EXT_shader_texture_lod"])+"\n"+["precision",d=t.precision,"float"].join(" ")+";\n"+["precision",d,"int"].join(" ")+";\n"+["precision",d,"sampler2D"].join(" ")+";\n\n"+m+"\n"+t.shader.fragment,v=a(g,t.vertexDefines,l),y=a(_,t.fragmentDefines,l);(f=new i.a).uniformSemantics=t.shader.uniformSemantics,f.attributes=t.shader.attributes;var b=f.buildProgram(u,t.shader,v,y);return f.__error=b,r[o]=f,f},t.a=o},function(e,t,n){"use strict";var i=n(18),r=n(8),a={};function s(e){for(var t=e.split("\n"),n=0,i=t.length;n<i;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function o(e,t,n){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),s(n)].join("\n")}var l=r.a.extend({uniformSemantics:{},attributes:{}},(function(){this._locations={},this._textureSlot=0,this._program=null}),{bind:function(e){this._textureSlot=0,e.gl.useProgram(this._program)},hasUniform:function(e){var t=this._locations[e];return null!=t},useTextureSlot:function(e,t,n){t&&(e.gl.activeTexture(e.gl.TEXTURE0+n),t.isRenderable()?t.bind(e):t.unbind(e))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(e){this._textureSlot=e||0},takeCurrentTextureSlot:function(e,t){var n=this._textureSlot;return this.useTextureSlot(e,t,n),this._textureSlot++,n},setUniform:function(e,t,n,r){var a=this._locations[n];if(null==a)return!1;switch(t){case"m4":e.uniformMatrix4fv(a,!1,r);break;case"2i":e.uniform2i(a,r[0],r[1]);break;case"2f":e.uniform2f(a,r[0],r[1]);break;case"3i":e.uniform3i(a,r[0],r[1],r[2]);break;case"3f":e.uniform3f(a,r[0],r[1],r[2]);break;case"4i":e.uniform4i(a,r[0],r[1],r[2],r[3]);break;case"4f":e.uniform4f(a,r[0],r[1],r[2],r[3]);break;case"1i":e.uniform1i(a,r);break;case"1f":e.uniform1f(a,r);break;case"1fv":e.uniform1fv(a,r);break;case"1iv":e.uniform1iv(a,r);break;case"2iv":e.uniform2iv(a,r);break;case"2fv":e.uniform2fv(a,r);break;case"3iv":e.uniform3iv(a,r);break;case"3fv":e.uniform3fv(a,r);break;case"4iv":e.uniform4iv(a,r);break;case"4fv":e.uniform4fv(a,r);break;case"m2":case"m2v":e.uniformMatrix2fv(a,!1,r);break;case"m3":case"m3v":e.uniformMatrix3fv(a,!1,r);break;case"m4v":if(Array.isArray(r)){for(var s=new i.a.Float32Array(16*r.length),o=0,l=0;l<r.length;l++)for(var u=r[l],c=0;c<16;c++)s[o++]=u[c];e.uniformMatrix4fv(a,!1,s)}else r instanceof i.a.Float32Array&&e.uniformMatrix4fv(a,!1,r)}return!0},setUniformOfSemantic:function(e,t,n){var i=this.uniformSemantics[t];return!!i&&this.setUniform(e,i.type,i.symbol,n)},enableAttributes:function(e,t,n){var i,r=e.gl,s=this._program,o=this._locations;(i=n?n.__enabledAttributeList:a[e.__uid__])||(i=n?n.__enabledAttributeList=[]:a[e.__uid__]=[]);for(var l=[],u=0;u<t.length;u++){var c=t[u];if(this.attributes[c]){var h=o[c];if(null==h){if(-1===(h=r.getAttribLocation(s,c))){l[u]=-1;continue}o[c]=h}l[u]=h,i[h]?i[h]=2:i[h]=1}else l[u]=-1}for(u=0;u<i.length;u++)switch(i[u]){case 1:r.enableVertexAttribArray(u),i[u]=3;break;case 2:i[u]=3;break;case 3:r.disableVertexAttribArray(u),i[u]=0}return l},buildProgram:function(e,t,n,i){var r=e.createShader(e.VERTEX_SHADER),a=e.createProgram();e.shaderSource(r,n),e.compileShader(r);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,i),e.compileShader(s);var l=o(e,r,n);if(l)return l;if(l=o(e,s,i))return l;if(e.attachShader(a,r),e.attachShader(a,s),t.attributeSemantics.POSITION)e.bindAttribLocation(a,0,t.attributeSemantics.POSITION.symbol);else{var u=Object.keys(this.attributes);e.bindAttribLocation(a,0,u[0])}if(e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))return"Could not link program\nVALIDATE_STATUS: "+e.getProgramParameter(a,e.VALIDATE_STATUS)+", gl error ["+e.getError()+"]";for(var c=0;c<t.uniforms.length;c++){var h=t.uniforms[c];this._locations[h]=e.getUniformLocation(a,h)}e.deleteShader(r),e.deleteShader(s),this._program=a,this.vertexCode=n,this.fragmentCode=i}});t.a=l},function(e,t,n){"use strict";var i=n(99),r="uniform vec3 ",a="uniform float ",s="@export clay.header.",o="@end",l=":unconfigurable;";t.a=[s+"directional_light",r+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+l,r+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+l,o,s+"ambient_light",r+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+l,o,s+"ambient_sh_light",r+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+l,r+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+l,i.a,o,s+"ambient_cubemap_light",r+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+l,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+l,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+l,o,s+"point_light",r+"pointLightPosition[POINT_LIGHT_COUNT]"+l,a+"pointLightRange[POINT_LIGHT_COUNT]"+l,r+"pointLightColor[POINT_LIGHT_COUNT]"+l,o,s+"spot_light",r+"spotLightPosition[SPOT_LIGHT_COUNT]"+l,r+"spotLightDirection[SPOT_LIGHT_COUNT]"+l,a+"spotLightRange[SPOT_LIGHT_COUNT]"+l,a+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+l,a+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+l,a+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+l,r+"spotLightColor[SPOT_LIGHT_COUNT]"+l,o].join("\n")},function(e,t,n){"use strict";t.a="vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}"},function(e,t,n){"use strict";var i,r,a,s,o,l=n(8),u=n(49),c=n(23),h=n(4),d=n(9),f=n(64),p=n(11),m=n(1),g=n.n(m).a.vec3,_=l.a.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new u.a,this._ndc=new c.a}),{pick:function(e,t,n){return this.pickAll(e,t,[],n)[0]||null},pickAll:function(e,t,n,i){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),n=n||[],this._intersectNode(this.scene,n,i||!1),n.sort(this._intersectionCompareFunc),n},_intersectNode:function(e,t,n){e instanceof f.a&&e.isRenderable()&&(e.ignorePicking&&!n||!(e.mode===p.a.TRIANGLES&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var i=0;i<e._children.length;i++)this._intersectNode(e._children[i],t,n)},_intersectRenderable:(i=new h.a,r=new h.a,a=new h.a,s=new u.a,o=new d.a,function(e,t){var n=e.isSkinnedMesh();s.copy(this._ray),d.a.invert(o,e.worldTransform),n||s.applyTransform(o);var l=e.geometry;if(n||!l.boundingBox||s.intersectBoundingBox(l.boundingBox))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,e,t);else if(l.pickByRay)l.pickByRay(s,e,t);else{var u,c,f=e.cullFace===p.a.BACK&&e.frontFace===p.a.CCW||e.cullFace===p.a.FRONT&&e.frontFace===p.a.CW,m=l.indices,v=l.attributes.position,y=l.attributes.weight,b=l.attributes.joint,x=[];if(v&&v.value&&m){if(n){c=e.skeleton.getSubSkinMatrices(e.__uid__,e.joints);for(var E=0;E<e.joints.length;E++){x[E]=x[E]||[];for(var w=0;w<16;w++)x[E][w]=c[16*E+w]}var T=[],S=[],A=[],C=[],L=[],R=l.attributes.skinnedPosition;for(R&&R.value||(l.createAttribute("skinnedPosition","f",3),(R=l.attributes.skinnedPosition).init(l.vertexCount)),E=0;E<l.vertexCount;E++){for(v.get(E,T),y.get(E,S),b.get(E,A),S[3]=1-S[0]-S[1]-S[2],g.set(C,0,0,0),w=0;w<4;w++)A[w]>=0&&S[w]>1e-4&&(g.transformMat4(L,T,x[A[w]]),g.scaleAndAdd(C,C,L,S[w]));R.set(E,C)}}for(E=0;E<m.length;E+=3){var I=m[E],D=m[E+1],k=m[E+2],M=n?l.attributes.skinnedPosition:v;if(M.get(I,i.array),M.get(D,r.array),M.get(k,a.array),u=f?s.intersectTriangle(i,r,a,e.culling):s.intersectTriangle(i,a,r,e.culling)){var P=new h.a;n?h.a.copy(P,u):h.a.transformMat4(P,u,e.worldTransform),t.push(new _.Intersection(u,P,e,[I,D,k],E/3,h.a.dist(P,this._ray.origin)))}}}}}),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});_.Intersection=function(e,t,n,i,r,a){this.point=e,this.pointWorld=t,this.target=n,this.triangle=i,this.triangleIndex=r,this.distance=a},t.a=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function s(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,i=e[t].emphasis;n&&(e[t]=n),i&&(e.emphasis=e.emphasis||{},e.emphasis[t]=i)}}function o(e){e&&(e instanceof Array||(e=[e]),r.a.util.each(e,(function(e){if(e.axisLabel){var t=e.axisLabel;r.a.util.extend(t,t.textStyle),t.textStyle=null}})))}t.a=function(e){r.a.util.each(e.series,(function(t){r.a.util.indexOf(a,t.type)>=0&&(function(e){s(e,"itemStyle"),s(e,"lineStyle"),s(e,"areaStyle"),s(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),o(e.xAxis3D),o(e.yAxis3D),o(e.zAxis3D),o(e.grid3D),s(e.geo3D)}},function(e,t,n){"use strict";t.a={get:function(e){var t=new XMLHttpRequest;t.open("get",e.url),t.responseType=e.responseType||"text",e.onprogress&&(t.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total;e.onprogress(n,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(n){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}}},function(e,t,n){"use strict";t.a="@export clay.basic.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position : POSITION;\nattribute vec3 barycentric;\n@import clay.chunk.skinning_header\nvarying vec2 v_Texcoord;\nvarying vec3 v_Barycentric;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\nvoid main()\n{\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n v_Barycentric = barycentric;\n gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n}\n@end\n@export clay.basic.fragment\nvarying vec2 v_Texcoord;\nuniform sampler2D diffuseMap;\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform vec3 emission : [0.0, 0.0, 0.0];\nuniform float alpha : 1.0;\n#ifdef ALPHA_TEST\nuniform float alphaCutoff: 0.9;\n#endif\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nuniform float lineWidth : 0.0;\nuniform vec4 lineColor : [0.0, 0.0, 0.0, 0.6];\nvarying vec3 v_Barycentric;\n@import clay.util.edge_factor\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n#ifdef RENDER_TEXCOORD\n gl_FragColor = vec4(v_Texcoord, 1.0, 1.0);\n return;\n#endif\n gl_FragColor = vec4(color, alpha);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n#ifdef DIFFUSEMAP_ENABLED\n vec4 tex = decodeHDR(texture2D(diffuseMap, v_Texcoord));\n#ifdef SRGB_DECODE\n tex = sRGBToLinear(tex);\n#endif\n#if defined(DIFFUSEMAP_ALPHA_ALPHA)\n gl_FragColor.a = tex.a;\n#endif\n gl_FragColor.rgb *= tex.rgb;\n#endif\n gl_FragColor.rgb += emission;\n if( lineWidth > 0.)\n {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor(lineWidth)) * lineColor.a);\n }\n#ifdef ALPHA_TEST\n if (gl_FragColor.a < alphaCutoff) {\n discard;\n }\n#endif\n#ifdef TONEMAPPING\n gl_FragColor.rgb = ACESToneMapping(gl_FragColor.rgb);\n#endif\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n}\n@end"},function(e,t,n){"use strict";var i=n(6),r=n(5);function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}n(25);var s=a("DXT1"),o=a("DXT3"),l=a("DXT5"),u={parse:function(e,t){var n=new Int32Array(e,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var a,u,c=n(21),h=n[4],d=n[3],f=512&n[28],p=131072&n[2];switch(c){case s:a=8,u=i.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case o:a=16,u=i.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case l:a=16,u=i.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var m=n[1]+4,g=f?6:1,_=1;p&&(_=Math.max(1,n[7]));for(var v=[],y=0;y<g;y++){var b=h,x=d;v[y]=new r.a({width:b,height:x,format:u});for(var E=[],w=0;w<_;w++){var T=Math.max(4,b)/4*Math.max(4,x)/4*a,S=new Uint8Array(e,m,T);m+=T,b*=.5,x*=.5,E[w]=S}v[y].pixels=E[0],p&&(v[y].mipmaps=E)}if(!t)return v[0];t.width=v[0].width,t.height=v[0].height,t.format=v[0].format,t.pixels=v[0].pixels,t.mipmaps=v[0].mipmaps}};t.a=u},function(e,t,n){"use strict";var i=n(6),r=n(5),a=String.fromCharCode;function s(e,t,n,i){if(e[3]>0){var r=Math.pow(2,e[3]-128-8+i);t[n+0]=e[0]*r,t[n+1]=e[1]*r,t[n+2]=e[2]*r}else t[n+0]=0,t[n+1]=0,t[n+2]=0;return t[n+3]=1,t}function o(e,t,n,i){for(var r,a,s=0,o=0,l=i;l>0;)if(e[o][0]=t[n++],e[o][1]=t[n++],e[o][2]=t[n++],e[o][3]=t[n++],1===e[o][0]&&1===e[o][1]&&1===e[o][2]){for(var u=e[o][3]<<s>>>0;u>0;u--)r=e[o-1],(a=e[o])[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],o++,l--;s+=8}else o++,l--,s=0;return n}function l(e,t,n,i){if(i<8|i>32767)return o(e,t,n,i);if(2!=(r=t[n++]))return o(e,t,n-1,i);if(e[0][1]=t[n++],e[0][2]=t[n++],r=t[n++],(e[0][2]<<8>>>0|r)>>>0!==i)return null;for(var r=0;r<4;r++)for(var a=0;a<i;){var s=t[n++];if(s>128){s=(127&s)>>>0;for(var l=t[n++];s--;)e[a++][r]=l}else for(;s--;)e[a++][r]=t[n++]}return n}var u={parseRGBE:function(e,t,n){null==n&&(n=0);var o=new Uint8Array(e),u=o.length;if("#?"===function(e,t,n){for(var i="",r=t;r<n;r++)i+=a(e[r]);return i}(o,0,2)){for(var c=2;c<u&&("\n"!==a(o[c])||"\n"!==a(o[c+1]));c++);if(!(c>=u)){c+=2;for(var h="";c<u;c++){var d=a(o[c]);if("\n"===d)break;h+=d}var f=h.split(" "),p=parseInt(f[1]),m=parseInt(f[3]);if(m&&p){for(var g=c+1,_=[],v=0;v<m;v++){_[v]=[];for(var y=0;y<4;y++)_[v][y]=0}for(var b=new Float32Array(m*p*4),x=0,E=0;E<p;E++){if(!(g=l(_,o,g,m)))return null;for(v=0;v<m;v++)s(_[v],b,x,n),x+=4}return t||(t=new r.a),t.width=m,t.height=p,t.pixels=b,t.type=i.a.FLOAT,t}}}},parseRGBEFromPNG:function(e){}};t.a=u},function(e,t,n){"use strict";var i=n(5),r=n(4),a=n(23),s=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function o(e){return"_on"+e}var l,u,c,h,d,f,p,m,g=function(e){var t=this;this._texture=new i.a({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),i.a.prototype.dispose.call(this,e)}}),s.forEach((function(e){this[o(e)]=function(t){t.triangle&&this._meshes.forEach((function(n){this.dispatchEvent(e,n,t.triangle,t.point)}),this)}}),this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null};g.prototype={constructor:g,getTexture:function(){return this._texture},setECharts:function(e){this._chart=e;var t=e.getDom();if(t instanceof HTMLCanvasElement){var n=this,i=e.getZr(),r=i.__oldRefreshImmediately||i.refreshImmediately;i.refreshImmediately=function(){r.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},i.__oldRefreshImmediately=r}else console.error("ECharts must init on canvas if it is used as texture."),t=document.createElement("canvas");this._texture.image=t,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:(l=new r.a,u=new r.a,c=new r.a,h=new a.a,d=new a.a,f=new a.a,p=new a.a,m=new r.a,function(e,t,n,i){var s=t.geometry,o=s.attributes.position,g=s.attributes.texcoord0,_=r.a.dot,v=r.a.cross;o.get(n[0],l.array),o.get(n[1],u.array),o.get(n[2],c.array),g.get(n[0],h.array),g.get(n[1],d.array),g.get(n[2],f.array),v(m,u,c);var y=_(l,m),b=_(i,m)/y;v(m,c,l);var x=_(i,m)/y;v(m,l,u);var E=_(i,m)/y;a.a.scale(p,h,b),a.a.scaleAndAdd(p,p,d,x),a.a.scaleAndAdd(p,p,f,E);var w=p.x*this._chart.getWidth(),T=p.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(e,{zrX:w,zrY:T})}),attachToMesh:function(e){this._meshes.indexOf(e)>=0||(s.forEach((function(t){e.on(t,this[o(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),s.forEach((function(t){e.off(t,this[o(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}},t.a=g},function(e,t,n){"use strict";var i=n(19),r=n(108),a=i.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){this._brdfLookup||(this._normalDistribution=r.a.generateNormalDistribution(),this._brdfLookup=r.a.integrateBRDF(e,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var i=r.a.prefilterEnvironmentMap(e,n,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=i.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(e)}},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}});t.a=a},function(e,t,n){"use strict";var i=n(5),r=n(25),a=n(6),s=n(10),o=n(14),l=n(17),u=n(7),c=n(57),h=n(29),d=n(55),f=n(18),p=n(54),m=n(111),g=n(112),_={},v=["px","nx","py","ny","pz","nz"];_.prefilterEnvironmentMap=function(e,t,n,o,m){m&&o||(o=_.generateNormalDistribution(),m=_.integrateBRDF(e,o));var y=(n=n||{}).width||64,b=n.height||64,x=n.type||t.type,E=new r.a({width:y,height:b,type:x,flipY:!1,mipmaps:[]});E.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var w=Math.min(y,b),T=Math.log(w)/Math.log(2)+1,S=new l.a({shader:new u.a({vertex:u.a.source("clay.skybox.vertex"),fragment:g.a})});S.set("normalDistribution",o),n.encodeRGBM&&S.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&S.define("fragment","RGBM_DECODE");var A,C=new h.a;if(t instanceof i.a){var L=new r.a({width:y,height:b,type:x===a.a.FLOAT?a.a.HALF_FLOAT:x});p.a.panoramaToCubeMap(e,t,L,{encodeRGBM:n.decodeRGBM}),t=L}(A=new c.a({scene:C,material:S})).material.set("environmentMap",t);var R=new d.a({texture:E});n.encodeRGBM&&(x=E.type=a.a.UNSIGNED_BYTE);for(var I=new i.a({width:y,height:b,type:x}),D=new s.a({depthBuffer:!1}),k=f.a[x===a.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],M=0;M<T;M++){E.mipmaps[M]={pixels:{}},A.material.set("roughness",M/(v.length-1));for(var P=I.width,O=2*Math.atan(P/(P-.5))/Math.PI*180,N=0;N<v.length;N++){var F=new k(I.width*I.height*4);D.attach(I),D.bind(e);var B=R.getCamera(v[N]);B.fov=O,e.render(C,B),e.gl.readPixels(0,0,I.width,I.height,a.a.RGBA,x,F),D.unbind(e),E.mipmaps[M].pixels[v[N]]=F}I.width/=2,I.height/=2,I.dirty()}return D.dispose(e),I.dispose(e),A.dispose(e),o.dispose(e),{environmentMap:E,brdfLookup:m,normalDistribution:o,maxMipmapLevel:T}},_.integrateBRDF=function(e,t){t=t||_.generateNormalDistribution();var n=new s.a({depthBuffer:!1}),r=new o.a({fragment:m.a}),l=new i.a({width:512,height:256,type:a.a.HALF_FLOAT,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",t),r.setUniform("viewportSize",[512,256]),r.attachOutput(l),r.render(e,n),n.dispose(e),l},_.generateNormalDistribution=function(e,t){e=e||256,t=t||1024;for(var n=new i.a({width:e,height:t,type:a.a.FLOAT,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,useMipmap:!1}),r=new Float32Array(t*e*4),s=0;s<t;s++){var o=s/t,l=(s<<16|s>>>16)>>>0;l=(((16711935&(l=((252645135&(l=((858993459&(l=((1431655765&l)<<1|(2863311530&l)>>>1)>>>0))<<2|(3435973836&l)>>>2)>>>0))<<4|(4042322160&l)>>>4)>>>0))<<8|(4278255360&l)>>>8)>>>0)/4294967296;for(var u=0;u<e;u++){var c=u/e,h=c*c,d=2*Math.PI*o,f=Math.sqrt((1-l)/(1+(h*h-1)*l)),p=Math.sqrt(1-f*f),m=4*(s*e+u);r[m]=p*Math.cos(d),r[m+1]=p*Math.sin(d),r[m+2]=f,r[m+3]=1}}return n.pixels=r,n},t.a=_},function(e,t,n){"use strict";t.a="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end"},function(e,t,n){"use strict";t.a="@export clay.skybox.vertex\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 viewDirection = normalize(v_WorldPosition - eyePos);\n#ifdef LOD\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, viewDirection, lod));\n#else\n vec4 texel = decodeHDR(textureCube(environmentMap, viewDirection));\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end"},function(e,t,n){"use strict";t.a="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n vec3 tangentX = normalize(cross(upVector, N));\n vec3 tangentY = cross(N, tangentX);\n return tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"},function(e,t,n){"use strict";t.a="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\nconst float fSampleNumber = float(SAMPLE_NUMBER);\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n vec3 tangentX = normalize(cross(upVector, N));\n vec3 tangentY = cross(N, tangentX);\n return tangentX * H.x + tangentY * H.y + N * H.z;\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 R = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"},function(e,t,n){"use strict";var i=n(19),r=n(18),a=i.a.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new r.a.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,n=0;n<e.coefficients.length;n++)t[n]=e.coefficients[n];return t}}}});t.a=a},function(e,t,n){"use strict";var i=n(6),r=n(10),a=n(5),s=(n(14),n(18)),o=n(57),l=n(56),u=n(55),c=n(29),h=n(1),d=n.n(h),f=(n(115),d.a.vec3),p={},m=["px","nx","py","ny","pz","nz"];function g(e,t){var n=e[0],i=e[1],r=e[2];return 0===t?1:1===t?n:2===t?i:3===t?r:4===t?n*r:5===t?i*r:6===t?n*i:7===t?3*r*r-1:n*n-i*i}var _={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};p.projectEnvironmentMap=function(e,t,n){var h;(n=n||{}).lod=n.lod||0;var d=new c.a,p=64;t instanceof a.a?h=new l.a({scene:d,environmentMap:t}):(p=t.image&&t.image.px?t.image.px.width:t.width,h=new o.a({scene:d,environmentMap:t}));var v=Math.ceil(p/Math.pow(2,n.lod)),y=Math.ceil(p/Math.pow(2,n.lod)),b=new a.a({width:v,height:y}),x=new r.a;h.material.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&h.material.define("fragment","RGBM_DECODE"),h.material.set("lod",n.lod);for(var E=new u.a({texture:b}),w={},T=0;T<m.length;T++){w[m[T]]=new Uint8Array(v*y*4);var S=E.getCamera(m[T]);S.fov=90,x.attach(b),x.bind(e),e.render(d,S),e.gl.readPixels(0,0,v,y,i.a.RGBA,i.a.UNSIGNED_BYTE,w[m[T]]),x.unbind(e)}return h.dispose(e),x.dispose(e),b.dispose(e),function(e,t,n,i){for(var r=new s.a.Float32Array(27),a=f.create(),o=f.create(),l=f.create(),u=0;u<9;u++){for(var c=f.create(),h=0;h<m.length;h++){for(var d=t[m[h]],p=f.create(),v=0,y=0,b=_[m[h]],x=0;x<i;x++)for(var E=0;E<n;E++){a[0]=E/(n-1)*2-1,a[1]=x/(i-1)*2-1,a[2]=-1,f.normalize(a,a),l[0]=a[b[0]]*b[3],l[1]=a[b[1]]*b[4],l[2]=a[b[2]]*b[5],o[0]=d[y++]/255,o[1]=d[y++]/255,o[2]=d[y++]/255;var w=d[y++]/255*51.5;o[0]*=w,o[1]*=w,o[2]*=w,f.scaleAndAdd(p,p,o,g(l,u)*-a[2]),v+=-a[2]}f.scaleAndAdd(c,c,p,1/v)}r[3*u]=c[0]/6,r[3*u+1]=c[1]/6,r[3*u+2]=c[2]/6}return r}(0,w,v,y)},t.a=p},function(e,t,n){"use strict";t.a="uniform samplerCube environmentMap;\nvarying vec2 v_Texcoord;\n#define TEXTURE_SIZE 16\nmat3 front = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n);\nmat3 back = mat3(\n -1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, -1.0\n);\nmat3 left = mat3(\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0,\n 1.0, 0.0, 0.0\n);\nmat3 right = mat3(\n 0.0, 0.0, 1.0,\n 0.0, 1.0, 0.0,\n -1.0, 0.0, 0.0\n);\nmat3 up = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0,\n 0.0, -1.0, 0.0\n);\nmat3 down = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0\n);\nfloat harmonics(vec3 normal){\n int index = int(gl_FragCoord.x);\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n if(index==0){\n return 1.0;\n }\n else if(index==1){\n return x;\n }\n else if(index==2){\n return y;\n }\n else if(index==3){\n return z;\n }\n else if(index==4){\n return x*z;\n }\n else if(index==5){\n return y*z;\n }\n else if(index==6){\n return x*y;\n }\n else if(index==7){\n return 3.0*z*z - 1.0;\n }\n else{\n return x*x - y*y;\n }\n}\nvec3 sampleSide(mat3 rot)\n{\n vec3 result = vec3(0.0);\n float divider = 0.0;\n for (int i = 0; i < TEXTURE_SIZE * TEXTURE_SIZE; i++) {\n float x = mod(float(i), float(TEXTURE_SIZE));\n float y = float(i / TEXTURE_SIZE);\n vec2 sidecoord = ((vec2(x, y) + vec2(0.5, 0.5)) / vec2(TEXTURE_SIZE)) * 2.0 - 1.0;\n vec3 normal = normalize(vec3(sidecoord, -1.0));\n vec3 fetchNormal = rot * normal;\n vec3 texel = textureCube(environmentMap, fetchNormal).rgb;\n result += harmonics(fetchNormal) * texel * -normal.z;\n divider += -normal.z;\n }\n return result / divider;\n}\nvoid main()\n{\n vec3 result = (\n sampleSide(front) +\n sampleSide(back) +\n sampleSide(left) +\n sampleSide(right) +\n sampleSide(up) +\n sampleSide(down)\n ) / 6.0;\n gl_FragColor = vec4(result, 1.0);\n}"},function(e,t,n){"use strict";var i=n(19).a.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,n=e.intensity;return[t[0]*n,t[1]*n,t[2]*n]}}}});t.a=i},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.vec4,a=function(e,t,n,i){e=e||0,t=t||0,n=n||0,i=i||0,this.array=r.fromValues(e,t,n,i),this._dirty=!0};a.prototype={constructor:a,add:function(e){return r.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,n,i){return this.array[0]=e,this.array[1]=t,this.array[2]=n,this.array[3]=i,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new a(this.x,this.y,this.z,this.w)},copy:function(e){return r.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return r.dist(this.array,e.array)},distance:function(e){return r.distance(this.array,e.array)},div:function(e){return r.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return r.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return r.dot(this.array,e.array)},len:function(){return r.len(this.array)},length:function(){return r.length(this.array)},lerp:function(e,t,n){return r.lerp(this.array,e.array,t.array,n),this._dirty=!0,this},min:function(e){return r.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return r.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return r.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return r.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return r.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return r.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return r.random(this.array,e),this._dirty=!0,this},scale:function(e){return r.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return r.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return r.sqrDist(this.array,e.array)},squaredDistance:function(e){return r.squaredDistance(this.array,e.array)},sqrLen:function(){return r.sqrLen(this.array)},squaredLength:function(){return r.squaredLength(this.array)},sub:function(e){return r.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return r.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return r.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return r.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var o=a.prototype;s(o,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),s(o,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),s(o,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),s(o,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}a.add=function(e,t,n){return r.add(e.array,t.array,n.array),e._dirty=!0,e},a.set=function(e,t,n,i,a){r.set(e.array,t,n,i,a),e._dirty=!0},a.copy=function(e,t){return r.copy(e.array,t.array),e._dirty=!0,e},a.distance=a.dist=function(e,t){return r.distance(e.array,t.array)},a.divide=a.div=function(e,t,n){return r.divide(e.array,t.array,n.array),e._dirty=!0,e},a.dot=function(e,t){return r.dot(e.array,t.array)},a.len=function(e){return r.length(e.array)},a.lerp=function(e,t,n,i){return r.lerp(e.array,t.array,n.array,i),e._dirty=!0,e},a.min=function(e,t,n){return r.min(e.array,t.array,n.array),e._dirty=!0,e},a.max=function(e,t,n){return r.max(e.array,t.array,n.array),e._dirty=!0,e},a.multiply=a.mul=function(e,t,n){return r.multiply(e.array,t.array,n.array),e._dirty=!0,e},a.negate=function(e,t){return r.negate(e.array,t.array),e._dirty=!0,e},a.normalize=function(e,t){return r.normalize(e.array,t.array),e._dirty=!0,e},a.random=function(e,t){return r.random(e.array,t),e._dirty=!0,e},a.scale=function(e,t,n){return r.scale(e.array,t.array,n),e._dirty=!0,e},a.scaleAndAdd=function(e,t,n,i){return r.scaleAndAdd(e.array,t.array,n.array,i),e._dirty=!0,e},a.squaredDistance=a.sqrDist=function(e,t){return r.sqrDist(e.array,t.array)},a.squaredLength=a.sqrLen=function(e){return r.sqrLen(e.array)},a.subtract=a.sub=function(e,t,n){return r.subtract(e.array,t.array,n.array),e._dirty=!0,e},a.transformMat4=function(e,t,n){return r.transformMat4(e.array,t.array,n.array),e._dirty=!0,e},a.transformQuat=function(e,t,n){return r.transformQuat(e.array,t.array,n.array),e._dirty=!0,e},t.a=a},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.mat2,a=function(){this.array=r.create(),this._dirty=!0};a.prototype={constructor:a,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new a).copy(this)},copy:function(e){return r.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return r.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return r.determinant(this.array)},identity:function(){return r.identity(this.array),this._dirty=!0,this},invert:function(){return r.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return r.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return r.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return r.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return r.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return r.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return r.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return r.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},a.adjoint=function(e,t){return r.adjoint(e.array,t.array),e._dirty=!0,e},a.copy=function(e,t){return r.copy(e.array,t.array),e._dirty=!0,e},a.determinant=function(e){return r.determinant(e.array)},a.identity=function(e){return r.identity(e.array),e._dirty=!0,e},a.invert=function(e,t){return r.invert(e.array,t.array),e._dirty=!0,e},a.multiply=a.mul=function(e,t,n){return r.mul(e.array,t.array,n.array),e._dirty=!0,e},a.rotate=function(e,t,n){return r.rotate(e.array,t.array,n),e._dirty=!0,e},a.scale=function(e,t,n){return r.scale(e.array,t.array,n.array),e._dirty=!0,e},a.transpose=function(e,t){return r.transpose(e.array,t.array),e._dirty=!0,e},t.a=a},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.mat2d,a=function(){this.array=r.create(),this._dirty=!0};a.prototype={constructor:a,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new a).copy(this)},copy:function(e){return r.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return r.determinant(this.array)},identity:function(){return r.identity(this.array),this._dirty=!0,this},invert:function(){return r.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return r.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return r.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return r.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return r.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return r.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return r.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return r.translate(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},a.copy=function(e,t){return r.copy(e.array,t.array),e._dirty=!0,e},a.determinant=function(e){return r.determinant(e.array)},a.identity=function(e){return r.identity(e.array),e._dirty=!0,e},a.invert=function(e,t){return r.invert(e.array,t.array),e._dirty=!0,e},a.multiply=a.mul=function(e,t,n){return r.mul(e.array,t.array,n.array),e._dirty=!0,e},a.rotate=function(e,t,n){return r.rotate(e.array,t.array,n),e._dirty=!0,e},a.scale=function(e,t,n){return r.scale(e.array,t.array,n.array),e._dirty=!0,e},a.translate=function(e,t,n){return r.translate(e.array,t.array,n.array),e._dirty=!0,e},t.a=a},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.mat3,a=function(){this.array=r.create(),this._dirty=!0};a.prototype={constructor:a,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return r.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new a).copy(this)},copy:function(e){return r.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return r.determinant(this.array)},fromMat2d:function(e){return r.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return r.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return r.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return r.identity(this.array),this._dirty=!0,this},invert:function(){return r.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return r.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return r.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return r.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return r.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return r.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return r.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return r.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return r.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return r.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},a.adjoint=function(e,t){return r.adjoint(e.array,t.array),e._dirty=!0,e},a.copy=function(e,t){return r.copy(e.array,t.array),e._dirty=!0,e},a.determinant=function(e){return r.determinant(e.array)},a.identity=function(e){return r.identity(e.array),e._dirty=!0,e},a.invert=function(e,t){return r.invert(e.array,t.array),e},a.multiply=a.mul=function(e,t,n){return r.mul(e.array,t.array,n.array),e._dirty=!0,e},a.fromMat2d=function(e,t){return r.fromMat2d(e.array,t.array),e._dirty=!0,e},a.fromMat4=function(e,t){return r.fromMat4(e.array,t.array),e._dirty=!0,e},a.fromQuat=function(e,t){return r.fromQuat(e.array,t.array),e._dirty=!0,e},a.normalFromMat4=function(e,t){return r.normalFromMat4(e.array,t.array),e._dirty=!0,e},a.rotate=function(e,t,n){return r.rotate(e.array,t.array,n),e._dirty=!0,e},a.scale=function(e,t,n){return r.scale(e.array,t.array,n.array),e._dirty=!0,e},a.transpose=function(e,t){return r.transpose(e.array,t.array),e._dirty=!0,e},a.translate=function(e,t,n){return r.translate(e.array,t.array,n.array),e._dirty=!0,e},t.a=a},function(e,t,n){"use strict";var i=n(122),r=n.n(i),a={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){var n;if(this._animators=this._animators||[],e){for(var i=e.split("."),a=this,s=0,o=i.length;s<o;s++)a&&(a=a[i[s]]);a&&(n=a)}else n=this;if(null==n)throw new Error("Target "+e+" not exists");var l=this._animators,u=new r.a(n,t),c=this;return u.during((function(){c.__zr&&c.__zr.refresh()})).done((function(){var e=l.indexOf(u);e>=0&&l.splice(e,1)})),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,n=t.length,i=0;i<n;i++)t[i].stop(e);return t.length=0,this},addAnimatorsToZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.addAnimator(this._animators[t])},removeAnimatorsFromZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.removeAnimator(this._animators[t])}};t.a=a},function(e,t,n){var i=n(123),r=n(125),a=n(12).isArrayLike,s=Array.prototype.slice;function o(e,t){return e[t]}function l(e,t,n){e[t]=n}function u(e,t,n){return(t-e)*n+e}function c(e,t,n){return n>.5?t:e}function h(e,t,n,i,r){var a=e.length;if(1==r)for(var s=0;s<a;s++)i[s]=u(e[s],t[s],n);else{var o=a&&e[0].length;for(s=0;s<a;s++)for(var l=0;l<o;l++)i[s][l]=u(e[s][l],t[s][l],n)}}function d(e,t,n){var i=e.length,r=t.length;if(i!==r)if(i>r)e.length=r;else for(var a=i;a<r;a++)e.push(1===n?t[a]:s.call(t[a]));var o=e[0]&&e[0].length;for(a=0;a<e.length;a++)if(1===n)isNaN(e[a])&&(e[a]=t[a]);else for(var l=0;l<o;l++)isNaN(e[a][l])&&(e[a][l]=t[a][l])}function f(e,t,n){if(e===t)return!0;var i=e.length;if(i!==t.length)return!1;if(1===n){for(var r=0;r<i;r++)if(e[r]!==t[r])return!1}else{var a=e[0].length;for(r=0;r<i;r++)for(var s=0;s<a;s++)if(e[r][s]!==t[r][s])return!1}return!0}function p(e,t,n,i,r,a,s,o,l){var u=e.length;if(1==l)for(var c=0;c<u;c++)o[c]=m(e[c],t[c],n[c],i[c],r,a,s);else{var h=e[0].length;for(c=0;c<u;c++)for(var d=0;d<h;d++)o[c][d]=m(e[c][d],t[c][d],n[c][d],i[c][d],r,a,s)}}function m(e,t,n,i,r,a,s){var o=.5*(n-e),l=.5*(i-t);return(2*(t-n)+o+l)*s+(-3*(t-n)-2*o-l)*a+o*r+t}function g(e){if(a(e)){var t=e.length;if(a(e[0])){for(var n=[],i=0;i<t;i++)n.push(s.call(e[i]));return n}return s.call(e)}return e}function _(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function v(e,t,n,s,o,l){var g=e._getter,v=e._setter,y="spline"===t,b=s.length;if(b){var x,E=s[0].value,w=a(E),T=!1,S=!1,A=w?function(e){var t=e[e.length-1].value;return a(t&&t[0])?2:1}(s):0;s.sort((function(e,t){return e.time-t.time})),x=s[b-1].time;for(var C=[],L=[],R=s[0].value,I=!0,D=0;D<b;D++){C.push(s[D].time/x);var k=s[D].value;if(w&&f(k,R,A)||!w&&k===R||(I=!1),R=k,"string"==typeof k){var M=r.parse(k);M?(k=M,T=!0):S=!0}L.push(k)}if(l||!I){var P=L[b-1];for(D=0;D<b-1;D++)w?d(L[D],P,A):!isNaN(L[D])||isNaN(P)||S||T||(L[D]=P);w&&d(g(e._target,o),P,A);var O,N,F,B,U,G=0,z=0;if(T)var j=[0,0,0,0];var H=new i({target:e._target,life:x,loop:e._loop,delay:e._delay,onframe:function(e,t){var n;if(t<0)n=0;else if(t<z){for(n=Math.min(G+1,b-1);n>=0&&!(C[n]<=t);n--);n=Math.min(n,b-2)}else{for(n=G;n<b&&!(C[n]>t);n++);n=Math.min(n-1,b-2)}G=n,z=t;var i=C[n+1]-C[n];if(0!==i)if(O=(t-C[n])/i,y)if(F=L[n],N=L[0===n?n:n-1],B=L[n>b-2?b-1:n+1],U=L[n>b-3?b-1:n+2],w)p(N,F,B,U,O,O*O,O*O*O,g(e,o),A);else{if(T)r=p(N,F,B,U,O,O*O,O*O*O,j,1),r=_(j);else{if(S)return c(F,B,O);r=m(N,F,B,U,O,O*O,O*O*O)}v(e,o,r)}else if(w)h(L[n],L[n+1],O,g(e,o),A);else{var r;if(T)h(L[n],L[n+1],O,j,1),r=_(j);else{if(S)return c(L[n],L[n+1],O);r=u(L[n],L[n+1],O)}v(e,o,r)}},ondestroy:n});return t&&"spline"!==t&&(H.easing=t),H}}}var y=function(e,t,n,i){this._tracks={},this._target=e,this._loop=t||!1,this._getter=n||o,this._setter=i||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};y.prototype={when:function(e,t){var n=this._tracks;for(var i in t)if(t.hasOwnProperty(i)){if(!n[i]){n[i]=[];var r=this._getter(this._target,i);if(null==r)continue;0!==e&&n[i].push({time:0,value:g(r)})}n[i].push({time:e,value:t[i]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,n=0;n<t;n++)e[n].call(this)},start:function(e,t){var n,i=this,r=0,a=function(){--r||i._doneCallback()};for(var s in this._tracks)if(this._tracks.hasOwnProperty(s)){var o=v(this,e,a,this._tracks[s],s,t);o&&(this._clipList.push(o),r++,this.animation&&this.animation.addClip(o),n=o)}if(n){var l=n.onframe;n.onframe=function(e,t){l(e,t);for(var n=0;n<i._onframeList.length;n++)i._onframeList[n](e,t)}}return r||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,n=this.animation,i=0;i<t.length;i++){var r=t[i];e&&r.onframe(this._target,1),n&&n.removeClip(r)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var b=y;e.exports=b},function(e,t,n){var i=n(124);function r(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}r.prototype={constructor:r,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var n=(e-this._startTime-this._pausedTime)/this._life;if(!(n<0)){n=Math.min(n,1);var r=this.easing,a="string"==typeof r?i[r]:r,s="function"==typeof a?a(n):n;return this.fire("frame",s),1==n?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var a=r;e.exports=a},function(e,t){var n={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-n.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*n.bounceIn(2*e):.5*n.bounceOut(2*e-1)+.5}},i=n;e.exports=i},function(e,t,n){var i=n(53),r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(e){return(e=Math.round(e))<0?0:e>255?255:e}function s(e){return e<0?0:e>1?1:e}function o(e){return e.length&&"%"===e.charAt(e.length-1)?a(parseFloat(e)/100*255):a(parseInt(e,10))}function l(e){return e.length&&"%"===e.charAt(e.length-1)?s(parseFloat(e)/100):s(parseFloat(e))}function u(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function c(e,t,n){return e+(t-e)*n}function h(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var f=new i(20),p=null;function m(e,t){p&&d(p,t),p=f.put(e,p||t.slice())}function g(e,t){if(e){t=t||[];var n=f.get(e);if(n)return d(t,n);var i,a=(e+="").replace(/ /g,"").toLowerCase();if(a in r)return d(t,r[a]),m(e,t),t;if("#"===a.charAt(0))return 4===a.length?(i=parseInt(a.substr(1),16))>=0&&i<=4095?(h(t,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),m(e,t),t):void h(t,0,0,0,1):7===a.length?(i=parseInt(a.substr(1),16))>=0&&i<=16777215?(h(t,(16711680&i)>>16,(65280&i)>>8,255&i,1),m(e,t),t):void h(t,0,0,0,1):void 0;var s=a.indexOf("("),u=a.indexOf(")");if(-1!==s&&u+1===a.length){var c=a.substr(0,s),p=a.substr(s+1,u-(s+1)).split(","),g=1;switch(c){case"rgba":if(4!==p.length)return void h(t,0,0,0,1);g=l(p.pop());case"rgb":return 3!==p.length?void h(t,0,0,0,1):(h(t,o(p[0]),o(p[1]),o(p[2]),g),m(e,t),t);case"hsla":return 4!==p.length?void h(t,0,0,0,1):(p[3]=l(p[3]),_(p,t),m(e,t),t);case"hsl":return 3!==p.length?void h(t,0,0,0,1):(_(p,t),m(e,t),t);default:return}}h(t,0,0,0,1)}}function _(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=l(e[1]),r=l(e[2]),s=r<=.5?r*(i+1):r+i-r*i,o=2*r-s;return h(t=t||[],a(255*u(o,s,n+1/3)),a(255*u(o,s,n)),a(255*u(o,s,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function v(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i=e*(t.length-1),r=Math.floor(i),o=Math.ceil(i),l=t[r],u=t[o],h=i-r;return n[0]=a(c(l[0],u[0],h)),n[1]=a(c(l[1],u[1],h)),n[2]=a(c(l[2],u[2],h)),n[3]=s(c(l[3],u[3],h)),n}}var y=v;function b(e,t,n){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),r=Math.floor(i),o=Math.ceil(i),l=g(t[r]),u=g(t[o]),h=i-r,d=E([a(c(l[0],u[0],h)),a(c(l[1],u[1],h)),a(c(l[2],u[2],h)),s(c(l[3],u[3],h))],"rgba");return n?{color:d,leftIndex:r,rightIndex:o,value:i}:d}}var x=b;function E(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(n+=","+e[3]),t+"("+n+")"}}t.parse=g,t.lift=function(e,t){var n=g(e);if(n){for(var i=0;i<3;i++)n[i]=t<0?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0;return E(n,4===n.length?"rgba":"rgb")}},t.toHex=function(e){var t=g(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},t.fastLerp=v,t.fastMapToColor=y,t.lerp=b,t.mapToColor=x,t.modifyHSL=function(e,t,n,i){if(e=g(e))return e=function(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.min(i,r,a),o=Math.max(i,r,a),l=o-s,u=(o+s)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(o+s):l/(2-o-s);var c=((o-i)/6+l/2)/l,h=((o-r)/6+l/2)/l,d=((o-a)/6+l/2)/l;i===o?t=d-h:r===o?t=1/3+c-d:a===o&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,n,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=(r=t,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(e[1]=l(n)),null!=i&&(e[2]=l(i)),E(_(e),"rgba");var r},t.modifyAlpha=function(e,t){if((e=g(e))&&null!=t)return e[3]=s(t),E(e,"rgba")},t.stringify=E},function(e,t,n){"use strict";t.a="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 51.5), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 51.5);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end"},function(e,t,n){"use strict";t.a="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"},function(e,t,n){"use strict";t.a="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"},function(e,t,n){"use strict";t.a="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,n){"use strict";t.a="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 51.5);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,n){"use strict";t.a="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"},function(e,t,n){"use strict";t.a="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end"},function(e,t,n){"use strict";n(134),n(138),n(139),n(145);var i=n(0),r=n.n(i);r.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"grid3D",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(e,t){})),r.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(e,t){}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(135),s=r.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});function o(e,t){return t.type||(t.data?"category":"value")}r.a.helper.mixinAxisModelCommonMethods(s),Object(a.a)("x",s,o,{name:"X"}),Object(a.a)("y",s,o,{name:"Y"}),Object(a.a)("z",s,o,{name:"Z"})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(136),s=n(137),o=n.n(s),l=["value","category","time","log"];t.a=function(e,t,n,i){r.a.util.each(l,(function(s){t.extend({type:e+"Axis3D."+s,__ordinalMeta:null,mergeDefaultAndTheme:function(t,i){var a=i.getTheme();r.a.util.merge(t,a.get(s+"Axis3D")),r.a.util.merge(t,this.getDefaultOption()),t.type=n(e,t)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=o.a.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:r.a.util.merge(r.a.util.clone(a.a[s+"Axis3D"]),i||{},!0)})})),t.superClass.registerSubTypeDefaulter(e+"Axis3D",r.a.util.curry(n,e))}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},s=r.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),o=r.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),l=r.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},o),u=r.a.util.defaults({logBase:10},o);u.scale=!0,t.a={categoryAxis3D:s,valueAxis3D:o,timeAxis3D:l,logAxis3D:u}},function(e,t,n){var i=n(12),r=i.createHashMap,a=i.isObject,s=i.map;function o(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}o.createByAxisModel=function(e){var t=e.option,n=t.data,i=n&&s(n,c);return new o({categories:i,needCollect:!i,deduplication:!1!==t.dedplication})};var l=o.prototype;function u(e){return e._map||(e._map=r(e.categories))}function c(e){return a(e)&&null!=e.value?e.value:e+""}l.getOrdinal=function(e){return u(this).get(e)},l.parseAndCollect=function(e){var t,n=this._needCollect;if("string"!=typeof e&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=u(this);return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t};var h=o;e.exports=h},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(38),s=n(31),o=n(32),l=r.a.extendComponentModel({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,s.a),r.a.util.merge(l.prototype,o.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(39),o=n(22),l=n(3),u=n(73),c=n(34),h=n(140),d=n(142),f=n(58),p=n(40),m=l.a.firstNotNull;a.a.Shader.import(p.a),["x","y","z"].forEach((function(e){r.a.extendComponentView({type:e+"Axis3D"})}));var g={x:0,y:2,z:1};r.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(e,t){var n=new a.a.Material({shader:a.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),i=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new a.a.Node,this._control=new s.a({zr:t.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(e){var t=new h.a(e,i,n);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new d.a(e,i);return this.groupGL.add(t.rootNode),t}),this);var r=t.getDevicePixelRatio();this._axisLabelSurface=new u.a({width:256,height:256,devicePixelRatio:r}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:i,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new u.a({width:128,height:128,devicePixelRatio:r}),this._axisPointerLabelsMesh=new f.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new a.a.Node,this._sceneHelper=new c.a,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,n){this._model=e,this._api=n;var i=e.coordinateSystem;i.viewGL.add(this._lightRoot),e.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._axisLabelSurface.clear();var s=["x","y","z"].reduce((function(t,n){var r=i.getAxis(n),a=r.model;return t[n]=m(a.get("axisLabel.interval"),e.get("axisLabel.interval")),"ordinal"===r.scale.type&&(null!=t[n]&&"auto"!=t[n]||(t[n]=Math.floor(r.scale.getTicks().length/8))),t}),{});r.off("update"),e.get("show")&&(this._faces.forEach((function(i){i.update(s,e,t,n)}),this),this._axes.forEach((function(t){t.update(e,s,this._axisLabelSurface,n)}),this)),r.on("update",this._onCameraChange.bind(this,e,n),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(e),i.viewGL.setPostEffect(e.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,e,n),this._sceneHelper.updateSkybox(r,e,n)},showAxisPointer:function(e,t,n,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(e,t,n,i){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem.viewGL;e.get("show")&&e.get("axisPointer.show")?t.on("mousemove",this._updateAxisPointerOnMousePosition,this):t.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,n=this._model.coordinateSystem,i=n.viewGL,r=i.castRay(e.offsetX,e.offsetY,new a.a.Ray),s=0;s<this._faces.length;s++){var o=this._faces[s];if(!o.rootNode.invisible){o.plane.normal.dot(i.camera.worldTransform.z)<0&&o.plane.normal.negate();var l=r.intersectPlane(o.plane);if(l){var u=n.getAxis(o.faceInfo[0]),c=n.getAxis(o.faceInfo[1]),h=g[o.faceInfo[0]],d=g[o.faceInfo[1]];u.contain(l.array[h])&&c.contain(l.array[d])&&(t=l)}}}if(t){var f=n.pointToData(t.array,[],!0);this._updateAxisPointer(f),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var n=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new a.a.Vector3;e.update();for(var n=0;n<this._faces.length/2;n++){for(var i=[],r=0;r<2;r++)this._faces[2*n+r].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),i[r]=t.z;var s=i[0]>i[1]?0:1,o=this._faces[2*n+s],l=this._faces[2*n+1-s];o.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),n=e.getAxis("y"),i=e.getAxis("z"),r=i.getExtentMax(),a=i.getExtentMin(),s=t.getExtentMin(),o=t.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),c=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,m=f[2].rootNode.invisible?r:a,g=f[0].rootNode.invisible?s:o,_=f[2].rootNode.invisible?r:a,v=f[0].rootNode.invisible?o:s,y=f[4].rootNode.invisible?u:l;c.rotation.identity(),h.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,c.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),c.position.set(0,m,p),h.position.set(g,_,0),d.position.set(v,0,y),c.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new a.a.Vector4,new a.a.Vector4],n=new a.a.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(i){for(var r=i.axisLineCoords,a=(i.labelsMesh.geometry,0);a<t.length;a++)t[a].setArray(r[a]),t[a].w=1,t[a].transformMat4(i.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),t[a].x/=t[a].w,t[a].y/=t[a].w;var s,o,l=t[1].x-t[0].x,u=t[1].y-t[0].y,c=(t[1].x+t[0].x)/2,h=(t[1].y+t[0].y)/2;Math.abs(u/l)<.5?(s="center",o=h>n.y?"bottom":"top"):(o="middle",s=c>n.x?"left":"right"),i.setSpriteAlign(s,o,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,n=t.dataToPoint(e),i=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),s=this._api.getDevicePixelRatio();function o(e){return l.a.firstNotNull(e.model.get("axisPointer.show"),r.get("show"))}function u(e){var t=e.model.getModel("axisPointer",r).getModel("lineStyle"),n=a.a.parseColor(t.get("color")),i=m(t.get("width"),1),s=m(t.get("opacity"),1);return n[3]*=s,{color:n,lineWidth:i}}i.convertToDynamicArray(!0);for(var c=0;c<this._faces.length;c++){var h=this._faces[c];if(!h.rootNode.invisible){for(var d=h.faceInfo,f=d[3]<0?t.getAxis(d[2]).getExtentMin():t.getAxis(d[2]).getExtentMax(),p=g[d[2]],_=0;_<2;_++){var v=d[_],y=d[1-_],b=t.getAxis(v),x=t.getAxis(y);if(o(b)){var E=g[v],w=g[y];(A=[0,0,0])[E]=(S=[0,0,0])[E]=n[E],A[p]=S[p]=f,A[w]=x.getExtentMin(),S[w]=x.getExtentMax();var T=u(b);i.addLine(A,S,T.color,T.lineWidth*s)}}if(o(t.getAxis(d[2]))){var S,A=n.slice();(S=n.slice())[p]=f,T=u(t.getAxis(d[2])),i.addLine(A,S,T.color,T.lineWidth*s)}}}i.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(e){var t=this._model,n=this._axisPointerLabelsMesh,i=this._axisPointerLabelsSurface,a=t.coordinateSystem,s=t.getModel("axisPointer");n.geometry.convertToDynamicArray(!0),i.clear();var o={x:"y",y:"x",z:"y"};this._axes.forEach((function(t,l){var u=a.getAxis(t.dim),c=u.model.getModel("axisPointer",s),h=c.getModel("label"),d=c.get("lineStyle.color");if(h.get("show")&&c.get("show")){var f=e[l],p=h.get("formatter"),m=u.scale.getLabel(f);if(null!=p)m=p(m,e);else if("interval"===u.scale.type||"log"===u.scale.type){var _=r.a.number.getPrecisionSafe(u.scale.getTicks()[0]);m=f.toFixed(_+2)}var v=h.getModel("textStyle"),y=v.get("color"),b=new r.a.graphic.Text;r.a.graphic.setTextStyle(b.style,v,{text:m,textFill:y||d,textAlign:"left",textVerticalAlign:"top"});var x=i.add(b),E=b.getBoundingRect(),w=this._api.getDevicePixelRatio(),T=t.rootNode.position.toArray();T[g[o[t.dim]]]+=(t.flipped?-1:1)*h.get("margin"),T[g[t.dim]]=u.dataToCoord(e[l]),n.geometry.addSprite(T,[E.width*w,E.height*w],x,t.textAlign,t.textVerticalAlign)}}),this),i.getZr().refreshImmediately(),n.material.set("uvScale",i.getCoordsScale()),n.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(3),o=n(22),l=n(141),u=n(74),c=s.a.firstNotNull,h={x:0,y:2,z:1};function d(e,t,n){this.rootNode=new a.a.Node;var i=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:1}),r=new a.a.Mesh({geometry:new l.a,material:n,castShadow:!1,culling:!1,ignorePicking:!0,renderOrder:0});this.rootNode.add(r),this.rootNode.add(i),this.faceInfo=e,this.plane=new a.a.Plane,this.linesMesh=i,this.quadsMesh=r}d.prototype.update=function(e,t,n,i){var r=t.coordinateSystem,a=[r.getAxis(this.faceInfo[0]),r.getAxis(this.faceInfo[1])],s=this.linesMesh.geometry,o=this.quadsMesh.geometry;s.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(s,a,t,e,i),this._udpateSplitAreas(o,a,t,e,i),s.convertToTypedArray(),o.convertToTypedArray();var l=r.getAxis(this.faceInfo[2]);!function(e,t,n,i){var r=[0,0,0],a=i<0?n.getExtentMin():n.getExtentMax();r[h[n.dim]]=a,e.position.setArray(r),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),"x"===n.dim?(e.rotation.rotateY(i*Math.PI/2),t.normal.x=-i):"z"===n.dim?(e.rotation.rotateX(-i*Math.PI/2),t.normal.y=-i):(i>0&&e.rotation.rotateY(Math.PI),t.normal.z=-i)}(this.rootNode,this.plane,l,this.faceInfo[3])},d.prototype._updateSplitLines=function(e,t,n,i,s){var o=s.getDevicePixelRatio();t.forEach((function(s,l){var h=s.model,d=t[1-l].getExtent();if(!s.scale.isBlank()){var f=h.getModel("splitLine",n.getModel("splitLine"));if(f.get("show")){var p=f.getModel("lineStyle"),m=p.get("color"),g=c(p.get("opacity"),1),_=c(p.get("width"),1),v=f.get("interval");null!=v&&"auto"!==v||(v=i[s.dim]),m=r.a.util.isArray(m)?m:[m];for(var y=s.getTicksCoords(),b=0,x=0;x<y.length;x++)if(!Object(u.a)(s,x,v)){var E=y[x],w=a.a.parseColor(m[b%m.length]);w[3]*=g;var T=[0,0,0],S=[0,0,0];T[l]=S[l]=E,T[1-l]=d[0],S[1-l]=d[1],e.addLine(T,S,w,_*o),b++}}}}))},d.prototype._udpateSplitAreas=function(e,t,n,i,s){t.forEach((function(s,o){var l=s.model,h=t[1-o].getExtent();if(!s.scale.isBlank()){var d=l.getModel("splitArea",n.getModel("splitArea"));if(d.get("show")){var f=d.getModel("areaStyle"),p=f.get("color"),m=c(f.get("opacity"),1),g=d.get("interval");null!=g&&"auto"!==g||(g=i[s.dim]),p=r.a.util.isArray(p)?p:[p];for(var _=s.getTicksCoords(),v=0,y=[0,0,0],b=[0,0,0],x=0;x<_.length;x++){var E=_[x],w=[0,0,0],T=[0,0,0];if(w[o]=T[o]=E,w[1-o]=h[0],T[1-o]=h[1],0!==x){if(!Object(u.a)(s,x,g)){var S=a.a.parseColor(p[v%p.length]);S[3]*=m,e.addQuad([y,w,T,b],S),y=w,b=T,v++}}else y=w,b=T}}}}))},t.a=d},function(e,t,n){"use strict";var i,r,a,s,o=n(13),l=n(0),u=n.n(l),c=n(33),h=n(1),d=n.n(h).a.vec3,f=o.a.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new o.a.Attribute("position","float",3,"POSITION"),normal:new o.a.Attribute("normal","float",3,"NORMAL"),color:new o.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,n=this.getQuadVertexCount()*e,i=this.getQuadTriangleCount()*e;this.vertexCount!==n&&(t.position.init(n),t.normal.init(n),t.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(i=d.create(),r=d.create(),a=d.create(),s=[0,3,1,3,2,1],function(e,t){var n=this.attributes.position,o=this.attributes.normal,l=this.attributes.color;d.sub(i,e[1],e[0]),d.sub(r,e[2],e[1]),d.cross(a,i,r),d.normalize(a,a);for(var u=0;u<4;u++)n.set(this._vertexOffset+u,e[u]),l.set(this._vertexOffset+u,t),o.set(this._vertexOffset+u,a);var c=3*this._faceOffset;for(u=0;u<6;u++)this.indices[c+u]=s[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});u.a.util.defaults(f.prototype,c.a),t.a=f},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(22),o=n(3),l=n(58),u=n(74),c=o.a.firstNotNull,h={x:0,y:2,z:1};function d(e,t){var n=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new l.a;i.material.depthMask=!1;var r=new a.a.Node;r.add(n),r.add(i),this.rootNode=r,this.dim=e,this.linesMesh=n,this.labelsMesh=i,this.axisLineCoords=null,this.labelElements=[]}var f={x:"y",y:"x",z:"y"};d.prototype.update=function(e,t,n,i){var s=e.coordinateSystem.getAxis(this.dim),o=t[this.dim],l=this.linesMesh.geometry,d=this.labelsMesh.geometry;l.convertToDynamicArray(!0),d.convertToDynamicArray(!0);var p=s.model,m=s.getExtent(),g=i.getDevicePixelRatio(),_=p.getModel("axisLine",e.getModel("axisLine")),v=p.getModel("axisTick",e.getModel("axisTick")),y=p.getModel("axisLabel",e.getModel("axisLabel")),b=_.get("lineStyle.color");if(_.get("show")){var x=_.getModel("lineStyle"),E=[0,0,0];(k=[0,0,0])[M=h[s.dim]]=m[0],E[M]=m[1],this.axisLineCoords=[k,E];var w=a.a.parseColor(b),T=c(x.get("width"),1),S=c(x.get("opacity"),1);w[3]*=S,l.addLine(k,E,w,T*g)}if(v.get("show")){var A=v.getModel("lineStyle"),C=a.a.parseColor(c(A.get("color"),b));T=c(A.get("width"),1),C[3]*=c(A.get("opacity"),1);var L=s.getTicksCoords();null!=(F=v.get("interval"))&&"auto"!==F||(F=o);for(var R=v.get("length"),I=0;I<L.length;I++)if(!Object(u.a)(s,I,F)){var D=L[I],k=[0,0,0],M=(E=[0,0,0],h[s.dim]),P=h[f[s.dim]];k[M]=E[M]=D,E[P]=R,l.addLine(k,E,C,T*g)}}if(this.labelElements=[],g=i.getDevicePixelRatio(),y.get("show")){var O=s.getLabelsCoords(),N=p.get("data"),F=o,B=y.get("margin"),U=p.getFormattedLabels(),G=s.scale.getTicks();for(I=0;I<O.length;I++)if(!Object(u.a)(s,I,F)){D=O[I];var z=[0,0,0];M=h[s.dim],P=h[f[s.dim]],z[M]=z[M]=D,z[P]=B;var j=y;N&&N[G[I]]&&N[G[I]].textStyle&&(j=new r.a.Model(N[G[I]].textStyle,y,p.ecModel));var H=c(j.get("color"),b),V=new r.a.graphic.Text;r.a.graphic.setTextStyle(V.style,j,{text:U[I],textFill:"function"==typeof H?H("category"===s.type?U[I]:"value"===s.type?G[I]+"":G[I],I):H,textVerticalAlign:"top",textAlign:"left"});var W=n.add(V),Z=V.getBoundingRect();d.addSprite(z,[Z.width*g,Z.height*g],W),this.labelElements.push(V)}}if(p.get("name")){var K=p.getModel("nameTextStyle"),q=(z=[0,0,0],M=h[s.dim],P=h[f[s.dim]],c(K.get("color"),b)),X=K.get("borderColor");T=K.get("borderWidth"),z[M]=z[M]=(m[0]+m[1])/2,z[P]=p.get("nameGap"),V=new r.a.graphic.Text,r.a.graphic.setTextStyle(V.style,K,{text:p.get("name"),textFill:q,textStroke:X,lineWidth:T}),W=n.add(V),Z=V.getBoundingRect(),d.addSprite(z,[Z.width*g,Z.height*g],W),V.__idx=this.labelElements.length,this.nameLabelElement=V}this.labelsMesh.material.set("textureAtlas",n.getTexture()),this.labelsMesh.material.set("uvScale",n.getCoordsScale()),l.convertToTypedArray(),d.convertToTypedArray()},d.prototype.setSpriteAlign=function(e,t,n){for(var i=n.getDevicePixelRatio(),r=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var s=this.labelElements[a].getBoundingRect();r.setSpriteAlign(a,[s.width*i,s.height*i],e,t)}var o=this.nameLabelElement;o&&(s=o.getBoundingRect(),r.setSpriteAlign(o.__idx,[s.width*i,s.height*i],e,t),r.dirty()),this.textAlign=e,this.textVerticalAlign=t},t.a=d},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(13),s=n(33),o=[0,1,2,0,2,3],l=a.a.extend((function(){return{attributes:{position:new a.a.Attribute("position","float",3,"POSITION"),texcoord:new a.a.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new a.a.Attribute("offset","float",2),color:new a.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){this._spriteCount=e;var t=4*e,n=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==n&&(this.indices=t>65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(e,t,n,i,r){var a,s,o,l;switch(null==n&&(n="left"),null==i&&(i="top"),r=r||0,n){case"left":a=r,o=t[0]+r;break;case"center":case"middle":a=-t[0]/2,o=t[0]/2;break;case"right":a=-t[0]-r,o=-r}switch(i){case"bottom":s=r,l=t[1]+r;break;case"middle":s=-t[1]/2,l=t[1]/2;break;case"top":s=-t[1]-r,l=-r}var u=4*e,c=this.attributes.offset;c.set(u,[a,l]),c.set(u+1,[o,l]),c.set(u+2,[o,s]),c.set(u+3,[a,s])},addSprite:function(e,t,n,i,r,a){var s=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,n,i,r,a);for(var l=0;l<o.length;l++)this.indices[3*this._faceOffset+l]=o[l]+s;return this._faceOffset+=2,this._vertexOffset+=4,s/4},setSprite:function(e,t,n,i,r,a,s){for(var o=4*e,l=this.attributes,u=0;u<4;u++)l.position.set(o+u,t);var c=l.texcoord;c.set(o,[i[0][0],i[0][1]]),c.set(o+1,[i[1][0],i[0][1]]),c.set(o+2,[i[1][0],i[1][1]]),c.set(o+3,[i[0][0],i[1][1]]),this.setSpriteAlign(e,n,r,a,s)}});r.a.util.defaults(l.prototype,s.a),t.a=l},function(e,t,n){"use strict";t.a="@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end"},function(e,t,n){"use strict";var i=n(146),r=n(148),a=n(0),s=n.n(a),o=n(41),l=n.n(o),u=n(20),c=n(3);function h(e,t){var n=e.getBoxLayoutParams(),i=l.a.getLayoutRect(n,{width:t.getWidth(),height:t.getHeight()});i.y=t.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,t.getDevicePixelRatio());var r=e.get("boxWidth"),a=e.get("boxHeight"),s=e.get("boxDepth");["x","y","z"].forEach((function(t){if(!this.getAxis(t))throw new Error("Grid"+e.id+" don't have "+t+"Axis")}),this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(s/2,-s/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[r,a,s]}function d(e,t){var n={};e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();["x","y","z"].forEach((function(i){!function(e,t){n[e]=n[e]||[1/0,-1/0],n[e][0]=Math.min(t[0],n[e][0]),n[e][1]=Math.max(t[1],n[e][1])}(i,t.getDataExtent(e.coordDimToDataDim(i)[0],!0))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(t){e.eachComponent(t,(function(e){var i=t.charAt(0),a=e.getReferringComponents("grid3D")[0].coordinateSystem;if(a===this){var o=a.getAxis(i);if(o)console.warn("Can't have two %s in one grid3D",t);else{var l=s.a.helper.createScale(n[i]||[1/0,-1/0],e);(o=new r.a(i,l)).type=e.get("type");var u="category"===o.type;o.onBand=u&&e.get("boundaryGap"),o.inverse=e.get("inverse"),e.axis=o,o.model=e,a.addAxis(o)}}}),this)}),this),this.resize(this.model,t)}var f={dimensions:i.a.prototype.dimensions,create:function(e,t){var n=[];e.eachComponent("grid3D",(function(e){e.__viewGL=e.__viewGL||new u.a;var t=new i.a;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,n.push(t),t.resize=h,t.update=d}));var r=["xAxis3D","yAxis3D","zAxis3D"];return e.eachSeries((function(t){if("cartesian3D"===t.get("coordinateSystem")){if(null==(i=t.getReferringComponents("grid3D")[0])){var n=function(e,t){return r.map((function(n){var i=e.getReferringComponents(n)[0];if(null==i&&(i=t.getComponent(n)),!i)throw new Error(n+' "'+c.a.firstNotNull(e.get(n+"Index"),e.get(n+"Id"),0)+'" not found');return i}))}(t,e),i=n[0].getCoordSysModel();n.forEach((function(e){var t=e.getCoordSysModel();if(!t)throw new Error('grid3D "'+c.a.firstNotNull(e.get("gridIndex"),e.get("gridId"),0)+'" not found');if(t!==i)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}))}var a=i.coordinateSystem;t.coordinateSystem=a}})),n}};s.a.registerCoordinateSystem("grid3D",f)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(147),s=n.n(a);function o(e){s.a.call(this,e),this.size=[0,0,0]}o.prototype={constructor:o,type:"cartesian3D",dimensions:["x","y","z"],model:null,containPoint:function(e){return this.getAxis("x").contain(e[0])&&this.getAxis("y").contain(e[2])&&this.getAxis("z").contain(e[1])},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])&&this.getAxis("z").containData(e[2])},dataToPoint:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],n),t[2]=this.getAxis("y").dataToCoord(e[1],n),t[1]=this.getAxis("z").dataToCoord(e[2],n),t},pointToData:function(e,t,n){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],n),t[1]=this.getAxis("y").coordToData(e[2],n),t[2]=this.getAxis("z").coordToData(e[1],n),t}},r.a.util.inherits(o,s.a),t.a=o},function(e,t,n){var i=n(12);function r(e){return this._axes[e]}var a=function(e){this._axes={},this._dimList=[],this.name=e||""};a.prototype={constructor:a,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return i.map(this._dimList,r,this)},getAxesByScale:function(e){return e=e.toLowerCase(),i.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var n=this._dimList,i=e instanceof Array?[]:{},r=0;r<n.length;r++){var a=n[r],s=this._axes[a];i[a]=s[t](e[a])}return i}};var s=a;e.exports=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i);function a(e,t,n){r.a.Axis.call(this,e,t,n)}a.prototype={constructor:a,getExtentMin:function(){var e=this._extent;return Math.min(e[0],e[1])},getExtentMax:function(){var e=this._extent;return Math.max(e[0],e[1])}},r.a.util.inherits(a,r.a.Axis),t.a=a},function(e,t,n){var i=n(12),r=n(150),a=n(78),s=i.normalizeCssArray;function o(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var l=["a","b","c","d","e","f","g"],u=function(e,t){return"{"+e+(null==t?"":t)+"}"},c=function(e){return e<10?"0"+e:e},h=r.truncateText,d=r.getBoundingRect;t.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},t.toCamelCase=function(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e},t.normalizeCssArray=s,t.encodeHTML=o,t.formatTpl=function(e,t,n){i.isArray(t)||(t=[t]);var r=t.length;if(!r)return"";for(var a=t[0].$vars||[],s=0;s<a.length;s++){var c=l[s];e=e.replace(u(c),u(c,0))}for(var h=0;h<r;h++)for(var d=0;d<a.length;d++){var f=t[h][a[d]];e=e.replace(u(l[d],h),n?o(f):f)}return e},t.formatTplSimple=function(e,t,n){return i.each(t,(function(t,i){e=e.replace("{"+i+"}",n?o(t):t)})),e},t.getTooltipMarker=function(e,t){var n=(e=i.isString(e)?{color:e,extraCssText:t}:e||{}).color,r=e.type;return t=e.extraCssText,n?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+o(n)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+o(n)+";"+(t||"")+'"></span>':""},t.formatTime=function(e,t,n){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var i=a.parseDate(t),r=n?"UTC":"",s=i["get"+r+"FullYear"](),o=i["get"+r+"Month"]()+1,l=i["get"+r+"Date"](),u=i["get"+r+"Hours"](),h=i["get"+r+"Minutes"](),d=i["get"+r+"Seconds"]();return e=e.replace("MM",c(o)).replace("M",o).replace("yyyy",s).replace("yy",s%100).replace("dd",c(l)).replace("d",l).replace("hh",c(u)).replace("h",u).replace("mm",c(h)).replace("m",h).replace("ss",c(d)).replace("s",d)},t.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},t.truncateText=h,t.getTextRect=d},function(e,t,n){var i=n(75),r=n(151),a=n(12),s=a.getContext,o=a.extend,l=a.retrieve2,u=a.retrieve3,c={},h=0,d=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,f="12px sans-serif",p={};function m(e,t){var n=e+":"+(t=t||f);if(c[n])return c[n];for(var i=(e+"").split("\n"),r=0,a=0,s=i.length;a<s;a++)r=Math.max(w(i[a],t).width,r);return h>5e3&&(h=0,c={}),h++,c[n]=r,r}function g(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function _(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function v(e,t,n,i,r){if(!t)return"";var a=(e+"").split("\n");r=y(t,n,i,r);for(var s=0,o=a.length;s<o;s++)a[s]=b(a[s],r);return a.join("\n")}function y(e,t,n,i){(i=o({},i)).font=t,n=l(n,"..."),i.maxIterations=l(i.maxIterations,2);var r=i.minChar=l(i.minChar,0);i.cnCharWidth=m("国",t);var a=i.ascCharWidth=m("a",t);i.placeholder=l(i.placeholder,"");for(var s=e=Math.max(0,e-1),u=0;u<r&&s>=a;u++)s-=a;var c=m(n);return c>s&&(n="",c=0),s=e-c,i.ellipsis=n,i.ellipsisWidth=c,i.contentWidth=s,i.containerWidth=e,i}function b(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var a=m(e,i);if(a<=n)return e;for(var s=0;;s++){if(a<=r||s>=t.maxIterations){e+=t.ellipsis;break}var o=0===s?x(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=m(e=e.substr(0,o),i)}return""===e&&(e=t.placeholder),e}function x(e,t,n,i){for(var r=0,a=0,s=e.length;a<s&&r<t;a++){var o=e.charCodeAt(a);r+=0<=o&&o<=127?n:i}return a}function E(e){return m("国",e)}function w(e,t){return p.measureText(e,t)}function T(e,t,n,i){null!=e&&(e+="");var r=E(t),a=e?e.split("\n"):[],s=a.length*r,o=s;if(n&&(o+=n[0]+n[2]),e&&i){var l=i.outerHeight,u=i.outerWidth;if(null!=l&&o>l)e="",a=[];else if(null!=u)for(var c=y(u-(n?n[1]+n[3]:0),t,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),h=0,d=a.length;h<d;h++)a[h]=b(a[h],c)}return{lines:a,height:s,outerHeight:o,lineHeight:r}}function S(e,t){var n={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return n;for(var i,a=d.lastIndex=0;null!=(i=d.exec(e));){var s=i.index;s>a&&A(n,e.substring(a,s)),A(n,i[2],i[1]),a=d.lastIndex}a<e.length&&A(n,e.substring(a,e.length));var o=n.lines,c=0,h=0,f=[],p=t.textPadding,g=t.truncate,_=g&&g.outerWidth,y=g&&g.outerHeight;p&&(null!=_&&(_-=p[1]+p[3]),null!=y&&(y-=p[0]+p[2]));for(var b=0;b<o.length;b++){for(var x=o[b],w=0,T=0,S=0;S<x.tokens.length;S++){var C=(F=x.tokens[S]).styleName&&t.rich[F.styleName]||{},L=F.textPadding=C.textPadding,R=F.font=C.font||t.font,I=F.textHeight=l(C.textHeight,E(R));if(L&&(I+=L[0]+L[2]),F.height=I,F.lineHeight=u(C.textLineHeight,t.textLineHeight,I),F.textAlign=C&&C.textAlign||t.textAlign,F.textVerticalAlign=C&&C.textVerticalAlign||"middle",null!=y&&c+F.lineHeight>y)return{lines:[],width:0,height:0};F.textWidth=m(F.text,R);var D=C.textWidth,k=null==D||"auto"===D;if("string"==typeof D&&"%"===D.charAt(D.length-1))F.percentWidth=D,f.push(F),D=0;else{if(k){D=F.textWidth;var M=C.textBackgroundColor,P=M&&M.image;P&&(P=r.findExistImage(P),r.isImageReady(P)&&(D=Math.max(D,P.width*I/P.height)))}var O=L?L[1]+L[3]:0;D+=O;var N=null!=_?_-T:null;null!=N&&N<D&&(!k||N<O?(F.text="",F.textWidth=D=0):(F.text=v(F.text,N-O,R,g.ellipsis,{minChar:g.minChar}),F.textWidth=m(F.text,R),D=F.textWidth+O))}T+=F.width=D,C&&(w=Math.max(w,F.lineHeight))}x.width=T,x.lineHeight=w,c+=w,h=Math.max(h,T)}for(n.outerWidth=n.width=l(t.textWidth,h),n.outerHeight=n.height=l(t.textHeight,c),p&&(n.outerWidth+=p[1]+p[3],n.outerHeight+=p[0]+p[2]),b=0;b<f.length;b++){var F,B=(F=f[b]).percentWidth;F.width=parseInt(B,10)/100*h}return n}function A(e,t,n){for(var i=""===t,r=t.split("\n"),a=e.lines,s=0;s<r.length;s++){var o=r[s],l={styleName:n,text:o,isLineHolder:!o&&!i};if(s)a.push({tokens:[l]});else{var u=(a[a.length-1]||(a[0]={tokens:[]})).tokens,c=u.length;1===c&&u[0].isLineHolder?u[0]=l:(o||!c||i)&&u.push(l)}}}p.measureText=function(e,t){var n=s();return n.font=t||f,n.measureText(e)},t.DEFAULT_FONT=f,t.$override=function(e,t){p[e]=t},t.getWidth=m,t.getBoundingRect=function(e,t,n,r,a,s,o){return s?function(e,t,n,r,a,s,o){var l=S(e,{rich:s,truncate:o,font:t,textAlign:n,textPadding:a}),u=l.outerWidth,c=l.outerHeight,h=g(0,u,n),d=_(0,c,r);return new i(h,d,u,c)}(e,t,n,r,a,s,o):function(e,t,n,r,a,s){var o=T(e,t,a,s),l=m(e,t);a&&(l+=a[1]+a[3]);var u=o.outerHeight,c=g(0,l,n),h=_(0,u,r),d=new i(c,h,l,u);return d.lineHeight=o.lineHeight,d}(e,t,n,r,a,o)},t.adjustTextX=g,t.adjustTextY=_,t.adjustTextPositionOnRect=function(e,t,n){var i=t.x,r=t.y,a=t.height,s=t.width,o=a/2,l="left",u="top";switch(e){case"left":i-=n,r+=o,l="right",u="middle";break;case"right":i+=n+s,r+=o,u="middle";break;case"top":i+=s/2,r-=n,l="center",u="bottom";break;case"bottom":i+=s/2,r+=a+n,l="center";break;case"inside":i+=s/2,r+=o,l="center",u="middle";break;case"insideLeft":i+=n,r+=o,u="middle";break;case"insideRight":i+=s-n,r+=o,l="right",u="middle";break;case"insideTop":i+=s/2,r+=n,l="center";break;case"insideBottom":i+=s/2,r+=a-n,l="center",u="bottom";break;case"insideTopLeft":i+=n,r+=n;break;case"insideTopRight":i+=s-n,r+=n,l="right";break;case"insideBottomLeft":i+=n,r+=a-n,u="bottom";break;case"insideBottomRight":i+=s-n,r+=a-n,l="right",u="bottom"}return{x:i,y:r,textAlign:l,textVerticalAlign:u}},t.truncateText=v,t.getLineHeight=E,t.measureText=w,t.parsePlainText=T,t.parseRichText=S,t.makeFont=function(e){return(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ")||e.textFont||e.font}},function(e,t,n){var i=new(n(53))(50);function r(){var e=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function a(e){return e&&e.width&&e.height}t.findExistImage=function(e){if("string"==typeof e){var t=i.get(e);return t&&t.image}return e},t.createOrUpdateImage=function(e,t,n,s,o){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!n)return t;var l=i.get(e),u={hostEl:n,cb:s,cbPayload:o};return l?!a(t=l.image)&&l.pending.push(u):(!t&&(t=new Image),t.onload=r,i.put(e,t.__cachedImgObj={image:t,pending:[u]}),t.src=t.__zrImageSrc=e),t}return e}return t},t.isImageReady=a},function(e,t,n){"use strict";var i=n(8),r=n(11),a=n(4),s=n(15),o=n(52),l=n(9),u=n(46),c=n(7),h=(n(19),n(24),n(72)),d=n(70),f=n(71),p=(n(153),n(17)),m=n(10),g=n(6),_=n(5),v=n(25),y=n(36),b=n(30),x=n(14),E=n(79),w=n(1),T=n.n(w),S=n(154),A=T.a.mat4,C=(T.a.vec3,["px","nx","py","ny","pz","nz"]);c.a.import(S.a);var L,R,I,D,k,M,P,O=i.a.extend((function(){return{softShadow:O.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"mediump",_lastRenderNotCastShadow:!1,_frameBuffer:new m.a,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_opaqueCasters:[],_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new E.a}}),(function(){this._gaussianPassH=new x.a({fragment:c.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new x.a({fragment:c.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new x.a({fragment:c.a.source("clay.sm.debug_depth")})}),{render:function(e,t,n,i){n||(n=t.getMainCamera()),this.trigger("beforerender",this,e,t,n),this._renderShadowPass(e,t,n,i),this.trigger("afterrender",this,e,t,n)},renderDebug:function(e,t){e.saveClear();var n=e.viewport,i=0,r=t||n.width/4,a=r;for(var s in this.softShadow===O.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var o=this._textures[s];e.setViewport(i,0,r*o.width/o.height,a),this._outputDepthPass.setUniform("depthMap",o),this._outputDepthPass.render(e),i+=r*o.width/o.height}e.setViewport(n),e.restoreClear()},_updateCasterAndReceiver:function(e,t){if(t.castShadow&&this._opaqueCasters.push(t),t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),!t.material.shader&&t.material.updateShader&&t.material.updateShader(e),this.softShadow===O.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?t.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){for(var n=0;n<t.opaqueList.length;n++)this._updateCasterAndReceiver(e,t.opaqueList[n]);for(n=0;n<t.transparentList.length;n++)this._updateCasterAndReceiver(e,t.transparentList[n]);for(n=0;n<t.lights.length;n++){var i=t.lights[n];i.castShadow&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(e,t,n,i){for(var r in this._shadowMapNumber)this._shadowMapNumber[r]=0;this._lightsCastShadow.length=0,this._opaqueCasters.length=0,this._receivers.length=0;var a=e.gl;if(i||t.update(),n&&n.update(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,a.enable(a.DEPTH_TEST),a.depthMask(!0),a.disable(a.BLEND),a.clearColor(1,1,1,1);for(var s,o=[],l=[],u=[],c=[],p=[],m=[],g=0;g<this._lightsCastShadow.length;g++){var _=this._lightsCastShadow[g];if(_ instanceof d.a){if(s){console.warn("Only one direectional light supported with shadow cascade");continue}if(_.shadowCascade>4){console.warn("Support at most 4 cascade");continue}_.shadowCascade>1&&(s=_.shadowCascade),this.renderDirectionalLightShadow(e,t,n,_,this._opaqueCasters,p,c,u)}else _ instanceof h.a?this.renderSpotLightShadow(e,t,_,this._opaqueCasters,l,o):_ instanceof f.a&&this.renderPointLightShadow(e,t,_,this._opaqueCasters,m);this._shadowMapNumber[_.type]++}for(var v in this._shadowMapNumber){var y=this._shadowMapNumber[v],b=v+"_SHADOWMAP_COUNT";for(g=0;g<this._receivers.length;g++)(x=this._receivers[g].material).fragmentDefines[b]!==y&&(y>0?x.define("fragment",b,y):x.isDefined("fragment",b)&&x.undefine("fragment",b))}for(g=0;g<this._receivers.length;g++){var x=this._receivers[g].material;s?x.define("fragment","SHADOW_CASCADE",s.shadowCascade):x.undefine("fragment","SHADOW_CASCADE")}var E=t.shadowUniforms;if(u.length>0){var w=u.map(C);if(E.directionalLightShadowMaps={value:u,type:"tv"},E.directionalLightMatrices={value:c,type:"m4v"},E.directionalLightShadowMapSizes={value:w,type:"1fv"},s){var T=p.slice(),S=p.slice();T.pop(),S.shift(),T.reverse(),S.reverse(),c.reverse(),E.shadowCascadeClipsNear={value:T,type:"1fv"},E.shadowCascadeClipsFar={value:S,type:"1fv"}}}if(o.length>0){var A=o.map(C);(E=t.shadowUniforms).spotLightShadowMaps={value:o,type:"tv"},E.spotLightMatrices={value:l,type:"m4v"},E.spotLightShadowMapSizes={value:A,type:"1fv"}}m.length>0&&(E.pointLightShadowMaps={value:m,type:"tv"})}function C(e){return e.height}},renderDirectionalLightShadow:(L=new o.a,R=new l.a,I=new s.a,D=new l.a,k=new l.a,M=new l.a,P=new l.a,function(e,t,n,i,r,a,s,o){var c=this._getDepthMaterial(i),h={getMaterial:function(e){return e.shadowDepthMaterial||c},sortCompare:u.a.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var d=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(d).applyTransform(n.viewMatrix)}var f=Math.min(-t.viewBoundingBoxLastFrame.min.z,n.far),p=Math.max(-t.viewBoundingBoxLastFrame.max.z,n.near),m=this._getDirectionalLightCamera(i,t,n),g=M.array;P.copy(m.projectionMatrix),A.invert(k.array,m.worldTransform.array),A.multiply(k.array,k.array,n.worldTransform.array),A.multiply(g,P.array,k.array);for(var _=[],v=n instanceof y.a,b=(n.near+n.far)/(n.near-n.far),x=2*n.near*n.far/(n.near-n.far),E=0;E<=i.shadowCascade;E++){var w=p*Math.pow(f/p,E/i.shadowCascade),T=p+(f-p)*E/i.shadowCascade,S=w*i.cascadeSplitLogFactor+T*(1-i.cascadeSplitLogFactor);_.push(S),a.push(-(-S*b+x)/-S)}var C=this._getTexture(i,i.shadowCascade);o.push(C);var N=e.viewport,F=e.gl;for(this._frameBuffer.attach(C),this._frameBuffer.bind(e),F.clear(F.COLOR_BUFFER_BIT|F.DEPTH_BUFFER_BIT),E=0;E<i.shadowCascade;E++){var B=_[E],U=_[E+1];v?A.perspective(R.array,n.fov/180*Math.PI,n.aspect,B,U):A.ortho(R.array,n.left,n.right,n.bottom,n.top,B,U),L.setFromProjection(R),L.getTransformedBoundingBox(I,k),I.applyProjection(P);var G=I.min.array,z=I.max.array;G[0]=Math.max(G[0],-1),G[1]=Math.max(G[1],-1),z[0]=Math.min(z[0],1),z[1]=Math.min(z[1],1),D.ortho(G[0],z[0],G[1],z[1],1,-1),m.projectionMatrix.multiplyLeft(D);var j=i.shadowResolution||512;e.setViewport((i.shadowCascade-E-1)*j,0,j,j,1),e.renderPass(r,m,h),this.softShadow===O.VSM&&this._gaussianFilter(e,C,C.width);var H=new l.a;H.copy(m.viewMatrix).multiplyLeft(m.projectionMatrix),s.push(H.array),m.projectionMatrix.copy(P)}this._frameBuffer.unbind(e),e.setViewport(N)}),renderSpotLightShadow:function(e,t,n,i,r,a){var s=this._getTexture(n),o=this._getSpotLightCamera(n),c=e.gl;this._frameBuffer.attach(s),this._frameBuffer.bind(e),c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT);var h=this._getDepthMaterial(n),d={getMaterial:function(e){return e.shadowDepthMaterial||h},sortCompare:u.a.opaqueSortCompare};e.renderPass(e.cullRenderList(i,null,o),o,d),this._frameBuffer.unbind(e),this.softShadow===O.VSM&&this._gaussianFilter(e,s,s.width);var f=new l.a;f.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix),a.push(s),r.push(f.array)},renderPointLightShadow:function(e,t,n,i,r){var a=this._getTexture(n),s=e.gl;r.push(a);for(var o=this._getDepthMaterial(n),l={getMaterial:function(e){return e.shadowDepthMaterial||o},sortCompare:u.a.opaqueSortCompare},c=0;c<6;c++){var h=C[c],d=this._getPointLightCamera(n,h);this._frameBuffer.attach(a,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+c),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),e.renderPass(e.cullRenderList(i,null,d),d,l)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t=this._lightMaterials[e.__uid__],n=e instanceof f.a;if(!t){var i=n?"clay.sm.distance.":"clay.sm.depth.";t=new p.a({precision:this.precision,shader:new c.a(c.a.source(i+"vertex"),c.a.source(i+"fragment"))}),this._lightMaterials[e.__uid__]=t}return null!=e.shadowSlopeScale&&t.setUniform("slopeScale",e.shadowSlopeScale),null!=e.shadowBias&&t.setUniform("shadowBias",e.shadowBias),this.softShadow===O.VSM?t.define("fragment","USE_VSM"):t.undefine("fragment","USE_VSM"),n&&(t.set("lightPosition",e.getWorldPosition().array),t.set("range",e.range)),t},_gaussianFilter:function(e,t,n){var i={width:n,height:n,type:g.a.FLOAT},r=this._texturePool.get(i);this._frameBuffer.attach(r),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",n),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",r),this._gaussianPassV.setUniform("textureHeight",n),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(r)},_getTexture:function(e,t){var n=e.__uid__,i=this._textures[n],a=e.shadowResolution||512;return t=t||1,i||((i=e instanceof f.a?new v.a:new _.a).width=a*t,i.height=a,this.softShadow===O.VSM?(i.type=g.a.FLOAT,i.anisotropic=4):(i.minFilter=r.a.NEAREST,i.magFilter=r.a.NEAREST,i.useMipmap=!1),this._textures[n]=i),i},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new y.a,nx:new y.a,py:new y.a,ny:new y.a,pz:new y.a,nz:new y.a});var n=this._lightCameras.point[t];switch(n.far=e.range,n.fov=90,n.position.set(0,0,0),t){case"px":n.lookAt(a.a.POSITIVE_X,a.a.NEGATIVE_Y);break;case"nx":n.lookAt(a.a.NEGATIVE_X,a.a.NEGATIVE_Y);break;case"py":n.lookAt(a.a.POSITIVE_Y,a.a.POSITIVE_Z);break;case"ny":n.lookAt(a.a.NEGATIVE_Y,a.a.NEGATIVE_Z);break;case"pz":n.lookAt(a.a.POSITIVE_Z,a.a.NEGATIVE_Y);break;case"nz":n.lookAt(a.a.NEGATIVE_Z,a.a.NEGATIVE_Y)}return e.getWorldPosition(n.position),n.update(),n},_getDirectionalLightCamera:function(){var e=new l.a,t=new s.a,n=new s.a;return function(i,r,a){this._lightCameras.directional||(this._lightCameras.directional=new b.a);var s=this._lightCameras.directional;t.copy(r.viewBoundingBoxLastFrame),t.intersection(a.frustum.boundingBox),s.position.copy(t.min).add(t.max).scale(.5).transformMat4(a.worldTransform),s.rotation.copy(i.rotation),s.scale.copy(i.scale),s.updateWorldTransform(),l.a.invert(e,s.worldTransform),l.a.multiply(e,e,a.worldTransform),n.copy(t).applyTransform(e);var o=n.min.array,u=n.max.array;return s.position.set((o[0]+u[0])/2,(o[1]+u[1])/2,u[2]).transformMat4(s.worldTransform),s.near=0,s.far=-o[2]+u[2],isNaN(this.lightFrustumBias)?s.far*=4:s.far+=this.lightFrustumBias,s.left=o[0],s.right=u[0],s.top=u[1],s.bottom=o[1],s.update(!0),s}}(),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new y.a);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),A.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t=e.gl||e;for(var n in this._frameBuffer&&this._frameBuffer.dispose(t),this._textures)this._textures[n].dispose(t);this._texturePool.clear(e.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var i=0;i<this._receivers.length;i++){var r=this._receivers[i];if(r.material&&r.material.shader){var a=r.material,s=a.shader;s.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),s.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),s.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),a.set("shadowEnabled",0)}}this._opaqueCasters=[],this._receivers=[],this._lightsCastShadow=[]}});O.VSM=1,O.PCF=2,t.a=O},function(e,t,n){"use strict";var i=n(7),r={};function a(){this._pool={}}a.prototype.get=function(e){var t=e;if(this._pool[t])return this._pool[t];var n=r[e];if(n){var a=new i.a(n.vertex,n.fragment);return this._pool[t]=a,a}console.error('Shader "'+e+'" is not in the library')},a.prototype.clear=function(){this._pool={}},new a},function(e,t,n){"use strict";t.a="@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\n#ifdef SHADOW_TRANSPARENT\nattribute vec2 texcoord : TEXCOORD_0;\n#endif\n@import clay.chunk.skinning_header\nvarying vec4 v_ViewPosition;\n#ifdef SHADOW_TRANSPARENT\nvarying vec2 v_Texcoord;\n#endif\nvoid main(){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_ViewPosition = worldViewProjection * vec4(skinnedPosition, 1.0);\n gl_Position = v_ViewPosition;\n#ifdef SHADOW_TRANSPARENT\n v_Texcoord = texcoord;\n#endif\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\n#ifdef SHADOW_TRANSPARENT\nvarying vec2 v_Texcoord;\n#endif\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\n#ifdef SHADOW_TRANSPARENT\nuniform sampler2D transparentMap;\n#endif\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n#ifdef SHADOW_TRANSPARENT\n if (texture2D(transparentMap, v_Texcoord).a <= 0.1) {\n gl_FragColor = encodeFloat(0.9999);\n return;\n }\n#endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition , 1.0);\n v_WorldPosition = (world * vec4(skinnedPosition, 1.0)).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end"},function(e,t,n){"use strict";var i=n(7),r=n(5),a=n(6),s=n(10),o=n(156),l=n(162),u=n(164),c=n(166),h=n(2),d=n(167),f=n(169),p=(n(9),n(170)),m=n(171),g=n(172),_=n(173),v=n(174),y=n(175),b=n(176),x=n(177),E=n(178),w=n(179),T=n(180),S=n(181);i.a.import(m.a),i.a.import(g.a),i.a.import(_.a),i.a.import(v.a),i.a.import(y.a),i.a.import(b.a),i.a.import(x.a),i.a.import(E.a),i.a.import(w.a),i.a.import(T.a),i.a.import(S.a);var A={color:{parameters:{width:function(e){return e.getWidth()},height:function(e){return e.getHeight()}}}},C=["composite","FXAA"];function L(){this._sourceTexture=new r.a({type:a.a.HALF_FLOAT}),this._depthTexture=new r.a({format:a.a.DEPTH_COMPONENT,type:a.a.UNSIGNED_INT}),this._framebuffer=new s.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,s.a.DEPTH_ATTACHMENT),this._normalPass=new d.a,this._compositor=Object(o.a)(p.a);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(e){return this._compositor.getNodeByName(e)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=C.map((function(e){return this._compositor.getNodeByName(e)}),this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new l.a(n),this._ssrPass=new u.a(n),this._edgePass=new f.a(n)}L.prototype.resize=function(e,t,n){e*=n=n||1,t*=n;var i=this._sourceTexture,r=this._depthTexture;i.width=e,i.height=t,r.width=e,r.height=t},L.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},L.prototype._getPrevNode=function(e){for(var t=C.indexOf(e.name)-1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t-=1,n=this._finalNodesChain[t];return n},L.prototype._getNextNode=function(e){for(var t=C.indexOf(e.name)+1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t+=1,n=this._finalNodesChain[t];return n},L.prototype._addChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(t.outputs=A,e.inputs.texture=t.name,n?(e.outputs=A,n.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},L.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(n?(t.outputs=A,n.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},L.prototype.updateNormal=function(e,t,n,i){this._ifRenderNormalPass()&&this._normalPass.update(e,t,n)},L.prototype.updateSSAO=function(e,t,n,i){this._ssaoPass.update(e,n,i)},L.prototype.enableSSAO=function(){this._enableSSAO=!0},L.prototype.disableSSAO=function(){this._enableSSAO=!1},L.prototype.enableSSR=function(){this._enableSSR=!0},L.prototype.disableSSR=function(){this._enableSSR=!1},L.prototype.getSSAOTexture=function(e,t,n,i){return this._ssaoPass.getTargetTexture()},L.prototype.getSourceFrameBuffer=function(){return this._framebuffer},L.prototype.getSourceTexture=function(){return this._sourceTexture},L.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},L.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},L.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},L.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},L.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},L.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},L.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},L.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},L.prototype.enableEdge=function(){this._enableEdge=!0},L.prototype.disableEdge=function(){this._enableEdge=!1},L.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},L.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var n={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:console.warn("Unkown SSAO parameter "+e)}},L.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].setParameter("blurRadius",t);break;case"quality":var i={low:4,medium:8,high:16,ultra:32}[t]||8;for(this._dofBlurKernelSize=i,n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].pass.material.define("POISSON_KERNEL_SIZE",i);this._dofBlurKernel=new Float32Array(2*i);break;default:console.warn("Unkown DOF parameter "+e)}},L.prototype.setSSRParameter=function(e,t){switch(e){case"quality":var n={low:10,medium:20,high:40,ultra:80}[t]||20,i={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",n),this._ssrPass.setParameter("pixelStride",i);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-t,1),0));break;default:console.warn("Unkown SSR parameter "+e)}},L.prototype.setEdgeColor=function(e){var t=h.a.parseColor(e);this._edgePass.setParameter("edgeColor",t)},L.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},L.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:h.a.Texture.NEAREST,magFilter:h.a.Texture.NEAREST,flipY:!1})},L.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},L.prototype.composite=function(e,t,n,i){var r=this._sourceTexture,a=r;this._enableEdge&&(this._edgePass.update(e,t,r,i),r=a=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,t,r,i),a=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=a,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,o=this._dofBlurKernelSize,l=i%Math.floor(c.a.length/2/o),u=0;u<2*o;u++)s[u]=c.a[u+l*o*2];for(u=0;u<this._dofBlurNodes.length;u++)this._dofBlurNodes[u].setParameter("percent",i/30),this._dofBlurNodes[u].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",t.near),this._cocNode.setParameter("zFar",t.far),this._compositor.render(e,n)},L.prototype.dispose=function(e){this._sourceTexture.dispose(e),this._depthTexture.dispose(e),this._framebuffer.dispose(e),this._compositor.dispose(e),this._normalPass.dispose(e),this._ssaoPass.dispose(e)},t.a=L},function(e,t,n){"use strict";var i=n(21),r=n(157),a=n(159),s=n(160),o=n(161),l=n(7),u=n(6),c=n(5),h=n(25),d=/^#source\((.*?)\)/;function f(e,t,n){var i,r,u,c,h=e.type||"filter";if("filter"===h){var f=e.shader.trim(),_=d.exec(f);if(_?i=l.a.source(_[1].trim()):"#"===f.charAt(0)&&(i=t.shaders[f.substr(1)]),i||(i=f),!i)return}if(e.inputs)for(var v in r={},e.inputs)"string"==typeof e.inputs[v]?r[v]=e.inputs[v]:r[v]={node:e.inputs[v].node,pin:e.inputs[v].pin};if(e.outputs)for(var v in u={},e.outputs){var y=e.outputs[v];u[v]={},null!=y.attachment&&(u[v].attachment=y.attachment),null!=y.keepLastFrame&&(u[v].keepLastFrame=y.keepLastFrame),null!=y.outputLastFrame&&(u[v].outputLastFrame=y.outputLastFrame),y.parameters&&(u[v].parameters=p(y.parameters))}if(c="scene"===h?new a.a({name:e.name,scene:n.scene,camera:n.camera,outputs:u}):"texture"===h?new s.a({name:e.name,outputs:u}):new o.a({name:e.name,shader:i,inputs:r,outputs:u})){if(e.parameters)for(var v in e.parameters)"string"==typeof(b=e.parameters[v])&&("#"===(b=b.trim()).charAt(0)?b=t.textures[b.substr(1)]:c.on("beforerender",m(v,g(b)))),c.setParameter(v,b);if(e.defines&&c.pass)for(var v in e.defines){var b=e.defines[v];c.pass.material.define("fragment",v,b)}}return c}function p(e){var t={};return e?(["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(n){var i=e[n];null!=i&&("string"==typeof i&&(i=u.a[i]),t[n]=i)})),["width","height"].forEach((function(n){if(null!=e[n]){var i=e[n];"string"==typeof i?(i=i.trim(),t[n]=(r=g(i),function(e){var t=e.getDevicePixelRatio(),n=e.getWidth(),i=e.getHeight();return r(n,i,t)})):t[n]=i}var r})),null!=e.useMipmap&&(t.useMipmap=e.useMipmap),t):t}function m(e,t){return function(n){var i=n.getDevicePixelRatio(),r=n.getWidth(),a=n.getHeight(),s=t(r,a,i);this.setParameter(e,s)}}function g(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var n=new Function("width","height","dpr","return "+t[1]);return n(1,1),n}catch(e){throw new Error("Invalid expression.")}}t.a=function(e,t){var n=new r.a;t=t||{};var a={textures:{},parameters:{}};for(var s in e.parameters){var o=e.parameters[s];a.parameters[s]=p(o)}return function(e,t,n,r){if(e.textures){var a={},s=0,o=!1,l=n.textureRootPath;i.a.each(e.textures,(function(e,t){var n,u=e.path,d=p(e.parameters);if(Array.isArray(u)&&6===u.length)l&&(u=u.map((function(e){return i.a.relative2absolute(e,l)}))),n=new h.a(d);else{if("string"!=typeof u)return;l&&(u=i.a.relative2absolute(u,l)),n=new c.a(d)}n.load(u),s++,n.once("success",(function(){a[t]=n,0==--s&&(r(a),o=!0)}))})),0!==s||o||r(a)}else r({})}(e,0,t,(function(i){a.textures=i,function(i,r){for(var s=0;s<e.nodes.length;s++){var o=f(e.nodes[s],a,t);o&&n.addNode(o)}}()})),n}},function(e,t,n){"use strict";var i=n(158),r=n(79),a=n(10),s=i.a.extend((function(){return{_outputs:[],_texturePool:new r.a,_frameBuffer:new a.a({depthBuffer:!1})}}),{addNode:function(e){i.a.prototype.addNode.call(this,e),e._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var n=0;n<this.nodes.length;n++)this.nodes[n].outputs||this._outputs.push(this.nodes[n])}for(n=0;n<this.nodes.length;n++)this.nodes[n].beforeFrame();for(n=0;n<this._outputs.length;n++)this._outputs[n].updateReference();for(n=0;n<this._outputs.length;n++)this._outputs[n].render(e,t);for(n=0;n<this.nodes.length;n++)this.nodes[n].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}});t.a=s},function(e,t,n){"use strict";var i=n(8),r=n(42),a=i.a.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t<this.nodes.length;t++)if(this.nodes[t].name===e)return this.nodes[t]},update:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].clear();for(e=0;e<this.nodes.length;e++){var t=this.nodes[e];if(t.inputs)for(var n in t.inputs)if(t.inputs[n])if(!t.pass||t.pass.material.isUniformEnabled(n)){var i=t.inputs[n],r=this.findPin(i);r?t.link(n,r.node,r.pin):"string"==typeof i?console.warn("Node "+i+" not exist"):console.warn("Pin of "+i.node+"."+i.pin+" not exist")}else console.warn("Pin "+t.name+"."+n+" not used.")}},findPin:function(e){var t;if(("string"==typeof e||e instanceof r.a)&&(e={node:e}),"string"==typeof e.node)for(var n=0;n<this.nodes.length;n++){var i=this.nodes[n];i.name===e.node&&(t=i)}else t=e.node;if(t){var a=e.pin;if(a||t.outputs&&(a=Object.keys(t.outputs)[0]),t.outputs[a])return{node:t,pin:a}}}});t.a=a},function(e,t,n){"use strict";var i=n(42),r=n(11),a=n(10),s=i.a.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new a.a}),{render:function(e){this._rendering=!0;var t,n=e.gl;if(this.trigger("beforerender"),this.outputs){var i=this.frameBuffer;for(var a in this.outputs){var s=this.updateParameter(a,e),o=this.outputs[a],l=this._compositor.allocateTexture(s);this._outputTextures[a]=l,"string"==typeof(h=o.attachment||n.COLOR_ATTACHMENT0)&&(h=n[h]),i.attach(l,h)}i.bind(e);var u=e.getGLExtension("EXT_draw_buffers");if(u){var c=[];for(var h in this.outputs)(h=parseInt(h))>=n.COLOR_ATTACHMENT0&&h<=n.COLOR_ATTACHMENT0+8&&c.push(h);u.drawBuffersEXT(c)}e.saveClear(),e.clearBit=r.a.DEPTH_BUFFER_BIT|r.a.COLOR_BUFFER_BIT,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),i.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}});t.a=s},function(e,t,n){"use strict";var i=n(42).a.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});t.a=i},function(e,t,n){"use strict";var i=n(14),r=n(42),a=r.a.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var e=new i.a({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var n=e.gl;for(var i in this.inputLinks){var r=(h=this.inputLinks[i]).node.getOutput(e,h.pin);this.pass.setUniform(i,r)}if(this.outputs){this.pass.outputs={};var a={};for(var s in this.outputs){var o=this.updateParameter(s,e);isNaN(o.width)&&this.updateParameter(s,e);var l=this.outputs[s],u=this._compositor.allocateTexture(o);this._outputTextures[s]=u,"string"==typeof(c=l.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),a[c]=u}for(var c in this._compositor.getFrameBuffer().bind(e),a)this._compositor.getFrameBuffer().attach(a[c],c);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e.gl)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var i in this.inputLinks){var h;(h=this.inputLinks[i]).node.removeReference(h.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var n,i,r=this.outputs[e],a=r.parameters,s=r._parametersCopy;if(s||(s=r._parametersCopy={}),a)for(var o in a)"width"!==o&&"height"!==o&&(s[o]=a[o]);return n=a.width instanceof Function?a.width.call(this,t):a.width,i=a.height instanceof Function?a.height.call(this,t):a.height,s.width===n&&s.height===i||this._outputTextures[e]&&this._outputTextures[e].dispose(t),s.width=n,s.height=i,s},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){this._outputReferences[e]--,0===this._outputReferences[e]&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},clear:function(){r.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});t.a=a},function(e,t,n){"use strict";var i=n(9),r=n(4),a=n(5),s=n(6),o=n(14),l=n(7),u=n(10),c=n(43),h=n(163);function d(e){for(var t=new Uint8Array(e*e*4),n=0,i=new r.a,a=0;a<e;a++)for(var s=0;s<e;s++)i.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[n++]=255*(.5*i.x+.5),t[n++]=255*(.5*i.y+.5),t[n++]=0,t[n++]=255;return t}function f(e){return new a.a({pixels:d(e),wrapS:s.a.REPEAT,wrapT:s.a.REPEAT,width:e,height:e})}function p(e,t,n){var i=new Float32Array(3*e);t=t||0;for(var r=0;r<e;r++){var a=Object(c.a)(r+t,2)*(n?1:2)*Math.PI,s=Object(c.a)(r+t,3)*Math.PI,o=Math.random(),l=Math.cos(a)*Math.sin(s)*o,u=Math.cos(s)*o,h=Math.sin(a)*Math.sin(s)*o;i[3*r]=l,i[3*r+1]=u,i[3*r+2]=h}return i}function m(e){e=e||{},this._ssaoPass=new o.a({fragment:l.a.source("ecgl.ssao.estimate")}),this._blurPass=new o.a({fragment:l.a.source("ecgl.ssao.blur")}),this._framebuffer=new u.a({depthBuffer:!1}),this._ssaoTexture=new a.a,this._blurTexture=new a.a,this._blurTexture2=new a.a,this._depthTex=e.depthTexture,this._normalTex=e.normalTexture,this.setNoiseSize(4),this.setKernelSize(e.kernelSize||12),null!=e.radius&&this.setParameter("radius",e.radius),null!=e.power&&this.setParameter("power",e.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}l.a.import(h.a),m.prototype.setDepthTexture=function(e){this._depthTex=e},m.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},m.prototype.update=function(e,t,n){var r=e.getWidth(),a=e.getHeight(),s=this._ssaoPass,o=this._blurPass;s.setUniform("kernel",this._kernels[n%this._kernels.length]),s.setUniform("depthTex",this._depthTex),null!=this._normalTex&&s.setUniform("normalTex",this._normalTex),s.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var l=new i.a;i.a.transpose(l,t.worldTransform),s.setUniform("projection",t.projectionMatrix.array),s.setUniform("projectionInv",t.invProjectionMatrix.array),s.setUniform("viewInverseTranspose",l.array);var u=this._ssaoTexture,c=this._blurTexture,h=this._blurTexture2;u.width=r/2,u.height=a/2,c.width=r,c.height=a,h.width=r,h.height=a,this._framebuffer.attach(u),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),s.render(e),o.setUniform("textureSize",[r/2,a/2]),o.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(c),o.setUniform("direction",0),o.setUniform("ssaoTexture",u),o.render(e),this._framebuffer.attach(h),o.setUniform("textureSize",[r,a]),o.setUniform("direction",1),o.setUniform("ssaoTexture",c),o.render(e),this._framebuffer.unbind(e);var d=e.clearColor;e.gl.clearColor(d[0],d[1],d[2],d[3])},m.prototype.getTargetTexture=function(){return this._blurTexture2},m.prototype.setParameter=function(e,t){"noiseTexSize"===e?this.setNoiseSize(t):"kernelSize"===e?this.setKernelSize(t):"intensity"===e?this._ssaoPass.material.set("intensity",t):this._ssaoPass.setUniform(e,t)},m.prototype.setKernelSize=function(e){this._kernelSize=e,this._ssaoPass.material.define("fragment","KERNEL_SIZE",e),this._kernels=this._kernels||[];for(var t=0;t<30;t++)this._kernels[t]=p(e,t*e,!!this._normalTex)},m.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=d(e),t.width=t.height=e,t.dirty()):(t=f(e),this._ssaoPass.setUniform("noiseTex",f(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},m.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)},t.a=m},function(e,t,n){"use strict";t.a="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"},function(e,t,n){"use strict";var i=n(9),r=(n(4),n(5)),a=n(6),s=n(14),o=n(7),l=n(10),u=(n(43),n(165));function c(e){e=e||{},this._ssrPass=new s.a({fragment:o.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new s.a({fragment:o.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new s.a({fragment:o.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._texture1=new r.a({type:a.a.HALF_FLOAT}),this._texture2=new r.a({type:a.a.HALF_FLOAT}),this._texture3=new r.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new l.a({depthBuffer:!1})}o.a.import(u.a),c.prototype.update=function(e,t,n,r){var a=e.getWidth(),s=e.getHeight(),o=e.getDevicePixelRatio(),l=this._texture1,u=this._texture2,c=this._texture3;u.width=a/2,u.height=s/2,l.width=a,l.height=s,c.width=a*o,c.height=s*o;var h=this._frameBuffer,d=this._ssrPass,f=this._blurPass1,p=this._blurPass2,m=new i.a;i.a.transpose(m,t.worldTransform),d.setUniform("sourceTexture",n),d.setUniform("projection",t.projectionMatrix.array),d.setUniform("projectionInv",t.invProjectionMatrix.array),d.setUniform("viewInverseTranspose",m.array),d.setUniform("nearZ",t.near),d.setUniform("jitterOffset",r/30),f.setUniform("textureSize",[a/2,s/2]),p.setUniform("textureSize",[a,s]),p.setUniform("sourceTexture",n),f.setUniform("projection",t.projectionMatrix.array),p.setUniform("projection",t.projectionMatrix.array),h.attach(l),h.bind(e),d.render(e),h.attach(u),f.setUniform("texture",l),f.render(e),h.attach(c),p.setUniform("texture",u),p.render(e),h.unbind(e)},c.prototype.getTargetTexture=function(){return this._texture3},c.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},c.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},c.prototype.dispose=function(e){this._texture1.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._frameBuffer.dispose(e)},t.a=c},function(e,t,n){"use strict";t.a="@export ecgl.ssr.main\n\n#define MAX_ITERATION 20;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 viewInverseTranspose;\n\nuniform float maxRayDistance: 50;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 10;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n if (intersect) {\n break;\n }\n }\n\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n if (g <= minGlossiness) {\n discard;\n }\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalAndGloss.rgb * 2.0 - 1.0;\n N = normalize((viewInverseTranspose * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n\n vec3 rayDir = normalize(reflect(normalize(rayOrigin), N));\n vec2 hitPixel;\n vec3 hitPoint;\n float iterationCount;\n\n vec2 uv2 = v_Texcoord * viewportSize;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n float alpha = calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir) * float(intersect);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((viewInverseTranspose * vec4(hitNormal, 0.0)).xyz);\n\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n\n \n if (!intersect) {\n discard;\n }\n vec4 color = decodeHDR(texture2D(sourceTexture, hitPixel));\n gl_FragColor = encodeHDR(vec4(color.rgb * alpha, color.a));\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 4.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g + 0.1, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"},function(e,t,n){"use strict";t.a=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925]},function(e,t,n){"use strict";var i=n(5),r=n(6),a=n(7),s=n(10),o=n(17),l=n(14),u=n(54),c=n(168);function h(e,t,n,i,r){var a=e.gl;t.setUniform(a,"1i",n,r),a.activeTexture(a.TEXTURE0+r),i.isRenderable()?i.bind(e):i.unbind(e)}function d(e,t,n,i,r){var a,s,o,l,u=e.gl;return function(r,c,d){if(!l||l.material!==r.material){var f=r.material,p=r.__program,m=f.get("roughness");null==m&&(m=1);var g=f.get("normalMap")||t,_=f.get("roughnessMap"),v=f.get("bumpMap"),y=f.get("uvRepeat"),b=f.get("uvOffset"),x=f.get("detailUvRepeat"),E=f.get("detailUvOffset"),w=!!v&&f.isTextureEnabled("bumpMap"),T=!!_&&f.isTextureEnabled("roughnessMap"),S=f.isDefined("fragment","DOUBLE_SIDED");v=v||n,_=_||i,d!==c?(c.set("normalMap",g),c.set("bumpMap",v),c.set("roughnessMap",_),c.set("useBumpMap",w),c.set("useRoughnessMap",T),c.set("doubleSide",S),null!=y&&c.set("uvRepeat",y),null!=b&&c.set("uvOffset",b),null!=x&&c.set("detailUvRepeat",x),null!=E&&c.set("detailUvOffset",E),c.set("roughness",m)):(p.setUniform(u,"1f","roughness",m),a!==g&&h(e,p,"normalMap",g,0),s!==v&&v&&h(e,p,"bumpMap",v,1),o!==_&&_&&h(e,p,"roughnessMap",_,2),null!=y&&p.setUniform(u,"2f","uvRepeat",y),null!=b&&p.setUniform(u,"2f","uvOffset",b),null!=x&&p.setUniform(u,"2f","detailUvRepeat",x),null!=E&&p.setUniform(u,"2f","detailUvOffset",E),p.setUniform(u,"1i","useBumpMap",+w),p.setUniform(u,"1i","useRoughnessMap",+T),p.setUniform(u,"1i","doubleSide",+S)),a=g,s=v,o=_,l=r}}}function f(e){e=e||{},this._depthTex=new i.a({format:r.a.DEPTH_COMPONENT,type:r.a.UNSIGNED_INT}),this._normalTex=new i.a({type:r.a.HALF_FLOAT}),this._framebuffer=new s.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,s.a.DEPTH_ATTACHMENT),this._normalMaterial=new o.a({shader:new a.a(a.a.source("ecgl.normal.vertex"),a.a.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=u.a.createBlank("#000"),this._defaultBumpMap=u.a.createBlank("#000"),this._defaultRoughessMap=u.a.createBlank("#000"),this._debugPass=new l.a({fragment:a.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}a.a.import(c.a),f.prototype.getDepthTexture=function(){return this._depthTex},f.prototype.getNormalTexture=function(){return this._normalTex},f.prototype.update=function(e,t,n){var i=e.getWidth(),r=e.getHeight(),a=this._depthTex,s=this._normalTex,o=this._normalMaterial;a.width=i,a.height=r,s.width=i,s.height=r;var l=t.opaqueList;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,n,{getMaterial:function(){return o},ifRender:function(e){return e.renderNormal},beforeRender:d(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},f.prototype.renderDebug=function(e){this._debugPass.render(e)},f.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},t.a=f},function(e,t,n){"use strict";t.a="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"},function(e,t,n){"use strict";n(9),n(4);var i=n(5),r=n(6),a=n(14),s=n(7),o=n(10);function l(e){e=e||{},this._edgePass=new a.a({fragment:s.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new i.a({type:r.a.HALF_FLOAT}),this._frameBuffer=new o.a,this._frameBuffer.attach(this._targetTexture)}l.prototype.update=function(e,t,n,i){var r=e.getWidth(),a=e.getHeight(),s=this._targetTexture;s.width=r,s.height=a;var o=this._frameBuffer;o.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[r,a]),this._edgePass.setUniform("texture",n),this._edgePass.render(e),o.unbind(e)},l.prototype.getTargetTexture=function(){return this._targetTexture},l.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},l.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=l},function(e,t,n){"use strict";t.a={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]}},function(e,t,n){"use strict";t.a="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n"},function(e,t,n){"use strict";t.a="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end"},function(e,t,n){"use strict";t.a="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(e,t,n){"use strict";t.a="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n"},function(e,t,n){"use strict";t.a="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end"},function(e,t,n){"use strict";t.a="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end"},function(e,t,n){"use strict";t.a="@export clay.compositor.hdr.composite\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(e,t,n){"use strict";t.a="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end"},function(e,t,n){"use strict";t.a="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end"},function(e,t,n){"use strict";t.a="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = decodeHDR(texture2D(blurred, v_Texcoord));\n vec4 originalColor = decodeHDR(texture2D(original, v_Texcoord));\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = decodeHDR(texture2D(nearfield, v_Texcoord));\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = decodeHDR(texel);\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n gl_FragColor = encodeHDR(color);\n#endif\n}\n\n@end"},function(e,t,n){"use strict";t.a="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end"},function(e,t,n){"use strict";var i=n(43),r=n(14),a=n(10),s=n(5),o=n(7),l=n(9);function u(e){for(var t=[],n=0;n<30;n++)t.push([Object(i.a)(n,2),Object(i.a)(n,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new s.a,this._sourceFb=new a.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new s.a,this._outputTex=new s.a;var l=this._blendPass=new r.a({fragment:o.a.source("clay.compositor.blend")});l.material.disableTexturesAll(),l.material.enableTexture(["texture1","texture2"]),this._blendFb=new a.a({depthBuffer:!1}),this._outputPass=new r.a({fragment:o.a.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(e){e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}}u.prototype={constructor:u,jitterProjection:function(e,t){var n=e.viewport,i=n.devicePixelRatio||e.getDevicePixelRatio(),r=n.width*i,a=n.height*i,s=this._haltonSequence[this._frame%this._haltonSequence.length],o=new l.a;o.array[12]=(2*s[0]-1)/r,o.array[13]=(2*s[1]-1)/a,l.a.mul(t.projectionMatrix,o,t.projectionMatrix),l.a.invert(t.invProjectionMatrix,t.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(e,t){this._prevFrameTex.width=e,this._prevFrameTex.height=t,this._outputTex.width=e,this._outputTex.height=t,this._sourceTex.width=e,this._sourceTex.height=t,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(e,t,n){var i=this._blendPass;0===this._frame?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),i.render(e),this._blendFb.unbind(e),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var r=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=r,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}},t.a=u},function(e,t,n){"use strict";var i=n(0),r=n.n(i);n(184),n(185),n(82),r.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"geo3D",query:e},(function(t){t.setView(e)}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(38),s=n(31),o=n(32),l=n(26),u=n(80),c=r.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=r.a.helper.completeDimensions(["value"],e.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),n=new r.a.List(t,this);n.initData(e.regions);var i={};n.each((function(e){var t=n.getName(e),r=n.getItemModel(e);i[t]=r})),this._regionModelMap=i,this._data=n},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new r.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),n=this.coordinateSystem.getRegion(t);return n?n.geometries:[]},getFormattedLabel:function(e,t){var n=this._data.getName(e),i=this.getRegionModel(n),r=i.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==r&&(r=i.get(["label","formatter"]));var a={name:n};if("function"==typeof r)return a.status=t,r(a);if("string"==typeof r){var s=a.seriesName;return r.replace("{a}",null!=s?s:"")}return n},defaultOption:{regions:[]}});r.a.util.merge(c.prototype,u.a),r.a.util.merge(c.prototype,a.a),r.a.util.merge(c.prototype,s.a),r.a.util.merge(c.prototype,o.a),r.a.util.merge(c.prototype,l.a)},function(e,t,n){"use strict";var i=n(59),r=n(0),a=n.n(r),s=n(2),o=n(39),l=n(34);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new i.a(t),this.groupGL=new s.a.Node,this._lightRoot=new s.a.Node,this._sceneHelper=new l.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new o.a({zr:t.getZr()}),this._control.init()},render:function(e,t,n){this.groupGL.add(this._geo3DBuilder.rootNode);var i=e.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this._lightRoot),e.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(e),i.viewGL.setPostEffect(e.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,n,0,e.getData().count());var s=i.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[s]("fragment","SRGB_DECODE")})),r.off("update"),r.on("update",(function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,geo3DId:e.id})}))}},afterRender:function(e,t,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,e,n),this._sceneHelper.updateSkybox(r,e,n)},dispose:function(){this._control.dispose()}})},function(e,t,n){"use strict";function i(e,t,n){n=n||2;var i,o,l,u,c,f,m,g=t&&t.length,_=g?t[0]*n:e.length,v=r(e,0,_,n,!0),y=[];if(!v)return y;if(g&&(v=function(e,t,n,i){var s,o,l,u=[];for(s=0,o=t.length;s<o;s++)(l=r(e,t[s]*i,s<o-1?t[s+1]*i:e.length,i,!1))===l.next&&(l.steiner=!0),u.push(p(l));for(u.sort(h),s=0;s<u.length;s++)d(u[s],n),n=a(n,n.next);return n}(e,t,v,n)),e.length>80*n){i=l=e[0],o=u=e[1];for(var b=n;b<_;b+=n)(c=e[b])<i&&(i=c),(f=e[b+1])<o&&(o=f),c>l&&(l=c),f>u&&(u=f);m=Math.max(l-i,u-o)}return s(v,y,n,i,o,m),y}function r(e,t,n,i,r){var a,s;if(r===S(e,t,n,i)>0)for(a=t;a<n;a+=i)s=E(a,e[a],e[a+1],s);else for(a=n-i;a>=t;a-=i)s=E(a,e[a],e[a+1],s);return s&&v(s,s.next)&&(w(s),s=s.next),s}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!v(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(w(i),(i=t=i.prev)===i.next)return null;n=!0}}while(n||i!==t);return t}function s(e,t,n,i,r,h,d){if(e){!d&&h&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=f(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,s,o,l,u=1;do{for(n=e,e=null,a=null,s=0;n;){for(s++,i=n,o=0,t=0;t<u&&(o++,i=i.nextZ);t++);for(l=u;o>0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,u*=2}while(s>1)}(r)}(e,i,r,h);for(var p,m,g=e;e.prev!==e.next;)if(p=e.prev,m=e.next,h?l(e,i,r,h):o(e))t.push(p.i/n),t.push(e.i/n),t.push(m.i/n),w(e),e=m.next,g=m.next;else if((e=m)===g){d?1===d?s(e=u(e,t,n),t,n,i,r,h,2):2===d&&c(e,t,n,i,r,h):s(a(e),t,n,i,r,h,1);break}}}function o(e){var t=e.prev,n=e,i=e.next;if(_(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(m(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&_(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function l(e,t,n,i){var r=e.prev,a=e,s=e.next;if(_(r,a,s)>=0)return!1;for(var o=r.x<a.x?r.x<s.x?r.x:s.x:a.x<s.x?a.x:s.x,l=r.y<a.y?r.y<s.y?r.y:s.y:a.y<s.y?a.y:s.y,u=r.x>a.x?r.x>s.x?r.x:s.x:a.x>s.x?a.x:s.x,c=r.y>a.y?r.y>s.y?r.y:s.y:a.y>s.y?a.y:s.y,h=f(o,l,t,n,i),d=f(u,c,t,n,i),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&m(r.x,r.y,a.x,a.y,s.x,s.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&m(r.x,r.y,a.x,a.y,s.x,s.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!v(r,a)&&y(r,i,i.next,a)&&b(r,a)&&b(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),w(i),w(i.next),i=e=a),i=i.next}while(i!==e);return i}function c(e,t,n,i,r,o){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=x(l,u);return l=a(l,l.next),c=a(c,c.next),s(l,t,n,i,r,o),void s(c,t,n,i,r,o)}u=u.next}l=l.next}while(l!==e)}function h(e,t){return e.x-t.x}function d(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,s=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var o=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=r&&o>s){if(s=o,o===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===s)return n.prev;var l,u=n,c=n.x,h=n.y,d=1/0;for(i=n.next;i!==u;)r>=i.x&&i.x>=c&&r!==i.x&&m(a<h?r:s,a,c,h,a<h?s:r,a,i.x,i.y)&&((l=Math.abs(a-i.y)/(r-i.x))<d||l===d&&i.x>n.x)&&b(i,e)&&(n=i,d=l),i=i.next;return n}(e,t),t){var n=x(t,e);a(n,n.next)}}function f(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function m(e,t,n,i,r,a,s,o){return(r-s)*(t-o)-(e-s)*(a-o)>=0&&(e-s)*(i-o)-(n-s)*(t-o)>=0&&(n-s)*(a-o)-(r-s)*(i-o)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&y(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&b(e,t)&&b(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,n,i){return!!(v(e,t)&&v(n,i)||v(e,i)&&v(n,t))||_(e,t,n)>0!=_(e,t,i)>0&&_(n,i,e)>0!=_(n,i,t)>0}function b(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function x(e,t){var n=new T(e.i,e.x,e.y),i=new T(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function E(e,t,n,i){var r=new T(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function w(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,s=n-i;a<n;a+=i)r+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return r}t.a=i,i.deviation=function(e,t,n,i){var r=t&&t.length,a=r?t[0]*n:e.length,s=Math.abs(S(e,0,a,n));if(r)for(var o=0,l=t.length;o<l;o++){var u=t[o]*n,c=o<l-1?t[o+1]*n:e.length;s-=Math.abs(S(e,u,c,n))}var h=0;for(o=0;o<i.length;o+=3){var d=i[o]*n,f=i[o+1]*n,p=i[o+2]*n;h+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)}},function(e,t,n){var i=n(12),r={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};e.exports=function(e){i.each(e.regions,(function(e){var t=r[e.name];if(t){var n=e.center;n[0]+=t[0]/10.5,n[1]+=-t[1]/14}}))}},function(e,t,n){var i=n(12),r={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};e.exports=function(e){i.each(e.regions,(function(e){var t=r[e.name];if(t){var n=e.center;n[0]=t[0],n[1]=t[1]}}))}},function(e,t,n){"use strict";var i=n(0),r=n.n(i);n(190),n(191),n(193),r.a.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"globe",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(e,t){}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(38),s=n(31),o=n(32),l=n(26);function u(e,t){e.id=e.id||e.name||t+""}var c=r.a.extendComponentModel({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){c.superApply(this,"init",arguments),r.a.util.each(this.option.layers,(function(e,t){r.a.util.merge(e,this.defaultLayerOption),u(e,t)}),this)},mergeOption:function(e){var t=this.option.layers;function n(e){return r.a.util.reduce(e,(function(e,t,n){return u(t,n),e[t.id]=t,e}),{})}if(this.option.layers=null,c.superApply(this,"mergeOption",arguments),t&&t.length){var i=n(e.layers),a=n(t);for(var s in i)a[s]?r.a.util.merge(a[s],i[s],!0):t.push(e.layers[s]);this.option.layers=t}r.a.util.each(this.option.layers,(function(e){r.a.util.merge(e,this.defaultLayerOption)}),this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var e=this.getDisplacementTexture(),t=this.get("displacementScale");return e&&"none"!==e||(t=0),t},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});r.a.util.merge(c.prototype,a.a),r.a.util.merge(c.prototype,s.a),r.a.util.merge(c.prototype,o.a),r.a.util.merge(c.prototype,l.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(39),o=n(34),l=n(192),u=n(3);r.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new a.a.Node,this._sphereGeometry=new a.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a.a.PlaneGeometry,this._earthMesh=new a.a.Mesh({renderNormal:!0}),this._lightRoot=new a.a.Node,this._sceneHelper=new o.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new s.a({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,n){var i=e.coordinateSystem,r=e.get("shading");i.viewGL.add(this._lightRoot),e.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL),this._sceneHelper.setScene(i.viewGL.scene),i.viewGL.setPostEffect(e.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var s=this._earthMesh;s.geometry=this._sphereGeometry;var o="ecgl."+r;s.material&&s.material.shader.name===o||(s.material=a.a.createMaterial(o)),a.a.setMaterialFromModel(r,s.material,e,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=s.material.get(e);t&&(t.flipY=!1)})),s.material.set("color",a.a.parseColor(e.get("baseColor")));var l=.99*i.radius;s.scale.set(l,l,l);var u=s.material.setTextureImage("diffuseMap",e.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(s);var c=s.material.setTextureImage("bumpMap",e.get("heightTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(s),s.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,n),this._displaceVertices(e,n),this._updateViewControl(e,n),this._updateLayers(e,n)},afterRender:function(e,t,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,e,n),this._sceneHelper.updateSkybox(r,e,n)},_updateLayers:function(e,t){var n=e.coordinateSystem,i=e.get("layers"),s=n.radius,o=[],l=[],c=[],h=[];r.a.util.each(i,(function(e){var i=new r.a.Model(e),d=i.get("type"),f=a.a.loadTexture(i.get("texture"),t,{flipY:!1,anisotropic:8});if(f.surface&&f.surface.attachToMesh(this._earthMesh),"blend"===d){var p=i.get("blendTo"),m=u.a.firstNotNull(i.get("intensity"),1);"emission"===p?(c.push(f),h.push(m)):(o.push(f),l.push(m))}else{var g=i.get("id"),_=this._layerMeshes[g];_||(_=this._layerMeshes[g]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===i.get("shading")?(_.material=_.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),_.__lambertMaterial=_.material):(_.material=_.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),_.__colorMaterial=_.material),_.material.enableTexture("diffuseMap");var v=i.get("distance"),y=s+(null==v?n.radius/100:v);_.scale.set(y,y,y),s=y;var b=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));_.material.set("diffuseMap",b),a.a.loadTexture(i.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(_),_.material.set("diffuseMap",e),t.getZr().refresh()})),i.get("show")?this.groupGL.add(_):this.groupGL.remove(_)}}),this);var d=this._earthMesh.material;d.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),d.define("fragment","LAYER_EMISSIVEMAP_COUNT",c.length),d.set("layerDiffuseMap",o),d.set("layerDiffuseIntensity",l),d.set("layerEmissiveMap",c),d.set("layerEmissionIntensity",h);var f=e.getModel("debug.wireframe");if(f.get("show")){d.define("both","WIREFRAME_TRIANGLE");var p=a.a.parseColor(f.get("lineStyle.color")||"rgba(0,0,0,0.5)"),m=u.a.firstNotNull(f.get("lineStyle.width"),1);d.set("wireframeLineWidth",m),d.set("wireframeLineColor",p)}else d.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var n=e.coordinateSystem,i=e.getModel("viewControl"),r=(n.viewGL.camera,this),a=this._control;a.setViewGL(n.viewGL);var s,o,l=i.get("targetCoord");null!=l&&(o=l[0]+90,s=l[1]),a.setFromViewControlModel(i,{baseDistance:n.radius,alpha:s,beta:o}),a.off("update"),a.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-n.radius,center:a.getCenter(),from:r.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var n=e.get("displacementQuality"),i=e.get("debug.wireframe.show"),r=e.coordinateSystem;if(e.isDisplacementChanged()||n!==this._displacementQuality||i!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=i;var a=this._sphereGeometry,s={low:100,medium:200,high:400,ultra:800}[n]||200,o=s/2;(a.widthSegments!==s||i)&&(a.widthSegments=s,a.heightSegments=o,a.build()),this._doDisplaceVertices(a,r),i&&a.generateBarycentric()}},_doDisplaceVertices:function(e,t){var n=e.attributes.position.value,i=e.attributes.texcoord0.value,r=e.__originalPosition;r&&r.length===n.length||((r=new Float32Array(n.length)).set(n),e.__originalPosition=r);for(var a=t.displacementWidth,s=t.displacementHeight,o=t.displacementData,l=0;l<e.vertexCount;l++){var u=3*l,c=2*l,h=r[u+1],d=r[u+2],f=r[u+3],p=i[c++],m=i[c++],g=Math.round(p*(a-1)),_=Math.round(m*(s-1)),v=o?o[_*a+g]:0;n[u+1]=h+h*v,n[u+2]=d+d*v,n[u+3]=f+f*v}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e,t){var n=this._earthMesh;this._sceneHelper.updateLight(e);var i=this._sceneHelper.mainLight,a=e.get("light.main.time")||new Date,s=l.a.getPosition(r.a.number.parseDate(a),0,0),o=Math.cos(s.altitude);i.position.y=-o*Math.cos(s.azimuth),i.position.x=Math.sin(s.altitude),i.position.z=o*Math.sin(s.azimuth),i.lookAt(n.getWorldPosition())},dispose:function(e,t){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,n){"use strict";var i=Math.PI,r=Math.sin,a=Math.cos,s=Math.tan,o=Math.asin,l=Math.atan2,u=i/180,c=23.4397*u;function h(e,t){return l(r(e)*a(c)-s(t)*r(c),a(e))}function d(e,t,n){return l(r(e),a(e)*r(t)-s(n)*a(t))}function f(e,t,n){return o(r(t)*r(n)+a(t)*a(n)*a(e))}function p(e){var t,n,s=function(e){return u*(357.5291+.98560028*e)}(e),l=function(e){return e+u*(1.9148*r(e)+.02*r(2*e)+3e-4*r(3*e))+102.9372*u+i}(s);return{dec:(t=l,n=0,o(r(n)*a(c)+a(n)*r(c)*r(t))),ra:h(l,0)}}var m={getPosition:function(e,t,n){var i=u*-n,r=u*t,a=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),s=p(a),o=function(e,t){return u*(280.16+360.9856235*e)-t}(a,i)-s.ra;return{azimuth:d(o,r,s.dec),altitude:f(o,r,s.dec)}}};t.a=m},function(e,t,n){"use strict";var i=n(194),r=n(0),a=n.n(r),s=n(41),o=n.n(s),l=n(20),u=n(3),c=n(2);function h(e,t){var n=e.getBoxLayoutParams(),i=o.a.getLayoutRect(n,{width:t.getWidth(),height:t.getHeight()});i.y=t.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,t.getDevicePixelRatio()),this.radius=e.get("globeRadius");var r=e.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function d(e,t){var n=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),i=e.coordDimToDataDim("alt")[0];if(i){var r=t.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])){var i=a.a.helper.createScale(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",i),this.resize(this.model,t)}}var f={dimensions:i.a.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("globe",(function(e){e.__viewGL=e.__viewGL||new l.a;var r=new i.a;r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,n.push(r),r.resize=h,r.resize(e,t),r.update=d})),e.eachSeries((function(t){if("globe"===t.get("coordinateSystem")){var n=t.getReferringComponents("globe")[0];if(n||(n=e.getComponent("globe")),!n)throw new Error('globe "'+u.a.firstNotNull(t.get("globe3DIndex"),t.get("globe3DId"),0)+'" not found');var i=n.coordinateSystem;t.coordinateSystem=i}})),e.eachComponent("globe",(function(e,n){var i=e.coordinateSystem,r=e.getDisplacementTexture(),a=e.getDisplacemenScale();if(e.isDisplacementChanged()){if(e.hasDisplacement()){var s=!0;c.a.loadTexture(r,t,(function(n){var i=function(e,t){var n=document.createElement("canvas"),i=n.getContext("2d"),r=e.width,a=e.height;n.width=r,n.height=a,i.drawImage(e,0,0,r,a);for(var s=i.getImageData(0,0,r,a).data,o=new Float32Array(s.length/4),l=0;l<s.length/4;l++){var u=s[4*l];o[l]=u/255*t}return{data:o,width:r,height:a}}(n.image,a);e.setDisplacementData(i.data,i.width,i.height),s||t.dispatchAction({type:"globeUpdateDisplacment"})})),s=!1}else i.setDisplacementData(null,0,0);i.setDisplacementData(e.displacementData,e.displacementWidth,e.displacementHeight)}})),n}};a.a.registerCoordinateSystem("globe",f)},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.vec3;function a(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}a.prototype={constructor:a,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,n){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=n},_getDisplacementScale:function(e,t){var n=(e+180)/360*(this.displacementWidth-1),i=(90-t)/180*(this.displacementHeight-1),r=Math.round(n)+Math.round(i)*this.displacementWidth;return this.displacementData[r]},dataToPoint:function(e,t){var n=e[0],i=e[1],r=e[2]||0,a=this.radius;this.displacementData&&(a*=1+this._getDisplacementScale(n,i)),this.altitudeAxis&&(a+=this.altitudeAxis.dataToCoord(r)),n=n*Math.PI/180,i=i*Math.PI/180;var s=Math.cos(i)*a;return(t=t||[])[0]=-s*Math.cos(n+Math.PI),t[1]=Math.sin(i)*a,t[2]=s*Math.sin(n+Math.PI),t},pointToData:function(e,t){var n=e[0],i=e[1],a=e[2],s=r.len(e);n/=s,i/=s,a/=s;var o=Math.asin(i),l=Math.atan2(a,-n);l<0&&(l=2*Math.PI+l);var u=180*o/Math.PI,c=180*l/Math.PI-180;return(t=t||[])[0]=c,t[1]=u,t[2]=s-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}},t.a=a},function(e,t,n){"use strict";var i=n(0),r=n.n(i);n(196),n(198),n(199),r.a.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))},function(e,t,n){"use strict";var i=n(197),r=n(0),a=n.n(r),s=n(3),o=n(2),l=n(20);function u(e,t){var n=t.getWidth(),i=t.getHeight(),r=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,i,r),this.width=n,this.height=i,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function c(e,t){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),i=e.coordDimToDataDim("alt")[0];if(i){var r=t.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}var h={dimensions:i.a.prototype.dimensions,create:function(e,t){var n=[];return e.eachComponent("mapbox3D",(function(e){var r=e.__viewGL;r||(r=e.__viewGL=new l.a).setRootNode(new o.a.Node);var a=new i.a;a.viewGL=e.__viewGL,a.resize=u,a.resize(e,t),n.push(a),e.coordinateSystem=a,a.model=e,a.setCameraOption(e.getMapboxCameraOption()),a.update=c})),e.eachSeries((function(t){if("mapbox3D"===t.get("coordinateSystem")){var n=t.getReferringComponents("mapbox3D")[0];if(n||(n=e.getComponent("mapbox3D")),!n)throw new Error('mapbox3D "'+s.a.firstNotNull(t.get("mapbox3DIndex"),t.get("mapbox3DId"),0)+'" not found');t.coordinateSystem=n.coordinateSystem}})),n}};a.a.registerCoordinateSystem("mapbox3D",h)},function(e,t,n){"use strict";var i=n(1),r=n.n(i).a.mat4,a=512,s=.6435011087932844,o=Math.PI,l=.1;function u(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom}u.prototype={constructor:u,type:"mapbox3D",dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(e){this.bearing=e.bearing,this.pitch=e.pitch,this.center=e.center,this.zoom=e.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,a)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var e=.5/Math.tan(s/2)*this.height*l,t=Math.max(Math.min(this.pitch,60),0)/180*Math.PI,n=s/2,i=Math.PI/2+t,o=Math.sin(n)*e/Math.sin(Math.PI-i-n),u=1.1*(Math.cos(Math.PI/2-t)*o+e),c=new Float64Array(16);r.perspective(c,s,this.width/this.height,1,u),this.viewGL.camera.projectionMatrix.setArray(c),this.viewGL.camera.decomposeProjectionMatrix(),c=r.identity(new Float64Array(16));var h=this.dataToPoint(this.center);r.scale(c,c,[1,-1,1]),r.translate(c,c,[0,0,-e]),r.rotateX(c,c,t),r.rotateZ(c,c,-this.bearing/180*Math.PI),r.translate(c,c,[-h[0]*this.getScale()*l,-h[1]*this.getScale()*l,0]),this.viewGL.camera.viewMatrix.array=c;var d=new Float64Array(16);r.invert(d,c),this.viewGL.camera.worldTransform.array=d,this.viewGL.camera.decomposeWorldTransform();var f,p=a*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var m=this.altitudeExtent[1]-this.altitudeExtent[0];f=this.boxHeight/m*this.getScale()/Math.pow(2,this._initialZoom)}else f=p/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*l;this.viewGL.rootNode.scale.set(this.getScale()*l,this.getScale()*l,f)}},getScale:function(){return Math.pow(2,this.zoom)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*a,t)},projectOnTileWithScale:function(e,t,n){var i=e[0],r=e[1]*o/180,a=t*(i*o/180+o)/(2*o),s=t*(o-Math.log(Math.tan(o/4+.5*r)))/(2*o);return(n=n||[])[0]=a,n[1]=s,n},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*a,t)},unprojectOnTileWithScale:function(e,t,n){var i=e[0],r=e[1],a=i/t*(2*o)-o,s=2*(Math.atan(Math.exp(o-r/t*(2*o)))-o/4);return(n=n||[])[0]=180*a/o,n[1]=180*s/o,n},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,a,t))[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}},t.a=u},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(31),s=n(32),o=["zoom","center","pitch","bearing"],l=r.a.extendComponentModel({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var e=this;return o.reduce((function(t,n){return t[n]=e.get(n),t}),{})},setMapboxCameraOption:function(e){null!=e&&o.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=e}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,s.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(200),s=n(34),o=n(2),l=n(201);o.a.Shader.import(l.a),r.a.extendComponentView({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var n=t.getZr();this._zrLayer=new a.a("mapbox3D",n),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new o.a.Node,this._sceneHelper=new s.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var i=this._zrLayer.getMapbox(),r=this._dispatchInteractAction.bind(this,t,i);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(e){i.on(e,r)})),this._groundMesh=new o.a.Mesh({geometry:new o.a.PlaneGeometry,material:new o.a.Material({shader:new o.a.Shader({vertex:o.a.Shader.source("ecgl.displayShadow.vertex"),fragment:o.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(e,t,n){var i=this._zrLayer.getMapbox(),r=e.get("style"),a=JSON.stringify(r);a!==this._oldStyleStr&&r&&i.setStyle(r),this._oldStyleStr=a,i.setCenter(e.get("center")),i.setZoom(e.get("zoom")),i.setPitch(e.get("pitch")),i.setBearing(e.get("bearing")),e.setMapbox(i);var s=e.coordinateSystem;s.viewGL.scene.add(this._lightRoot),s.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(s.viewGL.scene),this._sceneHelper.updateLight(e),s.viewGL.setPostEffect(e.getModel("postEffect"),n),s.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._mapbox3DModel=e},afterRender:function(e,t,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,e,n),this._sceneHelper.updateSkybox(r,e,n),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,n,i){e.coordinateSystem.setCameraOption(i),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){e.dispatchAction({type:"mapbox3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var e=this._mapbox3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new o.a.Plane(new o.a.Vector3(0,0,1),0),i=e.viewGL.camera.castRay(new o.a.Vector2(-1,-1)),r=e.viewGL.camera.castRay(new o.a.Vector2(1,1)),a=i.intersectPlane(n),s=r.intersectPlane(n),l=a.dist(s)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(e,t){t.getZr().delLayer(-1e3)}})},function(e,t,n){"use strict";function i(e,t){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}i.prototype.resize=function(){this._mapbox.resize()},i.prototype.getMapbox=function(){return this._mapbox},i.prototype.clear=function(){},i.prototype.refresh=function(){this._mapbox.resize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];i.prototype._initEvents=function(){var e=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},r.forEach((function(t){this._handlers[t]=function(t){var n={};for(var i in t)n[i]=t[i];n.bubbles=!1;var r=new t.constructor(t.type,n);e.dispatchEvent(r)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},i.prototype.dispose=function(){r.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this)},t.a=i},function(e,t,n){"use strict";t.a="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(203),n(206),n(208),n(16));r.a.registerVisual(Object(a.a)("bar3D")),r.a.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(4),s=n(1),o=n.n(s),l=n(204),u=n(205),c=o.a.vec3;r.a.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,n=t&&t.type;if("globe"===n)!function(e,t){var n=e.getData(),i=e.get("minHeight")||0,s=e.get("barSize"),o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==s){var l=t.radius*Math.PI,h=Object(u.a)(n,o[0],o[1]);s=[l/Math.sqrt(n.count()/h),l/Math.sqrt(n.count()/h)]}else r.a.util.isArray(s)||(s=[s,s]);n.each(o,(function(e,r,a,l){var u=n.get(o[2],l,!0),h=n.stackedOn?u-a:t.altitudeAxis.scale.getExtent()[0],d=Math.max(t.altitudeAxis.dataToCoord(a),i),f=t.dataToPoint([e,r,h]),p=t.dataToPoint([e,r,u]),m=c.sub([],p,f);c.normalize(m,m);var g=[s[0],d,s[1]];n.setItemLayout(l,[f,m,g])})),n.setLayout("orient",a.a.UP.array)}(e,t);else if("cartesian3D"===n)Object(l.a)(e,t);else if("geo3D"===n)!function(e,t){var n=e.getData(),i=e.get("barSize"),a=e.get("minHeight")||0,s=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==i){var o=Math.min(t.size[0],t.size[2]),l=Object(u.a)(n,s[0],s[1]);i=[o/Math.sqrt(n.count()/l),o/Math.sqrt(n.count()/l)]}else r.a.util.isArray(i)||(i=[i,i]);var c=[0,1,0];n.each(s,(function(e,r,o,l){var u=n.get(s[2],l,!0),h=n.stackedOn?u-o:t.altitudeAxis.scale.getExtent()[0],d=Math.max(t.altitudeAxis.dataToCoord(o),a),f=t.dataToPoint([e,r,h]),p=[i[0],d,i[1]];n.setItemLayout(l,[f,c,p])})),n.setLayout("orient",[1,0,0])}(e,t);else{if("mapbox3D"!==n)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.");!function(e,t){var n=e.getData(),i=e.coordDimToDataDim("lng")[0],a=e.coordDimToDataDim("lat")[0],s=e.coordDimToDataDim("alt")[0],o=e.get("barSize"),l=e.get("minHeight")||0;if(null==o){var c=n.getDataExtent(i),h=n.getDataExtent(a),d=t.dataToPoint([c[0],h[0]]),f=t.dataToPoint([c[1],h[1]]),p=Math.min(Math.abs(d[0]-f[0]),Math.abs(d[1]-f[1]))||1,m=Object(u.a)(n,i,a);o=[p/Math.sqrt(n.count()/m),p/Math.sqrt(n.count()/m)]}else r.a.util.isArray(o)||(o=[o,o]),o[0]/=t.getScale()/16,o[1]/=t.getScale()/16;var g=[0,0,1];n.each([i,a,s],(function(e,i,r,a){var u=n.get(s,a,!0),c=n.stackedOn?u-r:0,h=t.dataToPoint([e,i,c]),d=t.dataToPoint([e,i,u]),f=Math.max(d[2]-h[2],l),p=[o[0],f,o[1]];n.setItemLayout(a,[h,g,p])})),n.setLayout("orient",[1,0,0])}(e,t)}}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(1),s=n.n(a).a.vec3;t.a=function(e,t){var n=e.getData(),i=e.get("barSize");if(null==i){var a,o,l=t.size,u=t.getAxis("x"),c=t.getAxis("y");a="category"===u.type?.7*u.getBandWidth():.6*Math.round(l[0]/Math.sqrt(n.count())),o="category"===c.type?.7*c.getBandWidth():.6*Math.round(l[1]/Math.sqrt(n.count())),i=[a,o]}else r.a.util.isArray(i)||(i=[i,i]);var h,d,f,p=t.getAxis("z").scale.getExtent(),m=(d=(h=p)[0],f=h[1],!(d>0&&f>0||d<0&&f<0)),g=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]}));n.each(g,(function(e,r,a,o){var l=n.get(g[2],o,!0),u=n.stackedOn?l-a:m?0:p[0],c=t.dataToPoint([e,r,u]),h=t.dataToPoint([e,r,l]),d=s.dist(c,h),f=[0,h[1]<c[1]?-1:1,0];0===Math.abs(d)&&(d=.1);var _=[i[0],d,i[1]];n.setItemLayout(o,[c,f,_])})),n.setLayout("orient",[1,0,0])}},function(e,t,n){"use strict";t.a=function(e,t,n){for(var i=e.getDataExtent(t),r=e.getDataExtent(n),a=i[1]-i[0]||i[0],s=r[1]-r[0]||r[0],o=new Uint8Array(2500),l=0;l<e.count();l++){var u=e.get(t,l),c=e.get(n,l),h=Math.floor((u-i[0])/a*49),d=50*Math.floor((c-r[0])/s*49)+h;o[d]=o[d]||1}var f=0;for(l=0;l<o.length;l++)o[l]&&f++;return f/o.length}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(3),o=n(27),l=n(207),u=n(61),c=n(1),h=n.n(c).a.vec3;r.a.extendChartView({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._api=t,this._labelsBuilder=new u.a(256,256,t);var n=this;this._labelsBuilder.getLabelPosition=function(e,t,i){if(n._data){var r=n._data.getItemLayout(e),a=r[0],s=r[1],o=r[2][1];return h.scaleAndAdd([],a,s,i+o)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,n){var i=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=i,this._barMesh||(this._barMesh=new a.a.Mesh({geometry:new l.a,shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===e.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var r=e.coordinateSystem;if(this._doRender(e,n),r&&r.viewGL){r.viewGL.add(this.groupGL);var s=r.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[s]("fragment","SRGB_DECODE")}this._data=e.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(e)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var n=e.getData(),i=e.get("shading"),r="color"!==i,s=this,o=this._barMesh,l="ecgl."+i;o.material&&o.material.shader.name===l||(o.material=a.a.createMaterial(l,["VERTEX_COLOR"])),a.a.setMaterialFromModel(i,o.material,e,t),o.geometry.enableNormal=r,o.geometry.resetOffset();var u=e.get("bevelSize"),c=e.get("bevelSmoothness");o.geometry.bevelSegments=c,o.geometry.bevelSize=u;var h=[],d=new Float32Array(4*n.count()),f=0,p=0,m=!1;n.each((function(e){if(n.hasValue(e)){var t=n.getItemVisual(e,"color"),i=n.getItemVisual(e,"opacity");null==i&&(i=1),a.a.parseColor(t,h),h[3]*=i,d[f++]=h[0],d[f++]=h[1],d[f++]=h[2],d[f++]=h[3],h[3]>0&&(p++,h[3]<.99&&(m=!0))}})),o.geometry.setBarCount(p);var g=n.getLayout("orient"),_=this._barIndexOfData=new Int32Array(n.count());p=0,n.each((function(e){if(n.hasValue(e)){var t=n.getItemLayout(e),i=t[0],r=t[1],a=t[2],o=4*e;h[0]=d[o++],h[1]=d[o++],h[2]=d[o++],h[3]=d[o++],h[3]>0&&(s._barMesh.geometry.addBar(i,r,g,a,h,e),_[e]=p++)}else _[e]=-1})),o.geometry.dirty(),o.geometry.updateBoundingBox();var v=o.material;v.transparent=m,v.depthMask=!m,o.geometry.sortTriangles=m,this._initHandler(e,t)},_initHandler:function(e,t){var n=e.getData(),i=this._barMesh,r="cartesian3D"===e.coordinateSystem.type;i.seriesIndex=e.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(e){var s=i.geometry.getDataIndexOfVertex(e.triangle[0]);s!==a&&(this._downplay(a),this._highlight(s),this._labelsBuilder.updateLabels([s]),r&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",s),n.get("y",s),n.get("z",s,!0)]})),a=s,i.dataIndex=s}),this),i.on("mouseout",(function(e){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,i.dataIndex=-1,r&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var i=t.getItemModel(e).getModel("emphasis.itemStyle"),s=i.get("color"),o=i.get("opacity");if(null==s){var l=t.getItemVisual(e,"color");s=r.a.color.lift(l,-.4)}null==o&&(o=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(s);u[3]*=o,this._barMesh.geometry.setColor(n,u),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var i=t.getItemVisual(e,"color"),r=t.getItemVisual(e,"opacity"),s=a.a.parseColor(i);s[3]*=r,this._barMesh.geometry.setColor(n,s),this._api.getZr().refresh()}}},highlight:function(e,t,n,i){this._toggleStatus("highlight",e,t,n,i)},downplay:function(e,t,n,i){this._toggleStatus("downplay",e,t,n,i)},_toggleStatus:function(e,t,n,i,a){var l=t.getData(),u=s.a.queryDataIndex(l,a),c=this;null!=u?r.a.util.each(o.a.normalizeToArray(u),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):l.each((function(t){"highlight"===e?c._highlight(t):c._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i,r,a,s,o,l,u,c,h=n(0),d=n.n(h),f=n(33),p=n(60),m=n(13),g=n(1),_=n.n(g),v=_.a.vec3,y=_.a.mat3,b=m.a.extend((function(){return{attributes:{position:new m.a.Attribute("position","float",3,"POSITION"),normal:new m.a.Attribute("normal","float",3,"NORMAL"),color:new m.a.Attribute("color","float",4,"COLOR"),prevPosition:new m.a.Attribute("prevPosition","float",3),prevNormal:new m.a.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,n=this.getBarVertexCount()*e,i=this.getBarTriangleCount()*e;this.vertexCount!==n&&(this.attributes.position.init(n),t?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){return(4*e+3+1)*(2*e+1)*2+4},setColor:function(e,t){for(var n=this.getBarVertexCount(),i=n*(e+1),r=n*e;r<i;r++)this.attributes.color.set(r,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=v.create,t=v.scaleAndAdd,n=e(),i=e(),r=e(),a=e(),s=e(),o=e(),l=e(),u=[],c=[],h=0;h<8;h++)u[h]=e();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],f=[0,1,2,0,2,3],p=[];for(h=0;h<d.length;h++)for(var m=d[h],g=0;g<2;g++){for(var _=[],y=0;y<3;y++)_.push(m[f[3*g+y]]);p.push(_)}return function(e,h,m,g,_,y){var b=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(e,h,m,g,this.bevelSize,this.bevelSegments,_);else{v.copy(r,h),v.normalize(r,r),v.cross(a,m,r),v.normalize(a,a),v.cross(i,r,a),v.normalize(a,a),v.negate(s,i),v.negate(o,r),v.negate(l,a),t(u[0],e,i,g[0]/2),t(u[0],u[0],a,g[2]/2),t(u[1],e,i,g[0]/2),t(u[1],u[1],l,g[2]/2),t(u[2],e,s,g[0]/2),t(u[2],u[2],l,g[2]/2),t(u[3],e,s,g[0]/2),t(u[3],u[3],a,g[2]/2),t(n,e,r,g[1]),t(u[4],n,i,g[0]/2),t(u[4],u[4],a,g[2]/2),t(u[5],n,i,g[0]/2),t(u[5],u[5],l,g[2]/2),t(u[6],n,s,g[0]/2),t(u[6],u[6],l,g[2]/2),t(u[7],n,s,g[0]/2),t(u[7],u[7],a,g[2]/2);var x=this.attributes;if(this.enableNormal){c[0]=i,c[1]=s,c[2]=r,c[3]=o,c[4]=a,c[5]=l;for(var E=this._vertexOffset,w=0;w<d.length;w++){for(var T=3*this._triangleOffset,S=0;S<6;S++)this.indices[T++]=E+f[S];E+=4,this._triangleOffset+=2}for(w=0;w<d.length;w++){var A=c[w];for(S=0;S<4;S++){var C=d[w][S];x.position.set(this._vertexOffset,u[C]),x.normal.set(this._vertexOffset,A),x.color.set(this._vertexOffset++,_)}}}else{for(w=0;w<p.length;w++){for(T=3*this._triangleOffset,S=0;S<3;S++)this.indices[T+S]=p[w][S]+this._vertexOffset;this._triangleOffset++}for(w=0;w<u.length;w++)x.position.set(this._vertexOffset,u[w]),x.color.set(this._vertexOffset++,_)}}var L=this._vertexOffset;for(w=b;w<L;w++)this._dataIndices[w]=y}}(),_addBevelBar:(i=v.create(),r=v.create(),a=v.create(),s=y.create(),o=[],l=[1,-1,-1,1],u=[1,1,-1,-1],c=[2,0],function(e,t,n,h,d,f,p){v.copy(r,t),v.normalize(r,r),v.cross(a,n,r),v.normalize(a,a),v.cross(i,r,a),v.normalize(a,a),s[0]=i[0],s[1]=i[1],s[2]=i[2],s[3]=r[0],s[4]=r[1],s[5]=r[2],s[6]=a[0],s[7]=a[1],s[8]=a[2],d=Math.min(h[0],h[2])/2*d;for(var m=0;m<3;m++)o[m]=Math.max(h[m]-2*d,0);var g=(h[0]-o[0])/2,_=(h[1]-o[1])/2,y=(h[2]-o[2])/2,b=[],x=[],E=this._vertexOffset,w=[];for(m=0;m<2;m++){w[m]=w[m]=[];for(var T=0;T<=f;T++)for(var S=0;S<4;S++){(0===T&&0===m||1===m&&T===f)&&w[m].push(E);for(var A=0;A<=f;A++){var C=A/f*Math.PI/2+Math.PI/2*S,L=T/f*Math.PI/2+Math.PI/2*m;x[0]=g*Math.cos(C)*Math.sin(L),x[1]=_*Math.cos(L),x[2]=y*Math.sin(C)*Math.sin(L),b[0]=x[0]+l[S]*o[0]/2,b[1]=x[1]+_+c[m]*o[1]/2,b[2]=x[2]+u[S]*o[2]/2,Math.abs(g-_)<1e-6&&Math.abs(_-y)<1e-6||(x[0]/=g*g,x[1]/=_*_,x[2]/=y*y),v.normalize(x,x),v.transformMat3(b,b,s),v.transformMat3(x,x,s),v.add(b,b,e),this.attributes.position.set(E,b),this.enableNormal&&this.attributes.normal.set(E,x),this.attributes.color.set(E,p),E++}}}var R=4*f+3,I=2*f+1,D=R+1;for(S=0;S<I;S++)for(m=0;m<=R;m++){var k=S*D+m+this._vertexOffset,M=S*D+(m+1)%D+this._vertexOffset,P=(S+1)*D+(m+1)%D+this._vertexOffset,O=(S+1)*D+m+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[P,k,M]),this.setTriangleIndices(this._triangleOffset++,[P,O,k])}this.setTriangleIndices(this._triangleOffset++,[w[0][0],w[0][2],w[0][1]]),this.setTriangleIndices(this._triangleOffset++,[w[0][0],w[0][3],w[0][2]]),this.setTriangleIndices(this._triangleOffset++,[w[1][0],w[1][1],w[1][2]]),this.setTriangleIndices(this._triangleOffset++,[w[1][0],w[1][2],w[1][3]]),this._vertexOffset=E})});d.a.util.defaults(b.prototype,f.a),d.a.util.defaults(b.prototype,p.a),t.a=b},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(26),s=n(27),o=n(35),l=n(44),u=r.a.extendSeriesModel({type:"series.bar3D",dependencies:["globe"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){return Object(l.a)(this)},getFormattedLabel:function(e,t,n,i){var r=s.a.getFormattedLabel(this,e,t,n,i);return null==r&&(r=this.getData().get("z",e)),r},formatTooltip:function(e){return Object(o.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});r.a.util.merge(u.prototype,a.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(210),n(211),n(45)),s=n.n(a),o=n(16);r.a.registerVisual(s()("line3D","circle",null)),r.a.registerVisual(Object(o.a)("line3D")),r.a.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),n=e.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void console.error("line3D needs cartesian3D coordinateSystem");var i=new Float32Array(3*t.count()),r=[],a=[],s=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n&&t.each(s,(function(e,t,s,o){r[0]=e,r[1]=t,r[2]=s,n.dataToPoint(r,a),i[3*o]=a[0],i[3*o+1]=a[1],i[3*o+2]=a[2]})),t.setLayout("points",i)}}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(35),s=n(44);r.a.extendSeriesModel({type:"series.line3D",dependencies:["grid3D"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){return Object(s.a)(this)},formatTooltip:function(e){return Object(a.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(3),o=n(22),l=n(9),u=n(4),c=n(212),h=n.n(c),d=n(1),f=n.n(d),p=n(40),m=f.a.vec3;a.a.Shader.import(p.a),r.a.extendChartView({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._api=t},render:function(e,t,n){var i=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=i,this._line3DMesh||(this._line3DMesh=new a.a.Mesh({geometry:new o.a({useNativeLine:!1,sortTriangles:!0}),material:new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL);var s=r.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[s]("fragment","SRGB_DECODE")}this._doRender(e,n),this._data=e.getData(),this._camera=r.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var n=e.getData(),i=this._line3DMesh;i.geometry.resetOffset();var r=n.getLayout("points"),o=[],l=new Float32Array(r.length/3*4),u=0,c=!1;n.each((function(e){var t=n.getItemVisual(e,"color"),i=n.getItemVisual(e,"opacity");null==i&&(i=1),a.a.parseColor(t,o),o[3]*=i,l[u++]=o[0],l[u++]=o[1],l[u++]=o[2],l[u++]=o[3],o[3]<.99&&(c=!0)})),i.geometry.setVertexCount(i.geometry.getPolylineVertexCount(r)),i.geometry.setTriangleCount(i.geometry.getPolylineTriangleCount(r)),i.geometry.addPolyline(r,l,s.a.firstNotNull(e.get("lineStyle.width"),1)),i.geometry.dirty(),i.geometry.updateBoundingBox();var h=i.material;h.transparent=c,h.depthMask=!c;var d=e.getModel("debug.wireframe");d.get("show")?(i.geometry.createAttribute("barycentric","float",3),i.geometry.generateBarycentric(),i.material.set("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")||"rgba(0,0,0,0.5)")),i.material.set("wireframeLineWidth",s.a.firstNotNull(d.get("lineStyle.width"),1))):i.material.set("both","WIREFRAME_TRIANGLE"),this._points=r,this._initHandler(e,t)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var n=e.getData(),i=e.coordinateSystem,r=this._line3DMesh,a=-1;r.seriesIndex=e.seriesIndex,r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var s=i.pointToData(e.point.array),o=n.indicesOfNearest("x",s[0])[0];o!==a&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",o),n.get("y",o),n.get("z",o)]}),r.dataIndex=o),a=o}),this),r.on("mouseout",(function(e){a=-1,r.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new l.a,t=this._camera;l.a.multiply(e,t.projectionMatrix,t.viewMatrix);var n=this._positionNDC,i=this._points,r=i.length/3;n&&n.length/2===r||(n=this._positionNDC=new Float32Array(2*r));for(var a=[],s=0;s<r;s++){var o=3*s,u=2*s;a[0]=i[o],a[1]=i[o+1],a[2]=i[o+2],a[3]=1,m.transformMat4(a,a,e.array),n[u]=a[0]/a[3],n[u+1]=a[1]/a[3]}},_pick:function(e,t,n,i,r,a){var s=this._positionNDC,o=this._data.hostModel.get("lineStyle.width"),l=-1,c=.5*n.viewport.width,d=.5*n.viewport.height;e=(e+1)*c,t=(t+1)*d;for(var f=1;f<s.length/2;f++){var p=(s[2*(f-1)]+1)*c,m=(s[2*(f-1)+1]+1)*d,g=(s[2*f]+1)*c,_=(s[2*f+1]+1)*d;h.a.containStroke(p,m,g,_,o,e,t)&&(l=(p-e)*(p-e)+(m-t)*(m-t)<(g-e)*(g-e)+(_-t)*(_-t)?f-1:f)}if(l>=0){var v=3*l,y=new u.a(this._points[v],this._points[v+1],this._points[v+2]);a.push({dataIndex:l,point:y,pointWorld:y.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(y)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t){t.containStroke=function(e,t,n,i,r,a,s){if(0===r)return!1;var o=r,l=0;if(s>t+o&&s>i+o||s<t-o&&s<i-o||a>e+o&&a>n+o||a<e-o&&a<n-o)return!1;if(e===n)return Math.abs(a-e)<=o/2;var u=(l=(t-i)/(e-n))*a-s+(e*i-n*t)/(e-n);return u*u/(l*l+1)<=o/2*o/2}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(214),n(215),n(45)),s=n.n(a),o=n(16);r.a.registerVisual(s()("scatter3D","circle",null)),r.a.registerVisual(Object(o.a)("scatter3D")),r.a.registerLayout({seriesType:"scatter3D",reset:function(e){var t=e.coordinateSystem;if(t){var n=t.dimensions;if(n.length<3)return void console.error("scatter3D needs 3D coordinateSystem");var i=n.map((function(t){return e.coordDimToDataDim(t)[0]})),r=[],a=[];return{progress:function(e,n){for(var s=new Float32Array(3*(e.end-e.start)),o=e.start;o<e.end;o++){var l=3*(o-e.start);r[0]=n.get(i[0],o),r[1]=n.get(i[1],o),r[2]=n.get(i[2],o),t.dataToPoint(r,a),s[l]=a[0],s[l+1]=a[1],s[l+2]=a[2]}n.setLayout("points",s)}}}}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(27),s=n(35),o=n(44);r.a.extendSeriesModel({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){return Object(o.a)(this)},getFormattedLabel:function(e,t,n,i){var r=a.a.getFormattedLabel(this,e,t,n,i);if(null==r){var s=this.getData(),o=s.dimensions[s.dimensions.length-1];r=s.get(o,e)}return r},formatTooltip:function(e){return Object(s.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(3),o=n(27),l=n(62);r.a.extendChartView({type:"scatter3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,n){if(this.groupGL.removeAll(),e.getData().count()){var i=e.coordinateSystem;if(!i||!i.viewGL)throw new Error("Invalid coordinate system");i.viewGL.add(this.groupGL),this._camera=i.viewGL.camera;var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new l.a(!1,n)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),r.update(e,t,n),r.updateView(i.viewGL.camera)}},incrementalPrepareRender:function(e,t,n){var i=e.coordinateSystem;if(!i||!i.viewGL)throw new Error("Invalid coordinate system");i.viewGL.add(this.groupGL),this._camera=i.viewGL.camera,this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,n,i){if(!(e.end<=e.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new l.a(!1,i),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),r.update(t,n,i,e.start,e.end),r.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(e){e.updateView(this._camera)}),this)},highlight:function(e,t,n,i){this._toggleStatus("highlight",e,t,n,i)},downplay:function(e,t,n,i){this._toggleStatus("downplay",e,t,n,i)},_toggleStatus:function(e,t,n,i,a){var l=t.getData(),u=s.a.queryDataIndex(l,a),c="highlight"===e;null!=u?r.a.util.each(o.a.normalizeToArray(u),(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];c?n.highlight(l,e):n.downplay(l,e)}}),this):l.each((function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var n=this._pointsBuilderList[t];c?n.highlight(l,e):n.downplay(l,e)}}))},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i);function a(e,t,n){(t=t||document.createElement("canvas")).width=e,t.height=e;var i=t.getContext("2d");return n&&n(i),t}var s={getMarginByStyle:function(e){var t=e.minMargin||0,n=0;e.stroke&&"none"!==e.stroke&&(n=null==e.lineWidth?1:e.lineWidth);var i=e.shadowBlur||0,r=e.shadowOffsetX||0,a=e.shadowOffsetY||0,s={};return s.left=Math.max(n/2,-r+i,t),s.right=Math.max(n/2,r+i,t),s.top=Math.max(n/2,-a+i,t),s.bottom=Math.max(n/2,a+i,t),s},createSymbolSprite:function(e,t,n,i){var o=function(e,t,n,i){r.a.util.isArray(t)||(t=[t,t]);var a=s.getMarginByStyle(n,i),o=t[0]+a.left+a.right,l=t[1]+a.top+a.bottom,u=r.a.helper.createSymbol(e,0,0,t[0],t[1]),c=Math.max(o,l);u.position=[a.left,a.top],o>l?u.position[1]+=(c-l)/2:u.position[0]+=(c-o)/2;var h=u.getBoundingRect();return u.position[0]-=h.x,u.position[1]-=h.y,u.setStyle(n),u.update(),u.__size=c,u}(e,t,n),l=s.getMarginByStyle(n);return{image:a(o.__size,i,(function(e){o.brush(e)})),margin:l}},createSDFFromCanvas:function(e,t,n,i){return a(t,i,(function(t){var i=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,n){var i=t.width,r=t.height,a=e.canvas.width,s=e.canvas.height,o=i/a,l=r/s;function u(e){return e<128?1:-1}function c(e,a){var s=1/0;e=Math.floor(e*o);for(var c=(a=Math.floor(a*l))*i+e,h=u(t.data[4*c]),d=Math.max(a-n,0);d<Math.min(a+n,r);d++)for(var f=Math.max(e-n,0);f<Math.min(e+n,i);f++){c=d*i+f;var p=f-e,m=d-a;if(h!==u(t.data[4*c])){var g=p*p+m*m;g<s&&(s=g)}}return h*Math.sqrt(s)}for(var h=e.createImageData(a,s),d=0;d<s;d++)for(var f=0;f<a;f++){var p=c(f,d)/n*.5+.5,m=4*(d*a+f);h.data[m++]=255*(1-p),h.data[m++]=255*(1-p),h.data[m++]=255*(1-p),h.data[m++]=255}return h}(t,i,n),0,0)}))},createSimpleSprite:function(e,t){return a(e,t,(function(t){var n=e/2;t.beginPath(),t.arc(n,n,60,0,2*Math.PI,!1),t.closePath();var i=t.createRadialGradient(n,n,0,n,n,n);i.addColorStop(0,"rgba(255, 255, 255, 1)"),i.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),i.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=i,t.fill()}))}};t.a=s},function(e,t,n){"use strict";var i=n(2),r=n(218),a=n(0),s=n.n(a),o=n(1),l=n.n(o),u=n(219),c=l.a.vec4;i.a.Shader.import(u.a);var h=i.a.Mesh.extend((function(){var e=new i.a.Geometry({dynamic:!0,attributes:{color:new i.a.Geometry.Attribute("color","float",4,"COLOR"),position:new i.a.Geometry.Attribute("position","float",3,"POSITION"),size:new i.a.Geometry.Attribute("size","float",1),prevPosition:new i.a.Geometry.Attribute("prevPosition","float",3),prevSize:new i.a.Geometry.Attribute("prevSize","float",1)}});s.a.util.extend(e,r.a);var t=new i.a.Material({shader:i.a.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var n=new i.a.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",n),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:i.a.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,n,r,a,s){var o=this._positionNDC;if(o)for(var l=n.viewport,u=2/l.width,c=2/l.height,h=this.geometry.vertexCount-1;h>=0;h--){var d,f=o[2*(d=this.geometry.indices?this.geometry.indices[h]:h)],p=o[2*d+1],m=this.geometry.attributes.size.get(d)/this.sizeScale/2;if(e>f-m*u&&e<f+m*u&&t>p-m*c&&t<p+m*c){var g=new i.a.Vector3,_=new i.a.Vector3;this.geometry.attributes.position.get(d,g.array),i.a.Vector3.transformMat4(_,g,this.worldTransform),s.push({vertexIndex:d,point:g,pointWorld:_,target:this,distance:_.distance(r.getWorldPosition())})}}},updateNDCPosition:function(e,t,n){var i=this._positionNDC,r=this.geometry;i&&i.length/2===r.vertexCount||(i=this._positionNDC=new Float32Array(2*r.vertexCount));for(var a=c.create(),s=0;s<r.vertexCount;s++)r.attributes.position.get(s,a),a[3]=1,c.transformMat4(a,a,e.array),c.scale(a,a,1/a[3]),i[2*s]=a[0],i[2*s+1]=a[1]}});t.a=h},function(e,t,n){"use strict";var i=n(81),r=n(1),a=n.n(r).a.vec3;t.a={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(e,t){var n=this.indices,i=a.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var r=0;r<n.length;r++)n[r]=r}if(0===t){var s,o=this.attributes.position,l=(e=e.array,0);for(this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount)),r=0;r<this.vertexCount;r++){o.get(r,i);var u=a.sqrDist(i,e);isNaN(u)&&(u=1e7,l++),0===r?(s=u,u=0):u-=s,this._zList[r]=u}this._noneCount=l}if(this.vertexCount<2e4)0===t&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(r=0;r<3;r++)this._progressiveQuickSort(3*t+r);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,n=this.indices;function r(e,n){return t[n]-t[e]}e?Array.prototype.sort.call(n,r):i.a.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(e){var t=this._zList,n=this.indices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(n,(function(e,n){return t[n]-t[e]}),e)}}},function(e,t,n){"use strict";t.a="@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(221),n(222),n(225),n(16));r.a.registerVisual(Object(a.a)("lines3D")),r.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),r.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),r.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(1),s=n.n(a),o=s.a.vec3,l=s.a.vec2,u=o.normalize,c=o.cross,h=o.sub,d=o.add,f=o.create,p=f(),m=f(),g=f(),_=f(),v=[],y=[];function b(e,t){l.copy(v,e[0]),l.copy(y,e[1]);var n=[],i=n[0]=f(),r=n[1]=f(),a=n[2]=f(),s=n[3]=f();t.dataToPoint(v,i),t.dataToPoint(y,s),u(p,i),h(m,s,i),u(m,m),c(g,m,p),u(g,g),c(m,p,g),d(r,p,m),u(r,r),u(p,s),h(m,i,s),u(m,m),c(g,m,p),u(g,g),c(m,p,g),d(a,p,m),u(a,a),d(_,i,s),u(_,_);var b=o.dot(i,_),x=o.dot(_,r),E=(Math.max(o.len(i),o.len(s))-b)/x*2;return o.scaleAndAdd(r,i,r,E),o.scaleAndAdd(a,s,a,E),n}function x(e,t){for(var n=new Float32Array(3*e.length),i=0,r=[],a=0;a<e.length;a++)t.dataToPoint(e[a],r),n[i++]=r[0],n[i++]=r[1],n[i++]=r[2];return n}function E(e){var t=[];return e.each((function(n){var i=e.getItemModel(n),r=i.option instanceof Array?i.option:i.getShallow("coords",!0);if(!(r instanceof Array&&r.length>0&&r[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(r)+". Lines must have 2d coords array in data item.");t.push(r)})),{coordsList:t}}function w(e,t,n){var i=e.getData(),r=e.get("polyline"),a=E(i);i.setLayout("lineType",r?"polyline":"cubicBezier"),i.each((function(e){var s=a.coordsList[e],l=r?x(s,t):function(e,t,n){var i=[],r=i[0]=o.create(),a=i[1]=o.create(),s=i[2]=o.create(),l=i[3]=o.create();t.dataToPoint(e[0],r),t.dataToPoint(e[1],l);var u=o.dist(r,l);return o.lerp(a,r,l,.3),o.lerp(s,r,l,.3),o.scaleAndAdd(a,a,n,Math.min(.1*u,10)),o.scaleAndAdd(s,s,n,Math.min(.1*u,10)),i}(s,t,n);i.setItemLayout(e,l)}))}r.a.registerLayout((function(e,t){e.eachSeriesByType("lines3D",(function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,t){var n=e.getData(),i=e.get("polyline");n.setLayout("lineType",i?"polyline":"cubicBezier");var r=E(n);n.each((function(e){var a=r.coordsList[e],s=i?x:b;n.setItemLayout(e,s(a,t))}))}(e,t):"geo3D"===t.type?w(e,t,[0,1,0]):"mapbox3D"===t.type&&w(e,t,[0,0,1])}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(22),o=n(223),l=n(40);a.a.Shader.import(l.a),r.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._meshLinesMaterial=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new a.a.Mesh({geometry:new s.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new o.a},render:function(e,t,n){this.groupGL.add(this._linesMesh);var i=e.coordinateSystem,r=e.getData();if(i&&i.viewGL){i.viewGL.add(this.groupGL),this._updateLines(e,t,n);var s=i.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[s]("fragment","SRGB_DECODE"),this._trailMesh.material[s]("fragment","SRGB_DECODE")}var o=this._trailMesh;if(o.stopAnimation(),e.get("effect.show")){this.groupGL.add(o),o.updateData(r,n,this._linesMesh.geometry),o.__time=o.__time||0;var l=36e5;this._curveEffectsAnimator=o.animate("",{loop:!0}).when(l,{__time:l}).during((function(){o.setAnimationTime(o.__time)})).start()}else this.groupGL.remove(o),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var e=this._curveEffectsAnimator;e&&(e.isPaused()?e.resume():e.pause())},_updateLines:function(e,t,n){var i=e.getData(),r=e.coordinateSystem,s=this._linesMesh.geometry,o=e.get("polyline");s.expandLine=!0;var l=function(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}(r);s.segmentScale=l/20;var u="lineStyle.width".split("."),c=n.getDevicePixelRatio(),h=0;i.each((function(e){var t=i.getItemModel(e).get(u);null==t&&(t=1),i.setItemVisual(e,"lineWidth",t),h=Math.max(t,h)})),s.useNativeLine=!1;var d=0,f=0;i.each((function(e){var t=i.getItemLayout(e);o?(d+=s.getPolylineVertexCount(t),f+=s.getPolylineTriangleCount(t)):(d+=s.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),f+=s.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),s.setVertexCount(d),s.setTriangleCount(f),s.resetOffset();var p=[];i.each((function(e){var t=i.getItemLayout(e),n=i.getItemVisual(e,"color"),r=i.getItemVisual(e,"opacity"),l=i.getItemVisual(e,"lineWidth")*c;null==r&&(r=1),(p=a.a.parseColor(n,p))[3]*=r,o?s.addPolyline(t,p,l):s.addCubicCurve(t[0],t[1],t[2],t[3],p,l)})),s.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i=n(0),r=(n.n(i),n(2)),a=n(1),s=n.n(a),o=n(22),l=n(224),u=s.a.vec3;r.a.Shader.import(l.a),t.a=r.a.Mesh.extend((function(){var e=new r.a.Material({shader:new r.a.Shader(r.a.Shader.source("ecgl.trail2.vertex"),r.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new o.a({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}}),{updateData:function(e,t,n){var i=e.hostModel,a=this.geometry,s=i.getModel("effect"),o=s.get("trailWidth")*t.getDevicePixelRatio(),l=s.get("trailLength"),c=i.get("effect.constantSpeed"),h=1e3*i.get("effect.period"),d=null!=c;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",c/1e3):this.material.set("period",h),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var f=i.get("polyline");a.trailLength=l,this.material.set("trailLength",l),a.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){a.attributes[e].value=n.attributes[e].value})),["dist","distAll","start","offset","color"].forEach((function(e){a.attributes[e].init(a.vertexCount)})),a.indices=n.indices;var p=[],m=s.get("trailColor"),g=s.get("trailOpacity"),_=null!=m,v=null!=g;this.updateWorldTransform();var y=this.worldTransform.x.len(),b=this.worldTransform.y.len(),x=this.worldTransform.z.len(),E=0,w=0;e.each((function(t){var i=e.getItemLayout(t),s=v?g:e.getItemVisual(t,"opacity"),l=e.getItemVisual(t,"color");null==s&&(s=1),(p=r.a.parseColor(_?m:l,p))[3]*=s;for(var c=f?n.getPolylineVertexCount(i):n.getCubicCurveVertexCount(i[0],i[1],i[2],i[3]),T=0,S=[],A=[],C=E;C<E+c;C++)a.attributes.position.get(C,S),S[0]*=y,S[1]*=b,S[2]*=x,C>E&&(T+=u.dist(S,A)),a.attributes.dist.set(C,T),u.copy(A,S);w=Math.max(w,T);var L=Math.random()*(d?T:h);for(C=E;C<E+c;C++)a.attributes.distAll.set(C,T),a.attributes.start.set(C,L),a.attributes.offset.set(C,(n.attributes.offset.get(C)>0?1:-1)*o/2),a.attributes.color.set(C,p);E+=c})),this.material.set("spotSize",.1*w*l),this.material.set("spotIntensity",s.get("spotIntensity")),a.dirty()},setAnimationTime:function(e){this.material.set("time",e)}})},function(e,t,n){"use strict";t.a="@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end"},function(e,t,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var n=new r.a.List(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,i,r){if(e instanceof Array)return NaN;n.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(227),n(228),n(16));r.a.registerVisual(Object(a.a)("polygons3D"))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(26);function s(e,t){for(var n=[],i=0;i<t.length;i++)n.push(e.dataToPoint(t[i]));return n}var o=r.a.extendSeriesModel({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getItemModel(e),i=n.option instanceof Array?n.option:n.getShallow("coords");n.get("multiPolygon")||(i=[i]);for(var r=[],a=0;a<i.length;a++){for(var o=[],l=1;l<i[a].length;l++)o.push(s(t,i[a][l]));r.push({exterior:s(t,i[a][0]),interiors:o})}return r},getInitialData:function(e){var t=new r.a.List(["value"],this);return t.hasItemOption=!1,t.initData(e.data,[],(function(e,n,i,r){if(e instanceof Array)return NaN;t.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),t},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});r.a.util.merge(o.prototype,a.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(59),s=n(2);r.a.extendChartView({type:"polygons3D",__ecgl__:!0,init:function(e,t){this.groupGL=new s.a.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll();var i=e.coordinateSystem;i&&i.viewGL&&i.viewGL.add(this.groupGL);var r=this._geo3DBuilderList[0];r||((r=new a.a(n)).extrudeY="mapbox3D"!==i.type,this._geo3DBuilderList[0]=r),this._updateShaderDefines(i,r),r.update(e,t,n),this._geo3DBuilderList.length=1,this.groupGL.add(r.rootNode)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll();var i=e.coordinateSystem;i&&i.viewGL&&i.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,n,i){var r=this._geo3DBuilderList[this._currentStep],s=t.coordinateSystem;r||((r=new a.a(i)).extrudeY="mapbox3D"!==s.type,this._geo3DBuilderList[this._currentStep]=r),r.update(t,n,i,e.start,e.end),this.groupGL.add(r.rootNode),this._updateShaderDefines(s,r),this._currentStep++},_updateShaderDefines:function(e,t){var n=e.viewGL.isLinearSpace()?"define":"undefine";t.rootNode.traverse((function(t){t.material&&(t.material[n]("fragment","SRGB_DECODE"),"mapbox3D"===e.type&&(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1)))}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(230),n(231),n(232),n(16));r.a.registerVisual(Object(a.a)("surface"))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(26),s=n(35),o=n(44),l=r.a.extendSeriesModel({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",formatTooltip:function(e){return Object(s.a)(this,e)},getInitialData:function(e,t){var n=e.data;function i(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function a(e){var t=r.a.number.getPrecisionSafe;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!n)if(n=[],e.parametric){var s=e.parametricEquation||{},l=s.u||{},u=s.v||{};["u","v"].forEach((function(e){i(s[e])||console.error("Invalid parametricEquation.%s",e)})),["x","y","z"].forEach((function(e){"function"==typeof s[e]||console.error("parametricEquation.%s needs to be function",e)}));for(var c=a(l),h=a(u),d=u.min;d<u.max+.999*u.step;d+=u.step)for(var f=l.min;f<l.max+.999*l.step;f+=l.step){var p=r.a.number.round(Math.min(f,l.max),c),m=r.a.number.round(Math.min(d,u.max),h);E=s.x(p,m),x=s.y(p,m),S=s.z(p,m),n.push([E,x,S,p,m])}}else{var g=e.equation||{},_=g.x||{},v=g.y||{};if(["x","y"].forEach((function(e){i(g[e])||console.error("Invalid equation.%s",e)})),"function"!=typeof g.z)return void console.error("equation.z needs to be function");for(var y=a(_),b=a(v),x=v.min;x<v.max+.999*v.step;x+=v.step)for(var E=_.min;E<_.max+.999*_.step;E+=_.step){var w=r.a.number.round(Math.min(E,_.max),y),T=r.a.number.round(Math.min(x,v.max),b),S=g.z(w,T);n.push([w,T,S])}}var A=["x","y","z"];return e.parametric&&A.push("u","v"),Object(o.a)(this,A,e.data||n)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},itemStyle:{},animationDurationUpdate:500}});r.a.util.merge(l.prototype,a.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=(n(3),n(1)),o=n.n(s),l=n(60),u=o.a.vec3;r.a.extendChartView({type:"surface",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node},render:function(e,t,n){var i=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=i,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var r=e.coordinateSystem,s=e.get("shading"),o=e.getData(),l="ecgl."+s;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===l||(this._surfaceMesh.material=a.a.createMaterial(l,["VERTEX_COLOR","DOUBLE_SIDED"])),a.a.setMaterialFromModel(s,this._surfaceMesh.material,e,n),r&&r.viewGL){r.viewGL.add(this.groupGL);var u=r.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[u]("fragment","SRGB_DECODE")}var c=e.get("parametric"),h=this._getDataShape(o,c),d=e.getModel("wireframe"),f=d.get("lineStyle.width"),p=d.get("show")&&f>0;this._updateSurfaceMesh(this._surfaceMesh,e,h,p);var m=this._surfaceMesh.material;p?(m.define("WIREFRAME_QUAD"),m.set("wireframeLineWidth",f),m.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")))):m.undefine("WIREFRAME_QUAD"),this._initHandler(e,n),this._updateAnimation(e)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new a.a.Mesh({geometry:new a.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),r.a.util.extend(e.geometry,l.a),e},_initHandler:function(e,t){var n=e.getData(),i=this._surfaceMesh,r=e.coordinateSystem;i.seriesIndex=e.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(e){var s=function(e,t){for(var n=1/0,r=-1,a=[],s=0;s<e.length;s++){i.geometry.attributes.position.get(e[s],a);var o=u.dist(t.array,a);o<n&&(n=o,r=e[s])}return r}(e.triangle,e.point);if(s>=0){var o=[];i.geometry.attributes.position.get(s,o);for(var l=r.pointToData(o),c=1/0,h=-1,d=[],f=0;f<n.count();f++){d[0]=n.get("x",f),d[1]=n.get("y",f),d[2]=n.get("z",f);var p=u.squaredDistance(d,l);p<c&&(h=f,c=p)}h!==a&&t.dispatchAction({type:"grid3DShowAxisPointer",value:l}),a=h,i.dataIndex=h}else i.dataIndex=-1}),this),i.on("mouseout",(function(e){a=-1,i.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(e,t,n,i){var r=e.geometry,s=t.getData(),o=s.getLayout("points"),l=0;s.each((function(e){s.hasValue(e)||l++}));var c=l||i,h=r.attributes.position,d=r.attributes.normal,f=r.attributes.texcoord0,p=r.attributes.barycentric,m=r.attributes.color,g=n.row,_=n.column,v="color"!==t.get("shading");if(c){var y=(g-1)*(_-1)*4;h.init(y),i&&p.init(y)}else h.value=new Float32Array(o);m.init(r.vertexCount),f.init(r.vertexCount);var b,x=[0,3,1,1,3,2],E=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],w=r.indices=new(r.vertexCount>65535?Uint32Array:Uint16Array)((g-1)*(_-1)*6),T=function(e,t,n){n[1]=e*_+t,n[0]=e*_+t+1,n[3]=(e+1)*_+t+1,n[2]=(e+1)*_+t},S=!1;if(c){var A=[],C=[],L=0;v?d.init(r.vertexCount):d.value=null;for(var R=[[],[],[]],I=[],D=[],k=u.create(),M=function(e,t,n){var i=3*t;return n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n},P=new Float32Array(o.length),O=new Float32Array(o.length/3*4),N=0;N<s.count();N++)if(s.hasValue(N)){var F=a.a.parseColor(s.getItemVisual(N,"color")),B=s.getItemVisual(N,"opacity");F[3]*=B,F[3]<.99&&(S=!0);for(var U=0;U<4;U++)O[4*N+U]=F[U]}var G=[1e7,1e7,1e7];for(N=0;N<g-1;N++)for(var z=0;z<_-1;z++){var j=4*(N*(_-1)+z);T(N,z,A);var H=!1;for(U=0;U<4;U++)M(o,A[U],C),b=C,(isNaN(b[0])||isNaN(b[1])||isNaN(b[2]))&&(H=!0);for(U=0;U<4;U++)H?h.set(j+U,G):(M(o,A[U],C),h.set(j+U,C)),i&&p.set(j+U,E[U]);for(U=0;U<6;U++)w[L++]=x[U]+j;if(v&&!H)for(U=0;U<2;U++){for(var V=3*U,W=0;W<3;W++)M(o,q=A[x[V]+W],R[W]);for(u.sub(I,R[0],R[1]),u.sub(D,R[1],R[2]),u.cross(k,I,D),W=0;W<3;W++){var Z=3*A[x[V]+W];P[Z]=P[Z]+k[0],P[Z+1]=P[Z+1]+k[1],P[Z+2]=P[Z+2]+k[2]}}}if(v)for(N=0;N<P.length/3;N++)M(P,N,k),u.normalize(k,k),P[3*N]=k[0],P[3*N+1]=k[1],P[3*N+2]=k[2];F=[];var K=[];for(N=0;N<g-1;N++)for(z=0;z<_-1;z++)for(j=4*(N*(_-1)+z),T(N,z,A),U=0;U<4;U++){for(W=0;W<4;W++)F[W]=O[4*A[U]+W];m.set(j+U,F),v&&(M(P,A[U],k),d.set(j+U,k));var q=A[U];K[0]=q%_/(_-1),K[1]=Math.floor(q/_)/(g-1),f.set(j+U,K)}}else{for(K=[],N=0;N<s.count();N++)K[0]=N%_/(_-1),K[1]=Math.floor(N/_)/(g-1),F=a.a.parseColor(s.getItemVisual(N,"color")),B=s.getItemVisual(N,"opacity"),F[3]*=B,F[3]<.99&&(S=!0),m.set(N,F),f.set(N,K);A=[];var X=0;for(N=0;N<g-1;N++)for(z=0;z<_-1;z++)for(T(N,z,A),U=0;U<6;U++)w[X++]=A[x[U]];v?r.generateVertexNormals():d.value=null}e.material.get("normalMap")&&r.generateTangents(),r.updateBoundingBox(),r.dirty(),e.material.transparent=S,e.material.depthMask=!S},_getDataShape:function(e,t){for(var n=-1/0,i=0,r=0,a=0,s=t?"u":"x",o=0;o<e.count();o++){var l=e.get(s,o);if(l<n){if(a&&a!==r)throw new Error("Invalid data. data should be a row major 2d array.");a=r,r=0,i++}n=l,r++}return{row:i+1,column:r}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i=n(0);n.n(i).a.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&"cartesian3D"===t.type||console.error("Surface chart only support cartesian3D coordinateSystem");var n=e.getData(),i=new Float32Array(3*n.count()),r=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var a=t.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));n.each(a,(function(e,a,s,o){var l;l=n.hasValue(o)?t.dataToPoint([e,a,s]):r,i[3*o]=l[0],i[3*o+1]=l[1],i[3*o+2]=l[2]}))}n.setLayout("points",i)}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(83),n(234),n(235),n(16));r.a.registerVisual(Object(a.a)("map3D")),r.a.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"series",subType:"map3D",query:e},(function(t){t.setView(e)}))}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(38),s=n(31),o=n(32),l=n(26),u=n(80),c=n(27),h=n(35),d=n(82);function f(e,t){for(var n=[],i=0;i<t.length;i++)n.push(e.dataToPoint(t[i]));return n}var p=r.a.extendSeriesModel({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualColorAccessPath:"itemStyle.color",optionUpdated:function(e){e=e||{};var t=this.get("coordinateSystem");if(null!=t&&"geo3D"!==t){var n=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(t){null!=e[t]&&n.push(t)})),n.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",n.join(", "),t),this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(e){e.data=this.getFilledRegions(e.data,e.map);var t=r.a.helper.completeDimensions(["value"],e.data),n=new r.a.List(t,this);n.initData(e.data);var i={};return n.each((function(e){var t=n.getName(e),r=n.getItemModel(e);i[t]=r})),this._regionModelMap=i,n},formatTooltip:function(e){return Object(h.a)(this,e)},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new r.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,n=this.getData().getName(e);if(t.transform)return(i=t.getRegion(n))?i.geometries:[];this._geo||(this._geo=d.a.createGeo3D(this));for(var i=this._geo.getRegion(n),r=[],a=0;a<i.geometries.length;a++){var s=i.geometries[a],o=[],l=f(t,s.exterior);if(o&&o.length)for(var u=0;u<s.interiors.length;u++)o.push(f(t,o[u]));r.push({interiors:o,exterior:l})}return r},getFormattedLabel:function(e,t){var n=c.a.getFormattedLabel(this,e,t);return null==n&&(n=this.getData().getName(e)),n},defaultOption:{coordinateSystem:"geo3D",data:null}});r.a.util.merge(p.prototype,u.a),r.a.util.merge(p.prototype,a.a),r.a.util.merge(p.prototype,s.a),r.a.util.merge(p.prototype,o.a),r.a.util.merge(p.prototype,l.a)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(39),o=n(34),l=n(59);r.a.extendChartView({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new l.a(t),this.groupGL=new a.a.Node},render:function(e,t,n){var i=e.coordinateSystem;if(i&&i.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),i.viewGL.add(this.groupGL),"geo3D"===i.type){this._sceneHelper||(this._sceneHelper=new o.a,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(e),i.viewGL.setPostEffect(e.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var r=this._control;r||(r=this._control=new s.a({zr:n.getZr()}),this._control.init());var a=e.getModel("viewControl");r.setViewGL(i.viewGL),r.setFromViewControlModel(a,0),r.off("update"),r.on("update",(function(){n.dispatchAction({type:"map3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),from:this.uid,map3DId:e.id})})),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),e.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(e,t,n,0,e.getData().count());var l=i.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[l]("fragment","SRGB_DECODE")}))}},afterRender:function(e,t,n,i){var r=i.renderer,a=e.coordinateSystem;a&&"geo3D"===a.type&&(this._sceneHelper.updateAmbientCubemap(r,e,n),this._sceneHelper.updateSkybox(r,e,n))},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(237),n(238),n(45)),s=n.n(a),o=n(16);r.a.registerVisual(s()("scatterGL","circle",null)),r.a.registerVisual(Object(o.a)("scatterGL")),r.a.registerLayout({seriesType:"scatterGL",reset:function(e){var t,n=e.coordinateSystem;if(n){var i=n.dimensions,r=[];1===i.length?t=function(e,t){for(var r=new Float32Array(2*(e.end-e.start)),a=e.start;a<e.end;a++){var s=2*(a-e.start),o=t.get(i[0],a),l=n.dataToPoint(o);r[s]=l[0],r[s+1]=l[1]}t.setLayout("points",r)}:2===i.length&&(t=function(e,t){for(var a=new Float32Array(2*(e.end-e.start)),s=e.start;s<e.end;s++){var o=2*(s-e.start),l=t.get(i[0],s),u=t.get(i[1],s);r[0]=l,r[1]=u,r=n.dataToPoint(r),a[o]=r[0],a[o+1]=r[1]}t.setLayout("points",a)})}return{progress:t}}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return r.a.helper.createList(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(20),o=n(62),l=n(84);n(3),r.a.extendChartView({type:"scatterGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new s.a("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new l.a(this.viewGL)},render:function(e,t,n){if(this.groupGL.removeAll(),this._glViewHelper.reset(e,n),e.getData().count()){var i=this._pointsBuilderList[0];i||(i=this._pointsBuilderList[0]=new o.a(!0,n)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),i.update(e,t,n),this.viewGL.setPostEffect(e.getModel("postEffect"),n)}},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,i){if(!(e.end<=e.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new o.a(!0,i),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),r.setSizeScale(this._sizeScale),r.update(t,n,i,e.start,e.end),i.getZr().refresh(),this._currentStep++}},updateTransform:function(e,t,n){if(e.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(e,n);var i=this._glViewHelper.getZoom(),r=Math.max((e.get("zoomScale")||0)*(i-1)+1,0);this._sizeScale=r,this._pointsBuilderList.forEach((function(e){e.setSizeScale(r)}))}},_removeTransformInPoints:function(e){if(e)for(var t=[],n=0;n<e.length;n+=2)t[0]=e[n],t[1]=e[n+1],this._glViewHelper.removeTransformInPoint(t),e[n]=t[0],e[n+1]=t[1]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(240),n(246),n(45)),s=n.n(a),o=n(16);function l(){}r.a.registerVisual(s()("graphGL","circle",null)),r.a.registerVisual(Object(o.a)("graphGL")),r.a.registerVisual((function(e){var t={};e.eachSeriesByType("graphGL",(function(e){var n=e.getCategoriesData(),i=e.getData(),r={};n.each((function(i){var a=n.getName(i);r[a]=i;var s=n.getItemModel(i).get("itemStyle.color")||e.getColorFromPalette(a,t);n.setItemVisual(i,"color",s)})),n.count()&&i.each((function(e){var t=i.getItemModel(e).getShallow("category");null!=t&&("string"==typeof t&&(t=r[t]),i.getItemVisual(e,"color",!0)||i.setItemVisual(e,"color",n.getItemVisual(t,"color")))}))}))})),r.a.registerVisual((function(e){e.eachSeriesByType("graphGL",(function(e){var t=e.getGraph(),n=e.getEdgeData(),i="lineStyle.color".split("."),r="lineStyle.opacity".split(".");n.setVisual("color",e.get(i)),n.setVisual("opacity",e.get(r)),n.each((function(e){var a=n.getItemModel(e),s=t.getEdgeByIndex(e),o=a.get(i),l=a.get(r);switch(o){case"source":o=s.node1.getVisual("color");break;case"target":o=s.node2.getVisual("color")}s.setVisual("color",o),s.setVisual("opacity",l)}))}))})),r.a.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},l),r.a.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},l),r.a.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},l),r.a.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},l)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(241),s=n(27),o=r.a.extendSeriesModel({type:"series.graphGL",visualColorAccessPath:"itemStyle.color",init:function(e){o.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){o.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,n,i){var r=s.a.getFormattedLabel(this,e,t,n,i);if(null==r){var a=this.getData(),o=a.dimensions[a.dimensions.length-1];r=a.get(o,e)}return r},getInitialData:function(e,t){var n=e.edges||e.links||[],i=e.data||e.nodes||[],s=this;if(i&&n)return Object(a.a)(i,n,this,!0,(function(e,n){e.wrapMethod("getItemModel",(function(e){var t=s._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var i=s.getModel("edgeLabel"),a=new r.a.Model({label:i.option},i.parentModel,t);function o(e){return(e=this.parsePath(e))&&"label"===e[0]?a:this.parentModel}n.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(o),e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,n){if("edge"===n){var i=this.getData(),a=this.getDataParams(e,n),s=i.graph.getEdgeByIndex(e),l=i.getName(s.node1.dataIndex),u=i.getName(s.node2.dataIndex),c=[];return null!=l&&c.push(l),null!=u&&c.push(u),c=r.a.format.encodeHTML(c.join(" > ")),a.value&&(c+=" : "+r.a.format.encodeHTML(a.value)),c}return o.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:r.a.util.extend({value:0},e)})),t=new r.a.List(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t<e.length/2;t++){var n=e[2*t],i=e[2*t+1],r=this.getData().getRawDataItem(t);r.x=n,r.y=i}},isAnimationEnabled:function(){return o.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(242),s=n.n(a),o=n(245),l=n.n(o),u=n(3);t.a=function(e,t,n,i,a){for(var o=new s.a(i),c=0;c<e.length;c++)o.addNode(u.a.firstNotNull(e[c].id,e[c].name,c),c);var h,d=[],f=[],p=0;for(c=0;c<t.length;c++){var m=t[c],g=m.source,_=m.target;o.addEdge(g,_,p)&&(f.push(m),d.push(u.a.firstNotNull(m.id,g+" > "+_)),p++)}var v=r.a.helper.completeDimensions(["value"],e);(h=new r.a.List(v,n)).initData(e);var y=new r.a.List(["value"],n);return y.initData(f,d),a&&a(h,y),l()({mainData:h,struct:o,structAttr:"graph",datas:{node:h,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}},function(e,t,n){n(85).__DEV__;var i=n(12),r=n(244).enableClassCheck;function a(e){return"_EC_"+e}var s=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},o=s.prototype;function l(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function u(e,t,n){this.node1=e,this.node2=t,this.dataIndex=null==n?-1:n}o.type="graph",o.isDirected=function(){return this._directed},o.addNode=function(e,t){e=e||""+t;var n=this._nodesMap;if(!n[a(e)]){var i=new l(e,t);return i.hostGraph=this,this.nodes.push(i),n[a(e)]=i,i}},o.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},o.getNodeById=function(e){return this._nodesMap[a(e)]},o.addEdge=function(e,t,n){var i=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),l.isInstance(e)||(e=i[a(e)]),l.isInstance(t)||(t=i[a(t)]),e&&t){var s=e.id+"-"+t.id;if(!r[s]){var o=new u(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),r[s]=o,o}}},o.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},o.getEdge=function(e,t){l.isInstance(e)&&(e=e.id),l.isInstance(t)&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},o.eachNode=function(e,t){for(var n=this.nodes,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&e.call(t,n[r],r)},o.eachEdge=function(e,t){for(var n=this.edges,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&e.call(t,n[r],r)},o.breadthFirstTraverse=function(e,t,n,i){if(l.isInstance(t)||(t=this._nodesMap[a(t)]),t){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",s=0;s<this.nodes.length;s++)this.nodes[s].__visited=!1;if(!e.call(i,t,null))for(var o=[t];o.length;){var u=o.shift(),c=u[r];for(s=0;s<c.length;s++){var h=c[s],d=h.node1===u?h.node2:h.node1;if(!d.__visited){if(e.call(i,d,u))return;o.push(d),d.__visited=!0}}}}},o.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,i=this.edges,r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)n[e.getRawIndex(r)].dataIndex=r;for(t.filterSelf((function(e){var n=i[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0})),r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)i[t.getRawIndex(r)].dataIndex=r},o.clone=function(){for(var e=new s(this._directed),t=this.nodes,n=this.edges,i=0;i<t.length;i++)e.addNode(t[i].id,t[i].dataIndex);for(i=0;i<n.length;i++){var r=n[i];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},l.prototype={constructor:l,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},u.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var c=function(e,t){return{getValue:function(n){var i=this[e][t];return i.get(i.getDimension(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,i)},getVisual:function(n,i){return this[e][t].getItemVisual(this.dataIndex,n,i)},setLayout:function(n,i){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}};i.mixin(l,c("hostGraph","data")),i.mixin(u,c("hostGraph","edgeData")),s.Node=l,s.Edge=u,r(l),r(u);var h=s;e.exports=h},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){n(85).__DEV__;var i=n(12),r="___EC__COMPONENT__CONTAINER___";function a(e){var t={main:"",sub:""};return e&&(e=e.split("."),t.main=e[0]||"",t.sub=e[1]||""),t}var s=0;function o(e,t){var n=i.slice(arguments,2);return this.superClass.prototype[t].apply(e,n)}function l(e,t,n){return this.superClass.prototype[t].apply(e,n)}t.parseClassType=a,t.enableClassExtend=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,n=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return i.extend(n.prototype,e),n.extend=this.extend,n.superCall=o,n.superApply=l,i.inherits(n,this),n.superClass=t,n}},t.enableClassCheck=function(e){var t=["__\0is_clz",s++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},t.enableClassManagement=function(e,t){t=t||{};var n={};if(e.registerClass=function(e,t){if(t)if(function(e){i.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=a(t)).sub){if(t.sub!==r){var s=function(e){var t=n[e.main];return t&&t[r]||((t=n[e.main]={})[r]=!0),t}(t);s[t.sub]=e}}else n[t.main]=e;return e},e.getClass=function(e,t,i){var a=n[e];if(a&&a[r]&&(a=t?a[t]:null),i&&!a)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return a},e.getClassesByMainType=function(e){e=a(e);var t=[],s=n[e.main];return s&&s[r]?i.each(s,(function(e,n){n!==r&&t.push(e)})):t.push(s),t},e.hasClass=function(e){return e=a(e),!!n[e.main]},e.getAllClassMainTypes=function(){var e=[];return i.each(n,(function(t,n){e.push(n)})),e},e.hasSubTypes=function(e){e=a(e);var t=n[e.main];return t&&t[r]},e.parseClassType=a,t.registerWhenExtend){var s=e.extend;s&&(e.extend=function(t){var n=s.call(this,t);return e.registerClass(n,t.type)})}return e},t.setReadOnly=function(e,t){}},function(e,t,n){var i=n(12),r=i.each,a="\0__link_datas",s="\0__link_mainData";function o(e,t){if((r=this)[s]===r){var n=i.extend({},this[a]);n[this.dataType]=t,h(t,n,e)}else d(t,this.dataType,this[s],e);var r;return t}function l(e,t){return e.struct&&e.struct.update(this),t}function u(e,t){return r(t[a],(function(n,i){n!==t&&d(n.cloneShallow(),i,t,e)})),t}function c(e){var t=this[s];return null==e||null==t?t:t[a][e]}function h(e,t,n){e[a]={},r(t,(function(t,i){d(t,i,e,n)}))}function d(e,t,n,i){n[a][t]=e,e[s]=n,e.dataType=t,i.struct&&(e[i.structAttr]=i.struct,i.struct[i.datasAttr[t]]=e),e.getLinkedData=c}var f=function(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,h(t,n,e),r(n,(function(n){r(t.TRANSFERABLE_METHODS,(function(t){n.wrapMethod(t,i.curry(o,e))}))})),t.wrapMethod("cloneShallow",i.curry(u,e)),r(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,i.curry(l,e))})),i.assert(n[t.dataType]===t)};e.exports=f},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(41),s=n.n(a),o=n(2),l=n(20),u=n(86),c=n(3),h=n(247),d=n(249),f=n(65),p=n.n(f),m=n(1),g=n.n(m),_=n(251),v=n(62),y=n(252),b=g.a.vec2;o.a.Shader.import(y.a);var x,E=1;r.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new o.a.Node,this.viewGL=new l.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new v.a(!0,t),this._forceEdgesMesh=new o.a.Mesh({material:new o.a.Material({shader:o.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new o.a.Geometry({attributes:{node:new o.a.Geometry.Attribute("node","float",2),color:new o.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:o.a.Mesh.LINES}),this._edgesMesh=new o.a.Mesh({material:new o.a.Material({shader:o.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new u.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new _.a({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=n,this._initLayout(e,t,n),this._pointsBuilder.update(e,t,n),this._forceLayoutInstance instanceof h.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(c.a.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var i=this._pointsBuilder.getPointsMesh();if(i.off("mousemove",this._mousemoveHandler),i.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var r=e.get("focusNodeAdjacencyOn");"click"===r?n.getZr().on("click",this._clickHandler):"mouseover"===r?(i.on("mousemove",this._mousemoveHandler,this),i.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+r)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var n=this._forceEdgesMesh.geometry,i=t.getEdgeData(),r=0,a=this._forceLayoutInstance,s=2*i.count();n.attributes.node.init(s),n.attributes.color.init(s),i.each((function(t){var s=e[t];n.attributes.node.set(r,a.getNodeUV(s.node1)),n.attributes.node.set(r+1,a.getNodeUV(s.node2));var l=i.getItemVisual(s.dataIndex,"color"),u=o.a.parseColor(l);u[3]*=c.a.firstNotNull(i.getItemVisual(s.dataIndex,"opacity"),1),n.attributes.color.set(r,u),n.attributes.color.set(r+1,u),r+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,n=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var i=[],r=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(s){var l=e.graph.getEdgeByIndex(s),u=2*l.node1.dataIndex,h=2*l.node2.dataIndex;i[0]=n[u],i[1]=n[u+1],r[0]=n[h],r[1]=n[h+1];var d=e.getItemVisual(l.dataIndex,"color"),f=o.a.parseColor(d);f[3]*=c.a.firstNotNull(e.getItemVisual(l.dataIndex,"opacity"),1);var p=e.getItemModel(l.dataIndex),m=c.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();t.addLine(i,r,f,m);for(var g=0;g<4;g++)this._originalEdgeColors[4*l.dataIndex+g]=f[g];this._edgeIndicesMap[l.dataIndex]=s}),!1,this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),n=[],i=0;i<e.count();i++)this._forceLayoutInstance.getNodeUV(i,n),t.geometry.attributes.position.set(i,n);t.geometry.dirty("position")},_initLayout:function(e,t,n){var i=e.get("layout"),a=e.getGraph(),o=e.getBoxLayoutParams(),l=s.a.getLayoutRect(o,{width:n.getWidth(),height:n.getHeight()});"force"===i&&(console.warn("Currently only forceAtlas2 layout supported."),i="forceAtlas2"),this.stopLayout(e,t,n,{beforeLayout:!0});var u=e.getData(),f=e.getData();if("forceAtlas2"===i){var p=e.getModel("forceAtlas2"),m=this._forceLayoutInstance,g=[],_=[],v=u.getDataExtent("value"),y=f.getDataExtent("value"),b=c.a.firstNotNull(p.get("edgeWeight"),1),x=c.a.firstNotNull(p.get("nodeWeight"),1);"number"==typeof b&&(b=[b,b]),"number"==typeof x&&(x=[x,x]);var E=0,w={},T=new Float32Array(2*u.count());if(a.eachNode((function(e){var t,n,i=e.dataIndex,a=u.get("value",i);if(u.hasItemOption){var s=u.getItemModel(i);t=s.get("x"),n=s.get("y")}null==t&&(t=l.x+Math.random()*l.width,n=l.y+Math.random()*l.height),T[2*E]=t,T[2*E+1]=n,w[e.id]=E++;var o=r.a.number.linearMap(a,v,x);isNaN(o)&&(o=isNaN(x[0])?1:x[0]),g.push({x:t,y:n,mass:o,size:u.getItemVisual(i,"symbolSize")})})),u.setLayout("points",T),a.eachEdge((function(e){var t=e.dataIndex,n=u.get("value",t),i=r.a.number.linearMap(n,y,b);isNaN(i)&&(i=isNaN(b[0])?1:b[0]),_.push({node1:w[e.node1.id],node2:w[e.node2.id],weight:i,dataIndex:t})})),!m){var S=p.get("GPU");this._forceLayoutInstance&&((!S||this._forceLayoutInstance instanceof h.a)&&(S||this._forceLayoutInstance instanceof d.a)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),m=this._forceLayoutInstance=S?new h.a:new d.a}m.initData(g,_),m.updateOption(p.option),this._updateForceEdgesGeometry(m.getEdges(),e),this._updatePositionTexture(),n.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else T=new Float32Array(2*u.count()),E=0,a.eachNode((function(e){var t,n,i=e.dataIndex;if(u.hasItemOption){var r=u.getItemModel(i);t=r.get("x"),n=r.get("y")}T[E++]=t,T[E++]=n})),u.setLayout("points",T),this._updateAfterLayout(e,t,n)},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(e,t,n,i){if(!i||null==i.from||i.from===this.uid){var r=this.viewGL,a=(n=this._api,this._forceLayoutInstance),s=this._model.getData(),o=this._model.getModel("forceAtlas2");if(a){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(e.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=E++,c=o.getShallow("maxSteps"),h=o.getShallow("steps"),d=0,f=Math.max(2*h,20),m=function(t){if(t===l._layoutId)return a.isFinished(c)?(n.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:s.getLayout("points"),from:l.uid})):void a.update(r.layer.renderer,h,(function(){l._updatePositionTexture(),(d+=h)>=f&&(l._syncNodePosition(e),d=0),n.getZr().refresh(),p()((function(){m(t)}))}))};p()((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),m(u)})),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,n,i){i&&null!=i.from&&i.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(i&&i.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,n,i){var r=this._model.getData();this._downplayAll();var a=i.dataIndex,s=r.graph,o=[],l=s.getNodeByIndex(a);o.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&o.push(e.node1),e.node2!==l&&o.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),o.forEach((function(e){this._pointsBuilder.highlight(r,e.dataIndex)}),this),this._pointsBuilder.updateLabels(o.map((function(e){return e.dataIndex})));var u=[];l.edges.forEach((function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),u.push(e))}),this),this._focusNodes=o,this._focusEdges=u},unfocusNodeAdjacency:function(e,t,n,i){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),n=o.a.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),i=c.a.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);n[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(e){this._downplayEdge(e.dataIndex)}),this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:(x=[],function(e,t){this._getColor(e,x),x[3]*=t,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],x)}),_getColor:function(e,t){for(var n=0;n<4;n++)t[n]=this._originalEdgeColors[4*e+n];return t},_fadeOutEdgesAll:function(e){this._model.getData().graph.eachEdge((function(t){this._setEdgeFade(t.dataIndex,e)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var n=this.viewGL.camera,i=e.getData().getLayout("points"),r=b.create(1/0,1/0),a=b.create(-1/0,-1/0),s=[],o=0;o<i.length;)s[0]=i[o++],s[1]=i[o++],b.min(r,r,s),b.max(a,a,s);var l=(a[1]+r[1])/2,u=(a[0]+r[0])/2;if(!(u>n.left&&u<n.right&&l<n.bottom&&l>n.top)){var c=Math.max(a[0]-r[0],10),h=c/t.getWidth()*t.getHeight();c*=1.4,h*=1.4,r[0]-=.2*c,n.left=r[0],n.top=l-h/2,n.bottom=l+h/2,n.right=c+r[0],n.near=0,n.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(14),o=n(10),l=n(248);a.a.Shader.import(l.a);var u={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function c(e){var t={type:a.a.Texture.FLOAT,minFilter:a.a.Texture.NEAREST,magFilter:a.a.Texture.NEAREST};this._positionSourceTex=new a.a.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new a.a.Texture2D(t),this._positionPrevTex=new a.a.Texture2D(t),this._forceTex=new a.a.Texture2D(t),this._forcePrevTex=new a.a.Texture2D(t),this._weightedSumTex=new a.a.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new a.a.Texture2D(t),this._globalSpeedPrevTex=new a.a.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new s.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new s.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new s.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new s.a({fragment:a.a.Shader.source("clay.compositor.output")});var n=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node1:new a.a.Geometry.Attribute("node1","float",2),node2:new a.a.Geometry.Attribute("node2","float",2),weight:new a.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._weightedSumMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node:new a.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._framebuffer=new o.a({depthBuffer:!1}),this._dummyCamera=new a.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}c.prototype.updateOption=function(e){for(var t in u)this[t]=u[t];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,e)for(var t in u)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var i=this._positionSourceTex.pixels,r=0;r<this._nodes.length;r++)i[4*r+2]=(this._nodes[r].degree||0)+1},c.prototype._updateGravityCenter=function(e){var t=this._nodes,n=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var i=[1/0,1/0],r=[-1/0,-1/0],a=0;a<t.length;a++)i[0]=Math.min(t[a].x,i[0]),i[1]=Math.min(t[a].y,i[1]),r[0]=Math.max(t[a].x,r[0]),r[1]=Math.max(t[a].y,r[1]);this._gravityCenter=[.5*(i[0]+r[0]),.5*(i[1]+r[1])]}for(a=0;a<n.length;a++){var s=n[a].node1,o=n[a].node2;t[s].degree=(t[s].degree||0)+1,t[o].degree=(t[o].degree||0)+1}},c.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var n=Math.ceil(Math.sqrt(e.length)),i=n,r=new Float32Array(n*i*4);this._resize(n,i);for(var a=0,s=0;s<e.length;s++){var o=e[s];r[a++]=o.x||0,r[a++]=o.y||0,r[a++]=o.mass||1,r[a++]=o.size||1}this._positionSourceTex.pixels=r;var l=this._edgeForceMesh.geometry,u=t.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var c=[];for(s=0;s<t.length;s++){var h=l.attributes,d=t[s].weight;null==d&&(d=1),h.node1.set(s,this.getNodeUV(t[s].node1,c)),h.node2.set(s,this.getNodeUV(t[s].node2,c)),h.weight.set(s,d),h.node1.set(s+u,this.getNodeUV(t[s].node2,c)),h.node2.set(s+u,this.getNodeUV(t[s].node1,c)),h.weight.set(s+u,d)}var f=this._weightedSumMesh.geometry;for(f.attributes.node.init(e.length),s=0;s<e.length;s++)f.attributes.node.set(s,this.getNodeUV(s,c));l.dirty(),f.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[n,i]),this._inited=!1,this._frame=0},c.prototype.getNodes=function(){return this._nodes},c.prototype.getEdges=function(){return this._edges},c.prototype.step=function(e){this._inited||(this._initFromSource(e),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(e);var t=this._nodeRepulsionPass;t.setUniform("strongGravityMode",this.strongGravityMode),t.setUniform("gravity",this.gravity),t.setUniform("gravityCenter",this._gravityCenter),t.setUniform("scaling",this.scaling),t.setUniform("preventOverlap",this.preventOverlap),t.setUniform("positionTex",this._positionPrevTex),t.render(e);var n=this._edgeForceMesh;n.material.set("linLogMode",this.linLogMode),n.material.set("edgeWeightInfluence",this.edgeWeightInfluence),n.material.set("preventOverlap",this.preventOverlap),n.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT),e.gl.enable(e.gl.BLEND);var i=this._weightedSumMesh;i.material.set("positionTex",this._positionPrevTex),i.material.set("forceTex",this._forceTex),i.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([i],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var r=this._globalSpeedPass;r.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),r.setUniform("weightedSumTex",this._weightedSumTex),r.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),r.render(e);var a=this._positionPass;this._framebuffer.attach(this._positionTex),a.setUniform("globalSpeedTex",this._globalSpeedTex),a.setUniform("positionTex",this._positionPrevTex),a.setUniform("forceTex",this._forceTex),a.setUniform("forcePrevTex",this._forcePrevTex),a.render(e),this._framebuffer.unbind(e),this._swapTexture()},c.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1);for(var i=0;i<t;i++)this.step(e);n&&n()},c.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},c.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,i=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(i-1)||0,t},c.prototype.getNodePosition=function(e,t){var n=this._positionArr,i=this._positionTex.width,r=this._positionTex.height,a=i*r;n&&n.length===4*a||(n=this._positionArr=new Float32Array(4*a)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,i,r,e.gl.RGBA,e.gl.FLOAT,n),this._framebuffer.unbind(e),t||(t=new Float32Array(2*this._nodes.length));for(var s=0;s<this._nodes.length;s++)t[2*s]=n[4*s],t[2*s+1]=n[4*s+1];return t},c.prototype.getTextureData=function(e,t){var n=this["_"+t+"Tex"],i=n.width,r=n.height;this._framebuffer.bind(e),this._framebuffer.attach(n);var a=new Float32Array(i*r*4);return e.gl.readPixels(0,0,i,r,e.gl.RGBA,e.gl.FLOAT,a),this._framebuffer.unbind(e),a},c.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},c.prototype.isFinished=function(e){return this._frame>e},c.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e,e=this._forcePrevTex,this._forcePrevTex=this._forceTex,this._forceTex=e,e=this._globalSpeedPrevTex,this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},c.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},c.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=e,this[n].height=t,this[n].dirty()}),this)},c.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)},r.a.ForceAtlas2GPU=c,t.a=c},function(e,t,n){"use strict";t.a="@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end"},function(e,t,n){"use strict";var i=n(5),r=n(6),a=n(250).a.toString();a=a.slice(a.indexOf("{")+1,a.lastIndexOf("}"));var s={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},o=function(e){for(var t in s)this[t]=s[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new i.a({type:r.a.FLOAT,flipY:!1,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST})};o.prototype.initData=function(e,t){var n=new Blob([a]),i=window.URL.createObjectURL(n);this._worker=new Worker(i),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var r=e.length,s=t.length,o=new Float32Array(2*r),l=new Float32Array(r),u=new Float32Array(r),c=new Float32Array(2*s),h=new Float32Array(s),d=0;d<e.length;d++){var f=e[d];o[2*d]=f.x,o[2*d+1]=f.y,l[d]=null==f.mass?1:f.mass,u[d]=null==f.size?1:f.size}for(d=0;d<t.length;d++){var p=t[d],m=p.node1,g=p.node2;c[2*d]=m,c[2*d+1]=g,h[d]=null==p.weight?1:p.weight}var _=Math.ceil(Math.sqrt(e.length)),v=_,y=new Float32Array(_*v*4),b=this._positionTex;b.width=_,b.height=v,b.pixels=y,this._worker.postMessage({cmd:"init",nodesPosition:o,nodesMass:l,nodesSize:u,edges:c,edgesWeight:h}),this._globalSpeed=1/0},o.prototype.updateOption=function(e){var t={};for(var n in s)t[n]=s[n];var i=this._nodes,r=this._edges,a=i.length;if(t.jitterTolerence=a>5e4?10:a>5e3?1:.1,t.scaling=a>100?2:10,t.barnesHutOptimize=a>1e3,e)for(var n in s)null!=e[n]&&(t[n]=e[n]);if(!t.gravityCenter){for(var o=[1/0,1/0],l=[-1/0,-1/0],u=0;u<i.length;u++)o[0]=Math.min(i[u].x,o[0]),o[1]=Math.min(i[u].y,o[1]),l[0]=Math.max(i[u].x,l[0]),l[1]=Math.max(i[u].y,l[1]);t.gravityCenter=[.5*(o[0]+l[0]),.5*(o[1]+l[1])]}for(u=0;u<r.length;u++){var c=r[u].node1,h=r[u].node2;i[c].degree=(i[c].degree||0)+1,i[h].degree=(i[h].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},o.prototype.update=function(e,t,n){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=n,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},o.prototype._$onupdate=function(e){if(!this._disposed){var t=new Float32Array(e.data.buffer);this._globalSpeed=e.data.globalSpeed,this._positionArr=t,this._updateTexture(t),this._onupdate&&this._onupdate()}},o.prototype.getNodePositionTexture=function(){return this._positionTex},o.prototype.getNodeUV=function(e,t){t=t||[];var n=this._positionTex.width,i=this._positionTex.height;return t[0]=e%n/(n-1),t[1]=Math.floor(e/n)/(i-1),t},o.prototype.getNodes=function(){return this._nodes},o.prototype.getEdges=function(){return this._edges},o.prototype.isFinished=function(e){return this._frame>e},o.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n<this._positionArr.length;n++)t[n]=this._positionArr[n];return t},o.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,n=0,i=0;i<e.length;)t[n++]=e[i++],t[n++]=e[i++],t[n++]=1,t[n++]=1;this._positionTex.dirty()},o.prototype.dispose=function(e){this._disposed=!0,this._worker=null},t.a=o},function(e,t,n){"use strict";t.a=function(){var e=function(){return new Float32Array(2)},t=function(e,t){var n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)},n=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},i=function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},r=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},a=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},s=function(e,t){return e[0]=t[0],e[1]=t[1],e},o=function(e,t,n){return e[0]=t,e[1]=n,e};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function c(){this.position=new Float32Array(2),this.force=e(),this.forcePrev=e(),this.mass=1,this.inDegree=0,this.outDegree=0}function h(e,t){this.source=e,this.target=t,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=e(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},u.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},u.findSubRegion=function(e,t){for(var n=0;n<this.nSubRegions;n++){var i=this.subRegions[n];if(i.contain(e,t))return i}},u.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=e&&this.bbox[1]<=t&&this.bbox[3]>=t},u.setBBox=function(e,t,n,i){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=i,this.size=(n-e+i-t)/2},u._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new l,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},u._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var i=(n[0]+n[2])/2,r=(n[1]+n[3])/2,a=(n[2]-n[0])/2,s=(n[3]-n[1])/2,o=e.position[0]>=i?1:0,l=e.position[1]>=r?1:0;(t=this._newSubRegion()).setBBox(o*a+n[0],l*s+n[1],(o+1)*a+n[0],(l+1)*s+n[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass};var f,p=d.prototype;p.initNodes=function(e,t,n){var i=t.length;this.nodes.length=0;for(var r=void 0!==n,a=0;a<i;a++){var s=new c;s.position[0]=e[2*a],s.position[1]=e[2*a+1],s.mass=t[a],r&&(s.size=n[a]),this.nodes.push(s)}this._massArr=t,this._swingingArr=new Float32Array(i),r&&(this._sizeArr=n)},p.initEdges=function(e,t){var n=e.length/2;this.edges.length=0;for(var i=0;i<n;i++){var r=e[2*i],a=e[2*i+1],s=this.nodes[r],o=this.nodes[a];if(!s||!o)return void console.error("Node not exists, try initNodes before initEdges");s.outDegree++,o.inDegree++;var l=new h(s,o);t&&(l.weight=t[i]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var e=0;e<this.nodes.length;e++)(t=this.nodes[e]).mass=t.inDegree+t.outDegree+1;else for(e=0;e<this.nodes.length;e++){var t;(t=this.nodes[e]).mass=this._massArr[e]}},p.update=function(){var a=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<a;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<a;l++){var u=this.nodes[l];s(u.forcePrev,u.force),o(u.force,0,0)}for(l=0;l<a;l++){var c=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,c);else for(var h=l+1;h<a;h++){var d=this.nodes[h];this.applyNodeToNodeRepulsion(c,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(c):this.applyNodeGravity(c))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var f=0,p=0,m=e();for(l=0;l<a;l++)u=this.nodes[l],f+=(_=t(u.force,u.forcePrev))*u.mass,r(m,u.force,u.forcePrev),p+=.5*n(m)*u.mass,this._swingingArr[l]=_;var g=this.jitterTolerence*this.jitterTolerence*p/f;for(this._globalSpeed>0&&(g=Math.min(g/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=g,l=0;l<a;l++){u=this.nodes[l];var _=this._swingingArr[l],v=.1*g/(1+g*Math.sqrt(_)),y=n(u.force);y>0&&(v=Math.min(y*v,10)/y,i(u.position,u.position,u.force,v))}},p.applyRegionToNodeRepulsion=(f=e(),function(e,t){if(e.node)this.applyNodeToNodeRepulsion(e.node,t,!0);else{a(f,t.position,e.centerOfMass);var n=f[0]*f[0]+f[1]*f[1];if(n>this.barnesHutTheta*e.size*e.size){var r=this.scaling*t.mass*e.mass/n;i(t.force,t.force,f,r)}else for(var s=0;s<e.nSubRegions;s++)this.applyRegionToNodeRepulsion(e.subRegions[s],t)}}),p.applyNodeToNodeRepulsion=function(){var t=e();return function(e,n,r){if(e!=n){a(t,e.position,n.position);var s=t[0]*t[0]+t[1]*t[1];if(0!==s){var o;if(this.preventOverlap){var l=Math.sqrt(s);if((l=l-e.size-n.size)>0)o=this.scaling*e.mass*n.mass/(l*l);else{if(!(l<0))return;o=100*this.scaling*e.mass*n.mass}}else o=this.scaling*e.mass*n.mass/s;i(e.force,e.force,t,o),i(n.force,n.force,t,-o)}}}}(),p.applyEdgeAttraction=function(){var t=e();return function(e){var r=e.source,s=e.target;a(t,r.position,s.position);var o,l,u=n(t);o=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-s.size)<=0||(l=this.linLogMode?-o*Math.log(u+1)/(u+1):-o,i(r.force,r.force,t,l),i(s.force,s.force,t,-l))}}(),p.applyNodeGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position);var r=n(t);i(e.force,e.force,t,this.gravity*e.mass/(r+1))}}(),p.applyNodeStrongGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position),i(e.force,e.force,t,this.gravity*e.mass)}}(),p.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,i=-1/0,r=0;r<this.nodes.length;r++){var a=this.nodes[r].position;e=Math.min(e,a[0]),t=Math.min(t,a[1]),n=Math.max(n,a[0]),i=Math.max(i,a[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=i},p.getGlobalSpeed=function(){return this._globalSpeed};var m=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(m=new d).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),m.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(m)for(var t in e.data.config)m[t]=e.data.config[t];break;case"update":var n=e.data.steps;if(m){for(var i=0;i<n;i++)m.update();var r=m.nodes.length,a=new Float32Array(2*r);for(i=0;i<r;i++){var s=m.nodes[i];a[2*i]=s.position[0],a[2*i+1]=s.position[1]}self.postMessage({buffer:a.buffer,globalSpeed:m.getGlobalSpeed()},[a.buffer])}else{var o=new Float32Array;self.postMessage({buffer:o.buffer,globalSpeed:m.getGlobalSpeed()},[o.buffer])}}}}},function(e,t,n){"use strict";var i=n(8),r=(n(3),i.a.extend((function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}}),(function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)}),{init:function(){var e=this.zr;e.on("mousedown",this._mouseDownHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("globalout",this._mouseUpHandler),e.animation.on("frame",this._update)},setTarget:function(e){this._target=e},setZoom:function(e){this._zoom=Math.max(Math.min(e,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(e){this._dx=e[0],this._dy=e[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var e=this._target,t=this._zoom;e.position.x=this._dx,e.position.y=this._dy,e.scale.set(t,t,t),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(e){if(!e.target){var t=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(t,n)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var i=this._convertPos(t,n);this._x=i.x,this._y=i.y}}},_convertPos:function(e,t){var n=this.viewGL.camera,i=this.viewGL.viewport;return{x:(e-i.x)/i.width*(n.right-n.left)+n.left,y:(t-i.y)/i.height*(n.bottom-n.top)+n.top}},_mouseMoveHandler:function(e){var t=this._convertPos(e.offsetX,e.offsetY);this._dx+=t.x-this._x,this._dy+=t.y-this._y,this._x=t.x,this._y=t.y,this._needsUpdate=!0},_mouseUpHandler:function(e){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(e){var t=(e=e.event).wheelDelta||-e.detail;if(0!==t){var n=e.offsetX,i=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(n,i)){var r=t>0?1.1:.9,a=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=a/this._zoom;var s=this._convertPos(n,i),o=(s.x-this._dx)*(r-1),l=(s.y-this._dy)*(r-1);this._dx-=o,this._dy-=l,this._zoom=a,this._needsUpdate=!0}}},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}}));t.a=r},function(e,t,n){"use strict";t.a="@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end"},function(e,t,n){"use strict";var i=n(0);n.n(i),n(254),n(258)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(3),o=n(20),l=n(255);r.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new o.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new l.a;var n=new a.a.Mesh({geometry:new a.a.PlaneGeometry,material:new a.a.Material({shader:new a.a.Shader({vertex:a.a.Shader.source("ecgl.color.vertex"),fragment:a.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(e,t,n){var i=this._particleSurface;i.setParticleType(e.get("particleType")),i.setSupersampling(e.get("supersampling")),this._updateData(e,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var r=s.a.firstNotNull(e.get("particleDensity"),128);i.setParticleDensity(r,r);var o=this._planeMesh,l=+new Date,u=this,c=!0;o.__percent=0,o.stopAnimation(),o.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-l,20);l+=t,u._renderer&&(i.update(u._renderer,n,t/1e3,c),o.material.set("diffuseMap",i.getSurfaceTexture())),c=!1})).start();var h=e.getModel("itemStyle"),d=a.a.parseColor(h.get("color"));d[3]*=s.a.firstNotNull(h.get("opacity"),1),o.material.set("color",d),i.setColorTextureImage(e.get("colorTexture"),n),i.setParticleSize(e.get("particleSize")),i.particleSpeedScaling=e.get("particleSpeed"),i.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,n){this._updateData(e,n)},afterRender:function(e,t,n,i){var r=i.renderer;this._renderer=r},_updateData:function(e,t){var n=e.coordinateSystem,i=n.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),r=e.getData(),a=r.getDataExtent(i[0]),s=r.getDataExtent(i[1]),o=e.get("gridWidth"),l=e.get("gridHeight");if(null==o||"auto"===o){var u=(a[1]-a[0])/(s[1]-s[0]);o=Math.round(Math.sqrt(u*r.count()))}null!=l&&"auto"!==l||(l=Math.ceil(r.count()/o));var c=this._particleSurface.vectorFieldTexture,h=c.pixels;if(h&&h.length===l*o*4)for(var d=0;d<h.length;d++)h[d]=0;else h=c.pixels=new Float32Array(o*l*4);var f=0,p=1/0,m=new Float32Array(2*r.count()),g=0,_=[[1/0,1/0],[-1/0,-1/0]];r.each([i[0],i[1],"vx","vy"],(function(e,t,i,r){var a=n.dataToPoint([e,t]);m[g++]=a[0],m[g++]=a[1],_[0][0]=Math.min(a[0],_[0][0]),_[0][1]=Math.min(a[1],_[0][1]),_[1][0]=Math.max(a[0],_[1][0]),_[1][1]=Math.max(a[1],_[1][1]);var s=Math.sqrt(i*i+r*r);f=Math.max(f,s),p=Math.min(p,s)})),r.each(["vx","vy"],(function(e,t,n){var i=Math.round((m[2*n]-_[0][0])/(_[1][0]-_[0][0])*(o-1)),r=4*((l-1-Math.round((m[2*n+1]-_[0][1])/(_[1][1]-_[0][1])*(l-1)))*o+i);h[r]=e/f*.5+.5,h[r+1]=t/f*.5+.5,h[r+3]=1})),c.width=o,c.height=l,"bmap"===e.get("coordinateSystem")&&this._fillEmptyPixels(c),c.dirty(),this._updatePlanePosition(_[0],_[1],e,t),this._updateGradientTexture(r.getVisual("visualMeta"),[p,f])},_fillEmptyPixels:function(e){var t=e.pixels,n=e.width,i=e.height;function r(e,r,a){e=Math.max(Math.min(e,n-1),0);var s=4*((r=Math.max(Math.min(r,i-1),0))*(n-1)+e);return 0!==t[s+3]&&(a[0]=t[s],a[1]=t[s+1],!0)}function a(e,t,n){n[0]=e[0]+t[0],n[1]=e[1]+t[1]}for(var s=[],o=[],l=[],u=[],c=[],h=0,d=0;d<i;d++)for(var f=0;f<n;f++){var p=4*(d*(n-1)+f);0===t[p+3]&&(h=s[0]=s[1]=0,r(f-1,d,o)&&(h++,a(o,s,s)),r(f+1,d,l)&&(h++,a(l,s,s)),r(f,d-1,u)&&(h++,a(u,s,s)),r(f,d+1,c)&&(h++,a(c,s,s)),s[0]/=h,s[1]/=h,t[p]=s[0],t[p+1]=s[1]),t[p+3]=1}},_updateGradientTexture:function(e,t){if(e&&e.length){this._gradientTexture=this._gradientTexture||new a.a.Texture2D({image:document.createElement("canvas")});var n=this._gradientTexture,i=n.image;i.width=200,i.height=1;var r=i.getContext("2d"),s=r.createLinearGradient(0,.5,i.width,.5);e[0].stops.forEach((function(e){var n;t[1]===t[0]?n=0:(n=e.value/t[1],n=Math.min(Math.max(n,0),1)),s.addColorStop(n,e.color)})),r.fillStyle=s,r.fillRect(0,0,i.width,i.height),n.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,n,i){var r=this._limitInViewportAndFullFill(e,t,n,i);e=r.leftTop,t=r.rightBottom,this._particleSurface.setRegion(r.region),this._planeMesh.position.set((e[0]+t[0])/2,i.getHeight()-(e[1]+t[1])/2,0);var a=t[0]-e[0],s=t[1]-e[1];this._planeMesh.scale.set(a/2,s/2,1),this._particleSurface.resize(Math.max(Math.min(a,2048),1),Math.max(Math.min(s,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,n,i){var r=[Math.max(e[0],0),Math.max(e[1],0)],a=[Math.min(t[0],i.getWidth()),Math.min(t[1],i.getHeight())];if("bmap"===n.get("coordinateSystem")){var s=n.getData().getDataExtent(n.coordDimToDataDim("lng")[0]);Math.floor(s[1]-s[0])>=359&&(r[0]>0&&(r[0]=0),a[0]<i.getWidth()&&(a[0]=i.getWidth()))}var o=t[0]-e[0],l=t[1]-e[1],u=a[0]-r[0],c=a[1]-r[1];return{leftTop:r,rightBottom:a,region:[(r[0]-e[0])/o,1-c/l-(r[1]-e[1])/l,u/o,c/l]}},_updateCamera:function(e,t,n){this.viewGL.setViewport(0,0,e,t,n);var i=this.viewGL.camera;i.left=i.bottom=0,i.top=t,i.right=e,i.near=0,i.far=100,i.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}})},function(e,t,n){"use strict";var i=n(14),r=n(13),a=n(24),s=n(17),o=n(7),l=n(5),u=n(6),c=n(30),h=n(37),d=n(10),f=n(256),p=n(257);o.a.import(p.a);var m=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new l.a({type:u.a.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};m.prototype={constructor:m,init:function(){var e={type:u.a.FLOAT,minFilter:u.a.NEAREST,magFilter:u.a.NEAREST,useMipmap:!1};this._spawnTexture=new l.a(e),this._particleTexture0=new l.a(e),this._particleTexture1=new l.a(e),this._frameBuffer=new d.a({depthBuffer:!1}),this._particlePass=new i.a({fragment:o.a.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new i.a({fragment:o.a.source("clay.compositor.downsample")});var t=new a.a({renderOrder:10,material:new s.a({shader:new o.a(o.a.source("ecgl.vfParticle.renderPoints.vertex"),o.a.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:a.a.POINTS,geometry:new r.a({dynamic:!0,mainAttribute:"texcoord0"})}),n=new a.a({renderOrder:10,material:new s.a({shader:new o.a(o.a.source("ecgl.vfParticle.renderLines.vertex"),o.a.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new f.a,culling:!1}),p=new a.a({material:new s.a({shader:new o.a(o.a.source("ecgl.color.vertex"),o.a.source("ecgl.color.fragment"))}),geometry:new h.a});p.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=p,this._camera=new c.a,this._thisFrameTexture=new l.a,this._lastFrameTexture=new l.a},setParticleDensity:function(e,t){for(var n=new Float32Array(e*t*4),i=0,r=this.particleLife,a=0;a<e;a++)for(var s=0;s<t;s++,i++){n[4*i]=Math.random(),n[4*i+1]=Math.random(),n[4*i+2]=Math.random();var o=(r[1]-r[0])*Math.random()+r[0];n[4*i+3]=o}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=n,this._particleTexture0.width=this._particleTexture1.width=e,this._particleTexture0.height=this._particleTexture1.height=t,this._particlePass.setUniform("textureSize",[e,t])},_setPointsGeometry:function(e,t){var n=e*t,i=this._particlePointsMesh.geometry,r=i.attributes;r.texcoord0.init(n);for(var a=0,s=0;s<e;s++)for(var o=0;o<t;o++,a++)r.texcoord0.value[2*a]=s/e,r.texcoord0.value[2*a+1]=o/t;i.dirty()},_setLineGeometry:function(e,t){var n=e*t,i=this._getParticleMesh().geometry;i.setLineCount(n),i.resetOffset();for(var r=0;r<e;r++)for(var a=0;a<t;a++)i.addLine([r/e,a/t]);i.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,n,i){var r=this._getParticleMesh(),a=this._frameBuffer,s=this._particlePass;i&&this._updateDownsampleTextures(e,t),r.material.set("size",this._particleSize*this._supersampling),r.material.set("color",this.particleColor),s.setUniform("speedScaling",this.particleSpeedScaling),a.attach(this._particleTexture1),s.setUniform("firstFrameTime",i?(this.particleLife[1]+this.particleLife[0])/2:0),s.setUniform("particleTexture",this._particleTexture0),s.setUniform("deltaTime",n),s.setUniform("elapsedTime",this._elapsedTime),s.render(e,a),r.material.set("particleTexture",this._particleTexture1),r.material.set("prevParticleTexture",this._particleTexture0),a.attach(this._thisFrameTexture),a.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT);var o=this._lastFrameFullQuadMesh;o.material.set("diffuseMap",this._lastFrameTexture),o.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),e.renderPass([o,r],this._camera),a.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=n},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var n=0,i=this._thisFrameTexture,r=t[n];r;)this._frameBuffer.attach(r),this._downsamplePass.setUniform("texture",i),this._downsamplePass.setUniform("textureSize",[i.width,i.height]),this._downsamplePass.render(e,this._frameBuffer),i=r,r=t[++n]},getSurfaceTexture:function(){var e=this._downsampleTextures;return e.length>0?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new l.a),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var n=t.getContext("2d");return n.fillStyle="#fff",n.arc(e/2,e/2,e/2,0,2*Math.PI),n.fill(),t}(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){this._getParticleMesh().material.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var n=this._downsampleTextures,i=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),r=2,a=this._width*this._supersampling,s=this._height*this._supersampling,o=0;o<i;o++)n[o]=n[o]||new l.a,n[o].width=a/r,n[o].height=s/r,r*=2;for(;o<n.length;o++)n[o].dispose(e);n.length=i},_swapTexture:function(){var e=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=e,e=this._thisFrameTexture,this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=e},dispose:function(e){e.disposeFrameBuffer(this._frameBuffer),e.disposeTexture(this.vectorFieldTexture),e.disposeTexture(this._spawnTexture),e.disposeTexture(this._particleTexture0),e.disposeTexture(this._particleTexture1),e.disposeTexture(this._thisFrameTexture),e.disposeTexture(this._lastFrameTexture),e.disposeGeometry(this._particleLinesMesh.geometry),e.disposeGeometry(this._particlePointsMesh.geometry),e.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&e.disposeTexture(this._spriteTexture),this._particlePass.dispose(e),this._downsamplePass.dispose(e),this._downsampleTextures.forEach((function(t){t.dispose(e)}))}},t.a=m},function(e,t,n){"use strict";var i=n(13),r=n(0),a=(n.n(r),i.a.extend((function(){return{dynamic:!0,attributes:{position:new i.a.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,n=4*e,i=2*e;this.vertexCount!==n&&t.position.init(n),this.triangleCount!==i&&(this.indices=0===i?null:this.vertexCount>65535?new Uint32Array(3*i):new Uint16Array(3*i))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}}));t.a=a},function(e,t,n){"use strict";t.a="@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n"},function(e,t,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){var n=r.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(n.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");n.push("vx","vy");var i=r.a.helper.completeDimensions(n,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new r.a.List(i,this);return a.initData(this.getSource()),a},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=(n(260),n(261),n(16));r.a.registerVisual(Object(a.a)("linesGL"))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(12),s=(n.n(a),r.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",streamEnabled:!0,init:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),s.superApply(this,"init",arguments)},mergeOption:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),s.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Object(a.concatArray)(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Object(a.concatArray)(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e),n=t.option instanceof Array?t.option:t.getShallow("coords");if(!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],i=this._flatCoordsOffset[2*e+1],r=0;r<i;r++)t[r]=t[r]||[],t[r][0]=this._flatCoords[n+2*r],t[r][1]=this._flatCoords[n+2*r+1];return i}var a=this._getCoordsFromItemModel(e);for(r=0;r<a.length;r++)t[r]=t[r]||[],t[r][0]=a[r][0],t[r][1]=a[r][1];return a.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var n=e.length,i=new Uint32Array(n),r=new Float64Array(n),a=0,s=0,o=0,l=0;l<n;){o++;var u=e[l++];i[s++]=a+t,i[s++]=u;for(var c=0;c<u;c++){var h=e[l++],d=e[l++];if(r[a++]=h,r[a++]=d,l>n)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,s),flatCoords:r,count:o}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var n=new r.a.List(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],(function(e,t,i,r){if(e instanceof Array)return NaN;n.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),a=n(2),s=n(20),o=n(86),l=n(84),u=n(3);r.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new s.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new l.a(this.viewGL),this._nativeLinesShader=a.a.createShader("ecgl.lines3D"),this._meshLinesShader=a.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n);var i=this._linesMeshes[0];i||(i=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(i),this._updateLinesMesh(e,i,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,i){var r=this._linesMeshes[this._currentStep];r||(r=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=r),this._updateLinesMesh(t,r,e.start,e.end),this.groupGL.add(r),i.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,n){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,n)},_createLinesMesh:function(e){return new a.a.Mesh({$ignorePicking:!0,material:new a.a.Material({shader:a.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new o.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,n,i){var r=e.getData();t.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null;var s=e.get("lineStyle.curveness")||0,o=e.get("polyline"),l=t.geometry,c=e.coordinateSystem,h=u.a.firstNotNull(e.get("lineStyle.width"),1);h>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=a.a.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=a.a.Mesh.LINES),n=n||0,i=i||r.count(),l.resetOffset();var d=0,f=0,p=[],m=[],g=[],_=[],v=[],y=.3,b=.7;function x(){m[0]=p[0]*b+_[0]*y-(p[1]-_[1])*s,m[1]=p[1]*b+_[1]*y-(_[0]-p[0])*s,g[0]=p[0]*y+_[0]*b-(p[1]-_[1])*s,g[1]=p[1]*y+_[1]*b-(_[0]-p[0])*s}if(o||0!==s)for(var E=n;E<i;E++)if(o){var w=e.getLineCoordsCount(E);d+=l.getPolylineVertexCount(w),f+=l.getPolylineTriangleCount(w)}else e.getLineCoords(E,v),this._glViewHelper.dataToPoint(c,v[0],p),this._glViewHelper.dataToPoint(c,v[1],_),x(),d+=l.getCubicCurveVertexCount(p,m,g,_),f+=l.getCubicCurveTriangleCount(p,m,g,_);else{var T=i-n;d+=T*l.getLineVertexCount(),f+=T*l.getLineVertexCount()}l.setVertexCount(d),l.setTriangleCount(f);var S=n,A=[];for(E=n;E<i;E++){a.a.parseColor(r.getItemVisual(S,"color"),A);var C=u.a.firstNotNull(r.getItemVisual(S,"opacity"),1);A[3]*=C,w=e.getLineCoords(E,v);for(var L=0;L<w;L++)this._glViewHelper.dataToPoint(c,v[L],v[L]);o?l.addPolyline(v,A,h,0,w):0!==s?(p=v[0],_=v[1],x(),l.addCubicCurve(p,m,g,_,A,h)):l.addPolyline(v,A,h,0,2),S++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})}])},e.exports=i(n(76411))},3867:function(e,t,n){var i=n(97671);e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=0,s=void 0,o=void 0,l=function(e,t){x[a]=e,x[a+1]=t,2===(a+=2)&&(o?o(E):T())};function u(e){o=e}function c(e){l=e}var h="undefined"!=typeof window?window:void 0,d=h||{},f=d.MutationObserver||d.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==i&&"[object process]"==={}.toString.call(i),m="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function g(){return function(){return i.nextTick(E)}}function _(){return void 0!==s?function(){s(E)}:b()}function v(){var e=0,t=new f(E),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function y(){var e=new MessageChannel;return e.port1.onmessage=E,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(E,1)}}var x=new Array(1e3);function E(){for(var e=0;e<a;e+=2)(0,x[e])(x[e+1]),x[e]=void 0,x[e+1]=void 0;a=0}function w(){try{var e=Function("return this")().require("vertx");return s=e.runOnLoop||e.runOnContext,_()}catch(e){return b()}}var T=void 0;function S(e,t){var n=this,i=new this.constructor(L);void 0===i[C]&&q(i);var r=n._state;if(r){var a=arguments[r-1];l((function(){return V(r,i,a,n._result)}))}else j(n,i,e,t);return i}function A(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(L);return B(n,e),n}T=p?g():f?v():m?y():void 0===h?w():b();var C=Math.random().toString(36).substring(2);function L(){}var R=void 0,I=1,D=2;function k(){return new TypeError("You cannot resolve a promise with itself")}function M(){return new TypeError("A promises callback cannot return that same promise.")}function P(e,t,n,i){try{e.call(t,n,i)}catch(e){return e}}function O(e,t,n){l((function(e){var i=!1,r=P(n,t,(function(n){i||(i=!0,t!==n?B(e,n):G(e,n))}),(function(t){i||(i=!0,z(e,t))}),"Settle: "+(e._label||" unknown promise"));!i&&r&&(i=!0,z(e,r))}),e)}function N(e,t){t._state===I?G(e,t._result):t._state===D?z(e,t._result):j(t,void 0,(function(t){return B(e,t)}),(function(t){return z(e,t)}))}function F(e,n,i){n.constructor===e.constructor&&i===S&&n.constructor.resolve===A?N(e,n):void 0===i?G(e,n):t(i)?O(e,n,i):G(e,n)}function B(t,n){if(t===n)z(t,k());else if(e(n)){var i=void 0;try{i=n.then}catch(e){return void z(t,e)}F(t,n,i)}else G(t,n)}function U(e){e._onerror&&e._onerror(e._result),H(e)}function G(e,t){e._state===R&&(e._result=t,e._state=I,0!==e._subscribers.length&&l(H,e))}function z(e,t){e._state===R&&(e._state=D,e._result=t,l(U,e))}function j(e,t,n,i){var r=e._subscribers,a=r.length;e._onerror=null,r[a]=t,r[a+I]=n,r[a+D]=i,0===a&&e._state&&l(H,e)}function H(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var i=void 0,r=void 0,a=e._result,s=0;s<t.length;s+=3)i=t[s],r=t[s+n],i?V(n,i,r,a):r(a);e._subscribers.length=0}}function V(e,n,i,r){var a=t(i),s=void 0,o=void 0,l=!0;if(a){try{s=i(r)}catch(e){l=!1,o=e}if(n===s)return void z(n,M())}else s=r;n._state!==R||(a&&l?B(n,s):!1===l?z(n,o):e===I?G(n,s):e===D&&z(n,s))}function W(e,t){try{t((function(t){B(e,t)}),(function(t){z(e,t)}))}catch(t){z(e,t)}}var Z=0;function K(){return Z++}function q(e){e[C]=Z++,e._state=void 0,e._result=void 0,e._subscribers=[]}function X(){return new Error("Array Methods must be provided an Array")}var Y=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(L),this.promise[C]||q(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?G(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&G(this.promise,this._result))):z(this.promise,X())}return e.prototype._enumerate=function(e){for(var t=0;this._state===R&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,i=n.resolve;if(i===A){var r=void 0,a=void 0,s=!1;try{r=e.then}catch(e){s=!0,a=e}if(r===S&&e._state!==R)this._settledAt(e._state,t,e._result);else if("function"!=typeof r)this._remaining--,this._result[t]=e;else if(n===ne){var o=new n(L);s?z(o,a):F(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(i(e),t)},e.prototype._settledAt=function(e,t,n){var i=this.promise;i._state===R&&(this._remaining--,e===D?z(i,n):this._result[t]=n),0===this._remaining&&G(i,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;j(e,void 0,(function(e){return n._settledAt(I,t,e)}),(function(e){return n._settledAt(D,t,e)}))},e}();function Q(e){return new Y(this,e).promise}function $(e){var t=this;return r(e)?new t((function(n,i){for(var r=e.length,a=0;a<r;a++)t.resolve(e[a]).then(n,i)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function J(e){var t=new this(L);return z(t,e),t}function ee(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function te(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var ne=function(){function e(t){this[C]=K(),this._result=this._state=void 0,this._subscribers=[],L!==t&&("function"!=typeof t&&ee(),this instanceof e?W(this,t):te())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();function ie(){var e=void 0;if(void 0!==n.g)e=n.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var i=null;try{i=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===i&&!t.cast)return}e.Promise=ne}return ne.prototype.then=S,ne.all=Q,ne.race=$,ne.resolve=A,ne.reject=J,ne._setScheduler=u,ne._setAsap=c,ne._asap=l,ne.polyfill=ie,ne.Promise=ne,ne}()},86204:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,a),i(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,r,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,n,i){var r,a,s;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),(r=l(e))>0&&s.length>r&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,function(e){console&&console.warn&&console.warn(e)}(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=c.bind(i);return r.listener=n,i.wrapFn=r,r}function d(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):p(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function m(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(a){i.once&&e.removeEventListener(t,r),n(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,a=this._events;if(void 0!==a)r=r&&void 0===a.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=p(l,u);for(n=0;n<u;++n)i(c[n],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,i,r,a,s;if(o(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,r=a;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,a=Object.keys(n);for(i=0;i<a.length;++i)"removeListener"!==(r=a[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},53291:function(e){"use strict";var t=Array.isArray,n=Object.keys,i=Object.prototype.hasOwnProperty;e.exports=function e(r,a){if(r===a)return!0;if(r&&a&&"object"==typeof r&&"object"==typeof a){var s,o,l,u=t(r),c=t(a);if(u&&c){if((o=r.length)!=a.length)return!1;for(s=o;0!=s--;)if(!e(r[s],a[s]))return!1;return!0}if(u!=c)return!1;var h=r instanceof Date,d=a instanceof Date;if(h!=d)return!1;if(h&&d)return r.getTime()==a.getTime();var f=r instanceof RegExp,p=a instanceof RegExp;if(f!=p)return!1;if(f&&p)return r.toString()==a.toString();var m=n(r);if((o=m.length)!==n(a).length)return!1;for(s=o;0!=s--;)if(!i.call(a,m[s]))return!1;for(s=o;0!=s--;)if(!e(r[l=m[s]],a[l]))return!1;return!0}return r!=r&&a!=a}},53184:function(e,t,n){"use strict";var i,r;i=[n(58553),n(87804),n(40998)],void 0===(r=function(e,t,n){return function(e,t,n){var i=function(t,n){return e.js_beautify(t,n)};return i.js=e.js_beautify,i.css=t.css_beautify,i.html=n.html_beautify,i.js_beautify=e.js_beautify,i.css_beautify=t.css_beautify,i.html_beautify=n.html_beautify,i}(e,t,n)}.apply(t,i))||(e.exports=r)},87804:function(e,t){var n;!function(){var i;!function(){"use strict";var e=[,,function(e){function t(e){this.__parent=e,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=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.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)},t.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},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.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(" "))},i.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&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},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},,,,function(e){function t(e,t){this.raw_options=n(e,t),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","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(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"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},n.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},n.prototype.__match=function(e,n){e.lastIndex=n;var i=e.exec(this.__input);return!i||t&&e.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},n.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},n.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(e,t,n){var i,r="";return e&&(i=this.match(e))&&(r+=i[0]),!t||!i&&e||(r+=this.readUntil(t,n)),r},n.prototype.readUntil=function(e,t){var n,i=this.__position;e.lastIndex=this.__position;var r=e.exec(this.__input);return r?(i=r.index,t&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},n.prototype.get_regexp=function(e,n){var i=null,r="g";return n&&t&&(r="y"),"string"==typeof e&&""!==e?i=new RegExp(e,r):e&&(i=new RegExp(e.source,r)),i},n.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},n.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},,,,,function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},,function(e,t,n){var i=n(16).Beautifier,r=n(17).Options;e.exports=function(e,t){return new i(e,t).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(17).Options,r=n(2).Output,a=n(8).InputScanner,s=new(0,n(13).Directives)(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,h=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,d=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function f(e,t){this._source_text=e||"",this._options=new i(t),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"]}f.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},f.prototype.eatWhitespace=function(e){for(var t=u.test(this._input.peek()),n=0;u.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},f.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},f.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},f.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},f.prototype.indent=function(){this._indentLevel++},f.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&o.test(e||"")&&(t=e.match(o)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0];this._output=new r(this._options,n),this._input=new a(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var i,f,p=0,m=!1,g=!1,_=!1,v=!1,y=!1,b=this._ch,x=!1;i=""!==this._input.read(c),f=b,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),b=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(h),w=s.get_directives(E);w&&"start"===w.ignore&&(E+=s.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(d)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(i),this.print_string(this._ch);var T=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);T.match(/[ :]$/)&&(T=this.eatString(": ").replace(/\s+$/,""),this.print_string(T),this._output.space_before_token=!0),0===p&&-1!==T.indexOf(":")&&(g=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(i),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var S=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);S.match(/[ :]$/)&&(S=this.eatString(": ").replace(/\s+$/,""),this.print_string(S),this._output.space_before_token=!0),0===p&&-1!==S.indexOf(":")?(g=!0,this.indent()):S in this.NESTED_AT_RULE?(this._nestedLevel+=1,S in this.CONDITIONAL_GROUP_RULE&&(_=!0)):0!==p||g||(v=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(i),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)g&&(g=!1,this.outdent()),v=!1,_?(_=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===f?this._output.space_before_token=!1:","!==f&&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(),"{"===f&&this._output.trim(!0),g&&(this.outdent(),g=!1),this.print_string(this._ch),m=!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),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var A=0;A<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;A++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[A])){x=!0;break}!m&&!_||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==p?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),g||(g=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var C='"'===f||"'"===f;this.preserveSingleSpace(C||i),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)x=!1,0===p?(g&&(this.outdent(),g=!1),v=!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(),p++,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(")")),p&&(p--,this.outdent()));else{var L=!1;this._input.lookBack("with")&&(L=!0),this.preserveSingleSpace(i||L),this.print_string(this._ch),g&&"$"===f&&this._options.selector_separator_newline?(this._output.add_new_line(),y=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),y&&";"===this._input.peek()&&this._options.selector_separator_newline&&(y=!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||g&&!y||0!==p||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||g||0!==p)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(i),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("\\")){var R='"'===f||"'"===f;this.preserveSingleSpace(R||i),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&x&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else 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=""));return this._output.get_code(t)},e.exports.Beautifier=f},function(e,t,n){var i=n(6).Options;function r(e){i.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r<n.length;r++)"expand"!==n[r]?this.brace_style="collapse":this.brace_style=n[r]}r.prototype=new i,e.exports.Options=r}],t={};var n=function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(15);i=n}();var r=i;void 0===(n=function(){return{css_beautify:r}}.apply(t,[]))||(e.exports=n)}()},40998:function(e,t,n){var i,r;!function(){var a;!function(){"use strict";var e=[,,function(e){function t(e){this.__parent=e,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=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.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)},t.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},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.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(" "))},i.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&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},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},function(e){e.exports.Token=function(e,t,n,i){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},,,function(e){function t(e,t){this.raw_options=n(e,t),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","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(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"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},n.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},n.prototype.__match=function(e,n){e.lastIndex=n;var i=e.exec(this.__input);return!i||t&&e.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},n.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},n.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(e,t,n){var i,r="";return e&&(i=this.match(e))&&(r+=i[0]),!t||!i&&e||(r+=this.readUntil(t,n)),r},n.prototype.readUntil=function(e,t){var n,i=this.__position;e.lastIndex=this.__position;var r=e.exec(this.__input);return r?(i=r.index,t&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},n.prototype.get_regexp=function(e,n){var i=null,r="g";return n&&t&&(r="y"),"string"==typeof e&&""!==e?i=new RegExp(e,r):e&&(i=new RegExp(e.source,r)),i},n.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},n.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},function(e,t,n){var i=n(8).InputScanner,r=n(3).Token,a=n(10).TokenStream,s=n(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new i(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new a,this._reset();for(var t=new r(o.START,""),n=null,i=[],s=new a;t.type!==o.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new a),e.parent=n,this._is_opening(e)?(i.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=i.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(o.RAW,n):this._create_token(o.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new r(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=o},function(e){function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position<this.__tokens_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},t.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},e.exports.TokenStream=t},function(e,t,n){var i=n(12).Pattern;function r(e,t){i.call(this,e,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new i,r.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},r.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,i=[],r=e.exec(t);r;)i.push(t.substring(n,r.index)),n=r.index+r[0].length,r=e.exec(t);return n<t.length?i.push(t.substring(n,t.length)):i.push(""),i},e.exports.WhitespacePattern=r},function(e){function t(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}t.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},t.prototype.read_match=function(){return this._input.match(this._match_pattern)},t.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){},e.exports.Pattern=t},function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},function(e,t,n){var i=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function a(e,t){i.call(this,e,t),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var n=new i(e);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new i,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},a.prototype.read_options=function(e){var t=this._create();for(var n in r)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},a.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},a.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},a.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},a.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},e.exports.TemplatablePattern=a},,,,function(e,t,n){var i=n(19).Beautifier,r=n(20).Options;e.exports=function(e,t,n,r){return new i(e,t,n,r).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(20).Options,r=n(2).Output,a=n(21).Tokenizer,s=n(21).TOKEN,o=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=function(e,t){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new r(e,t)};u.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},u.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},u.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},u.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},u.prototype.print_preserved_newlines=function(e){var t=0;e.type!==s.TEXT&&e.previous.type!==s.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},u.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},u.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},u.prototype.print_newline=function(e){this._output.add_new_line(e)},u.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},u.prototype.indent=function(){this.indent_level++},u.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},u.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var c=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==s.EOF&&e.closed!==n;){if(n.type===s.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===s.EQUALS&&n.next.next&&n.next.next.type===s.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function h(e,t){return-1!==t.indexOf(e)}function d(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function f(e){this._printer=e,this._current_frame=null}function p(e,t,n,r){this._source_text=e||"",t=t||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var a=new i(t,"html");this._options=a,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}f.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},f.prototype.record_tag=function(e){var t=new d(this._current_frame,e,this._printer.indent_level);this._current_frame=t},f.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},f.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},f.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},f.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&o.test(e)&&(t=e.match(o)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0],i={text:"",type:""},r=new m(this._options),c=new u(this._options,n),h=new a(e,this._options).tokenize();this._tag_stack=new f(c);for(var d=null,p=h.next();p.type!==s.EOF;)p.type===s.TAG_OPEN||p.type===s.COMMENT?r=d=this._handle_tag_open(c,p,r,i,h):p.type===s.ATTRIBUTE||p.type===s.EQUALS||p.type===s.VALUE||p.type===s.TEXT&&!r.tag_complete?d=this._handle_inside_tag(c,p,r,i):p.type===s.TAG_CLOSE?d=this._handle_tag_close(c,p,r):p.type===s.TEXT?d=this._handle_text(c,p,r):p.type===s.CONTROL_FLOW_OPEN?d=this._handle_control_flow_open(c,p):p.type===s.CONTROL_FLOW_CLOSE?d=this._handle_control_flow_close(c,p):c.add_raw_token(p),i=d,p=h.next();return c._output.get_code(t)},p.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},p.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},p.prototype._handle_tag_close=function(e,t,n){var i={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),i},p.prototype._handle_inside_tag=function(e,t,n,i){var r=n.has_wrapped_attrs,a={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===s.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===s.ATTRIBUTE?e.set_space_before_token(!0):(t.type===s.EQUALS||t.type===s.VALUE&&t.previous.type===s.EQUALS)&&e.set_space_before_token(!1),t.type===s.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),r=r||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==s.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),r=!0)),e.print_token(t),r=r||e.previous_token_wrapped(),n.has_wrapped_attrs=r),a},p.prototype._handle_text=function(e,t,n){var i={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),i},p.prototype._print_custom_beatifier_text=function(e,t,n){var i=this;if(""!==t.text){var r,a=t.text,s=1,o="",l="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?r=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?r=this._css_beautify:"html"===n.custom_beautifier_name&&(r=function(e,t){return new p(e,t,i._js_beautify,i._css_beautify).beautify()}),"keep"===this._options.indent_scripts?s=0:"separate"===this._options.indent_scripts&&(s=-e.indent_level);var u=e.get_full_indent(s);if(a=a.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===a[0]&&a.match(/^(<!--|<!\[CDATA\[)/)){var c=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(a);if(!c)return void e.add_raw_token(t);o=u+c[1]+"\n",a=c[4],c[5]&&(l=u+c[5]),a=a.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(t.whitespace_before=c[0])}if(a)if(r){var h=function(){this.eol="\n"};h.prototype=this._options.raw_options,a=r(u+a,new h)}else{var d=t.whitespace_before;d&&(a=a.replace(new RegExp("\n("+d+")?","g"),"\n")),a=u+a.replace(/\n/g,"\n"+u)}o&&(a=a?o+a+"\n"+l:o+l),e.print_newline(!1),a&&(t.text=a,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},p.prototype._handle_tag_open=function(e,t,n,i,r){var a=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==s.TAG_OPEN||a.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,a,n,i),a.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),a.start_tag_token=this._tag_stack.try_pop(a.tag_name)),a.is_start_tag&&this._is_wrap_attributes_force){var o,l=0;do{(o=r.peek(l)).type===s.ATTRIBUTE&&(a.attr_count+=1),l+=1}while(o.type!==s.EOF&&o.type!==s.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(a.alignment_size=t.text.length+1),a.tag_complete||a.is_unformatted||(e.alignment_size=a.alignment_size),a};var m=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===s.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||n.closed&&"/>"===n.closed.text;var r=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(r=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(r)))}else this.tag_complete=!0};p.prototype._get_tag_open_token=function(e){var t=new m(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||h(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&h(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&h(t.tag_check,this._options.content_unformatted),t.is_inline_element=h(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},p.prototype._set_tag_position=function(e,t,n,i,r){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=c(n.tag_check,t)))),h(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&r.type===s.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var a=!1;a=(a=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(r.type===s.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==r.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===r.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},p.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var g=["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"],_=["a","audio","del","ins","map","noscript","video"];p.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==g.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==_.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},e.exports.Beautifier=p},function(e,t,n){var i=n(6).Options;function r(e){i.call(this,e,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(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"])}r.prototype=new i,e.exports.Options=r},function(e,t,n){var i=n(9).Tokenizer,r=n(9).TOKEN,a=n(13).Directives,s=n(14).TemplatablePattern,o=n(12).Pattern,l={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:r.START,RAW:r.RAW,EOF:r.EOF},u=new a(/<\!--/,/-->/),c=function(e,t){i.call(this,e,t),this._current_tag_name="";var n=new s(this._input).read_options(this._options),r=new o(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),word_control_flow_close_excluded:n.until(/[\n\r\t <}]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),angular_control_flow_start:r.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(/<!--/).until_after(/-->/),cdata:r.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:r.starting_with(/<!\[/).until_after(/]>/),processing:r.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 a=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(a).until_after(a)}};(c.prototype=new i)._is_comment=function(e){return!1},c.prototype._is_opening=function(e){return e.type===l.TAG_OPEN||e.type===l.CONTROL_FLOW_OPEN},c.prototype._is_closing=function(e,t){return e.type===l.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===l.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},c.prototype._reset=function(){this._current_tag_name=""},c.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(l.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(i,t))||this._read_attribute(i,e,t))||this._read_close(i,t))||this._read_script_and_style(i,e))||this._read_control_flows(i,t))||this._read_raw_content(i,e,t))||this._read_content_word(i,t))||this._read_comment_or_cdata(i))||this._read_processing(i))||this._read_open(i,t))||this._create_token(l.UNKNOWN,this._input.next())},c.prototype._read_comment_or_cdata=function(e){var t=null,n=null,i=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(i=u.get_directives(n))&&"start"===i.ignore&&(n+=u.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=i));return t},c.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var i=this._input.peek(1);"!"!==i&&"?"!==i||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=null)}return t},c.prototype._read_open=function(e,t){var n=null,i=null;return t&&t.type!==l.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(l.TAG_OPEN,n)),i},c.prototype._read_open_handlebars=function(e,t){var n=null,i=null;return t&&t.type!==l.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),i=this._create_token(l.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),i=this._create_token(l.TAG_OPEN,n))),i},c.prototype._read_control_flows=function(e,t){var n="",i=null;if(!this._options.templating.includes("angular"))return i;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return i;for(var r=n.endsWith("(")?1:0,a=0;!n.endsWith("{")||r!==a;){var s=this._input.next();if(null===s)break;"("===s?r++:")"===s&&a++,n+=s}i=this._create_token(l.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===l.CONTROL_FLOW_OPEN&&(n=this._input.next(),i=this._create_token(l.CONTROL_FLOW_CLOSE,n));return i},c.prototype._read_close=function(e,t){var n=null,i=null;return t&&t.type===l.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),i=this._create_token(l.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(l.TAG_CLOSE,"}}"))),i},c.prototype._read_attribute=function(e,t,n){var i=null,r="";if(n&&"<"===n.text[0])if("="===e)i=this._create_token(l.EQUALS,this._input.next());else if('"'===e||"'"===e){var a=this._input.next();a+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),i=this._create_token(l.VALUE,a)}else(r=this.__patterns.attribute.read())&&(i=t.type===l.EQUALS?this._create_token(l.VALUE,r):this._create_token(l.ATTRIBUTE,r));return i},c.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},c.prototype._read_raw_content=function(e,t,n){var i="";if(n&&"{"===n.text[0])i=this.__patterns.handlebars_raw_close.read();else if(t.type===l.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var r=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(r)&&(i=this._input.readUntil(new RegExp("</"+r+"[\\n\\r\\t ]*?>","ig")))}return i?this._create_token(l.TEXT,i):null},c.prototype._read_script_and_style=function(e,t){if(t.type===l.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var i=this._read_comment_or_cdata(e);if(i)return i.type=l.TEXT,i;var r=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(r)return this._create_token(l.TEXT,r)}}return null},c.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===l.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(l.TEXT,n):null},e.exports.Tokenizer=c,e.exports.TOKEN=l}],t={};var n=function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(18);a=n}();var s=a;i=[n,n(58553),n(87804)],r=function(e){var t=n(58553),i=n(87804);return{html_beautify:function(e,n){return s(e,n,t.js_beautify,i.css_beautify)}}}.apply(t,i),void 0===r||(e.exports=r)}()},58553:function(e,t){var n;!function(){var i;!function(){"use strict";var e=[function(e,t,n){var i=n(1).Beautifier,r=n(5).Options;e.exports=function(e,t){return new i(e,t).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(2).Output,r=n(3).Token,a=n(4),s=n(5).Options,o=n(7).Tokenizer,l=n(7).line_starters,u=n(7).positionable_operators,c=n(7).TOKEN;function h(e,t){return-1!==t.indexOf(e)}function d(e,t){return e&&e.type===c.RESERVED&&e.text===t}function f(e,t){return e&&e.type===c.RESERVED&&h(e.text,t)}var p=["case","return","do","if","throw","else","await","break","continue","async"],m=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),g=[m.before_newline,m.preserve_newline],_="BlockStatement",v="Statement",y="ObjectLiteral",b="ArrayLiteral",x="ForInitializer",E="Conditional",w="Expression";function T(e,t){t.multiline_frame||t.mode===x||t.mode===E||e.remove_indent(t.start_line_index)}function S(e){return e===b}function A(e){return h(e,[w,x,E])}function C(e,t){t=t||{},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 s(t)}C.prototype.create_flags=function(e,t){var n=0;return e&&(n=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_token:e?e.last_token:new r(c.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:n,alignment:0,line_indent_level:e?e.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},C.prototype._reset=function(e){var t=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new i(this._options,t),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(_);var n=new o(e,this._options);return this._tokens=n.tokenize(),e},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&a.lineBreak.test(e||"")&&(t=e.match(a.lineBreak)[0]));for(var n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(t)},C.prototype.handle_token=function(e,t){e.type===c.START_EXPR?this.handle_start_expr(e):e.type===c.END_EXPR?this.handle_end_expr(e):e.type===c.START_BLOCK?this.handle_start_block(e):e.type===c.END_BLOCK?this.handle_end_block(e):e.type===c.WORD||e.type===c.RESERVED?this.handle_word(e):e.type===c.SEMICOLON?this.handle_semicolon(e):e.type===c.STRING?this.handle_string(e):e.type===c.EQUALS?this.handle_equals(e):e.type===c.OPERATOR?this.handle_operator(e):e.type===c.COMMA?this.handle_comma(e):e.type===c.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===c.COMMENT?this.handle_comment(e,t):e.type===c.DOT?this.handle_dot(e):e.type===c.EOF?this.handle_eof(e):(e.type,c.UNKNOWN,this.handle_unknown(e,t))},C.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,i=this._options.keep_array_indentation&&S(this._flags.mode);if(e.comments_before)for(var r=e.comments_before.next();r;)this.handle_whitespace_and_comments(r,t),this.handle_token(r,t),r=e.comments_before.next();if(i)for(var a=0;a<n;a+=1)this.print_newline(a>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var s=1;s<n;s+=1)this.print_newline(!0,t)}};var L=["async","break","continue","return","throw","yield"];C.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(h(this._flags.last_token.text,u)||h(e.text,u)){var i=h(this._flags.last_token.text,u)&&h(this._options.operator_position,g)||h(e.text,u);n=n&&i}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(f(this._flags.last_token,L))return;this._output.set_wrap_point()}}},C.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==c.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&d(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},C.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||S(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))},C.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===c.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),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)}},C.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.set_mode=function(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)},C.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===v&&T(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.start_of_object_property=function(){return this._flags.parent.mode===y&&this._flags.mode===v&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||f(this._flags.last_token,["get","set"]))},C.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||f(this._flags.last_token,["var","let","const"])&&e.type===c.WORD)||d(this._flags.last_token,"do"))||!(this._flags.parent.mode===y&&this._flags.mode===v)&&f(this._flags.last_token,L)&&!e.newlines)||d(this._flags.last_token,"else")&&!(d(e,"if")&&!e.comments_before))||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===x||this._previous_flags.mode===E))||this._flags.last_token.type===c.WORD&&this._flags.mode===_&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==c.WORD&&e.type!==c.RESERVED)||this._flags.mode===y&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||f(this._flags.last_token,["get","set"])))&&(this.set_mode(v),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,f(e,["do","for","if","while"])),!0)},C.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=w;if("["===e.text){if(this._flags.last_token.type===c.WORD||")"===this._flags.last_token.text)return f(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=b,S(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),h(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR,c.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=x):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=E):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(h(this._flags.last_token.text,l)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var i=this._tokens.peek(-4);f(n,["async","function"])||"*"===n.text&&f(i,["async","function"])?this._output.space_before_token=!0:this._flags.mode===y?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==i.text&&","!==i.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===c.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(h(this._last_last_text,["function","yield"])||this._flags.mode===y&&h(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===c.START_BLOCK?this.print_newline():this._flags.last_token.type!==c.END_EXPR&&this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==c.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},C.prototype.handle_end_expr=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&S(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==c.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),T(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===E&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},C.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(_),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(_):n&&(h(n.text,[":",","])&&h(t.type,[c.STRING,c.WORD,c.RESERVED])||h(t.text,["get","set","..."])&&h(n.type,[c.WORD,c.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(n.text,[":",","])?this.set_mode(_):this.set_mode(y):this._flags.last_token.type===c.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(_):h(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||f(this._flags.last_token,["return","throw","import","default"])?this.set_mode(y):this.set_mode(_),this._flags.last_token&&f(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var i=!t.comments_before&&"}"===t.text,r=i&&"function"===this._flags.last_word&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var a=0,s=null;this._flags.inline_frame=!0;do{if(a+=1,(s=this._tokens.peek(a-1)).newlines){this._flags.inline_frame=!1;break}}while(s.type!==c.EOF&&(s.type!==c.END_BLOCK||s.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(r||this._flags.last_token.type===c.EQUALS||f(this._flags.last_token,p)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!S(this._previous_flags.mode)||this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.COMMA||((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.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!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(h(this._flags.last_token.type,[c.START_BLOCK,c.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},C.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===v;)this.restore_mode();var t=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(S(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},C.prototype.handle_word=function(e){if(e.type===c.RESERVED)if(h(e.text,["set","get"])&&this._flags.mode!==y)e.type=c.WORD;else if("import"===e.text&&h(this._tokens.peek().text,["(","."]))e.type=c.WORD;else if(h(e.text,["as","from"])&&!this._flags.import_block)e.type=c.WORD;else if(this._flags.mode===y){":"===this._tokens.peek().text&&(e.type=c.WORD)}if(this.start_of_statement(e)?f(this._flags.last_token,["var","let","const"])&&e.type===c.WORD&&(this._flags.declaration_statement=!0):!e.newlines||A(this._flags.mode)||this._flags.last_token.type===c.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===c.EQUALS||!this._options.preserve_newlines&&f(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(d(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&d(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===v;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&f(e,["case","default"]))return 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),void(this._flags.in_case=!0);if(this._flags.last_token.type!==c.COMMA&&this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.EQUALS&&this._flags.last_token.type!==c.OPERATOR||this.start_of_object_property()||h(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===y||this.allow_wrap_or_preserved_newline(e),d(e,"function"))return(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!h(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==c.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?f(this._flags.last_token,["get","set","new","export"])||f(this._flags.last_token,L)||d(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===c.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!A(this._flags.mode)&&!S(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":f(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===_?t="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&A(this._flags.mode)?t="SPACE":this._flags.last_token.type===c.STRING?t="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||"*"===this._flags.last_token.text&&(h(this._last_last_text,["function","yield"])||this._flags.mode===y&&h(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===c.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),f(e,l)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),f(e,["else","catch","finally"]))?(this._flags.last_token.type!==c.END_BLOCK||this._previous_flags.mode!==_||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?f(this._flags.last_token,p)||"declare"===this._flags.last_token.text&&f(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?this._flags.last_token.type===c.START_EXPR&&f(e,["var","let","const"])||":"===this._flags.last_token.text||(d(e,"if")&&d(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):f(e,l)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&S(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==c.WORD&&e.previous.type!==c.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===c.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&d(e,"from")&&(this._flags.import_block=!1))},C.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&d(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},C.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==c.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==c.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},C.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},C.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?(A(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===y||this._flags.mode===v&&this._flags.parent.mode===y?(this._flags.mode===v&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},C.prototype.handle_operator=function(e){var t="*"===e.text&&(f(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),n=h(e.text,["-","+"])&&(h(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||h(this._flags.last_token.text,l)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var i=!t;this.handle_whitespace_and_comments(e,i)}if("*"!==e.text||this._flags.last_token.type!==c.DOT)if("::"!==e.text)if(h(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===c.OPERATOR&&h(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==c.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var r=!0,a=!0,s=!1;if(":"===e.text?0===this._flags.ternary_depth?r=!1:(this._flags.ternary_depth-=1,s=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&h(e.text,u)){var o=":"===e.text,d=o&&s,y=o&&!s;switch(this._options.operator_position){case m.before_newline:return this._output.space_before_token=!y,this.print_token(e),o&&!d||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case m.after_newline:return this._output.space_before_token=!0,!o||d?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),void(this._output.space_before_token=!0);case m.preserve_newline:return y||this.allow_wrap_or_preserved_newline(e),r=!(this._output.just_added_newline()||y),this._output.space_before_token=r,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),r=!1;var b=this._tokens.peek();a=b&&h(b.type,[c.WORD,c.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),r=this._flags.last_token.type===c.START_BLOCK,a=!1;else if(h(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==c.COMMA&&this._flags.last_token.type!==c.START_EXPR||this.allow_wrap_or_preserved_newline(e),r=!1,a=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var x=f(this._flags.last_token,p)&&e.newlines;x&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(x,!0)}";"===this._flags.last_token.text&&A(this._flags.mode)&&(r=!0),this._flags.last_token.type===c.RESERVED?r=!0:this._flags.last_token.type===c.END_EXPR?r=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===c.OPERATOR&&(r=h(e.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(e.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(a=!0)),(this._flags.mode!==_||this._flags.inline_frame)&&this._flags.mode!==v||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||r,this.print_token(e),this._output.space_before_token=a}else this.print_token(e);else this.print_token(e)},C.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):a.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},C.prototype.print_block_commment=function(e,t){var n,i=function(e){for(var t=[],n=(e=e.replace(a.allLineBreaks,"\n")).indexOf("\n");-1!==n;)t.push(e.substring(0,n)),n=(e=e.substring(n+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),r=!1,s=!1,o=e.whitespace_before,l=o.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(i=i.slice(1),"*"),s=function(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(i,o),r&&(this._flags.alignment=1),n=0;n<i.length;n++)r?(this.print_token_line_indentation(e),this._output.add_token(i[n].replace(/^\s+/g,""))):s&&i[n]?(this.print_token_line_indentation(e),this._output.add_token(i[n].substring(l))):(this._output.current_line.set_indent(-1),this._output.add_token(i[n])),this.print_newline(!1,t);this._flags.alignment=0}},C.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},C.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),f(this._flags.last_token,p)?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)},C.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},C.prototype.handle_eof=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e)},e.exports.Beautifier=C},function(e){function t(e){this.__parent=e,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=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.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)},t.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},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.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(" "))},i.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&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},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},function(e){e.exports.Token=function(e,t,n,i){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(e,t){var n="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",i="\\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",r="\\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]+\\}",s="(?:"+a+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+i+"])",o="(?:"+a+"|["+n+i+r+"])*";t.identifier=new RegExp(s+o,"g"),t.identifierStart=new RegExp(s),t.identifierMatch=new RegExp("(?:"+a+"|["+n+i+r+"])+");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")},function(e,t,n){var i=n(6).Options,r=["before-newline","after-newline","preserve-newline"];function a(e){i.call(this,e,"js");var t=this.raw_options.brace_style||null;"expand-strict"===t?this.raw_options.brace_style="expand":"collapse-preserve-inline"===t?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<n.length;a++)"preserve-inline"===n[a]?this.brace_preserve_inline=!0:this.brace_style=n[a];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",r),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new i,e.exports.Options=a},function(e){function t(e,t){this.raw_options=n(e,t),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","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(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"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},function(e,t,n){var i=n(8).InputScanner,r=n(9).Tokenizer,a=n(9).TOKEN,s=n(13).Directives,o=n(4),l=n(12).Pattern,u=n(14).TemplatablePattern;function c(e,t){return-1!==t.indexOf(e)}var h={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:a.START,RAW:a.RAW,EOF:a.EOF},d=new s(/\/\*/,/\*\//),f=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,p=/[0-9]/,m=/[^\d\.]/,g=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=(_="\\?\\.(?!\\d) "+(_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var v,y=new RegExp(_),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),x=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+x.join("|")+")$"),w=function(e,t){r.call(this,e,t),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new l(this._input),i=new u(this._input).read_options(this._options);this.__patterns={template:i,identifier:i.starting_with(o.identifier).matching(o.identifierMatch),number:n.matching(f),punct:n.matching(y),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(/<!--/),html_comment_end:n.matching(/-->/),include:n.starting_with(/#include/).until_after(o.lineBreak),shebang:n.starting_with(/#!/).until_after(o.lineBreak),xml:n.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:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}};(w.prototype=new r)._is_comment=function(e){return e.type===h.COMMENT||e.type===h.BLOCK_COMMENT||e.type===h.UNKNOWN},w.prototype._is_opening=function(e){return e.type===h.START_BLOCK||e.type===h.START_EXPR},w.prototype._is_closing=function(e,t){return(e.type===h.END_BLOCK||e.type===h.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},w.prototype._reset=function(){v=!1},w.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(h.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(i))||this._read_string(i))||this._read_pair(i,this._input.peek(1)))||this._read_word(e))||this._read_singles(i))||this._read_comment(i))||this._read_regexp(i,e))||this._read_xml(i,e))||this._read_punctuation())||this._create_token(h.UNKNOWN,this._input.next())},w.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(o.allLineBreaks,"\n"),e.type!==h.DOT&&(e.type!==h.RESERVED||"set"!==e.text&&"get"!==e.text)&&E.test(t)?"in"!==t&&"of"!==t||e.type!==h.WORD&&e.type!==h.STRING?this._create_token(h.RESERVED,t):this._create_token(h.OPERATOR,t):this._create_token(h.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(h.WORD,t):void 0},w.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(h.START_EXPR,e):")"===e||"]"===e?t=this._create_token(h.END_EXPR,e):"{"===e?t=this._create_token(h.START_BLOCK,e):"}"===e?t=this._create_token(h.END_BLOCK,e):";"===e?t=this._create_token(h.SEMICOLON,e):"."===e&&m.test(this._input.peek(1))?t=this._create_token(h.DOT,e):","===e&&(t=this._create_token(h.COMMA,e)),t&&this._input.next(),t},w.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(h.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},w.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(h.EQUALS,e):"?."===e?this._create_token(h.DOT,e):this._create_token(h.OPERATOR,e)},w.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(h.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(h.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(p)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)t+=this._input.next();return v=!0,this._create_token(h.COMMENT,t)}}else if(v&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return v=!1,this._create_token(h.COMMENT,t);return null},w.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var i=d.get_directives(n);i&&"start"===i.ignore&&(n+=d.readIgnored(this._input)),n=n.replace(o.allLineBreaks,"\n"),(t=this._create_token(h.BLOCK_COMMENT,n)).directives=i}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(h.COMMENT,n))}return t},w.prototype._read_string=function(e){if("`"===e||"'"===e||'"'===e){var t=this._input.next();return this.has_char_escapes=!1,t+="`"===e?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(t=function(e){var t="",n=0,r=new i(e),a=null;for(;r.hasNext();)if((a=r.match(/([\s]|[^\\]|\\\\)+/g))&&(t+=a[0]),"\\"===r.peek()){if(r.next(),"x"===r.peek())a=r.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==r.peek()){t+="\\",r.hasNext()&&(t+=r.next());continue}(a=r.match(/u([0-9A-Fa-f]{4})/g))||(a=r.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!a)return e;if((n=parseInt(a[1],16))>126&&n<=255&&0===a[0].indexOf("x"))return e;t+=n>=0&&n<32||n>1114111?"\\"+a[0]:34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return t}(t)),this._input.peek()===e&&(t+=this._input.next()),t=t.replace(o.allLineBreaks,"\n"),this._create_token(h.STRING,t)}return null},w.prototype._allow_regexp_or_xml=function(e){return e.type===h.RESERVED&&c(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===h.END_EXPR&&")"===e.text&&e.opened.previous.type===h.RESERVED&&c(e.opened.previous.text,["if","while","for"])||c(e.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},w.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),i=!1,r=!1;this._input.hasNext()&&(i||r||this._input.peek()!==e)&&!this._input.testChar(o.newline);)n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?r=!0:"]"===this._input.peek()&&(r=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(o.identifier)),this._create_token(h.STRING,n)}return null},w.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",i=this.__patterns.xml.read_match();if(i){for(var r=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),a=0===r.indexOf("{"),s=0;i;){var l=!!i[1],u=i[2];if(!(!!i[i.length-1]||"![CDATA["===u.slice(0,8))&&(u===r||a&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--s:++s),n+=i[0],s<=0)break;i=this.__patterns.xml.read_match()}return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(o.allLineBreaks,"\n"),this._create_token(h.STRING,n)}}return null},w.prototype._read_string_recursive=function(e,t,n){var i,r;"'"===e?r=this.__patterns.single_quote:'"'===e?r=this.__patterns.double_quote:"`"===e?r=this.__patterns.template_text:"}"===e&&(r=this.__patterns.template_expression);for(var a=r.read(),s="";this._input.hasNext();){if((s=this._input.next())===e||!t&&o.newline.test(s)){this._input.back();break}"\\"===s&&this._input.hasNext()?("x"===(i=this._input.peek())||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),s+=this._input.next()):n&&("${"===n&&"$"===s&&"{"===this._input.peek()&&(s+=this._input.next()),n===s&&(s+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(s+=this._input.next()))),a+=s+=r.read()}return a},e.exports.Tokenizer=w,e.exports.TOKEN=h,e.exports.positionable_operators=g.slice(),e.exports.line_starters=b.slice()},function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},n.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},n.prototype.__match=function(e,n){e.lastIndex=n;var i=e.exec(this.__input);return!i||t&&e.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},n.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},n.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(e,t,n){var i,r="";return e&&(i=this.match(e))&&(r+=i[0]),!t||!i&&e||(r+=this.readUntil(t,n)),r},n.prototype.readUntil=function(e,t){var n,i=this.__position;e.lastIndex=this.__position;var r=e.exec(this.__input);return r?(i=r.index,t&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},n.prototype.get_regexp=function(e,n){var i=null,r="g";return n&&t&&(r="y"),"string"==typeof e&&""!==e?i=new RegExp(e,r):e&&(i=new RegExp(e.source,r)),i},n.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},n.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},function(e,t,n){var i=n(8).InputScanner,r=n(3).Token,a=n(10).TokenStream,s=n(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new i(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new a,this._reset();for(var t=new r(o.START,""),n=null,i=[],s=new a;t.type!==o.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new a),e.parent=n,this._is_opening(e)?(i.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=i.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(o.RAW,n):this._create_token(o.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new r(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=o},function(e){function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position<this.__tokens_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},t.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},e.exports.TokenStream=t},function(e,t,n){var i=n(12).Pattern;function r(e,t){i.call(this,e,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new i,r.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},r.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,i=[],r=e.exec(t);r;)i.push(t.substring(n,r.index)),n=r.index+r[0].length,r=e.exec(t);return n<t.length?i.push(t.substring(n,t.length)):i.push(""),i},e.exports.WhitespacePattern=r},function(e){function t(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}t.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},t.prototype.read_match=function(){return this._input.match(this._match_pattern)},t.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){},e.exports.Pattern=t},function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},function(e,t,n){var i=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function a(e,t){i.call(this,e,t),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var n=new i(e);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new i,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},a.prototype.read_options=function(e){var t=this._create();for(var n in r)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},a.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},a.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},a.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},a.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},e.exports.TemplatablePattern=a}],t={};var n=function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(0);i=n}();var r=i;void 0===(n=function(){return{js_beautify:r}}.apply(t,[]))||(e.exports=n)}()},75918:function(e,t,n){"use strict";n.d(t,{Wi:function(){return l},Z0:function(){return u},aU:function(){return o},eZ:function(){return h},wY:function(){return c}});var i=n(4348),r=n(69323),a=n(13268),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}l((i=i.apply(e,t||[])).next())}))};class o extends r.JT{constructor(e,t="",n="",r=!0,a){super(),this._onDidChange=this._register(new i.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return s(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class l extends r.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new i.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new i.Q5),this.onDidRun=this._onDidRun.event}run(e,t){return s(this,void 0,void 0,(function*(){if(!e.enabled)return;let n;this._onBeforeRun.fire({action:e});try{yield this.runAction(e,t)}catch(e){n=e}this._onDidRun.fire({action:e,error:n})}))}runAction(e,t){return s(this,void 0,void 0,(function*(){yield e.run(t)}))}}class u extends o{constructor(e){super(u.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}u.ID="vs.actions.separator";class c{constructor(e,t,n,i){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=e,this.label=t,this.class=i,this._actions=n}get actions(){return this._actions}dispose(){}run(){return s(this,void 0,void 0,(function*(){}))}}class h extends o{constructor(){super(h.ID,a.N("submenu.empty","(empty)"),void 0,!1)}}h.ID="vs.actions.empty"},76068:function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}n.d(t,{ok:function(){return i}})},52615:function(e,t,n){"use strict";n.d(t,{CM:function(){return s},JL:function(){return o},dT:function(){return u},fK:function(){return a},lA:function(){return l}});var i=n(4348);const r=new class{constructor(){this._icons=new Map,this._onDidRegister=new i.Q5}add(e){const t=this._icons.get(e.id);t?e.description?t.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}},a=r;function s(e,t){return new l(e,t)}function o(e){return e?e.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():""}class l{constructor(e,t,n){this.id=e,this.definition=t,this.description=n,r.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var u;!function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function n(e){if(e instanceof l)return["codicon","codicon-"+e.id];const i=t.exec(e.id);if(!i)return n(l.error);let[,r,a]=i;const s=["codicon","codicon-"+r];return a&&s.push("codicon-modifier-"+a.substr(1)),s}e.asClassNameArray=n,e.asClassName=function(e){return n(e).join(" ")},e.asCSSSelector=function(e){return"."+n(e).join(".")}}(u||(u={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(l||(l={}))},79881:function(e,t,n){"use strict";n.d(t,{B8:function(){return d},Cp:function(){return a},F0:function(){return u},L6:function(){return h},VV:function(){return l},b1:function(){return c},dL:function(){return r},ri:function(){return s}});const i=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function r(e){l(e)||i.onUnexpectedError(e)}function a(e){l(e)||i.onUnexpectedExternalError(e)}function s(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e}const o="Canceled";function l(e){return e instanceof Error&&e.name===o&&e.message===o}function u(){const e=new Error(o);return e.name=e.message,e}function c(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function h(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class d extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}},4348:function(e,t,n){"use strict";n.d(t,{D0:function(){return h},E7:function(){return d},K3:function(){return c},Q5:function(){return u},ZD:function(){return f},ju:function(){return i}});var i,r=n(79881),a=n(69323),s=n(34502),o=n(95830);!function(e){function t(e){return(t,n=null,i)=>{let r,a=!1;return r=e((e=>{if(!a)return r?r.dispose():a=!0,t.call(n,e)}),null,i),a&&r.dispose(),r}}function n(e,t){return o(((n,i=null,r)=>e((e=>n.call(i,t(e))),null,r)))}function i(e,t){return o(((n,i=null,r)=>e((e=>{t(e),n.call(i,e)}),null,r)))}function r(e,t){return o(((n,i=null,r)=>e((e=>t(e)&&n.call(i,e)),null,r)))}function s(e,t,i){let r=i;return n(e,(e=>(r=t(r,e),r)))}function o(e){let t;const n=new u({onFirstListenerAdd(){t=e(n.fire,n)},onLastListenerRemove(){t.dispose()}});return n.event}function l(e,t,n=100,i=!1,r){let a,s,o,l=0;const c=new u({leakWarningThreshold:r,onFirstListenerAdd(){a=e((e=>{l++,s=t(s,e),i&&!o&&(c.fire(s),s=void 0),clearTimeout(o),o=setTimeout((()=>{const e=s;s=void 0,o=void 0,(!i||l>1)&&c.fire(e),l=0}),n)}))},onLastListenerRemove(){a.dispose()}});return c.event}function c(e,t=((e,t)=>e===t)){let n,i=!0;return r(e,(e=>{const r=i||!t(e,n);return i=!1,n=e,r}))}e.None=()=>a.JT.None,e.once=t,e.map=n,e.forEach=i,e.filter=r,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,i)=>(0,a.F8)(...e.map((e=>e((e=>t.call(n,e)),null,i))))},e.reduce=s,e.debounce=l,e.latch=c,e.split=function(t,n){return[e.filter(t,n),e.filter(t,(e=>!n(e)))]},e.buffer=function(e,t=!1,n=[]){let i=n.slice(),r=e((e=>{i?i.push(e):s.fire(e)}));const a=()=>{i&&i.forEach((e=>s.fire(e))),i=null},s=new u({onFirstListenerAdd(){r||(r=e((e=>s.fire(e))))},onFirstListenerDidAdd(){i&&(t?setTimeout(a):a())},onLastListenerRemove(){r&&r.dispose(),r=null}});return s.event};class h{constructor(e){this.event=e}map(e){return new h(n(this.event,e))}forEach(e){return new h(i(this.event,e))}filter(e){return new h(r(this.event,e))}reduce(e,t){return new h(s(this.event,e,t))}latch(){return new h(c(this.event))}debounce(e,t=100,n=!1,i){return new h(l(this.event,e,t,n,i))}on(e,t,n){return this.event(e,t,n)}once(e,n,i){return t(this.event)(e,n,i)}}e.chain=function(e){return new h(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>r.fire(n(...e)),r=new u({onFirstListenerAdd:()=>e.on(t,i),onLastListenerRemove:()=>e.removeListener(t,i)});return r.event},e.fromDOMEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>r.fire(n(...e)),r=new u({onFirstListenerAdd:()=>e.addEventListener(t,i),onLastListenerRemove:()=>e.removeEventListener(t,i)});return r.event},e.toPromise=function(e){return new Promise((n=>t(e)(n)))}}(i||(i={}));class l{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${l._idPool++}`}start(e){this._stopWatch=new o.G(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}l._idPool=0;class u{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new l(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,n)=>{var i;this._listeners||(this._listeners=new s.S);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(t?[e,t]:e);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const l=null===(i=this._leakageMon)||void 0===i?void 0:i.check(this._listeners.size),u=(0,a.OF)((()=>{if(l&&l(),!this._disposed&&(o(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}));return n instanceof a.SL?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}fire(e){var t,n;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new s.S);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){(0,r.dL)(e)}}null===(n=this._perfMon)||void 0===n||n.stop()}}dispose(){var e,t,n,i,r;this._disposed||(this._disposed=!0,null===(e=this._listeners)||void 0===e||e.clear(),null===(t=this._deliveryQueue)||void 0===t||t.clear(),null===(i=null===(n=this._options)||void 0===n?void 0:n.onLastListenerRemove)||void 0===i||i.call(n),null===(r=this._leakageMon)||void 0===r||r.dispose())}}class c extends u{constructor(e){super(e),this._isPaused=0,this._eventQueue=new s.S,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class h extends c{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class d{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,i)=>e((e=>{const i=this.buffers[this.buffers.length-1];i?i.push((()=>t.call(n,e))):t.call(n,e)}),void 0,i)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach((e=>e())),n}}class f{constructor(){this.listening=!1,this.inputEvent=i.None,this.inputEventListener=a.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(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(e,t,n){"use strict";function i(e){const t=this;let n,i=!1;return function(){return i||(i=!0,n=e.apply(t,arguments)),n}}n.d(t,{I:function(){return i}})},88226:function(e,t,n){"use strict";var i;n.d(t,{$:function(){return i}}),function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.find=function(e,t){for(const n of e)if(t(n))return n},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){let n=0;for(const i of e)yield t(i,n++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.concatNested=function*(e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,n){let i=n;for(const n of e)i=t(i,n);return i},e.slice=function*(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]},e.consume=function(t,n=Number.POSITIVE_INFINITY){const i=[];if(0===n)return[i,t];const r=t[Symbol.iterator]();for(let t=0;t<n;t++){const t=r.next();if(t.done)return[i,e.empty()];i.push(t.value)}return[i,{[Symbol.iterator](){return r}}]},e.equals=function(e,t,n=((e,t)=>e===t)){const i=e[Symbol.iterator](),r=t[Symbol.iterator]();for(;;){const e=i.next(),t=r.next();if(e.done!==t.done)return!1;if(e.done)return!0;if(!n(e.value,t.value))return!1}}}(i||(i={}))},69323:function(e,t,n){"use strict";n.d(t,{B9:function(){return d},F8:function(){return f},JT:function(){return g},Jz:function(){return v},OF:function(){return p},SL:function(){return m},Wf:function(){return h},XK:function(){return _},dk:function(){return u}});var i=n(17845),r=n(88226);let a=null;function s(e){return null==a||a.trackDisposable(e),e}function o(e){null==a||a.markAsDisposed(e)}function l(e,t){null==a||a.setParent(e,t)}function u(e){return null==a||a.markAsSingleton(e),e}class c extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function h(e){return"function"==typeof e.dispose&&0===e.dispose.length}function d(e){if(r.$.is(e)){let t=[];for(const n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new c(t);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function f(...e){const t=p((()=>d(e)));return function(e,t){if(a)for(const n of e)a.setParent(n,t)}(e,t),t}function p(e){const t=s({dispose:(0,i.I)((()=>{o(t),e()}))});return t}class m{constructor(){this._toDispose=new Set,this._isDisposed=!1,s(this)}dispose(){this._isDisposed||(o(this),this._isDisposed=!0,this.clear())}clear(){try{d(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return l(e,this),this._isDisposed?m.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(e),e}}m.DISABLE_DISPOSED_WARNING=!1;class g{constructor(){this._store=new m,s(this),l(this._store,this)}dispose(){o(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}g.None=Object.freeze({dispose(){}});class _{constructor(){this._isDisposed=!1,s(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&l(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,o(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e&&l(e,null),e}}class v{constructor(e){this.object=e}dispose(){}}},34502:function(e,t,n){"use strict";n.d(t,{S:function(){return r}});class i{constructor(e){this.element=e,this.next=i.Undefined,this.prev=i.Undefined}}i.Undefined=new i(void 0);class r{constructor(){this._first=i.Undefined,this._last=i.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===i.Undefined}clear(){let e=this._first;for(;e!==i.Undefined;){const t=e.next;e.prev=i.Undefined,e.next=i.Undefined,e=t}this._first=i.Undefined,this._last=i.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new i(e);if(this._first===i.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==i.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==i.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==i.Undefined&&e.next!==i.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===i.Undefined&&e.next===i.Undefined?(this._first=i.Undefined,this._last=i.Undefined):e.next===i.Undefined?(this._last=this._last.prev,this._last.next=i.Undefined):e.prev===i.Undefined&&(this._first=this._first.next,this._first.prev=i.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==i.Undefined;)yield e.element,e=e.next}}},23345:function(e,t,n){"use strict";n.d(t,{$L:function(){return S},ED:function(){return x},IJ:function(){return w},OS:function(){return R},WE:function(){return C},dz:function(){return E},gn:function(){return A},li:function(){return _},r:function(){return k},tY:function(){return T},xS:function(){return L}});var i,r=n(97671);const a="en";let s,o,l=!1,u=!1,c=!1,h=!1,d=!1,f=!1,p=!1,m=null,g=null;const _="object"==typeof self?self:"object"==typeof n.g?n.g:{};let v;void 0!==_.vscode&&void 0!==_.vscode.process?v=_.vscode.process:void 0!==r&&(v=r);const y="string"==typeof(null===(i=null==v?void 0:v.versions)||void 0===i?void 0:i.electron)&&"renderer"===v.type;if("object"!=typeof navigator||y)if("object"==typeof v){l="win32"===v.platform,u="darwin"===v.platform,c="linux"===v.platform,h=c&&!!v.env.SNAP&&!!v.env.SNAP_REVISION,s=a,m=a;const e=v.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];s=t.locale,m=n||a,g=t._translationsConfigFile}catch(e){}d=!0}else console.error("Unable to resolve platform.");else o=navigator.userAgent,l=o.indexOf("Windows")>=0,u=o.indexOf("Macintosh")>=0,p=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,c=o.indexOf("Linux")>=0,f=!0,s=navigator.language,m=s;let b=0;u?b=1:l?b=3:c&&(b=2);const x=l,E=u,w=c,T=d,S=f,A=p,C=o,L=function(){if(_.setImmediate)return _.setImmediate.bind(_);if("function"==typeof _.postMessage&&!_.importScripts){let e=[];_.addEventListener("message",(t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let n=0,i=e.length;n<i;n++){const i=e[n];if(i.id===t.data.vscodeSetImmediateId)return e.splice(n,1),void i.callback()}}));let t=0;return n=>{const i=++t;e.push({id:i,callback:n}),_.postMessage({vscodeSetImmediateId:i},"*")}}if("function"==typeof(null==v?void 0:v.nextTick))return v.nextTick.bind(v);const e=Promise.resolve();return t=>e.then(t)}(),R=u||p?2:l?1:3;let I=!0,D=!1;function k(){if(!D){D=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);I=513===t[0]}return I}},95830:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var i=n(23345);const r=i.li.performance&&"function"==typeof i.li.performance.now;class a{constructor(e){this._highResolution=r&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new a(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?i.li.performance.now():Date.now()}}},82983:function(e,t,n){"use strict";function i(e){return!e||"string"!=typeof e||0===e.trim().length}n.d(t,{$i:function(){return j},C8:function(){return K},GF:function(){return f},HO:function(){return N},IO:function(){return p},K7:function(){return Z},Kw:function(){return Y},LC:function(){return _},Mh:function(){return L},P1:function(){return R},PJ:function(){return Q},Qe:function(){return H},R1:function(){return d},RP:function(){return G},S6:function(){return $},TT:function(){return x},Ut:function(){return B},V8:function(){return v},WU:function(){return a},YK:function(){return D},YU:function(){return s},ZG:function(){return I},ZH:function(){return M},ab:function(){return V},c1:function(){return q},df:function(){return S},ec:function(){return o},fi:function(){return J},fy:function(){return l},j3:function(){return u},j_:function(){return w},m5:function(){return i},mK:function(){return T},mr:function(){return m},oH:function(){return te},oL:function(){return c},ok:function(){return C},ow:function(){return y},qq:function(){return A},qu:function(){return b},rL:function(){return k},uS:function(){return X},un:function(){return h},uq:function(){return g},vH:function(){return O},xe:function(){return W},zY:function(){return E}});const r=/{(\d+)}/g;function a(e,...t){return 0===t.length?e:e.replace(r,(function(e,n){const i=parseInt(n,10);return isNaN(i)||i<0||i>=t.length?e:t[i]}))}function s(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}}))}function o(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function l(e,t=" "){return c(u(e,t),t)}function u(e,t){if(!e||!t)return e;const n=t.length;if(0===n||0===e.length)return e;let i=0;for(;e.indexOf(t,i)===i;)i+=n;return e.substring(i)}function c(e,t){if(!e||!t)return e;const n=t.length,i=e.length;if(0===n||0===i)return e;let r=i,a=-1;for(;a=e.lastIndexOf(t,r-1),-1!==a&&a+n===r;){if(0===a)return"";r=a}return e.substring(0,r)}function h(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(e){return e.replace(/\*/g,"")}function f(e,t,n={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=o(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),n.unicode&&(i+="u"),new RegExp(e,i)}function p(e){if("^"===e.source||"^$"===e.source||"$"===e.source||"^\\s*$"===e.source)return!1;return!(!e.exec("")||0!==e.lastIndex)}function m(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function g(e){return e.split(/\r\n|\r|\n/)}function _(e){for(let t=0,n=e.length;t<n;t++){const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}return-1}function v(e,t=0,n=e.length){for(let i=t;i<n;i++){const n=e.charCodeAt(i);if(32!==n&&9!==n)return e.substring(t,i)}return e.substring(t,n)}function y(e,t=e.length-1){for(let n=t;n>=0;n--){const t=e.charCodeAt(n);if(32!==t&&9!==t)return n}return-1}function b(e,t){return e<t?-1:e>t?1:0}function x(e,t,n=0,i=e.length,r=0,a=t.length){for(;n<i&&r<a;n++,r++){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(i<a)return-1;if(i>a)return 1}const s=i-n,o=a-r;return s<o?-1:s>o?1:0}function E(e,t){return w(e,t,0,e.length,0,t.length)}function w(e,t,n=0,i=e.length,r=0,a=t.length){for(;n<i&&r<a;n++,r++){let s=e.charCodeAt(n),o=t.charCodeAt(r);if(s===o)continue;if(s>=128||o>=128)return x(e.toLowerCase(),t.toLowerCase(),n,i,r,a);T(s)&&(s-=32),T(o)&&(o-=32);const l=s-o;if(0!==l)return l}const s=i-n,o=a-r;return s<o?-1:s>o?1:0}function T(e){return e>=97&&e<=122}function S(e){return e>=65&&e<=90}function A(e,t){return e.length===t.length&&0===w(e,t)}function C(e,t){const n=t.length;return!(t.length>e.length)&&0===w(e,t,0,n)}function L(e,t){let n,i=Math.min(e.length,t.length);for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function R(e,t){let n,i=Math.min(e.length,t.length);const r=e.length-1,a=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(r-n)!==t.charCodeAt(a-n))return n;return i}function I(e){return 55296<=e&&e<=56319}function D(e){return 56320<=e&&e<=57343}function k(e,t){return t-56320+(e-55296<<10)+65536}function M(e,t,n){const i=e.charCodeAt(n);if(I(i)&&n+1<t){const t=e.charCodeAt(n+1);if(D(t))return k(i,t)}return i}function P(e,t){const n=e.charCodeAt(t-1);if(D(n)&&t>1){const i=e.charCodeAt(t-2);if(I(i))return k(i,n)}return n}function O(e,t){const n=ee.getInstance(),i=t,r=e.length,a=M(e,r,t);t+=a>=65536?2:1;let s=n.getGraphemeBreakType(a);for(;t<r;){const i=M(e,r,t),a=n.getGraphemeBreakType(i);if(J(s,a))break;t+=i>=65536?2:1,s=a}return t-i}function N(e,t){const n=ee.getInstance(),i=t,r=P(e,t);t-=r>=65536?2:1;let a=n.getGraphemeBreakType(r);for(;t>0;){const i=P(e,t),r=n.getGraphemeBreakType(i);if(J(r,a))break;t-=i>=65536?2:1,a=r}return i-t}const F=/(?:[\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 B(e){return F.test(e)}const U=/(?:[\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 G(e){return U.test(e)}const z=/^[\t\n\r\x20-\x7E]*$/;function j(e){return z.test(e)}const H=/[\u2028\u2029]/;function V(e){return H.test(e)}function W(e){for(let t=0,n=e.length;t<n;t++)if(Z(e.charCodeAt(t)))return!0;return!1}function Z(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function K(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129003||e>=129280&&e<=129535||e>=129648&&e<=129750}const q=String.fromCharCode(65279);function X(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Y(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)}function Q(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function $(e){return ee.getInstance().getGraphemeBreakType(e)}function J(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}class ee{constructor(){this._data=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]")}static getInstance(){return ee._INSTANCE||(ee._INSTANCE=new ee),ee._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let i=1;for(;i<=n;)if(e<t[3*i])i*=2;else{if(!(e>t[3*i+1]))return t[3*i+2];i=2*i+1}return 0}}function te(e,t){if(0===e)return 0;const n=function(e,t){let n=P(t,e);e-=ne(n);for(;ie(n)||65039===n||8419===n;){if(0===e)return;n=P(t,e),e-=ne(n)}if(!K(n))return;if(e>=0){const n=P(t,e);8205===n&&(e-=ne(n))}return e}(e,t);if(void 0!==n)return n;return e-=ne(P(t,e))}function ne(e){return e>=65536?2:1}function ie(e){return 127995<=e&&e<=127999}ee._INSTANCE=null},72999:function(e,t,n){"use strict";function i(e){return Array.isArray(e)}function r(e){return"string"==typeof e}function a(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function s(e){return"number"==typeof e&&!isNaN(e)}function o(e){return!0===e||!1===e}function l(e){return void 0===e}function u(e){return!c(e)}function c(e){return l(e)||null===e}function h(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function d(e){if(c(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function f(e){return"function"==typeof e}function p(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)m(e[i],t[i])}function m(e,t){if(r(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(f(t)){try{if(e instanceof t)return}catch(e){}if(!c(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function g(e){const t=[];for(const n of function(e){let t=[],n=Object.getPrototypeOf(e);for(;Object.prototype!==n;)t=t.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return t}(e))"function"==typeof e[n]&&t.push(n);return t}function _(e,t){const n=e=>function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)};let i={};for(const t of e)i[t]=n(t);return i}function v(e){return null===e?void 0:e}function y(e,t="Unreachable"){throw new Error(t)}n.d(t,{$E:function(){return g},$K:function(){return u},D8:function(){return p},HD:function(){return r},IU:function(){return _},Jp:function(){return c},Kn:function(){return a},cW:function(){return d},f6:function(){return v},hj:function(){return s},jn:function(){return o},kJ:function(){return i},mf:function(){return f},o8:function(){return l},p_:function(){return h},vE:function(){return y}})},13268:function(e,t,n){"use strict";function i(e,t,...n){return function(e,t){let n;return n=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,n){const i=n[0];return void 0!==t[i]?t[i]:e})),n}(t,n)}n.d(t,{N:function(){return i}})},96236:function(e,t,n){"use strict";n.d(t,{BH:function(){return v},NZ:function(){return y},U8:function(){return b},co:function(){return _},eH:function(){return g},vr:function(){return m}});var i=n(75918),r=n(52615),a=n(4348),s=n(88226),o=n(69323),l=n(34502),u=n(35884),c=n(90689),h=n(16925),d=n(49055),f=function(e,t,n,i){var r,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,n,s):r(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s},p=function(e,t){return function(n,i){t(n,i,e)}};function m(e){return void 0!==e.command}class g{constructor(e){this.id=g._idPool++,this._debugName=e}}g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.SimpleEditorContext=new g("SimpleEditorContext"),g.EditorContextCopy=new g("EditorContextCopy"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarCopy=new g("MenubarCopy"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),g.InlineCompletionsActions=new g("InlineCompletionsActions");const _=(0,h.yh)("menuService"),v=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new a.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===g.CommandPalette}}addCommand(e){return this.addCommands(s.$.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,o.OF)((()=>{let t=!1;for(const n of e)t=this._commands.delete(n.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,n)=>e.set(n,t))),e}appendMenuItem(e,t){return this.appendMenuItems(s.$.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,n=new l.S;for(const{id:i,item:r}of e){let e=this._menuItems.get(i);e||(e=new l.S,this._menuItems.set(i,e)),n.push(e.push(r)),t.add(i)}return this._onDidChangeMenu.fire(t),(0,o.OF)((()=>{if(n.size>0){for(let e of n)e();this._onDidChangeMenu.fire(t),n.clear()}}))}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===g.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const n of e)m(n)&&(t.add(n.command.id),n.alt&&t.add(n.alt.id));this._commands.forEach(((n,i)=>{t.has(i)||e.push({command:n})}))}};class y extends i.wY{constructor(e,t,n,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=n,this._options=i}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),n=t.getActions(this._options);t.dispose();for(const[,t]of n)t.length>0&&(e.push(...t),e.push(new i.Z0));return e.length&&e.pop(),e}}let b=class e{constructor(t,n,i,a,s){var o,l;if(this._commandService=s,this.id=t.id,this.label=(null==i?void 0:i.renderShortTitle)&&t.shortTitle?"string"==typeof t.shortTitle?t.shortTitle:t.shortTitle.value:"string"==typeof t.title?t.title:t.title.value,this.tooltip=null!==(l="string"==typeof t.tooltip?t.tooltip:null===(o=t.tooltip)||void 0===o?void 0:o.value)&&void 0!==l?l:"",this.enabled=!t.precondition||a.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=a.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=n?new e(n,void 0,i,a,s):void 0,this._options=i,d.kS.isThemeIcon(t.icon)&&(this.class=r.dT.asClassName(t.icon))}dispose(){}run(...e){var t,n;let i=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(i=[...i,this._options.arg]),(null===(n=this._options)||void 0===n?void 0:n.shouldForwardArgs)&&(i=[...i,...e]),this._commandService.executeCommand(this.id,...i)}};b=f([p(3,c.i6),p(4,u.H)],b)},35884:function(e,t,n){"use strict";n.d(t,{H:function(){return l},P:function(){return u}});var i=n(4348),r=n(88226),a=n(69323),s=n(34502),o=n(72999);const l=(0,n(16925).yh)("commandService"),u=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new i.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(let n of e.description.args)t.push(n.constraint);const n=e.handler;e.handler=function(e,...i){return(0,o.D8)(i,t),n(e,...i)}}const{id:n}=e;let i=this._commands.get(n);i||(i=new s.S,this._commands.set(n,i));let r=i.unshift(e),l=(0,a.OF)((()=>{r();const e=this._commands.get(n);(null==e?void 0:e.isEmpty())&&this._commands.delete(n)}));return this._onDidRegisterCommand.fire(n),l}registerCommandAlias(e,t){return u.registerCommand(e,((e,...n)=>e.get(l).executeCommand(t,...n)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return r.$.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const n=this.getCommand(t);n&&e.set(t,n)}return e}};u.registerCommand("noop",(()=>{}))},90689:function(e,t,n){"use strict";n.d(t,{Ao:function(){return u},Eq:function(){return k},Fb:function(){return c},K8:function(){return O},i6:function(){return D},uy:function(){return I}});var i=n(23345),r=n(82983),a=n(16925);let s=i.WE||"";const o=new Map;o.set("false",!1),o.set("true",!0),o.set("isMac",i.dz),o.set("isLinux",i.IJ),o.set("isWindows",i.ED),o.set("isWeb",i.$L),o.set("isMacNative",i.dz&&!i.$L),o.set("isEdge",s.indexOf("Edg/")>=0),o.set("isFirefox",s.indexOf("Firefox")>=0),o.set("isChrome",s.indexOf("Chrome")>=0),o.set("isSafari",s.indexOf("Safari")>=0);const l=Object.prototype.hasOwnProperty;class u{static has(e){return p.create(e)}static equals(e,t){return m.create(e,t)}static regex(e,t){return S.create(e,t)}static not(e){return y.create(e)}static and(...e){return L.create(e,null)}static or(...e){return R.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let n=e.split("||");return R.create(n.map((e=>this._deserializeAndExpression(e,t))),null,!0)}static _deserializeAndExpression(e,t){let n=e.split("&&");return L.create(n.map((e=>this._deserializeOne(e,t))),null)}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){let n=e.split("!=");return v.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("==")>=0){let n=e.split("==");return m.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("=~")>=0){let n=e.split("=~");return S.create(n[0].trim(),this._deserializeRegexValue(n[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return g.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return E.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return x.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return T.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return w.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?y.create(e.substr(1).trim()):p.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;let n=/^'([^']*)'$/.exec(e);return n?n[1].trim():e}static _deserializeRegexValue(e,t){if((0,r.m5)(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let n=e.indexOf("/"),i=e.lastIndexOf("/");if(n===i||n<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let a=e.slice(n+1,i),s="i"===e[i+1]?"i":"";try{return new RegExp(a,s)}catch(n){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${n}`);return console.warn(`bad regexp-value '${e}', parse error: ${n}`),null}}}function c(e,t){const n=e?e.substituteConstants():void 0,i=t?t.substituteConstants():void 0;return!n&&!i||!(!n||!i)&&n.equals(i)}function h(e,t){return e.cmp(t)}class d{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return f.INSTANCE}}d.INSTANCE=new d;class f{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return d.INSTANCE}}f.INSTANCE=new f;class p{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const n=o.get(e);return"boolean"==typeof n?n?f.INSTANCE:d.INSTANCE:new p(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:M(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=o.get(this.key);return"boolean"==typeof e?e?f.INSTANCE:d.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this)),this.negated}}class m{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}static create(e,t,n=null){if("boolean"==typeof t)return t?p.create(e,n):y.create(e,n);const i=o.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?f.INSTANCE:d.INSTANCE}return new m(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=o.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?f.INSTANCE:d.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class g{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new g(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.indexOf(n)>=0:"string"==typeof n&&"object"==typeof t&&null!==t&&l.call(t,n)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=_.create(this)),this.negated}}class _{constructor(e){this._actual=e,this.type=11}static create(e){return new _(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class v{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}static create(e,t,n=null){if("boolean"==typeof t)return t?y.create(e,n):p.create(e,n);const i=o.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?d.INSTANCE:f.INSTANCE}return new v(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=o.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?d.INSTANCE:f.INSTANCE}return this}evaluate(e){return e.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 y{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const n=o.get(e);return"boolean"==typeof n?n?d.INSTANCE:f.INSTANCE:new y(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:M(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=o.get(this.key);return"boolean"==typeof e?e?d.INSTANCE:f.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function b(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):d.INSTANCE}class x{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}static create(e,t,n=null){return b(t,(t=>new x(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class E{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}static create(e,t,n=null){return b(t,(t=>new E(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class w{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}static create(e,t,n=null){return b(t,(t=>new w(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class T{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}static create(e,t,n=null){return b(t,(t=>new T(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class S{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new S(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return t<n?-1:t>n?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this)),this.negated}}class A{constructor(e){this._actual=e,this.type=8}static create(e){return new A(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function C(e){let t=null;for(let n=0,i=e.length;n<i;n++){const i=e[n].substituteConstants();if(e[n]!==i&&null===t){t=[];for(let i=0;i<n;i++)t[i]=e[i]}null!==t&&(t[n]=i)}return null===t?e:t}class L{constructor(e,t){this.expr=e,this.negated=t,this.type=6}static create(e,t){return L._normalizeArr(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){const n=h(this.expr[t],e.expr[t]);if(0!==n)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=C(this.expr);return e===this.expr?this:L.create(e,this.negated)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t){const n=[];let i=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return d.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else i=!0;if(0===n.length&&i)return f.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(h);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),i=0===n.length,r=R.create(e.expr.map((e=>L.create([e,t],null))),null,i);r&&(n.push(r),n.sort(h))}return 1===n.length?n[0]:new L(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=R.create(e,this,!0)}return this.negated}}class R{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,n){return R._normalizeArr(e,t,n)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){const n=h(this.expr[t],e.expr[t]);if(0!==n)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=C(this.expr);return e===this.expr?this:R.create(e,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,n){let i=[],r=!1;if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n)if(0!==n.type){if(1===n.type)return f.INSTANCE;9!==n.type?i.push(n):i=i.concat(n.expr)}else r=!0}if(0===i.length&&r)return d.INSTANCE;i.sort(h)}if(0!==i.length){if(1===i.length)return i[0];for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(1===i.length)return i[0];if(n){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)O(i[e],i[t])&&(i.splice(t,1),t--);if(1===i.length)return i[0]}return new R(i,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),i=[];for(const e of N(t))for(const t of N(n))i.push(L.create([e,t],null));const r=0===e.length;e.unshift(R.create(i,null,r))}this.negated=e[0]}return this.negated}}class I extends p{constructor(e,t,n){super(e,null),this._defaultValue=t,"object"==typeof n?I._info.push(Object.assign(Object.assign({},n),{key:e})):!0!==n&&I._info.push({key:e,description:n,type:null!=t?typeof t:void 0})}static all(){return I._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return m.create(this.key,e)}}I._info=[];const D=(0,a.yh)("contextKeyService"),k="setContext";function M(e,t){return e<t?-1:e>t?1:0}function P(e,t,n,i){return e<n?-1:e>n?1:t<i?-1:t>i?1:0}function O(e,t){if(6===t.type&&9!==e.type&&6!==e.type)for(const n of t.expr)if(e.equals(n))return!0;const n=N(e.negate()).concat(N(t));n.sort(h);for(let e=0;e<n.length;e++){const t=n[e].negate();for(let i=e+1;i<n.length;i++){const e=n[i];if(t.equals(e))return!0}}return!1}function N(e){return 9===e.type?e.expr:[e]}},16925:function(e,t,n){"use strict";var i;n.d(t,{I8:function(){return i},TG:function(){return r},jt:function(){return o},yh:function(){return s}}),function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(i||(i={}));const r=s("instantiationService");function a(e,t,n,r){t[i.DI_TARGET]===t?t[i.DI_DEPENDENCIES].push({id:e,index:n,optional:r}):(t[i.DI_DEPENDENCIES]=[{id:e,index:n,optional:r}],t[i.DI_TARGET]=t)}function s(e){if(i.serviceIds.has(e))return i.serviceIds.get(e);const t=function(e,n,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");a(t,e,i,!1)};return t.toString=()=>e,i.serviceIds.set(e,t),t}function o(e){return function(t,n,i){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");a(e,t,i,!0)}}},44650:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var i=n(76068),r=n(72999);const a=new class{constructor(){this.data=new Map}add(e,t){i.ok(r.HD(e)),i.ok(r.Kn(t)),i.ok(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}},66213:function(e,t,n){"use strict";var i;n.d(t,{e:function(){return i}}),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST="hc"}(i||(i={}))},49055:function(e,t,n){"use strict";n.d(t,{EN:function(){return d},IP:function(){return p},Ic:function(){return g},XE:function(){return u},bB:function(){return _},kS:function(){return h},m6:function(){return f}});var i=n(52615),r=n(4348),a=n(69323),s=n(16925),o=n(44650),l=n(66213);const u=(0,s.yh)("themeService");var c,h;function d(e){return{id:e}}function f(e){switch(e){case l.e.DARK:return"vs-dark";case l.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}!function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(c||(c={})),function(e){e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||c.isThemeColor(e.color))};const t=new RegExp(`^\\$\\((${i.dT.iconNameExpression}(?:${i.dT.iconModifierExpression})?)\\)$`);e.fromString=function(e){const n=t.exec(e);if(!n)return;let[,i]=n;return{id:i}},e.modify=function(e,t){let n=e.id;const i=n.lastIndexOf("~");return-1!==i&&(n=n.substring(0,i)),t&&(n=`${n}~${t}`),{id:n}},e.isEqual=function(e,t){var n,i;return e.id===t.id&&(null===(n=e.color)||void 0===n?void 0:n.id)===(null===(i=t.color)||void 0===i?void 0:i.id)},e.asThemeIcon=function(e,t){return{id:e.id,color:t?d(t):void 0}},e.asClassNameArray=i.dT.asClassNameArray,e.asClassName=i.dT.asClassName,e.asCSSSelector=i.dT.asCSSSelector}(h||(h={}));const p={ThemingContribution:"base.contributions.theming"};let m=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new r.Q5}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),(0,a.OF)((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function g(e){return m.onColorThemeChange(e)}o.B.add(p.ThemingContribution,m);class _ extends a.JT{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}},96478:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var i=n(54476),r=n(20068),a=n(42978),s=n(75931),o=n(65030),l=n(92310),u=n.n(l),c=n(8654),h=n(59301),d=n(10228),f=n(16089),p=d.Z.ESC,m=d.Z.TAB;var g=(0,h.forwardRef)((function(e,t){var n=e.overlay,i=e.arrow,r=e.prefixCls,a=(0,h.useMemo)((function(){return"function"==typeof n?n():n}),[n]),s=(0,c.sQ)(t,(0,c.C4)(a));return h.createElement(h.Fragment,null,i&&h.createElement("div",{className:"".concat(r,"-arrow")}),h.cloneElement(a,{ref:(0,c.Yr)(a)?s:void 0}))})),_={adjustX:1,adjustY:1},v=[0,0],y={topLeft:{points:["bl","tl"],overflow:_,offset:[0,-4],targetOffset:v},top:{points:["bc","tc"],overflow:_,offset:[0,-4],targetOffset:v},topRight:{points:["br","tr"],overflow:_,offset:[0,-4],targetOffset:v},bottomLeft:{points:["tl","bl"],overflow:_,offset:[0,4],targetOffset:v},bottom:{points:["tc","bc"],overflow:_,offset:[0,4],targetOffset:v},bottomRight:{points:["tr","br"],overflow:_,offset:[0,4],targetOffset:v}},b=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function x(e,t){var n,l=e.arrow,d=void 0!==l&&l,_=e.prefixCls,v=void 0===_?"rc-dropdown":_,x=e.transitionName,E=e.animation,w=e.align,T=e.placement,S=void 0===T?"bottomLeft":T,A=e.placements,C=void 0===A?y:A,L=e.getPopupContainer,R=e.showAction,I=e.hideAction,D=e.overlayClassName,k=e.overlayStyle,M=e.visible,P=e.trigger,O=void 0===P?["hover"]:P,N=e.autoFocus,F=e.overlay,B=e.children,U=e.onVisibleChange,G=(0,s.Z)(e,b),z=h.useState(),j=(0,a.Z)(z,2),H=j[0],V=j[1],W="visible"in e?M:H,Z=h.useRef(null),K=h.useRef(null),q=h.useRef(null);h.useImperativeHandle(t,(function(){return Z.current}));var X=function(e){V(e),null==U||U(e)};!function(e){var t=e.visible,n=e.triggerRef,i=e.onVisibleChange,r=e.autoFocus,a=e.overlayRef,s=h.useRef(!1),o=function(){var e,r;t&&(null===(e=n.current)||void 0===e||null===(r=e.focus)||void 0===r||r.call(e),null==i||i(!1))},l=function(){var e;return!(null===(e=a.current)||void 0===e||!e.focus||(a.current.focus(),s.current=!0,0))},u=function(e){switch(e.keyCode){case p:o();break;case m:var t=!1;s.current||(t=l()),t?e.preventDefault():o()}};h.useEffect((function(){return t?(window.addEventListener("keydown",u),r&&(0,f.Z)(l,3),function(){window.removeEventListener("keydown",u),s.current=!1}):function(){s.current=!1}}),[t])}({visible:W,triggerRef:q,onVisibleChange:X,autoFocus:N,overlayRef:K});var Y,Q,$,J=function(){return h.createElement(g,{ref:K,overlay:F,prefixCls:v,arrow:d})},ee=h.cloneElement(B,{className:u()(null===(n=B.props)||void 0===n?void 0:n.className,W&&(Y=e.openClassName,void 0!==Y?Y:"".concat(v,"-open"))),ref:(0,c.Yr)(B)?(0,c.sQ)(q,(0,c.C4)(B)):void 0}),te=I;return te||-1===O.indexOf("contextMenu")||(te=["click"]),h.createElement(o.Z,(0,i.Z)({builtinPlacements:C},G,{prefixCls:v,ref:Z,popupClassName:u()(D,(0,r.Z)({},"".concat(v,"-show-arrow"),d)),popupStyle:k,action:O,showAction:R,hideAction:te,popupPlacement:S,popupAlign:w,popupTransitionName:x,popupAnimation:E,popupVisible:W,stretch:(Q=e.minOverlayWidthMatchTrigger,$=e.alignPoint,("minOverlayWidthMatchTrigger"in e?Q:!$)?"minWidth":""),popup:"function"==typeof F?J:J(),onPopupVisibleChange:X,onPopupClick:function(t){var n=e.onOverlayClick;V(!1),n&&n(t)},getPopupContainer:L}),ee)}var E=h.forwardRef(x)},66003:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(75931),r=n(33885),a=n(76190),s=n(59301),o=["show"];function l(e,t){return s.useMemo((function(){var n={};t&&(n.show="object"===(0,a.Z)(t)&&t.formatter?t.formatter:!!t);var s=n=(0,r.Z)((0,r.Z)({},n),e),l=s.show,u=(0,i.Z)(s,o);return(0,r.Z)((0,r.Z)({},u),{},{show:!!l,showFormatter:"function"==typeof l?l:void 0,strategy:u.strategy||function(e){return e.length}})}),[e,t])}},36901:function(e,t,n){"use strict";n.r(t),n.d(t,{BaseInput:function(){return h},default:function(){return y}});var i=n(33885),r=n(54476),a=n(20068),s=n(76190),o=n(92310),l=n.n(o),u=n(59301),c=n(30292),h=u.forwardRef((function(e,t){var n,o,h,d=e.inputElement,f=e.children,p=e.prefixCls,m=e.prefix,g=e.suffix,_=e.addonBefore,v=e.addonAfter,y=e.className,b=e.style,x=e.disabled,E=e.readOnly,w=e.focused,T=e.triggerFocus,S=e.allowClear,A=e.value,C=e.handleReset,L=e.hidden,R=e.classes,I=e.classNames,D=e.dataAttrs,k=e.styles,M=e.components,P=e.onClear,O=null!=f?f:d,N=(null==M?void 0:M.affixWrapper)||"span",F=(null==M?void 0:M.groupWrapper)||"span",B=(null==M?void 0:M.wrapper)||"span",U=(null==M?void 0:M.groupAddon)||"span",G=(0,u.useRef)(null),z=(0,c.X3)(e),j=(0,u.cloneElement)(O,{value:A,className:l()(null===(n=O.props)||void 0===n?void 0:n.className,!z&&(null==I?void 0:I.variant))||null}),H=(0,u.useRef)(null);if(u.useImperativeHandle(t,(function(){return{nativeElement:H.current||G.current}})),z){var V=null;if(S){var W=!x&&!E&&A,Z="".concat(p,"-clear-icon"),K="object"===(0,s.Z)(S)&&null!=S&&S.clearIcon?S.clearIcon:"✖";V=u.createElement("button",{type:"button",tabIndex:-1,onClick:function(e){null==C||C(e),null==P||P()},onMouseDown:function(e){return e.preventDefault()},className:l()(Z,(0,a.Z)((0,a.Z)({},"".concat(Z,"-hidden"),!W),"".concat(Z,"-has-suffix"),!!g))},K)}var q="".concat(p,"-affix-wrapper"),X=l()(q,(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(p,"-disabled"),x),"".concat(q,"-disabled"),x),"".concat(q,"-focused"),w),"".concat(q,"-readonly"),E),"".concat(q,"-input-with-clear-btn"),g&&S&&A),null==R?void 0:R.affixWrapper,null==I?void 0:I.affixWrapper,null==I?void 0:I.variant),Y=(g||S)&&u.createElement("span",{className:l()("".concat(p,"-suffix"),null==I?void 0:I.suffix),style:null==k?void 0:k.suffix},V,g);j=u.createElement(N,(0,r.Z)({className:X,style:null==k?void 0:k.affixWrapper,onClick:function(e){var t;null!==(t=G.current)&&void 0!==t&&t.contains(e.target)&&(null==T||T())}},null==D?void 0:D.affixWrapper,{ref:G}),m&&u.createElement("span",{className:l()("".concat(p,"-prefix"),null==I?void 0:I.prefix),style:null==k?void 0:k.prefix},m),j,Y)}if((0,c.He)(e)){var Q="".concat(p,"-group"),$="".concat(Q,"-addon"),J="".concat(Q,"-wrapper"),ee=l()("".concat(p,"-wrapper"),Q,null==R?void 0:R.wrapper,null==I?void 0:I.wrapper),te=l()(J,(0,a.Z)({},"".concat(J,"-disabled"),x),null==R?void 0:R.group,null==I?void 0:I.groupWrapper);j=u.createElement(F,{className:te,ref:H},u.createElement(B,{className:ee},_&&u.createElement(U,{className:$},_),j,v&&u.createElement(U,{className:$},v)))}return u.cloneElement(j,{className:l()(null===(o=j.props)||void 0===o?void 0:o.className,y)||null,style:(0,i.Z)((0,i.Z)({},null===(h=j.props)||void 0===h?void 0:h.style),b),hidden:L})})),d=n(94480),f=n(42978),p=n(75931),m=n(18929),g=n(2738),_=n(66003),v=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],y=(0,u.forwardRef)((function(e,t){var n=e.autoComplete,s=e.onChange,o=e.onFocus,y=e.onBlur,b=e.onPressEnter,x=e.onKeyDown,E=e.onKeyUp,w=e.prefixCls,T=void 0===w?"rc-input":w,S=e.disabled,A=e.htmlSize,C=e.className,L=e.maxLength,R=e.suffix,I=e.showCount,D=e.count,k=e.type,M=void 0===k?"text":k,P=e.classes,O=e.classNames,N=e.styles,F=e.onCompositionStart,B=e.onCompositionEnd,U=(0,p.Z)(e,v),G=(0,u.useState)(!1),z=(0,f.Z)(G,2),j=z[0],H=z[1],V=(0,u.useRef)(!1),W=(0,u.useRef)(!1),Z=(0,u.useRef)(null),K=(0,u.useRef)(null),q=function(e){Z.current&&(0,c.nH)(Z.current,e)},X=(0,m.Z)(e.defaultValue,{value:e.value}),Y=(0,f.Z)(X,2),Q=Y[0],$=Y[1],J=null==Q?"":String(Q),ee=(0,u.useState)(null),te=(0,f.Z)(ee,2),ne=te[0],ie=te[1],re=(0,_.Z)(D,I),ae=re.max||L,se=re.strategy(J),oe=!!ae&&se>ae;(0,u.useImperativeHandle)(t,(function(){var e;return{focus:q,blur:function(){var e;null===(e=Z.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var i;null===(i=Z.current)||void 0===i||i.setSelectionRange(e,t,n)},select:function(){var e;null===(e=Z.current)||void 0===e||e.select()},input:Z.current,nativeElement:(null===(e=K.current)||void 0===e?void 0:e.nativeElement)||Z.current}})),(0,u.useEffect)((function(){W.current&&(W.current=!1),H((function(e){return(!e||!S)&&e}))}),[S]);var le=function(e,t,n){var i,r,a=t;if(!V.current&&re.exceedFormatter&&re.max&&re.strategy(t)>re.max)t!==(a=re.exceedFormatter(t,{max:re.max}))&&ie([(null===(i=Z.current)||void 0===i?void 0:i.selectionStart)||0,(null===(r=Z.current)||void 0===r?void 0:r.selectionEnd)||0]);else if("compositionEnd"===n.source)return;$(a),Z.current&&(0,c.rJ)(Z.current,e,s,a)};(0,u.useEffect)((function(){var e;ne&&(null===(e=Z.current)||void 0===e||e.setSelectionRange.apply(e,(0,d.Z)(ne)))}),[ne]);var ue,ce=function(e){le(e,e.target.value,{source:"change"})},he=function(e){V.current=!1,le(e,e.currentTarget.value,{source:"compositionEnd"}),null==B||B(e)},de=function(e){b&&"Enter"===e.key&&!W.current&&(W.current=!0,b(e)),null==x||x(e)},fe=function(e){"Enter"===e.key&&(W.current=!1),null==E||E(e)},pe=function(e){H(!0),null==o||o(e)},me=function(e){W.current&&(W.current=!1),H(!1),null==y||y(e)},ge=oe&&"".concat(T,"-out-of-range");return u.createElement(h,(0,r.Z)({},U,{prefixCls:T,className:l()(C,ge),handleReset:function(e){$(""),q(),Z.current&&(0,c.rJ)(Z.current,e,s)},value:J,focused:j,triggerFocus:q,suffix:function(){var e=Number(ae)>0;if(R||re.show){var t=re.showFormatter?re.showFormatter({value:J,count:se,maxLength:ae}):"".concat(se).concat(e?" / ".concat(ae):"");return u.createElement(u.Fragment,null,re.show&&u.createElement("span",{className:l()("".concat(T,"-show-count-suffix"),(0,a.Z)({},"".concat(T,"-show-count-has-suffix"),!!R),null==O?void 0:O.count),style:(0,i.Z)({},null==N?void 0:N.count)},t),R)}return null}(),disabled:S,classes:P,classNames:O,styles:N}),(ue=(0,g.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),u.createElement("input",(0,r.Z)({autoComplete:n},ue,{onChange:ce,onFocus:pe,onBlur:me,onKeyDown:de,onKeyUp:fe,className:l()(T,(0,a.Z)({},"".concat(T,"-disabled"),S),null==O?void 0:O.input),style:null==N?void 0:N.input,ref:Z,size:A,type:M,onCompositionStart:function(e){V.current=!0,null==F||F(e)},onCompositionEnd:he}))))}))},30292:function(e,t,n){"use strict";function i(e){return!(!e.addonBefore&&!e.addonAfter)}function r(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n){var i=t.cloneNode(!0),r=Object.create(e,{target:{value:i},currentTarget:{value:i}});return i.value=n,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(i.selectionStart=t.selectionStart,i.selectionEnd=t.selectionEnd),i.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},r}function s(e,t,n,i){if(n){var r=t;"click"!==t.type?"file"===e.type||void 0===i?n(r):n(r=a(t,e,i)):n(r=a(t,e,""))}}function o(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var i=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i)}}}}n.d(t,{He:function(){return i},X3:function(){return r},nH:function(){return o},rJ:function(){return s}})},28321:function(e,t,n){"use strict";n.d(t,{iz:function(){return Ge},ck:function(){return ye},BW:function(){return He},sN:function(){return ye},Wd:function(){return Be},ZP:function(){return Qe},Xl:function(){return L}});var i=n(54476),r=n(20068),a=n(33885),s=n(94480),o=n(42978),l=n(75931),u=n(92310),c=n.n(u),h=n(11780),d=n(18929),f=n(13697),p=n(48736),m=n(59301),g=n(4676),_=m.createContext(null);function v(e,t){return void 0===e?null:"".concat(e,"-").concat(t)}function y(e){return v(m.useContext(_),e)}var b=n(80547),x=["children","locked"],E=m.createContext(null);function w(e){var t=e.children,n=e.locked,i=(0,l.Z)(e,x),r=m.useContext(E),s=(0,b.Z)((function(){return e=r,t=i,n=(0,a.Z)({},e),Object.keys(t).forEach((function(e){var i=t[e];void 0!==i&&(n[e]=i)})),n;var e,t,n}),[r,i],(function(e,t){return!(n||e[0]===t[0]&&(0,f.Z)(e[1],t[1],!0))}));return m.createElement(E.Provider,{value:s},t)}var T=[],S=m.createContext(null);function A(){return m.useContext(S)}var C=m.createContext(T);function L(e){var t=m.useContext(C);return m.useMemo((function(){return void 0!==e?[].concat((0,s.Z)(t),[e]):t}),[t,e])}var R=m.createContext(null),I=m.createContext({}),D=n(29194);function k(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,D.Z)(e)){var n=e.nodeName.toLowerCase(),i=["input","select","textarea","button"].includes(n)||e.isContentEditable||"a"===n&&!!e.getAttribute("href"),r=e.getAttribute("tabindex"),a=Number(r),s=null;return r&&!Number.isNaN(a)?s=a:i&&null===s&&(s=0),i&&e.disabled&&(s=null),null!==s&&(s>=0||t&&s<0)}return!1}function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,s.Z)(e.querySelectorAll("*")).filter((function(e){return k(e,t)}));return k(e,t)&&n.unshift(e),n}var P=n(10228),O=n(16089),N=P.Z.LEFT,F=P.Z.RIGHT,B=P.Z.UP,U=P.Z.DOWN,G=P.Z.ENTER,z=P.Z.ESC,j=P.Z.HOME,H=P.Z.END,V=[B,U,N,F];function W(e,t){return M(e,!0).filter((function(e){return t.has(e)}))}function Z(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var r=W(e,t),a=r.length,s=r.findIndex((function(e){return n===e}));return i<0?-1===s?s=a-1:s-=1:i>0&&(s+=1),r[s=(s+a)%a]}var K=function(e,t){var n=new Set,i=new Map,r=new Map;return e.forEach((function(e){var a=document.querySelector("[data-menu-id='".concat(v(t,e),"']"));a&&(n.add(a),r.set(a,e),i.set(e,a))})),{elements:n,key2element:i,element2key:r}};function q(e,t,n,i,a,s,o,l,u,c){var h=m.useRef(),d=m.useRef();d.current=t;var f=function(){O.Z.cancel(h.current)};return m.useEffect((function(){return function(){f()}}),[]),function(p){var m=p.which;if([].concat(V,[G,z,j,H]).includes(m)){var g=s(),_=K(g,i),v=_,y=v.elements,b=v.key2element,x=v.element2key,E=function(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}(b.get(t),y),w=x.get(E),T=function(e,t,n,i){var a,s="prev",o="next",l="children",u="parent";if("inline"===e&&i===G)return{inlineTrigger:!0};var c=(0,r.Z)((0,r.Z)({},B,s),U,o),h=(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({},N,n?o:s),F,n?s:o),U,l),G,l),d=(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({},B,s),U,o),G,l),z,u),N,n?l:u),F,n?u:l);switch(null===(a={inline:c,horizontal:h,vertical:d,inlineSub:c,horizontalSub:d,verticalSub:d}["".concat(e).concat(t?"":"Sub")])||void 0===a?void 0:a[i]){case s:return{offset:-1,sibling:!0};case o:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case l:return{offset:1,sibling:!1};default:return null}}(e,1===o(w,!0).length,n,m);if(!T&&m!==j&&m!==H)return;(V.includes(m)||[j,H].includes(m))&&p.preventDefault();var S=function(e){if(e){var t=e,n=e.querySelector("a");null!=n&&n.getAttribute("href")&&(t=n);var i=x.get(e);l(i),f(),h.current=(0,O.Z)((function(){d.current===i&&t.focus()}))}};if([j,H].includes(m)||T.sibling||!E){var A,C,L=W(A=E&&"inline"!==e?function(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}(E):a.current,y);C=m===j?L[0]:m===H?L[L.length-1]:Z(A,y,E,T.offset),S(C)}else if(T.inlineTrigger)u(w);else if(T.offset>0)u(w,!0),f(),h.current=(0,O.Z)((function(){_=K(g,i);var e=E.getAttribute("aria-controls"),t=Z(document.getElementById(e),_.elements);S(t)}),5);else if(T.offset<0){var R=o(w,!0),I=R[R.length-2],D=b.get(I);u(I,!1),S(D)}}null==c||c(p)}}var X="__RC_UTIL_PATH_SPLIT__",Y=function(e){return e.join(X)},Q="rc-menu-more";function $(){var e=m.useState({}),t=(0,o.Z)(e,2)[1],n=(0,m.useRef)(new Map),i=(0,m.useRef)(new Map),r=m.useState([]),a=(0,o.Z)(r,2),l=a[0],u=a[1],c=(0,m.useRef)(0),h=(0,m.useRef)(!1),d=(0,m.useCallback)((function(e,r){var a=Y(r);i.current.set(a,e),n.current.set(e,a),c.current+=1;var s,o=c.current;s=function(){o===c.current&&(h.current||t({}))},Promise.resolve().then(s)}),[]),f=(0,m.useCallback)((function(e,t){var r=Y(t);i.current.delete(r),n.current.delete(e)}),[]),p=(0,m.useCallback)((function(e){u(e)}),[]),g=(0,m.useCallback)((function(e,t){var i=n.current.get(e)||"",r=i.split(X);return t&&l.includes(r[0])&&r.unshift(Q),r}),[l]),_=(0,m.useCallback)((function(e,t){return e.filter((function(e){return void 0!==e})).some((function(e){return g(e,!0).includes(t)}))}),[g]),v=(0,m.useCallback)((function(e){var t="".concat(n.current.get(e)).concat(X),r=new Set;return(0,s.Z)(i.current.keys()).forEach((function(e){e.startsWith(t)&&r.add(i.current.get(e))})),r}),[]);return m.useEffect((function(){return function(){h.current=!0}}),[]),{registerPath:d,unregisterPath:f,refreshOverflowKeys:p,isSubPathKey:_,getKeyPath:g,getKeys:function(){var e=(0,s.Z)(n.current.keys());return l.length&&e.push(Q),e},getSubPathKeys:v}}function J(e){var t=m.useRef(e);t.current=e;var n=m.useCallback((function(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return null===(e=t.current)||void 0===e?void 0:e.call.apply(e,[t].concat(i))}),[]);return e?n:void 0}var ee=Math.random().toFixed(5).toString().slice(2),te=0;var ne=n(67732),ie=n(83652),re=n(42403),ae=n(158),se=n(2738),oe=n(8654);function le(e,t,n,i){var r=m.useContext(E),a=r.activeKey,s=r.onActive,o=r.onInactive,l={active:a===e};return t||(l.onMouseEnter=function(t){null==n||n({key:e,domEvent:t}),s(e)},l.onMouseLeave=function(t){null==i||i({key:e,domEvent:t}),o(e)}),l}function ue(e){var t=m.useContext(E),n=t.mode,i=t.rtl,r=t.inlineIndent;if("inline"!==n)return null;return i?{paddingRight:e*r}:{paddingLeft:e*r}}function ce(e){var t,n=e.icon,i=e.props,r=e.children;return null===n||!1===n?null:("function"==typeof n?t=m.createElement(n,(0,a.Z)({},i)):"boolean"!=typeof n&&(t=n),t||r||null)}var he=["item"];function de(e){var t=e.item,n=(0,l.Z)(e,he);return Object.defineProperty(n,"item",{get:function(){return(0,p.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}var fe=["title","attribute","elementRef"],pe=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],me=["active"],ge=function(e){(0,re.Z)(n,e);var t=(0,ae.Z)(n);function n(){return(0,ne.Z)(this,n),t.apply(this,arguments)}return(0,ie.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.attribute,r=e.elementRef,a=(0,l.Z)(e,fe),s=(0,se.Z)(a,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,p.ZP)(!n,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),m.createElement(h.Z.Item,(0,i.Z)({},n,{title:"string"==typeof t?t:void 0},s,{ref:r}))}}]),n}(m.Component),_e=m.forwardRef((function(e,t){var n=e.style,o=e.className,u=e.eventKey,h=(e.warnKey,e.disabled),d=e.itemIcon,f=e.children,p=e.role,g=e.onMouseEnter,_=e.onMouseLeave,v=e.onClick,b=e.onKeyDown,x=e.onFocus,w=(0,l.Z)(e,pe),T=y(u),S=m.useContext(E),A=S.prefixCls,C=S.onItemClick,R=S.disabled,D=S.overflowDisabled,k=S.itemIcon,M=S.selectedKeys,O=S.onActive,N=m.useContext(I)._internalRenderMenuItem,F="".concat(A,"-item"),B=m.useRef(),U=m.useRef(),G=R||h,z=(0,oe.x1)(t,U),j=L(u);var H=function(e){return{key:u,keyPath:(0,s.Z)(j).reverse(),item:B.current,domEvent:e}},V=d||k,W=le(u,G,g,_),Z=W.active,K=(0,l.Z)(W,me),q=M.includes(u),X=ue(j.length),Y={};"option"===e.role&&(Y["aria-selected"]=q);var Q=m.createElement(ge,(0,i.Z)({ref:B,elementRef:z,role:null===p?"none":p||"menuitem",tabIndex:h?null:-1,"data-menu-id":D&&T?null:T},(0,se.Z)(w,["extra"]),K,Y,{component:"li","aria-disabled":h,style:(0,a.Z)((0,a.Z)({},X),n),className:c()(F,(0,r.Z)((0,r.Z)((0,r.Z)({},"".concat(F,"-active"),Z),"".concat(F,"-selected"),q),"".concat(F,"-disabled"),G),o),onClick:function(e){if(!G){var t=H(e);null==v||v(de(t)),C(t)}},onKeyDown:function(e){if(null==b||b(e),e.which===P.Z.ENTER){var t=H(e);null==v||v(de(t)),C(t)}},onFocus:function(e){O(u),null==x||x(e)}}),f,m.createElement(ce,{props:(0,a.Z)((0,a.Z)({},e),{},{isSelected:q}),icon:V}));return N&&(Q=N(Q,e,{selected:q})),Q}));function ve(e,t){var n=e.eventKey,r=A(),a=L(n);return m.useEffect((function(){if(r)return r.registerPath(n,a),function(){r.unregisterPath(n,a)}}),[a]),r?null:m.createElement(_e,(0,i.Z)({},e,{ref:t}))}var ye=m.forwardRef(ve),be=["className","children"],xe=function(e,t){var n=e.className,r=e.children,a=(0,l.Z)(e,be),s=m.useContext(E),o=s.prefixCls,u=s.mode,h=s.rtl;return m.createElement("ul",(0,i.Z)({className:c()(o,h&&"".concat(o,"-rtl"),"".concat(o,"-sub"),"".concat(o,"-").concat("inline"===u?"inline":"vertical"),n),role:"menu"},a,{"data-menu-list":!0,ref:t}),r)},Ee=m.forwardRef(xe);Ee.displayName="SubMenuList";var we=Ee,Te=n(11592);function Se(e,t){return(0,Te.Z)(e).map((function(e,n){if(m.isValidElement(e)){var i,r,a=e.key,o=null!==(i=null===(r=e.props)||void 0===r?void 0:r.eventKey)&&void 0!==i?i:a;null==o&&(o="tmp_key-".concat([].concat((0,s.Z)(t),[n]).join("-")));var l={key:o,eventKey:o};return m.cloneElement(e,l)}return e}))}var Ae=n(65030),Ce={adjustX:1,adjustY:1},Le={topLeft:{points:["bl","tl"],overflow:Ce},topRight:{points:["br","tr"],overflow:Ce},bottomLeft:{points:["tl","bl"],overflow:Ce},bottomRight:{points:["tr","br"],overflow:Ce},leftTop:{points:["tr","tl"],overflow:Ce},leftBottom:{points:["br","bl"],overflow:Ce},rightTop:{points:["tl","tr"],overflow:Ce},rightBottom:{points:["bl","br"],overflow:Ce}},Re={topLeft:{points:["bl","tl"],overflow:Ce},topRight:{points:["br","tr"],overflow:Ce},bottomLeft:{points:["tl","bl"],overflow:Ce},bottomRight:{points:["tr","br"],overflow:Ce},rightTop:{points:["tr","tl"],overflow:Ce},rightBottom:{points:["br","bl"],overflow:Ce},leftTop:{points:["tl","tr"],overflow:Ce},leftBottom:{points:["bl","br"],overflow:Ce}};function Ie(e,t,n){return t||(n?n[e]||n.other:void 0)}var De={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function ke(e){var t=e.prefixCls,n=e.visible,i=e.children,s=e.popup,l=e.popupStyle,u=e.popupClassName,h=e.popupOffset,d=e.disabled,f=e.mode,p=e.onVisibleChange,g=m.useContext(E),_=g.getPopupContainer,v=g.rtl,y=g.subMenuOpenDelay,b=g.subMenuCloseDelay,x=g.builtinPlacements,w=g.triggerSubMenuAction,T=g.forceSubMenuRender,S=g.rootClassName,A=g.motion,C=g.defaultMotions,L=m.useState(!1),R=(0,o.Z)(L,2),I=R[0],D=R[1],k=v?(0,a.Z)((0,a.Z)({},Re),x):(0,a.Z)((0,a.Z)({},Le),x),M=De[f],P=Ie(f,A,C),N=m.useRef(P);"inline"!==f&&(N.current=P);var F=(0,a.Z)((0,a.Z)({},N.current),{},{leavedClassName:"".concat(t,"-hidden"),removeOnLeave:!1,motionAppear:!0}),B=m.useRef();return m.useEffect((function(){return B.current=(0,O.Z)((function(){D(n)})),function(){O.Z.cancel(B.current)}}),[n]),m.createElement(Ae.Z,{prefixCls:t,popupClassName:c()("".concat(t,"-popup"),(0,r.Z)({},"".concat(t,"-rtl"),v),u,S),stretch:"horizontal"===f?"minWidth":null,getPopupContainer:_,builtinPlacements:k,popupPlacement:M,popupVisible:I,popup:s,popupStyle:l,popupAlign:h&&{offset:h},action:d?[]:[w],mouseEnterDelay:y,mouseLeaveDelay:b,onPopupVisibleChange:p,forceRender:T,popupMotion:F,fresh:!0},i)}var Me=n(77900);function Pe(e){var t=e.id,n=e.open,r=e.keyPath,s=e.children,l="inline",u=m.useContext(E),c=u.prefixCls,h=u.forceSubMenuRender,d=u.motion,f=u.defaultMotions,p=u.mode,g=m.useRef(!1);g.current=p===l;var _=m.useState(!g.current),v=(0,o.Z)(_,2),y=v[0],b=v[1],x=!!g.current&&n;m.useEffect((function(){g.current&&b(!1)}),[p]);var T=(0,a.Z)({},Ie(l,d,f));r.length>1&&(T.motionAppear=!1);var S=T.onVisibleChanged;return T.onVisibleChanged=function(e){return g.current||e||b(!0),null==S?void 0:S(e)},y?null:m.createElement(w,{mode:l,locked:!g.current},m.createElement(Me.default,(0,i.Z)({visible:x},T,{forceRender:h,removeOnLeave:!1,leavedClassName:"".concat(c,"-hidden")}),(function(e){var n=e.className,i=e.style;return m.createElement(we,{id:t,className:n,style:i},s)})))}var Oe=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ne=["active"],Fe=m.forwardRef((function(e,t){var n=e.style,s=e.className,u=e.title,d=e.eventKey,f=(e.warnKey,e.disabled),p=e.internalPopupClose,g=e.children,_=e.itemIcon,v=e.expandIcon,b=e.popupClassName,x=e.popupOffset,T=e.popupStyle,S=e.onClick,A=e.onMouseEnter,C=e.onMouseLeave,D=e.onTitleClick,k=e.onTitleMouseEnter,M=e.onTitleMouseLeave,P=(0,l.Z)(e,Oe),O=y(d),N=m.useContext(E),F=N.prefixCls,B=N.mode,U=N.openKeys,G=N.disabled,z=N.overflowDisabled,j=N.activeKey,H=N.selectedKeys,V=N.itemIcon,W=N.expandIcon,Z=N.onItemClick,K=N.onOpenChange,q=N.onActive,X=m.useContext(I)._internalRenderSubMenuItem,Y=m.useContext(R).isSubPathKey,Q=L(),$="".concat(F,"-submenu"),ee=G||f,te=m.useRef(),ne=m.useRef();var ie=null!=_?_:V,re=null!=v?v:W,ae=U.includes(d),se=!z&&ae,oe=Y(H,d),he=le(d,ee,k,M),fe=he.active,pe=(0,l.Z)(he,Ne),me=m.useState(!1),ge=(0,o.Z)(me,2),_e=ge[0],ve=ge[1],ye=function(e){ee||ve(e)},be=m.useMemo((function(){return fe||"inline"!==B&&(_e||Y([j],d))}),[B,fe,j,_e,d,Y]),xe=ue(Q.length),Ee=J((function(e){null==S||S(de(e)),Z(e)})),Te=O&&"".concat(O,"-popup"),Se=m.useMemo((function(){return m.createElement(ce,{icon:"horizontal"!==B?re:void 0,props:(0,a.Z)((0,a.Z)({},e),{},{isOpen:se,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))}),[B,re,e,se,$]),Ae=m.createElement("div",(0,i.Z)({role:"menuitem",style:xe,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:te,title:"string"==typeof u?u:null,"data-menu-id":z&&O?null:O,"aria-expanded":se,"aria-haspopup":!0,"aria-controls":Te,"aria-disabled":ee,onClick:function(e){ee||(null==D||D({key:d,domEvent:e}),"inline"===B&&K(d,!ae))},onFocus:function(){q(d)}},pe),u,Se),Ce=m.useRef(B);if("inline"!==B&&Q.length>1?Ce.current="vertical":Ce.current=B,!z){var Le=Ce.current;Ae=m.createElement(ke,{mode:Le,prefixCls:$,visible:!p&&se&&"inline"!==B,popupClassName:b,popupOffset:x,popupStyle:T,popup:m.createElement(w,{mode:"horizontal"===Le?"vertical":Le},m.createElement(we,{id:Te,ref:ne},g)),disabled:ee,onVisibleChange:function(e){"inline"!==B&&K(d,e)}},Ae)}var Re=m.createElement(h.Z.Item,(0,i.Z)({ref:t,role:"none"},P,{component:"li",style:n,className:c()($,"".concat($,"-").concat(B),s,(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({},"".concat($,"-open"),se),"".concat($,"-active"),be),"".concat($,"-selected"),oe),"".concat($,"-disabled"),ee)),onMouseEnter:function(e){ye(!0),null==A||A({key:d,domEvent:e})},onMouseLeave:function(e){ye(!1),null==C||C({key:d,domEvent:e})}}),Ae,!z&&m.createElement(Pe,{id:Te,open:se,keyPath:Q},g));return X&&(Re=X(Re,e,{selected:oe,active:be,open:se,disabled:ee})),m.createElement(w,{onItemClick:Ee,mode:"horizontal"===B?"vertical":B,itemIcon:ie,expandIcon:re},Re)}));var Be=m.forwardRef((function(e,t){var n,r=e.eventKey,a=e.children,s=L(r),o=Se(a,s),l=A();return m.useEffect((function(){if(l)return l.registerPath(r,s),function(){l.unregisterPath(r,s)}}),[s]),n=l?o:m.createElement(Fe,(0,i.Z)({ref:t},e),o),m.createElement(C.Provider,{value:s},n)})),Ue=n(76190);function Ge(e){var t=e.className,n=e.style,i=m.useContext(E).prefixCls;return A()?null:m.createElement("li",{role:"separator",className:c()("".concat(i,"-item-divider"),t),style:n})}var ze=["className","title","eventKey","children"],je=m.forwardRef((function(e,t){var n=e.className,r=e.title,a=(e.eventKey,e.children),s=(0,l.Z)(e,ze),o=m.useContext(E).prefixCls,u="".concat(o,"-item-group");return m.createElement("li",(0,i.Z)({ref:t,role:"presentation"},s,{onClick:function(e){return e.stopPropagation()},className:c()(u,n)}),m.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:"string"==typeof r?r:void 0},r),m.createElement("ul",{role:"group",className:"".concat(u,"-list")},a))}));var He=m.forwardRef((function(e,t){var n=e.eventKey,r=Se(e.children,L(n));return A()?r:m.createElement(je,(0,i.Z)({ref:t},(0,se.Z)(e,["warnKey"])),r)})),Ve=["label","children","key","type","extra"];function We(e,t,n){var r=t.item,a=t.group,s=t.submenu,o=t.divider;return(e||[]).map((function(e,u){if(e&&"object"===(0,Ue.Z)(e)){var c=e,h=c.label,d=c.children,f=c.key,p=c.type,g=c.extra,_=(0,l.Z)(c,Ve),v=null!=f?f:"tmp-".concat(u);return d||"group"===p?"group"===p?m.createElement(a,(0,i.Z)({key:v},_,{title:h}),We(d,t,n)):m.createElement(s,(0,i.Z)({key:v},_,{title:h}),We(d,t,n)):"divider"===p?m.createElement(o,(0,i.Z)({key:v},_)):m.createElement(r,(0,i.Z)({key:v},_,{extra:g}),h,(!!g||0===g)&&m.createElement("span",{className:"".concat(n,"-item-extra")},g))}return null})).filter((function(e){return e}))}function Ze(e,t,n,i,r){var s=e,o=(0,a.Z)({divider:Ge,item:ye,group:He,submenu:Be},i);return t&&(s=We(t,o,r)),Se(s,n)}var Ke=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],qe=[],Xe=m.forwardRef((function(e,t){var n,u=e,p=u.prefixCls,v=void 0===p?"rc-menu":p,y=u.rootClassName,b=u.style,x=u.className,E=u.tabIndex,T=void 0===E?0:E,A=u.items,C=u.children,L=u.direction,D=u.id,k=u.mode,M=void 0===k?"vertical":k,P=u.inlineCollapsed,O=u.disabled,N=u.disabledOverflow,F=u.subMenuOpenDelay,B=void 0===F?.1:F,U=u.subMenuCloseDelay,G=void 0===U?.1:U,z=u.forceSubMenuRender,j=u.defaultOpenKeys,H=u.openKeys,V=u.activeKey,Z=u.defaultActiveFirst,X=u.selectable,Y=void 0===X||X,ne=u.multiple,ie=void 0!==ne&&ne,re=u.defaultSelectedKeys,ae=u.selectedKeys,se=u.onSelect,oe=u.onDeselect,le=u.inlineIndent,ue=void 0===le?24:le,ce=u.motion,he=u.defaultMotions,fe=u.triggerSubMenuAction,pe=void 0===fe?"hover":fe,me=u.builtinPlacements,ge=u.itemIcon,_e=u.expandIcon,ve=u.overflowedIndicator,be=void 0===ve?"...":ve,xe=u.overflowedIndicatorPopupClassName,Ee=u.getPopupContainer,we=u.onClick,Te=u.onOpenChange,Se=u.onKeyDown,Ae=(u.openAnimation,u.openTransitionName,u._internalRenderMenuItem),Ce=u._internalRenderSubMenuItem,Le=u._internalComponents,Re=(0,l.Z)(u,Ke),Ie=m.useMemo((function(){return[Ze(C,A,qe,Le,v),Ze(C,A,qe,{},v)]}),[C,A,Le]),De=(0,o.Z)(Ie,2),ke=De[0],Me=De[1],Pe=m.useState(!1),Oe=(0,o.Z)(Pe,2),Ne=Oe[0],Fe=Oe[1],Ue=m.useRef(),Ge=function(e){var t=(0,d.Z)(e,{value:e}),n=(0,o.Z)(t,2),i=n[0],r=n[1];return m.useEffect((function(){te+=1;var e="".concat(ee,"-").concat(te);r("rc-menu-uuid-".concat(e))}),[]),i}(D),ze="rtl"===L;var je=(0,d.Z)(j,{value:H,postState:function(e){return e||qe}}),He=(0,o.Z)(je,2),Ve=He[0],We=He[1],Xe=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(){We(e),null==Te||Te(e)}t?(0,g.flushSync)(n):n()},Ye=m.useState(Ve),Qe=(0,o.Z)(Ye,2),$e=Qe[0],Je=Qe[1],et=m.useRef(!1),tt=m.useMemo((function(){return"inline"!==M&&"vertical"!==M||!P?[M,!1]:["vertical",P]}),[M,P]),nt=(0,o.Z)(tt,2),it=nt[0],rt=nt[1],at="inline"===it,st=m.useState(it),ot=(0,o.Z)(st,2),lt=ot[0],ut=ot[1],ct=m.useState(rt),ht=(0,o.Z)(ct,2),dt=ht[0],ft=ht[1];m.useEffect((function(){ut(it),ft(rt),et.current&&(at?We($e):Xe(qe))}),[it,rt]);var pt=m.useState(0),mt=(0,o.Z)(pt,2),gt=mt[0],_t=mt[1],vt=gt>=ke.length-1||"horizontal"!==lt||N;m.useEffect((function(){at&&Je(Ve)}),[Ve]),m.useEffect((function(){return et.current=!0,function(){et.current=!1}}),[]);var yt=$(),bt=yt.registerPath,xt=yt.unregisterPath,Et=yt.refreshOverflowKeys,wt=yt.isSubPathKey,Tt=yt.getKeyPath,St=yt.getKeys,At=yt.getSubPathKeys,Ct=m.useMemo((function(){return{registerPath:bt,unregisterPath:xt}}),[bt,xt]),Lt=m.useMemo((function(){return{isSubPathKey:wt}}),[wt]);m.useEffect((function(){Et(vt?qe:ke.slice(gt+1).map((function(e){return e.key})))}),[gt,vt]);var Rt=(0,d.Z)(V||Z&&(null===(n=ke[0])||void 0===n?void 0:n.key),{value:V}),It=(0,o.Z)(Rt,2),Dt=It[0],kt=It[1],Mt=J((function(e){kt(e)})),Pt=J((function(){kt(void 0)}));(0,m.useImperativeHandle)(t,(function(){return{list:Ue.current,focus:function(e){var t,n,i=St(),r=K(i,Ge),a=r.elements,s=r.key2element,o=r.element2key,l=W(Ue.current,a),u=null!=Dt?Dt:l[0]?o.get(l[0]):null===(t=ke.find((function(e){return!e.props.disabled})))||void 0===t?void 0:t.key,c=s.get(u);u&&c&&(null==c||null===(n=c.focus)||void 0===n||n.call(c,e))}}}));var Ot=(0,d.Z)(re||[],{value:ae,postState:function(e){return Array.isArray(e)?e:null==e?qe:[e]}}),Nt=(0,o.Z)(Ot,2),Ft=Nt[0],Bt=Nt[1],Ut=J((function(e){null==we||we(de(e)),function(e){if(Y){var t,n=e.key,i=Ft.includes(n);t=ie?i?Ft.filter((function(e){return e!==n})):[].concat((0,s.Z)(Ft),[n]):[n],Bt(t);var r=(0,a.Z)((0,a.Z)({},e),{},{selectedKeys:t});i?null==oe||oe(r):null==se||se(r)}!ie&&Ve.length&&"inline"!==lt&&Xe(qe)}(e)})),Gt=J((function(e,t){var n=Ve.filter((function(t){return t!==e}));if(t)n.push(e);else if("inline"!==lt){var i=At(e);n=n.filter((function(e){return!i.has(e)}))}(0,f.Z)(Ve,n,!0)||Xe(n,!0)})),zt=q(lt,Dt,ze,Ge,Ue,St,Tt,kt,(function(e,t){var n=null!=t?t:!Ve.includes(e);Gt(e,n)}),Se);m.useEffect((function(){Fe(!0)}),[]);var jt=m.useMemo((function(){return{_internalRenderMenuItem:Ae,_internalRenderSubMenuItem:Ce}}),[Ae,Ce]),Ht="horizontal"!==lt||N?ke:ke.map((function(e,t){return m.createElement(w,{key:e.key,overflowDisabled:t>gt},e)})),Vt=m.createElement(h.Z,(0,i.Z)({id:D,ref:Ue,prefixCls:"".concat(v,"-overflow"),component:"ul",itemComponent:ye,className:c()(v,"".concat(v,"-root"),"".concat(v,"-").concat(lt),x,(0,r.Z)((0,r.Z)({},"".concat(v,"-inline-collapsed"),dt),"".concat(v,"-rtl"),ze),y),dir:L,style:b,role:"menu",tabIndex:T,data:Ht,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?ke.slice(-t):null;return m.createElement(Be,{eventKey:Q,title:be,disabled:vt,internalPopupClose:0===t,popupClassName:xe},n)},maxCount:"horizontal"!==lt||N?h.Z.INVALIDATE:h.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){_t(e)},onKeyDown:zt},Re));return m.createElement(I.Provider,{value:jt},m.createElement(_.Provider,{value:Ge},m.createElement(w,{prefixCls:v,rootClassName:y,mode:lt,openKeys:Ve,rtl:ze,disabled:O,motion:Ne?ce:null,defaultMotions:Ne?he:null,activeKey:Dt,onActive:Mt,onInactive:Pt,selectedKeys:Ft,inlineIndent:ue,subMenuOpenDelay:B,subMenuCloseDelay:G,forceSubMenuRender:z,builtinPlacements:me,triggerSubMenuAction:pe,getPopupContainer:Ee,itemIcon:ge,expandIcon:_e,onItemClick:Ut,onOpenChange:Gt},m.createElement(R.Provider,{value:Lt},Vt),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(S.Provider,{value:Ct},Me)))))})),Ye=Xe;Ye.Item=ye,Ye.SubMenu=Be,Ye.ItemGroup=He,Ye.Divider=Ge;var Qe=Ye},11780:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var i=n(54476),r=n(33885),a=n(42978),s=n(75931),o=n(59301),l=n(92310),u=n.n(l),c=n(29301),h=n(34280),d=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],f=void 0;function p(e,t){var n=e.prefixCls,a=e.invalidate,l=e.item,h=e.renderItem,p=e.responsive,m=e.responsiveDisabled,g=e.registerSize,_=e.itemKey,v=e.className,y=e.style,b=e.children,x=e.display,E=e.order,w=e.component,T=void 0===w?"div":w,S=(0,s.Z)(e,d),A=p&&!x;function C(e){g(_,e)}o.useEffect((function(){return function(){C(null)}}),[]);var L,R=h&&l!==f?h(l,{index:E}):b;a||(L={opacity:A?0:1,height:A?0:f,overflowY:A?"hidden":f,order:p?E:f,pointerEvents:A?"none":f,position:A?"absolute":f});var I={};A&&(I["aria-hidden"]=!0);var D=o.createElement(T,(0,i.Z)({className:u()(!a&&n,v),style:(0,r.Z)((0,r.Z)({},L),y)},I,S,{ref:t}),R);return p&&(D=o.createElement(c.Z,{onResize:function(e){C(e.offsetWidth)},disabled:m},D)),D}var m=o.forwardRef(p);m.displayName="Item";var g=m,_=n(6089),v=n(4676),y=n(16089);function b(){var e=o.useRef(null);return function(t){e.current||(e.current=[],function(e){if("undefined"==typeof MessageChannel)(0,y.Z)(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}((function(){(0,v.unstable_batchedUpdates)((function(){e.current.forEach((function(e){e()})),e.current=null}))}))),e.current.push(t)}}function x(e,t){var n=o.useState(t),i=(0,a.Z)(n,2),r=i[0],s=i[1];return[r,(0,_.Z)((function(t){e((function(){s(t)}))}))]}var E=o.createContext(null),w=["component"],T=["className"],S=["className"],A=function(e,t){var n=o.useContext(E);if(!n){var r=e.component,a=void 0===r?"div":r,l=(0,s.Z)(e,w);return o.createElement(a,(0,i.Z)({},l,{ref:t}))}var c=n.className,h=(0,s.Z)(n,T),d=e.className,f=(0,s.Z)(e,S);return o.createElement(E.Provider,{value:null},o.createElement(g,(0,i.Z)({ref:t,className:u()(c,d)},h,f)))},C=o.forwardRef(A);C.displayName="RawItem";var L=C,R=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],I="responsive",D="invalidate";function k(e){return"+ ".concat(e.length," ...")}function M(e,t){var n=e.prefixCls,l=void 0===n?"rc-overflow":n,d=e.data,f=void 0===d?[]:d,p=e.renderItem,m=e.renderRawItem,_=e.itemKey,v=e.itemWidth,y=void 0===v?10:v,w=e.ssr,T=e.style,S=e.className,A=e.maxCount,C=e.renderRest,L=e.renderRawRest,M=e.suffix,P=e.component,O=void 0===P?"div":P,N=e.itemComponent,F=e.onVisibleChange,B=(0,s.Z)(e,R),U="full"===w,G=b(),z=x(G,null),j=(0,a.Z)(z,2),H=j[0],V=j[1],W=H||0,Z=x(G,new Map),K=(0,a.Z)(Z,2),q=K[0],X=K[1],Y=x(G,0),Q=(0,a.Z)(Y,2),$=Q[0],J=Q[1],ee=x(G,0),te=(0,a.Z)(ee,2),ne=te[0],ie=te[1],re=x(G,0),ae=(0,a.Z)(re,2),se=ae[0],oe=ae[1],le=(0,o.useState)(null),ue=(0,a.Z)(le,2),ce=ue[0],he=ue[1],de=(0,o.useState)(null),fe=(0,a.Z)(de,2),pe=fe[0],me=fe[1],ge=o.useMemo((function(){return null===pe&&U?Number.MAX_SAFE_INTEGER:pe||0}),[pe,H]),_e=(0,o.useState)(!1),ve=(0,a.Z)(_e,2),ye=ve[0],be=ve[1],xe="".concat(l,"-item"),Ee=Math.max($,ne),we=A===I,Te=f.length&&we,Se=A===D,Ae=Te||"number"==typeof A&&f.length>A,Ce=(0,o.useMemo)((function(){var e=f;return Te?e=null===H&&U?f:f.slice(0,Math.min(f.length,W/y)):"number"==typeof A&&(e=f.slice(0,A)),e}),[f,y,H,A,Te]),Le=(0,o.useMemo)((function(){return Te?f.slice(ge+1):f.slice(Ce.length)}),[f,Ce,Te,ge]),Re=(0,o.useCallback)((function(e,t){var n;return"function"==typeof _?_(e):null!==(n=_&&(null==e?void 0:e[_]))&&void 0!==n?n:t}),[_]),Ie=(0,o.useCallback)(p||function(e){return e},[p]);function De(e,t,n){(pe!==e||void 0!==t&&t!==ce)&&(me(e),n||(be(e<f.length-1),null==F||F(e)),void 0!==t&&he(t))}function ke(e,t){X((function(n){var i=new Map(n);return null===t?i.delete(e):i.set(e,t),i}))}function Me(e){return q.get(Re(Ce[e],e))}(0,h.Z)((function(){if(W&&"number"==typeof Ee&&Ce){var e=se,t=Ce.length,n=t-1;if(!t)return void De(0,null);for(var i=0;i<t;i+=1){var r=Me(i);if(U&&(r=r||0),void 0===r){De(i-1,void 0,!0);break}if(e+=r,0===n&&e<=W||i===n-1&&e+Me(n)<=W){De(n,null);break}if(e+Ee>W){De(i-1,e-r-se+ne);break}}M&&Me(0)+se>W&&he(null)}}),[W,q,ne,se,Re,Ce]);var Pe=ye&&!!Le.length,Oe={};null!==ce&&Te&&(Oe={position:"absolute",left:ce,top:0});var Ne={prefixCls:xe,responsive:Te,component:N,invalidate:Se},Fe=m?function(e,t){var n=Re(e,t);return o.createElement(E.Provider,{key:n,value:(0,r.Z)((0,r.Z)({},Ne),{},{order:t,item:e,itemKey:n,registerSize:ke,display:t<=ge})},m(e,t))}:function(e,t){var n=Re(e,t);return o.createElement(g,(0,i.Z)({},Ne,{order:t,key:n,item:e,renderItem:Ie,itemKey:n,registerSize:ke,display:t<=ge}))},Be={order:Pe?ge:Number.MAX_SAFE_INTEGER,className:"".concat(xe,"-rest"),registerSize:function(e,t){ie(t),J(ne)},display:Pe},Ue=C||k,Ge=L?o.createElement(E.Provider,{value:(0,r.Z)((0,r.Z)({},Ne),Be)},L(Le)):o.createElement(g,(0,i.Z)({},Ne,Be),"function"==typeof Ue?Ue(Le):Ue),ze=o.createElement(O,(0,i.Z)({className:u()(!Se&&l,S),style:T,ref:t},B),Ce.map(Fe),Ae?Ge:null,M&&o.createElement(g,(0,i.Z)({},Ne,{responsive:we,responsiveDisabled:!Te,order:ge,className:"".concat(xe,"-suffix"),registerSize:function(e,t){oe(t)},display:!0,style:Oe}),M));return we?o.createElement(c.Z,{onResize:function(e,t){V(t.clientWidth)},disabled:!Te},ze):ze}var P=o.forwardRef(M);P.displayName="Overflow",P.Item=L,P.RESPONSIVE=I,P.INVALIDATE=D;var O=P},25930:function(e,t,n){"use strict";n.d(t,{Cd:function(){return T}});var i=n(54476),r=n(33885),a=n(75931),s=n(59301),o=n(92310),l=n.n(o),u={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},c=function(){var e=(0,s.useRef)([]),t=(0,s.useRef)(null);return(0,s.useEffect)((function(){var n=Date.now(),i=!1;e.current.forEach((function(e){if(e){i=!0;var r=e.style;r.transitionDuration=".3s, .3s, .3s, .06s",t.current&&n-t.current<100&&(r.transitionDuration="0s, 0s")}})),i&&(t.current=Date.now())})),e.current};var h=n(76190),d=n(42978),f=n(47273),p=0,m=(0,f.Z)();var g=function(e){var t=s.useState(),n=(0,d.Z)(t,2),i=n[0],r=n[1];return s.useEffect((function(){var e;r("rc_progress_".concat((m?(e=p,p+=1):e="TEST_OR_SSR",e)))}),[]),e||i},_=function(e){var t=e.bg,n=e.children;return s.createElement("div",{style:{width:"100%",height:"100%",background:t}},n)};function v(e,t){return Object.keys(e).map((function(n){var i=parseFloat(n),r="".concat(Math.floor(i*t),"%");return"".concat(e[n]," ").concat(r)}))}var y=s.forwardRef((function(e,t){var n=e.prefixCls,i=e.color,r=e.gradientId,a=e.radius,o=e.style,l=e.ptg,u=e.strokeLinecap,c=e.strokeWidth,d=e.size,f=e.gapDegree,p=i&&"object"===(0,h.Z)(i),m=p?"#FFF":void 0,g=d/2,y=s.createElement("circle",{className:"".concat(n,"-circle-path"),r:a,cx:g,cy:g,stroke:m,strokeLinecap:u,strokeWidth:c,opacity:0===l?0:1,style:o,ref:t});if(!p)return y;var b="".concat(r,"-conic"),x=f?"".concat(180+f/2,"deg"):"0deg",E=v(i,(360-f)/360),w=v(i,1),T="conic-gradient(from ".concat(x,", ").concat(E.join(", "),")"),S="linear-gradient(to ".concat(f?"bottom":"top",", ").concat(w.join(", "),")");return s.createElement(s.Fragment,null,s.createElement("mask",{id:b},y),s.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(b,")")},s.createElement(_,{bg:S},s.createElement(_,{bg:T}))))})),b=100,x=function(e,t,n,i,r,a,s,o,l,u){var c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,h=n/100*360*((360-a)/360),d=0===a?0:{bottom:0,top:180,left:90,right:-90}[s],f=(100-i)/100*t;"round"===l&&100!==i&&(f+=u/2)>=t&&(f=t-.01);var p=50;return{stroke:"string"==typeof o?o:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:f+c,transform:"rotate(".concat(r+h+d,"deg)"),transformOrigin:"".concat(p,"px ").concat(p,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},E=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function w(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var T=function(e){var t,n,o,d=(0,r.Z)((0,r.Z)({},u),e),f=d.id,p=d.prefixCls,m=d.steps,_=d.strokeWidth,v=d.trailWidth,T=d.gapDegree,S=void 0===T?0:T,A=d.gapPosition,C=d.trailColor,L=d.strokeLinecap,R=d.style,I=d.className,D=d.strokeColor,k=d.percent,M=(0,a.Z)(d,E),P=g(f),O="".concat(P,"-gradient"),N=50-_/2,F=2*Math.PI*N,B=S>0?90+S/2:-90,U=F*((360-S)/360),G="object"===(0,h.Z)(m)?m:{count:m,gap:2},z=G.count,j=G.gap,H=w(k),V=w(D),W=V.find((function(e){return e&&"object"===(0,h.Z)(e)})),Z=W&&"object"===(0,h.Z)(W)?"butt":L,K=x(F,U,0,100,B,S,A,C,Z,_),q=c();return s.createElement("svg",(0,i.Z)({className:l()("".concat(p,"-circle"),I),viewBox:"0 0 ".concat(b," ").concat(b),style:R,id:f,role:"presentation"},M),!z&&s.createElement("circle",{className:"".concat(p,"-circle-trail"),r:N,cx:50,cy:50,stroke:C,strokeLinecap:Z,strokeWidth:v||_,style:K}),z?(t=Math.round(z*(H[0]/100)),n=100/z,o=0,new Array(z).fill(null).map((function(e,i){var r=i<=t-1?V[0]:C,a=r&&"object"===(0,h.Z)(r)?"url(#".concat(O,")"):void 0,l=x(F,U,o,n,B,S,A,r,"butt",_,j);return o+=100*(U-l.strokeDashoffset+j)/U,s.createElement("circle",{key:i,className:"".concat(p,"-circle-path"),r:N,cx:50,cy:50,stroke:a,strokeWidth:_,opacity:1,style:l,ref:function(e){q[i]=e}})}))):function(){var e=0;return H.map((function(t,n){var i=V[n]||V[V.length-1],r=x(F,U,e,t,B,S,A,i,Z,_);return e+=t,s.createElement(y,{key:n,color:i,ptg:t,radius:N,prefixCls:p,gradientId:O,style:r,strokeLinecap:Z,strokeWidth:_,gapDegree:S,ref:function(e){q[n]=e},size:b})})).reverse()}())}},738:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var i=n(54476),r=n(20068),a=n(42978),s=n(75931),o=n(92310),l=n.n(o),u=n(18929),c=n(10228),h=n(26112),d=n(59301);function f(e,t){var n=e.disabled,i=e.prefixCls,r=e.character,a=e.characterRender,s=e.index,o=e.count,u=e.value,h=e.allowHalf,f=e.focused,p=e.onHover,m=e.onClick,g=s+1,_=new Set([i]);0===u&&0===s&&f?_.add("".concat(i,"-focused")):h&&u+.5>=g&&u<g?(_.add("".concat(i,"-half")),_.add("".concat(i,"-active")),f&&_.add("".concat(i,"-focused"))):(g<=u?_.add("".concat(i,"-full")):_.add("".concat(i,"-zero")),g===u&&f&&_.add("".concat(i,"-focused")));var v="function"==typeof r?r(e):r,y=d.createElement("li",{className:l()(Array.from(_)),ref:t},d.createElement("div",{onClick:n?null:function(e){m(e,s)},onKeyDown:n?null:function(e){e.keyCode===c.Z.ENTER&&m(e,s)},onMouseMove:n?null:function(e){p(e,s)},role:"radio","aria-checked":u>s?"true":"false","aria-posinset":s+1,"aria-setsize":o,tabIndex:n?-1:0},d.createElement("div",{className:"".concat(i,"-first")},v),d.createElement("div",{className:"".concat(i,"-second")},v)));return a&&(y=a(y,e)),y}var p=d.forwardRef(f);var m=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function g(e,t){var n,o=e.prefixCls,f=void 0===o?"rc-rate":o,g=e.className,_=e.defaultValue,v=e.value,y=e.count,b=void 0===y?5:y,x=e.allowHalf,E=void 0!==x&&x,w=e.allowClear,T=void 0===w||w,S=e.keyboard,A=void 0===S||S,C=e.character,L=void 0===C?"★":C,R=e.characterRender,I=e.disabled,D=e.direction,k=void 0===D?"ltr":D,M=e.tabIndex,P=void 0===M?0:M,O=e.autoFocus,N=e.onHoverChange,F=e.onChange,B=e.onFocus,U=e.onBlur,G=e.onKeyDown,z=e.onMouseLeave,j=(0,s.Z)(e,m),H=(n=d.useRef({}),[function(e){return n.current[e]},function(e){return function(t){n.current[e]=t}}]),V=(0,a.Z)(H,2),W=V[0],Z=V[1],K=d.useRef(null),q=function(){var e;I||(null===(e=K.current)||void 0===e||e.focus())};d.useImperativeHandle(t,(function(){return{focus:q,blur:function(){var e;I||(null===(e=K.current)||void 0===e||e.blur())}}}));var X=(0,u.Z)(_||0,{value:v}),Y=(0,a.Z)(X,2),Q=Y[0],$=Y[1],J=(0,u.Z)(null),ee=(0,a.Z)(J,2),te=ee[0],ne=ee[1],ie=function(e,t){var n,i,r,a,s="rtl"===k,o=e+1;if(E){var l=W(e),u=(i=function(e){var t,n,i=e.ownerDocument,r=i.body,a=i&&i.documentElement,s=e.getBoundingClientRect();return t=s.left,n=s.top,{left:t-=a.clientLeft||r.clientLeft||0,top:n-=a.clientTop||r.clientTop||0}}(n=l),r=n.ownerDocument,a=r.defaultView||r.parentWindow,i.left+=function(e){var t=e.pageXOffset,n="scrollLeft";if("number"!=typeof t){var i=e.document;"number"!=typeof(t=i.documentElement[n])&&(t=i.body[n])}return t}(a),i.left),c=l.clientWidth;(s&&t-u>c/2||!s&&t-u<c/2)&&(o-=.5)}return o},re=function(e){$(e),null==F||F(e)},ae=d.useState(!1),se=(0,a.Z)(ae,2),oe=se[0],le=se[1],ue=d.useState(null),ce=(0,a.Z)(ue,2),he=ce[0],de=ce[1],fe=function(e,t){var n=ie(t,e.pageX);n!==te&&(de(n),ne(null)),null==N||N(n)},pe=function(e){I||(de(null),ne(null),null==N||N(void 0)),e&&(null==z||z(e))},me=function(e,t){var n=ie(t,e.pageX),i=!1;T&&(i=n===Q),pe(),re(i?0:n),ne(i?n:null)};d.useEffect((function(){O&&!I&&q()}),[]);var ge=new Array(b).fill(0).map((function(e,t){return d.createElement(p,{ref:Z(t),index:t,count:b,disabled:I,prefixCls:"".concat(f,"-star"),allowHalf:E,value:null===he?Q:he,onClick:me,onHover:fe,key:e||t,character:L,characterRender:R,focused:oe})})),_e=l()(f,g,(0,r.Z)((0,r.Z)({},"".concat(f,"-disabled"),I),"".concat(f,"-rtl"),"rtl"===k));return d.createElement("ul",(0,i.Z)({className:_e,onMouseLeave:pe,tabIndex:I?-1:P,onFocus:I?null:function(){le(!0),null==B||B()},onBlur:I?null:function(){le(!1),null==U||U()},onKeyDown:I?null:function(e){var t=e.keyCode,n="rtl"===k,i=E?.5:1;A&&(t===c.Z.RIGHT&&Q<b&&!n?(re(Q+i),e.preventDefault()):t===c.Z.LEFT&&Q>0&&!n||t===c.Z.RIGHT&&Q>0&&n?(re(Q-i),e.preventDefault()):t===c.Z.LEFT&&Q<b&&n&&(re(Q+i),e.preventDefault())),null==G||G(e)},ref:K},(0,h.Z)(j,{aria:!0,data:!0,attr:!0})),ge)}var _=d.forwardRef(g)},29301:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var i=n(54476),r=n(59301),a=n(11592),s=(n(48736),n(33885)),o=n(76190),l=n(76846),u=n(8654),c=r.createContext(null);var h=n(76374),d=new Map;var f=new h.Z((function(e){e.forEach((function(e){var t,n=e.target;null===(t=d.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))}));var p=n(67732),m=n(83652),g=n(42403),_=n(158),v=function(e){(0,g.Z)(n,e);var t=(0,_.Z)(n);function n(){return(0,p.Z)(this,n),t.apply(this,arguments)}return(0,m.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(r.Component);function y(e,t){var n=e.children,i=e.disabled,a=r.useRef(null),h=r.useRef(null),p=r.useContext(c),m="function"==typeof n,g=m?n(a):n,_=r.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),y=!m&&r.isValidElement(g)&&(0,u.Yr)(g),b=y?(0,u.C4)(g):null,x=(0,u.x1)(b,a),E=function(){var e;return(0,l.ZP)(a.current)||(a.current&&"object"===(0,o.Z)(a.current)?(0,l.ZP)(null===(e=a.current)||void 0===e?void 0:e.nativeElement):null)||(0,l.ZP)(h.current)};r.useImperativeHandle(t,(function(){return E()}));var w=r.useRef(e);w.current=e;var T=r.useCallback((function(e){var t=w.current,n=t.onResize,i=t.data,r=e.getBoundingClientRect(),a=r.width,o=r.height,l=e.offsetWidth,u=e.offsetHeight,c=Math.floor(a),h=Math.floor(o);if(_.current.width!==c||_.current.height!==h||_.current.offsetWidth!==l||_.current.offsetHeight!==u){var d={width:c,height:h,offsetWidth:l,offsetHeight:u};_.current=d;var f=l===Math.round(a)?a:l,m=u===Math.round(o)?o:u,g=(0,s.Z)((0,s.Z)({},d),{},{offsetWidth:f,offsetHeight:m});null==p||p(g,e,i),n&&Promise.resolve().then((function(){n(g,e)}))}}),[]);return r.useEffect((function(){var e,t,n=E();return n&&!i&&(e=n,t=T,d.has(e)||(d.set(e,new Set),f.observe(e)),d.get(e).add(t)),function(){return function(e,t){d.has(e)&&(d.get(e).delete(t),d.get(e).size||(f.unobserve(e),d.delete(e)))}(n,T)}}),[a.current,i]),r.createElement(v,{ref:h},y?r.cloneElement(g,{ref:x}):g)}var b=r.forwardRef(y);function x(e,t){var n=e.children;return("function"==typeof n?[n]:(0,a.Z)(n)).map((function(n,a){var s=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(a);return r.createElement(b,(0,i.Z)({},e,{key:s,ref:0===a?t:void 0}),n)}))}var E=r.forwardRef(x);E.Collection=function(e){var t=e.children,n=e.onBatchResize,i=r.useRef(0),a=r.useRef([]),s=r.useContext(c),o=r.useCallback((function(e,t,r){i.current+=1;var o=i.current;a.current.push({size:e,element:t,data:r}),Promise.resolve().then((function(){o===i.current&&(null==n||n(a.current),a.current=[])})),null==s||s(e,t,r)}),[n,s]);return r.createElement(c.Provider,{value:o},t)};var w=E},6551:function(e,t,n){"use strict";n.d(t,{ZP:function(){return l}});var i=n(42978),r=n(59301),a=n(47273),s=0,o=(0,a.Z)();function l(e){var t=r.useState(),n=(0,i.Z)(t,2),a=n[0],l=n[1];return r.useEffect((function(){var e;l("rc_select_".concat((o?(e=s,s+=1):e="TEST_OR_SSR",e)))}),[]),e||a}},37463:function(e,t,n){"use strict";n.d(t,{Ac:function(){return ee},Xo:function(){return ne},Wx:function(){return re},ZP:function(){return Se},lk:function(){return b}});var i=n(54476),r=n(94480),a=n(20068),s=n(33885),o=n(42978),l=n(75931),u=n(76190),c=n(18929),h=n(48736),d=n(59301),f=n(92310),p=n.n(f),m=n(34280),g=n(49658),_=n(8654),v=function(e){var t=e.className,n=e.customizeIcon,i=e.customizeIconProps,r=e.children,a=e.onMouseDown,s=e.onClick,o="function"==typeof n?n(i):n;return d.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==a||a(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},void 0!==o?o:d.createElement("span",{className:p()(t.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},r))},y=d.createContext(null);function b(){return d.useContext(y)}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=d.useRef(null),n=d.useRef(null);function i(i){(i||null===t.current)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return d.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},i]}var E=n(10228);var w=n(26112),T=n(11780);var S=function(e,t,n){var i=(0,s.Z)((0,s.Z)({},e),n?t:{});return Object.keys(t).forEach((function(n){var r=t[n];"function"==typeof r&&(i[n]=function(){for(var t,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r.apply(void 0,a),null===(t=e[n])||void 0===t?void 0:t.call.apply(t,[e].concat(a))})})),i},A=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],C=function(e,t){var n=e.prefixCls,i=e.id,r=e.inputElement,a=e.autoFocus,o=e.autoComplete,u=e.editable,c=e.activeDescendantId,f=e.value,m=e.open,g=e.attrs,v=(0,l.Z)(e,A),y=r||d.createElement("input",null),b=y,x=b.ref,E=b.props;return(0,h.Kp)(!("maxLength"in y.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),y=d.cloneElement(y,(0,s.Z)((0,s.Z)((0,s.Z)({type:"search"},S(v,E,!0)),{},{id:i,ref:(0,_.sQ)(t,x),autoComplete:o||"off",autoFocus:a,className:p()("".concat(n,"-selection-search-input"),null==E?void 0:E.className),role:"combobox","aria-expanded":m||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":m?c:void 0},g),{},{value:u?f:"",readOnly:!u,unselectable:u?null:"on",style:(0,s.Z)((0,s.Z)({},E.style),{},{opacity:u?null:0})}))};var L=d.forwardRef(C);function R(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var I="undefined"!=typeof window&&window.document&&window.document.documentElement;function D(e){return["string","number"].includes((0,u.Z)(e))}function k(e){var t=void 0;return e&&(D(e.title)?t=e.title.toString():D(e.label)&&(t=e.label.toString())),t}function M(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var P=function(e){e.preventDefault(),e.stopPropagation()},O=function(e){var t,n,i=e.id,r=e.prefixCls,s=e.values,l=e.open,u=e.searchValue,c=e.autoClearSearchValue,h=e.inputRef,f=e.placeholder,m=e.disabled,g=e.mode,_=e.showSearch,y=e.autoFocus,b=e.autoComplete,x=e.activeDescendantId,E=e.tabIndex,S=e.removeIcon,A=e.maxTagCount,C=e.maxTagTextLength,R=e.maxTagPlaceholder,D=void 0===R?function(e){return"+ ".concat(e.length," ...")}:R,O=e.tagRender,N=e.onToggleOpen,F=e.onRemove,B=e.onInputChange,U=e.onInputPaste,G=e.onInputKeyDown,z=e.onInputMouseDown,j=e.onInputCompositionStart,H=e.onInputCompositionEnd,V=e.onInputBlur,W=d.useRef(null),Z=(0,d.useState)(0),K=(0,o.Z)(Z,2),q=K[0],X=K[1],Y=(0,d.useState)(!1),Q=(0,o.Z)(Y,2),$=Q[0],J=Q[1],ee="".concat(r,"-selection"),te=l||"multiple"===g&&!1===c||"tags"===g?u:"",ne="tags"===g||"multiple"===g&&!1===c||_&&(l||$);t=function(){X(W.current.scrollWidth)},n=[te],I?d.useLayoutEffect(t,n):d.useEffect(t,n);var ie=function(e,t,n,i,r){return d.createElement("span",{title:k(e),className:p()("".concat(ee,"-item"),(0,a.Z)({},"".concat(ee,"-item-disabled"),n))},d.createElement("span",{className:"".concat(ee,"-item-content")},t),i&&d.createElement(v,{className:"".concat(ee,"-item-remove"),onMouseDown:P,onClick:r,customizeIcon:S},"×"))},re=function(e,t,n,i,r,a){return d.createElement("span",{onMouseDown:function(e){P(e),N(!l)}},O({label:t,value:e,disabled:n,closable:i,onClose:r,isMaxTag:!!a}))},ae=d.createElement("div",{className:"".concat(ee,"-search"),style:{width:q},onFocus:function(){J(!0)},onBlur:function(){J(!1)}},d.createElement(L,{ref:h,open:l,prefixCls:r,id:i,inputElement:null,disabled:m,autoFocus:y,autoComplete:b,editable:ne,activeDescendantId:x,value:te,onKeyDown:G,onMouseDown:z,onChange:B,onPaste:U,onCompositionStart:j,onCompositionEnd:H,onBlur:V,tabIndex:E,attrs:(0,w.Z)(e,!0)}),d.createElement("span",{ref:W,className:"".concat(ee,"-search-mirror"),"aria-hidden":!0},te," ")),se=d.createElement(T.Z,{prefixCls:"".concat(ee,"-overflow"),data:s,renderItem:function(e){var t=e.disabled,n=e.label,i=e.value,r=!m&&!t,a=n;if("number"==typeof C&&("string"==typeof n||"number"==typeof n)){var s=String(a);s.length>C&&(a="".concat(s.slice(0,C),"..."))}var o=function(t){t&&t.stopPropagation(),F(e)};return"function"==typeof O?re(i,a,t,r,o):ie(e,a,t,r,o)},renderRest:function(e){if(!s.length)return null;var t="function"==typeof D?D(e):D;return"function"==typeof O?re(void 0,t,!1,!1,void 0,!0):ie({title:t},t,!1)},suffix:ae,itemKey:M,maxCount:A});return d.createElement("span",{className:"".concat(ee,"-wrap")},se,!s.length&&!te&&d.createElement("span",{className:"".concat(ee,"-placeholder")},f))},N=function(e){var t=e.inputElement,n=e.prefixCls,i=e.id,r=e.inputRef,a=e.disabled,s=e.autoFocus,l=e.autoComplete,u=e.activeDescendantId,c=e.mode,h=e.open,f=e.values,p=e.placeholder,m=e.tabIndex,g=e.showSearch,_=e.searchValue,v=e.activeValue,y=e.maxLength,b=e.onInputKeyDown,x=e.onInputMouseDown,E=e.onInputChange,T=e.onInputPaste,S=e.onInputCompositionStart,A=e.onInputCompositionEnd,C=e.onInputBlur,R=e.title,I=d.useState(!1),D=(0,o.Z)(I,2),M=D[0],P=D[1],O="combobox"===c,N=O||g,F=f[0],B=_||"";O&&v&&!M&&(B=v),d.useEffect((function(){O&&P(!1)}),[O,v]);var U=!("combobox"!==c&&!h&&!g)&&!!B,G=void 0===R?k(F):R,z=d.useMemo((function(){return F?null:d.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:U?{visibility:"hidden"}:void 0},p)}),[F,U,p,n]);return d.createElement("span",{className:"".concat(n,"-selection-wrap")},d.createElement("span",{className:"".concat(n,"-selection-search")},d.createElement(L,{ref:r,prefixCls:n,id:i,open:h,inputElement:t,disabled:a,autoFocus:s,autoComplete:l,editable:N,activeDescendantId:u,value:B,onKeyDown:b,onMouseDown:x,onChange:function(e){P(!0),E(e)},onPaste:T,onCompositionStart:S,onCompositionEnd:A,onBlur:C,tabIndex:m,attrs:(0,w.Z)(e,!0),maxLength:O?y:void 0})),!O&&F?d.createElement("span",{className:"".concat(n,"-selection-item"),title:G,style:U?{visibility:"hidden"}:void 0},F.label):null,z)},F=function(e,t){var n=(0,d.useRef)(null),r=(0,d.useRef)(!1),a=e.prefixCls,s=e.open,l=e.mode,u=e.showSearch,c=e.tokenWithEnter,h=e.disabled,f=e.prefix,p=e.autoClearSearchValue,m=e.onSearch,g=e.onSearchSubmit,_=e.onToggleOpen,v=e.onInputKeyDown,y=e.onInputBlur,b=e.domRef;d.useImperativeHandle(t,(function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}}));var w=x(0),T=(0,o.Z)(w,2),S=T[0],A=T[1],C=(0,d.useRef)(null),L=function(e){!1!==m(e,!0,r.current)&&_(!0)},R={inputRef:n,onInputKeyDown:function(e){var t,i=e.which,a=n.current instanceof HTMLTextAreaElement;(a||!s||i!==E.Z.UP&&i!==E.Z.DOWN||e.preventDefault(),v&&v(e),i!==E.Z.ENTER||"tags"!==l||r.current||s||null==g||g(e.target.value),a&&!s&&~[E.Z.UP,E.Z.DOWN,E.Z.LEFT,E.Z.RIGHT].indexOf(i))||(t=i)&&![E.Z.ESC,E.Z.SHIFT,E.Z.BACKSPACE,E.Z.TAB,E.Z.WIN_KEY,E.Z.ALT,E.Z.META,E.Z.WIN_KEY_RIGHT,E.Z.CTRL,E.Z.SEMICOLON,E.Z.EQUALS,E.Z.CAPS_LOCK,E.Z.CONTEXT_MENU,E.Z.F1,E.Z.F2,E.Z.F3,E.Z.F4,E.Z.F5,E.Z.F6,E.Z.F7,E.Z.F8,E.Z.F9,E.Z.F10,E.Z.F11,E.Z.F12].includes(t)&&_(!0)},onInputMouseDown:function(){A(!0)},onInputChange:function(e){var t=e.target.value;if(c&&C.current&&/[\r\n]/.test(C.current)){var n=C.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,C.current)}C.current=null,L(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");C.current=n||""},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==l&&L(e.target.value)},onInputBlur:y},I="multiple"===l||"tags"===l?d.createElement(O,(0,i.Z)({},e,R)):d.createElement(N,(0,i.Z)({},e,R));return d.createElement("div",{ref:b,className:"".concat(a,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(e){var t=S();e.target===n.current||t||"combobox"===l&&h||e.preventDefault(),("combobox"===l||u&&t)&&s||(s&&!1!==p&&m("",!0,!1),_())}},f&&d.createElement("div",{className:"".concat(a,"-prefix")},f),I)};var B=d.forwardRef(F),U=n(65030),G=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],z=function(e,t){var n=e.prefixCls,r=(e.disabled,e.visible),o=e.children,u=e.popupElement,c=e.animation,h=e.transitionName,f=e.dropdownStyle,m=e.dropdownClassName,g=e.direction,_=void 0===g?"ltr":g,v=e.placement,y=e.builtinPlacements,b=e.dropdownMatchSelectWidth,x=e.dropdownRender,E=e.dropdownAlign,w=e.getPopupContainer,T=e.empty,S=e.getTriggerDOMNode,A=e.onPopupVisibleChange,C=e.onPopupMouseEnter,L=(0,l.Z)(e,G),R="".concat(n,"-dropdown"),I=u;x&&(I=x(u));var D=d.useMemo((function(){return y||function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}}(b)}),[y,b]),k=c?"".concat(R,"-").concat(c):h,M="number"==typeof b,P=d.useMemo((function(){return M?null:!1===b?"minWidth":"width"}),[b,M]),O=f;M&&(O=(0,s.Z)((0,s.Z)({},O),{},{width:b}));var N=d.useRef(null);return d.useImperativeHandle(t,(function(){return{getPopupElement:function(){var e;return null===(e=N.current)||void 0===e?void 0:e.popupElement}}})),d.createElement(U.Z,(0,i.Z)({},L,{showAction:A?["click"]:[],hideAction:A?["click"]:[],popupPlacement:v||("rtl"===_?"bottomRight":"bottomLeft"),builtinPlacements:D,prefixCls:R,popupTransitionName:k,popup:d.createElement("div",{onMouseEnter:C},I),ref:N,stretch:P,popupAlign:E,popupVisible:r,getPopupContainer:w,popupClassName:p()(m,(0,a.Z)({},"".concat(R,"-empty"),T)),popupStyle:O,getTriggerDOMNode:S,onPopupVisibleChange:A}),o)};var j=d.forwardRef(z),H=n(66712);function V(e,t){var n,i=e.key;return"value"in e&&(n=e.value),null!=i?i:void 0!==n?n:"rc-index-key-".concat(t)}function W(e){return void 0!==e&&!Number.isNaN(e)}function Z(e,t){var n=e||{},i=n.label||(t?"children":"label");return{label:i,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||i}}function K(e){var t=(0,s.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,h.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var q=d.createContext(null);function X(e){var t=e.visible,n=e.values;if(!t)return null;return d.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map((function(e){var t=e.label,n=e.value;return["number","string"].includes((0,u.Z)(t))?t:n})).join(", ")),n.length>50?", ...":null)}var Y=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Q=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],$=function(e){return"tags"===e||"multiple"===e},J=d.forwardRef((function(e,t){var n,h=e.id,f=e.prefixCls,b=e.className,E=e.showSearch,w=e.tagRender,T=e.direction,S=e.omitDomProps,A=e.displayValues,C=e.onDisplayValuesChange,L=e.emptyOptions,R=e.notFoundContent,I=void 0===R?"Not Found":R,D=e.onClear,k=e.mode,M=e.disabled,P=e.loading,O=e.getInputElement,N=e.getRawInputElement,F=e.open,U=e.defaultOpen,G=e.onDropdownVisibleChange,z=e.activeValue,V=e.onActiveValueChange,Z=e.activeDescendantId,K=e.searchValue,J=e.autoClearSearchValue,ee=e.onSearch,te=e.onSearchSplit,ne=e.tokenSeparators,ie=e.allowClear,re=e.prefix,ae=e.suffixIcon,se=e.clearIcon,oe=e.OptionList,le=e.animation,ue=e.transitionName,ce=e.dropdownStyle,he=e.dropdownClassName,de=e.dropdownMatchSelectWidth,fe=e.dropdownRender,pe=e.dropdownAlign,me=e.placement,ge=e.builtinPlacements,_e=e.getPopupContainer,ve=e.showAction,ye=void 0===ve?[]:ve,be=e.onFocus,xe=e.onBlur,Ee=e.onKeyUp,we=e.onKeyDown,Te=e.onMouseDown,Se=(0,l.Z)(e,Y),Ae=$(k),Ce=(void 0!==E?E:Ae)||"combobox"===k,Le=(0,s.Z)({},Se);Q.forEach((function(e){delete Le[e]})),null==S||S.forEach((function(e){delete Le[e]}));var Re=d.useState(!1),Ie=(0,o.Z)(Re,2),De=Ie[0],ke=Ie[1];d.useEffect((function(){ke((0,g.Z)())}),[]);var Me=d.useRef(null),Pe=d.useRef(null),Oe=d.useRef(null),Ne=d.useRef(null),Fe=d.useRef(null),Be=d.useRef(!1),Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=d.useState(!1),n=(0,o.Z)(t,2),i=n[0],r=n[1],a=d.useRef(null),s=function(){window.clearTimeout(a.current)};return d.useEffect((function(){return s}),[]),[i,function(t,n){s(),a.current=window.setTimeout((function(){r(t),n&&n()}),e)},s]}(),Ge=(0,o.Z)(Ue,3),ze=Ge[0],je=Ge[1],He=Ge[2];d.useImperativeHandle(t,(function(){var e,t;return{focus:null===(e=Ne.current)||void 0===e?void 0:e.focus,blur:null===(t=Ne.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=Fe.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:Me.current||Pe.current}}));var Ve=d.useMemo((function(){var e;if("combobox"!==k)return K;var t=null===(e=A[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[K,k,A]),We="combobox"===k&&"function"==typeof O&&O()||null,Ze="function"==typeof N&&N(),Ke=(0,_.x1)(Pe,null==Ze||null===(n=Ze.props)||void 0===n?void 0:n.ref),qe=d.useState(!1),Xe=(0,o.Z)(qe,2),Ye=Xe[0],Qe=Xe[1];(0,m.Z)((function(){Qe(!0)}),[]);var $e=(0,c.Z)(!1,{defaultValue:U,value:F}),Je=(0,o.Z)($e,2),et=Je[0],tt=Je[1],nt=!!Ye&&et,it=!I&&L;(M||it&&nt&&"combobox"===k)&&(nt=!1);var rt=!it&&nt,at=d.useCallback((function(e){var t=void 0!==e?e:!nt;M||(tt(t),nt!==t&&(null==G||G(t)))}),[M,nt,tt,G]),st=d.useMemo((function(){return(ne||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[ne]),ot=d.useContext(q)||{},lt=ot.maxCount,ut=ot.rawValues,ct=function(e,t,n){if(!(Ae&&W(lt)&&(null==ut?void 0:ut.size)>=lt)){var i=!0,a=e;null==V||V(null);var s=function(e,t,n){if(!t||!t.length)return null;var i=!1,a=function e(t,n){var a=(0,H.Z)(n),s=a[0],o=a.slice(1);if(!s)return[t];var l=t.split(s);return i=i||l.length>1,l.reduce((function(t,n){return[].concat((0,r.Z)(t),(0,r.Z)(e(n,o)))}),[]).filter(Boolean)}(e,t);return i?void 0!==n?a.slice(0,n):a:null}(e,ne,W(lt)?lt-ut.size:void 0),o=n?null:s;return"combobox"!==k&&o&&(a="",null==te||te(o),at(!1),i=!1),ee&&Ve!==a&&ee(a,{source:t?"typing":"effect"}),i}};d.useEffect((function(){nt||Ae||"combobox"===k||ct("",!1,!1)}),[nt]),d.useEffect((function(){et&&M&&tt(!1),M&&!Be.current&&je(!1)}),[M]);var ht=x(),dt=(0,o.Z)(ht,2),ft=dt[0],pt=dt[1],mt=d.useRef(!1),gt=d.useRef(!1),_t=[];d.useEffect((function(){return function(){_t.forEach((function(e){return clearTimeout(e)})),_t.splice(0,_t.length)}}),[]);var vt,yt=d.useState({}),bt=(0,o.Z)(yt,2)[1];Ze&&(vt=function(e){at(e)}),function(e,t,n,i){var r=d.useRef(null);r.current={open:t,triggerOpen:n,customizedTrigger:i},d.useEffect((function(){function t(t){var n;if(null===(n=r.current)||void 0===n||!n.customizedTrigger){var i=t.target;i.shadowRoot&&t.composed&&(i=t.composedPath()[0]||i),r.current.open&&e().filter((function(e){return e})).every((function(e){return!e.contains(i)&&e!==i}))&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",t),function(){return window.removeEventListener("mousedown",t)}}),[])}((function(){var e;return[Me.current,null===(e=Oe.current)||void 0===e?void 0:e.getPopupElement()]}),rt,at,!!Ze);var xt,Et=d.useMemo((function(){return(0,s.Z)((0,s.Z)({},e),{},{notFoundContent:I,open:nt,triggerOpen:rt,id:h,showSearch:Ce,multiple:Ae,toggleOpen:at})}),[e,I,rt,nt,h,Ce,Ae,at]),wt=!!ae||P;wt&&(xt=d.createElement(v,{className:p()("".concat(f,"-arrow"),(0,a.Z)({},"".concat(f,"-arrow-loading"),P)),customizeIcon:ae,customizeIconProps:{loading:P,searchValue:Ve,open:nt,focused:ze,showSearch:Ce}}));var Tt,St=function(e,t,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7?arguments[7]:void 0,l=d.useMemo((function(){return"object"===(0,u.Z)(i)?i.clearIcon:r||void 0}),[i,r]),c=d.useMemo((function(){return!(a||!i||!n.length&&!s||"combobox"===o&&""===s)}),[i,a,n.length,s,o]);return{allowClear:c,clearIcon:d.createElement(v,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:l},"×")}}(f,(function(){var e;null==D||D(),null===(e=Ne.current)||void 0===e||e.focus(),C([],{type:"clear",values:A}),ct("",!1,!1)}),A,ie,se,M,Ve,k),At=St.allowClear,Ct=St.clearIcon,Lt=d.createElement(oe,{ref:Fe}),Rt=p()(f,b,(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(f,"-focused"),ze),"".concat(f,"-multiple"),Ae),"".concat(f,"-single"),!Ae),"".concat(f,"-allow-clear"),ie),"".concat(f,"-show-arrow"),wt),"".concat(f,"-disabled"),M),"".concat(f,"-loading"),P),"".concat(f,"-open"),nt),"".concat(f,"-customize-input"),We),"".concat(f,"-show-search"),Ce)),It=d.createElement(j,{ref:Oe,disabled:M,prefixCls:f,visible:rt,popupElement:Lt,animation:le,transitionName:ue,dropdownStyle:ce,dropdownClassName:he,direction:T,dropdownMatchSelectWidth:de,dropdownRender:fe,dropdownAlign:pe,placement:me,builtinPlacements:ge,getPopupContainer:_e,empty:L,getTriggerDOMNode:function(e){return Pe.current||e},onPopupVisibleChange:vt,onPopupMouseEnter:function(){bt({})}},Ze?d.cloneElement(Ze,{ref:Ke}):d.createElement(B,(0,i.Z)({},e,{domRef:Pe,prefixCls:f,inputElement:We,ref:Ne,id:h,prefix:re,showSearch:Ce,autoClearSearchValue:J,mode:k,activeDescendantId:Z,tagRender:w,values:A,open:nt,onToggleOpen:at,activeValue:z,searchValue:Ve,onSearch:ct,onSearchSubmit:function(e){e&&e.trim()&&ee(e,{source:"submit"})},onRemove:function(e){var t=A.filter((function(t){return t!==e}));C(t,{type:"remove",values:[e]})},tokenWithEnter:st,onInputBlur:function(){mt.current=!1}})));return Tt=Ze?It:d.createElement("div",(0,i.Z)({className:Rt},Le,{ref:Me,onMouseDown:function(e){var t,n=e.target,i=null===(t=Oe.current)||void 0===t?void 0:t.getPopupElement();if(i&&i.contains(n)){var r=setTimeout((function(){var e,t=_t.indexOf(r);-1!==t&&_t.splice(t,1),He(),De||i.contains(document.activeElement)||null===(e=Ne.current)||void 0===e||e.focus()}));_t.push(r)}for(var a=arguments.length,s=new Array(a>1?a-1:0),o=1;o<a;o++)s[o-1]=arguments[o];null==Te||Te.apply(void 0,[e].concat(s))},onKeyDown:function(e){var t,n=ft(),i=e.key,a="Enter"===i;if(a&&("combobox"!==k&&e.preventDefault(),nt||at(!0)),pt(!!Ve),"Backspace"===i&&!n&&Ae&&!Ve&&A.length){for(var s=(0,r.Z)(A),o=null,l=s.length-1;l>=0;l-=1){var u=s[l];if(!u.disabled){s.splice(l,1),o=u;break}}o&&C(s,{type:"remove",values:[o]})}for(var c=arguments.length,h=new Array(c>1?c-1:0),d=1;d<c;d++)h[d-1]=arguments[d];!nt||a&&mt.current||(a&&(mt.current=!0),null===(t=Fe.current)||void 0===t||t.onKeyDown.apply(t,[e].concat(h))),null==we||we.apply(void 0,[e].concat(h))},onKeyUp:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r;nt&&(null===(r=Fe.current)||void 0===r||r.onKeyUp.apply(r,[e].concat(n))),"Enter"===e.key&&(mt.current=!1),null==Ee||Ee.apply(void 0,[e].concat(n))},onFocus:function(){je(!0),M||(be&&!gt.current&&be.apply(void 0,arguments),ye.includes("focus")&&at(!0)),gt.current=!0},onBlur:function(){Be.current=!0,je(!1,(function(){gt.current=!1,Be.current=!1,at(!1)})),M||(Ve&&("tags"===k?ee(Ve,{source:"submit"}):"multiple"===k&&ee("",{source:"blur"})),xe&&xe.apply(void 0,arguments))}}),d.createElement(X,{visible:ze&&!nt,values:A}),It,xt,At&&Ct),d.createElement(y.Provider,{value:Et},Tt)}));var ee=J,te=function(){return null};te.isSelectOptGroup=!0;var ne=te,ie=function(){return null};ie.isSelectOption=!0;var re=ie,ae=n(80547),se=n(2738),oe=n(48911);var le=["disabled","title","children","style","className"];function ue(e){return"string"==typeof e||"number"==typeof e}var ce=function(e,t){var n=b(),s=n.prefixCls,u=n.id,c=n.open,h=n.multiple,f=n.mode,m=n.searchValue,g=n.toggleOpen,_=n.notFoundContent,y=n.onPopupScroll,x=d.useContext(q),T=x.maxCount,S=x.flattenOptions,A=x.onActiveValue,C=x.defaultActiveFirstOption,L=x.onSelect,R=x.menuItemSelectedIcon,I=x.rawValues,D=x.fieldNames,k=x.virtual,M=x.direction,P=x.listHeight,O=x.listItemHeight,N=x.optionRender,F="".concat(s,"-item"),B=(0,ae.Z)((function(){return S}),[c,S],(function(e,t){return t[0]&&e[1]!==t[1]})),U=d.useRef(null),G=d.useMemo((function(){return h&&W(T)&&(null==I?void 0:I.size)>=T}),[h,T,null==I?void 0:I.size]),z=function(e){e.preventDefault()},j=function(e){var t;null===(t=U.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},H=d.useCallback((function(e){return"combobox"!==f&&I.has(e)}),[f,(0,r.Z)(I).toString(),I.size]),V=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=B.length,i=0;i<n;i+=1){var r=(e+i*t+n)%n,a=B[r]||{},s=a.group,o=a.data;if(!s&&(null==o||!o.disabled)&&(H(o.value)||!G))return r}return-1},Z=d.useState((function(){return V(0)})),K=(0,o.Z)(Z,2),X=K[0],Y=K[1],Q=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Y(e);var n={source:t?"keyboard":"mouse"},i=B[e];i?A(i.value,e,n):A(null,-1,n)};(0,d.useEffect)((function(){Q(!1!==C?V(0):-1)}),[B.length,m]);var $=d.useCallback((function(e){return"combobox"===f?String(e).toLowerCase()===m.toLowerCase():I.has(e)}),[f,m,(0,r.Z)(I).toString(),I.size]);(0,d.useEffect)((function(){var e,t=setTimeout((function(){if(!h&&c&&1===I.size){var e=Array.from(I)[0],t=B.findIndex((function(t){var n=t.data;return m?String(n.value).startsWith(m):n.value===e}));-1!==t&&(Q(t),j(t))}}));c&&(null===(e=U.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[c,m]);var J=function(e){void 0!==e&&L(e,{selected:!I.has(e)}),h||g(!1)};if(d.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case E.Z.N:case E.Z.P:case E.Z.UP:case E.Z.DOWN:var i=0;if(t===E.Z.UP?i=-1:t===E.Z.DOWN?i=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===E.Z.N?i=1:t===E.Z.P&&(i=-1)),0!==i){var r=V(X+i,i);j(r),Q(r,!0)}break;case E.Z.TAB:case E.Z.ENTER:var a,s=B[X];!s||null!=s&&null!==(a=s.data)&&void 0!==a&&a.disabled||G?J(void 0):J(s.value),c&&e.preventDefault();break;case E.Z.ESC:g(!1),c&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){j(e)}}})),0===B.length)return d.createElement("div",{role:"listbox",id:"".concat(u,"_list"),className:"".concat(F,"-empty"),onMouseDown:z},_);var ee=Object.keys(D).map((function(e){return D[e]})),te=function(e){return e.label};function ne(e,t){return{role:e.group?"presentation":"option",id:"".concat(u,"_list_").concat(t)}}var ie=function(e){var t=B[e];if(!t)return null;var n=t.data||{},r=n.value,a=t.group,s=(0,w.Z)(n,!0),o=te(t);return t?d.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof o||a?null:o},s,{key:e},ne(t,e),{"aria-selected":$(r)}),r):null},re={role:"listbox",id:"".concat(u,"_list")};return d.createElement(d.Fragment,null,k&&d.createElement("div",(0,i.Z)({},re,{style:{height:0,width:0,overflow:"hidden"}}),ie(X-1),ie(X),ie(X+1)),d.createElement(oe.Z,{itemKey:"key",ref:U,data:B,height:P,itemHeight:O,fullHeight:!1,onMouseDown:z,onScroll:y,virtual:k,direction:M,innerProps:k?null:re},(function(e,t){var n=e.group,r=e.groupOption,s=e.data,o=e.label,u=e.value,c=s.key;if(n){var h,f=null!==(h=s.title)&&void 0!==h?h:ue(o)?o.toString():void 0;return d.createElement("div",{className:p()(F,"".concat(F,"-group"),s.className),title:f},void 0!==o?o:c)}var m=s.disabled,g=s.title,_=(s.children,s.style),y=s.className,b=(0,l.Z)(s,le),x=(0,se.Z)(b,ee),E=H(u),T=m||!E&&G,S="".concat(F,"-option"),A=p()(F,S,y,(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(S,"-grouped"),r),"".concat(S,"-active"),X===t&&!T),"".concat(S,"-disabled"),T),"".concat(S,"-selected"),E)),C=te(e),L=!R||"function"==typeof R||E,I="number"==typeof C?C:C||u,D=ue(I)?I.toString():void 0;return void 0!==g&&(D=g),d.createElement("div",(0,i.Z)({},(0,w.Z)(x),k?{}:ne(e,t),{"aria-selected":$(u),className:A,title:D,onMouseMove:function(){X===t||T||Q(t)},onClick:function(){T||J(u)},style:_}),d.createElement("div",{className:"".concat(S,"-content")},"function"==typeof N?N(e,{index:t}):I),d.isValidElement(R)||E,L&&d.createElement(v,{className:"".concat(F,"-option-state"),customizeIcon:R,customizeIconProps:{value:u,disabled:T,isSelected:E}},E?"✓":null))})))};var he=d.forwardRef(ce);function de(e,t){return R(e).join("").toUpperCase().includes(t)}var fe=n(6551),pe=n(11592),me=["children","value"],ge=["children"];function _e(e){var t=e,n=t.key,i=t.props,r=i.children,a=i.value,o=(0,l.Z)(i,me);return(0,s.Z)({key:n,value:void 0!==a?a:n,children:r},o)}function ve(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,pe.Z)(e).map((function(e,n){if(!d.isValidElement(e)||!e.type)return null;var i=e,r=i.type.isSelectOptGroup,a=i.key,o=i.props,u=o.children,c=(0,l.Z)(o,ge);return t||!r?_e(e):(0,s.Z)((0,s.Z)({key:"__RC_SELECT_GRP__".concat(null===a?n:a,"__"),label:a},c),{},{options:ve(u)})})).filter((function(e){return e}))}var ye=function(e,t,n,i,r){return d.useMemo((function(){var a=e;!e&&(a=ve(t));var s=new Map,o=new Map,l=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=0;u<t.length;u+=1){var c=t[u];!c[n.options]||a?(s.set(c[n.value],c),l(o,c,n.label),l(o,c,i),l(o,c,r)):e(c[n.options],!0)}}(a),{options:a,valueOptions:s,labelOptions:o}}),[e,t,n,i,r])};function be(e){var t=d.useRef();t.current=e;var n=d.useCallback((function(){return t.current.apply(t,arguments)}),[]);return n}var xe=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Ee=["inputValue"];var we=d.forwardRef((function(e,t){var n=e.id,h=e.mode,f=e.prefixCls,p=void 0===f?"rc-select":f,m=e.backfill,g=e.fieldNames,_=e.inputValue,v=e.searchValue,y=e.onSearch,b=e.autoClearSearchValue,x=void 0===b||b,E=e.onSelect,w=e.onDeselect,T=e.dropdownMatchSelectWidth,S=void 0===T||T,A=e.filterOption,C=e.filterSort,L=e.optionFilterProp,I=e.optionLabelProp,D=e.options,k=e.optionRender,M=e.children,P=e.defaultActiveFirstOption,O=e.menuItemSelectedIcon,N=e.virtual,F=e.direction,B=e.listHeight,U=void 0===B?200:B,G=e.listItemHeight,z=void 0===G?20:G,j=e.labelRender,H=e.value,W=e.defaultValue,X=e.labelInValue,Y=e.onChange,Q=e.maxCount,J=(0,l.Z)(e,xe),te=(0,fe.ZP)(n),ne=$(h),ie=!(D||!M),re=d.useMemo((function(){return(void 0!==A||"combobox"!==h)&&A}),[A,h]),ae=d.useMemo((function(){return Z(g,ie)}),[JSON.stringify(g),ie]),se=(0,c.Z)("",{value:void 0!==v?v:_,postState:function(e){return e||""}}),oe=(0,o.Z)(se,2),le=oe[0],ue=oe[1],ce=ye(D,M,ae,L,I),pe=ce.valueOptions,me=ce.labelOptions,ge=ce.options,_e=d.useCallback((function(e){return R(e).map((function(e){var t,n,i,r,a,s;(function(e){return!e||"object"!==(0,u.Z)(e)})(e)?t=e:(i=e.key,n=e.label,t=null!==(s=e.value)&&void 0!==s?s:i);var o,l=pe.get(t);l&&(void 0===n&&(n=null==l?void 0:l[I||ae.label]),void 0===i&&(i=null!==(o=null==l?void 0:l.key)&&void 0!==o?o:t),r=null==l?void 0:l.disabled,a=null==l?void 0:l.title);return{label:n,value:t,key:i,disabled:r,title:a}}))}),[ae,I,pe]),ve=(0,c.Z)(W,{value:H}),we=(0,o.Z)(ve,2),Te=we[0],Se=we[1],Ae=d.useMemo((function(){var e,t=_e(ne&&null===Te?[]:Te);return"combobox"===h&&function(e){return!e&&0!==e}(null===(e=t[0])||void 0===e?void 0:e.value)?[]:t}),[Te,_e,h,ne]),Ce=function(e,t){var n=d.useRef({values:new Map,options:new Map});return[d.useMemo((function(){var i=n.current,r=i.values,a=i.options,o=e.map((function(e){var t;return void 0===e.label?(0,s.Z)((0,s.Z)({},e),{},{label:null===(t=r.get(e.value))||void 0===t?void 0:t.label}):e})),l=new Map,u=new Map;return o.forEach((function(e){l.set(e.value,e),u.set(e.value,t.get(e.value)||a.get(e.value))})),n.current.values=l,n.current.options=u,o}),[e,t]),d.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(Ae,pe),Le=(0,o.Z)(Ce,2),Re=Le[0],Ie=Le[1],De=d.useMemo((function(){if(!h&&1===Re.length){var e=Re[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return Re.map((function(e){var t;return(0,s.Z)((0,s.Z)({},e),{},{label:null!==(t="function"==typeof j?j(e):e.label)&&void 0!==t?t:e.value})}))}),[h,Re,j]),ke=d.useMemo((function(){return new Set(Re.map((function(e){return e.value})))}),[Re]);d.useEffect((function(){if("combobox"===h){var e,t=null===(e=Re[0])||void 0===e?void 0:e.value;ue(function(e){return null!=e}(t)?String(t):"")}}),[Re]);var Me=be((function(e,t){var n=null!=t?t:e;return(0,a.Z)((0,a.Z)({},ae.value,e),ae.label,n)})),Pe=function(e,t,n,i,r){return d.useMemo((function(){if(!n||!1===i)return e;var o=t.options,l=t.label,u=t.value,c=[],h="function"==typeof i,d=n.toUpperCase(),f=h?i:function(e,t){return r?de(t[r],d):t[o]?de(t["children"!==l?l:"label"],d):de(t[u],d)},p=h?function(e){return K(e)}:function(e){return e};return e.forEach((function(e){if(e[o])if(f(n,p(e)))c.push(e);else{var t=e[o].filter((function(e){return f(n,p(e))}));t.length&&c.push((0,s.Z)((0,s.Z)({},e),{},(0,a.Z)({},o,t)))}else f(n,p(e))&&c.push(e)})),c}),[e,i,r,n,t])}(d.useMemo((function(){if("tags"!==h)return ge;var e=(0,r.Z)(ge);return(0,r.Z)(Re).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(t){var n=t.value;(function(e){return pe.has(e)})(n)||e.push(Me(n,t.label))})),e}),[Me,ge,pe,Re,h]),ae,le,re,L),Oe=d.useMemo((function(){return"tags"!==h||!le||Pe.some((function(e){return e[L||"value"]===le}))||Pe.some((function(e){return e[ae.value]===le}))?Pe:[Me(le)].concat((0,r.Z)(Pe))}),[Me,L,h,Pe,le,ae]),Ne=function e(t){return(0,r.Z)(t).sort((function(e,t){return C(e,t,{searchValue:le})})).map((function(t){return Array.isArray(t.options)?(0,s.Z)((0,s.Z)({},t),{},{options:t.options.length>0?e(t.options):t.options}):t}))},Fe=d.useMemo((function(){return C?Ne(Oe):Oe}),[Oe,C,le]),Be=d.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,i=t.childrenAsData,r=[],a=Z(n,!1),s=a.label,o=a.value,l=a.options,u=a.groupLabel;function c(e,t){Array.isArray(e)&&e.forEach((function(e){if(t||!(l in e)){var n=e[o];r.push({key:V(e,r.length),groupOption:t,data:e,label:e[s],value:n})}else{var a=e[u];void 0===a&&i&&(a=e.label),r.push({key:V(e,r.length),group:!0,data:e,label:a}),c(e[l],!0)}}))}return c(e,!1),r}(Fe,{fieldNames:ae,childrenAsData:ie})}),[Fe,ae,ie]),Ue=function(e){var t=_e(e);if(Se(t),Y&&(t.length!==Re.length||t.some((function(e,t){var n;return(null===(n=Re[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=X?t:t.map((function(e){return e.value})),i=t.map((function(e){return K(Ie(e.value))}));Y(ne?n:n[0],ne?i:i[0])}},Ge=d.useState(null),ze=(0,o.Z)(Ge,2),je=ze[0],He=ze[1],Ve=d.useState(0),We=(0,o.Z)(Ve,2),Ze=We[0],Ke=We[1],qe=void 0!==P?P:"combobox"!==h,Xe=d.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.source,r=void 0===i?"keyboard":i;Ke(t),m&&"combobox"===h&&null!==e&&"keyboard"===r&&He(String(e))}),[m,h]),Ye=function(e,t,n){var i=function(){var t,n=Ie(e);return[X?{label:null==n?void 0:n[ae.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,K(n)]};if(t&&E){var r=i(),a=(0,o.Z)(r,2),s=a[0],l=a[1];E(s,l)}else if(!t&&w&&"clear"!==n){var u=i(),c=(0,o.Z)(u,2),h=c[0],d=c[1];w(h,d)}},Qe=be((function(e,t){var n,i=!ne||t.selected;n=i?ne?[].concat((0,r.Z)(Re),[e]):[e]:Re.filter((function(t){return t.value!==e})),Ue(n),Ye(e,i),"combobox"===h?He(""):$&&!x||(ue(""),He(""))})),$e=d.useMemo((function(){var e=!1!==N&&!1!==S;return(0,s.Z)((0,s.Z)({},ce),{},{flattenOptions:Be,onActiveValue:Xe,defaultActiveFirstOption:qe,onSelect:Qe,menuItemSelectedIcon:O,rawValues:ke,fieldNames:ae,virtual:e,direction:F,listHeight:U,listItemHeight:z,childrenAsData:ie,maxCount:Q,optionRender:k})}),[Q,ce,Be,Xe,qe,Qe,O,ke,ae,N,S,F,U,z,ie,k]);return d.createElement(q.Provider,{value:$e},d.createElement(ee,(0,i.Z)({},J,{id:te,prefixCls:p,ref:t,omitDomProps:Ee,mode:h,displayValues:De,onDisplayValuesChange:function(e,t){Ue(e);var n=t.type,i=t.values;"remove"!==n&&"clear"!==n||i.forEach((function(e){Ye(e.value,!1,n)}))},direction:F,searchValue:le,onSearch:function(e,t){if(ue(e),He(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===h&&Ue(e),null==y||y(e));else{var n=(e||"").trim();if(n){var i=Array.from(new Set([].concat((0,r.Z)(ke),[n])));Ue(i),Ye(n,!0),ue("")}}},autoClearSearchValue:x,onSearchSplit:function(e){var t=e;"tags"!==h&&(t=e.map((function(e){var t=me.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat((0,r.Z)(ke),(0,r.Z)(t))));Ue(n),n.forEach((function(e){Ye(e,!0)}))},dropdownMatchSelectWidth:S,OptionList:he,emptyOptions:!Be.length,activeValue:je,activeDescendantId:"".concat(te,"_list_").concat(Ze)})))}));var Te=we;Te.Option=re,Te.OptGroup=ne;var Se=Te},22711:function(e,t,n){"use strict";n.r(t),n.d(t,{ResizableTextArea:function(){return C},default:function(){return R}});var i,r=n(54476),a=n(20068),s=n(33885),o=n(94480),l=n(42978),u=n(75931),c=n(92310),h=n.n(c),d=n(36901),f=n(66003),p=n(30292),m=n(18929),g=n(59301),_=n(76190),v=n(29301),y=n(34280),b=n(16089),x="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],w={};function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&w[n])return w[n];var i=window.getComputedStyle(e),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),a=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),s=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),o=E.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),l={sizingStyle:o,paddingSize:a,borderSize:s,boxSizing:r};return t&&n&&(w[n]=l),l}var S=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],A=g.forwardRef((function(e,t){var n=e,o=n.prefixCls,c=n.defaultValue,d=n.value,f=n.autoSize,p=n.onResize,E=n.className,w=n.style,A=n.disabled,C=n.onChange,L=(n.onInternalAutoSize,(0,u.Z)(n,S)),R=(0,m.Z)(c,{value:d,postState:function(e){return null!=e?e:""}}),I=(0,l.Z)(R,2),D=I[0],k=I[1],M=g.useRef();g.useImperativeHandle(t,(function(){return{textArea:M.current}}));var P=g.useMemo((function(){return f&&"object"===(0,_.Z)(f)?[f.minRows,f.maxRows]:[]}),[f]),O=(0,l.Z)(P,2),N=O[0],F=O[1],B=!!f,U=g.useState(2),G=(0,l.Z)(U,2),z=G[0],j=G[1],H=g.useState(),V=(0,l.Z)(H,2),W=V[0],Z=V[1],K=function(){j(0)};(0,y.Z)((function(){B&&K()}),[d,N,F,B]),(0,y.Z)((function(){if(0===z)j(1);else if(1===z){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i||((i=document.createElement("textarea")).setAttribute("tab-index","-1"),i.setAttribute("aria-hidden","true"),i.setAttribute("name","hiddenTextarea"),document.body.appendChild(i)),e.getAttribute("wrap")?i.setAttribute("wrap",e.getAttribute("wrap")):i.removeAttribute("wrap");var a=T(e,t),s=a.paddingSize,o=a.borderSize,l=a.boxSizing,u=a.sizingStyle;i.setAttribute("style","".concat(u,";").concat(x)),i.value=e.value||e.placeholder||"";var c,h=void 0,d=void 0,f=i.scrollHeight;if("border-box"===l?f+=o:"content-box"===l&&(f-=s),null!==n||null!==r){i.value=" ";var p=i.scrollHeight-s;null!==n&&(h=p*n,"border-box"===l&&(h=h+s+o),f=Math.max(h,f)),null!==r&&(d=p*r,"border-box"===l&&(d=d+s+o),c=f>d?"":"hidden",f=Math.min(d,f))}var m={height:f,overflowY:c,resize:"none"};return h&&(m.minHeight=h),d&&(m.maxHeight=d),m}(M.current,!1,N,F);j(2),Z(e)}else!function(){try{if(document.activeElement===M.current){var e=M.current,t=e.selectionStart,n=e.selectionEnd,i=e.scrollTop;M.current.setSelectionRange(t,n),M.current.scrollTop=i}}catch(e){}}()}),[z]);var q=g.useRef(),X=function(){b.Z.cancel(q.current)};g.useEffect((function(){return X}),[]);var Y=B?W:null,Q=(0,s.Z)((0,s.Z)({},w),Y);return 0!==z&&1!==z||(Q.overflowY="hidden",Q.overflowX="hidden"),g.createElement(v.Z,{onResize:function(e){2===z&&(null==p||p(e),f&&(X(),q.current=(0,b.Z)((function(){K()}))))},disabled:!(f||p)},g.createElement("textarea",(0,r.Z)({},L,{ref:M,style:Q,className:h()(o,E,(0,a.Z)({},"".concat(o,"-disabled"),A)),disabled:A,value:D,onChange:function(e){k(e.target.value),null==C||C(e)}})))})),C=A,L=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],R=g.forwardRef((function(e,t){var n,i=e.defaultValue,c=e.value,_=e.onFocus,v=e.onBlur,y=e.onChange,b=e.allowClear,x=e.maxLength,E=e.onCompositionStart,w=e.onCompositionEnd,T=e.suffix,S=e.prefixCls,A=void 0===S?"rc-textarea":S,R=e.showCount,I=e.count,D=e.className,k=e.style,M=e.disabled,P=e.hidden,O=e.classNames,N=e.styles,F=e.onResize,B=e.onClear,U=e.onPressEnter,G=e.readOnly,z=e.autoSize,j=e.onKeyDown,H=(0,u.Z)(e,L),V=(0,m.Z)(i,{value:c,defaultValue:i}),W=(0,l.Z)(V,2),Z=W[0],K=W[1],q=null==Z?"":String(Z),X=g.useState(!1),Y=(0,l.Z)(X,2),Q=Y[0],$=Y[1],J=g.useRef(!1),ee=g.useState(null),te=(0,l.Z)(ee,2),ne=te[0],ie=te[1],re=(0,g.useRef)(null),ae=(0,g.useRef)(null),se=function(){var e;return null===(e=ae.current)||void 0===e?void 0:e.textArea},oe=function(){se().focus()};(0,g.useImperativeHandle)(t,(function(){var e;return{resizableTextArea:ae.current,focus:oe,blur:function(){se().blur()},nativeElement:(null===(e=re.current)||void 0===e?void 0:e.nativeElement)||se()}})),(0,g.useEffect)((function(){$((function(e){return!M&&e}))}),[M]);var le=g.useState(null),ue=(0,l.Z)(le,2),ce=ue[0],he=ue[1];g.useEffect((function(){var e;ce&&(e=se()).setSelectionRange.apply(e,(0,o.Z)(ce))}),[ce]);var de,fe=(0,f.Z)(I,R),pe=null!==(n=fe.max)&&void 0!==n?n:x,me=Number(pe)>0,ge=fe.strategy(q),_e=!!pe&&ge>pe,ve=function(e,t){var n=t;!J.current&&fe.exceedFormatter&&fe.max&&fe.strategy(t)>fe.max&&t!==(n=fe.exceedFormatter(t,{max:fe.max}))&&he([se().selectionStart||0,se().selectionEnd||0]),K(n),(0,p.rJ)(e.currentTarget,e,y,n)},ye=T;fe.show&&(de=fe.showFormatter?fe.showFormatter({value:q,count:ge,maxLength:pe}):"".concat(ge).concat(me?" / ".concat(pe):""),ye=g.createElement(g.Fragment,null,ye,g.createElement("span",{className:h()("".concat(A,"-data-count"),null==O?void 0:O.count),style:null==N?void 0:N.count},de)));var be=!z&&!R&&!b;return g.createElement(d.BaseInput,{ref:re,value:q,allowClear:b,handleReset:function(e){K(""),oe(),(0,p.rJ)(se(),e,y)},suffix:ye,prefixCls:A,classNames:(0,s.Z)((0,s.Z)({},O),{},{affixWrapper:h()(null==O?void 0:O.affixWrapper,(0,a.Z)((0,a.Z)({},"".concat(A,"-show-count"),R),"".concat(A,"-textarea-allow-clear"),b))}),disabled:M,focused:Q,className:h()(D,_e&&"".concat(A,"-out-of-range")),style:(0,s.Z)((0,s.Z)({},k),ne&&!be?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof de?de:void 0}},hidden:P,readOnly:G,onClear:B},g.createElement(C,(0,r.Z)({},H,{autoSize:z,maxLength:x,onKeyDown:function(e){"Enter"===e.key&&U&&U(e),null==j||j(e)},onChange:function(e){ve(e,e.target.value)},onFocus:function(e){$(!0),null==_||_(e)},onBlur:function(e){$(!1),null==v||v(e)},onCompositionStart:function(e){J.current=!0,null==E||E(e)},onCompositionEnd:function(e){J.current=!1,ve(e,e.currentTarget.value),null==w||w(e)},className:h()(null==O?void 0:O.textarea),style:(0,s.Z)((0,s.Z)({},null==N?void 0:N.textarea),{},{resize:null==k?void 0:k.resize}),disabled:M,prefixCls:A,onResize:function(e){var t;null==F||F(e),null!==(t=se())&&void 0!==t&&t.style.height&&ie(!0)},ref:ae,readOnly:G})))}))},29125:function(e,t,n){"use strict";n.d(t,{G:function(){return s},Z:function(){return v}});var i=n(92310),r=n.n(i),a=n(59301);function s(e){var t=e.children,n=e.prefixCls,i=e.id,s=e.overlayInnerStyle,o=e.bodyClassName,l=e.className,u=e.style;return a.createElement("div",{className:r()("".concat(n,"-content"),l),style:u},a.createElement("div",{className:r()("".concat(n,"-inner"),o),id:i,role:"tooltip",style:s},"function"==typeof t?t():t))}var o=n(54476),l=n(33885),u=n(75931),c=n(65030),h={shiftX:64,adjustY:1},d={adjustX:1,shiftY:!0},f=[0,0],p={left:{points:["cr","cl"],overflow:d,offset:[-4,0],targetOffset:f},right:{points:["cl","cr"],overflow:d,offset:[4,0],targetOffset:f},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:f},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:f},topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:f},leftTop:{points:["tr","tl"],overflow:d,offset:[-4,0],targetOffset:f},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:f},rightTop:{points:["tl","tr"],overflow:d,offset:[4,0],targetOffset:f},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:f},rightBottom:{points:["bl","br"],overflow:d,offset:[4,0],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:f},leftBottom:{points:["br","bl"],overflow:d,offset:[-4,0],targetOffset:f}},m=n(80402),g=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],_=function(e,t){var n=e.overlayClassName,i=e.trigger,h=void 0===i?["hover"]:i,d=e.mouseEnterDelay,f=void 0===d?0:d,_=e.mouseLeaveDelay,v=void 0===_?.1:_,y=e.overlayStyle,b=e.prefixCls,x=void 0===b?"rc-tooltip":b,E=e.children,w=e.onVisibleChange,T=e.afterVisibleChange,S=e.transitionName,A=e.animation,C=e.motion,L=e.placement,R=void 0===L?"right":L,I=e.align,D=void 0===I?{}:I,k=e.destroyTooltipOnHide,M=void 0!==k&&k,P=e.defaultVisible,O=e.getTooltipContainer,N=e.overlayInnerStyle,F=(e.arrowContent,e.overlay),B=e.id,U=e.showArrow,G=void 0===U||U,z=e.classNames,j=e.styles,H=(0,u.Z)(e,g),V=(0,m.Z)(B),W=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(function(){return W.current}));var Z=(0,l.Z)({},H);"visible"in e&&(Z.popupVisible=e.visible);var K,q,X;return a.createElement(c.Z,(0,o.Z)({popupClassName:r()(n,null==z?void 0:z.root),prefixCls:x,popup:function(){return a.createElement(s,{key:"content",prefixCls:x,id:V,bodyClassName:null==z?void 0:z.body,overlayInnerStyle:(0,l.Z)((0,l.Z)({},N),null==j?void 0:j.body)},F)},action:h,builtinPlacements:p,popupPlacement:R,ref:W,popupAlign:D,getPopupContainer:O,onPopupVisibleChange:w,afterPopupVisibleChange:T,popupTransitionName:S,popupAnimation:A,popupMotion:C,defaultPopupVisible:P,autoDestroy:M,mouseLeaveDelay:v,popupStyle:(0,l.Z)((0,l.Z)({},y),null==j?void 0:j.root),mouseEnterDelay:f,arrow:G},Z),(K=a.Children.only(E),q=(null==K?void 0:K.props)||{},X=(0,l.Z)((0,l.Z)({},q),{},{"aria-describedby":F?V:null}),a.cloneElement(E,X)))},v=(0,a.forwardRef)(_)},49658:function(e,t){"use strict";t.Z=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=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(e)||/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(null==e?void 0:e.substr(0,4))}},48911:function(e,t,n){"use strict";n.d(t,{Z:function(){return B}});var i=n(54476),r=n(76190),a=n(33885),s=n(20068),o=n(42978),l=n(75931),u=n(92310),c=n.n(u),h=n(29301),d=n(70425),f=n(34280),p=n(59301),m=n(4676),g=p.forwardRef((function(e,t){var n=e.height,r=e.offsetY,o=e.offsetX,l=e.children,u=e.prefixCls,d=e.onInnerResize,f=e.innerProps,m=e.rtl,g=e.extra,_={},v={display:"flex",flexDirection:"column"};return void 0!==r&&(_={height:n,position:"relative",overflow:"hidden"},v=(0,a.Z)((0,a.Z)({},v),{},(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({transform:"translateY(".concat(r,"px)")},m?"marginRight":"marginLeft",-o),"position","absolute"),"left",0),"right",0),"top",0))),p.createElement("div",{style:_},p.createElement(h.Z,{onResize:function(e){e.offsetHeight&&d&&d()}},p.createElement("div",(0,i.Z)({style:v,className:c()((0,s.Z)({},"".concat(u,"-holder-inner"),u)),ref:t},f),l,g)))}));g.displayName="Filler";var _=g;function v(e){var t=e.children,n=e.setRef,i=p.useCallback((function(e){n(e)}),[]);return p.cloneElement(t,{ref:i})}function y(e,t,n){var i=p.useState(e),r=(0,o.Z)(i,2),a=r[0],s=r[1],l=p.useState(null),u=(0,o.Z)(l,2),c=u[0],h=u[1];return p.useEffect((function(){var i=function(e,t,n){var i,r,a=e.length,s=t.length;if(0===a&&0===s)return null;a<s?(i=e,r=t):(i=t,r=e);var o={__EMPTY_ITEM__:!0};function l(e){return void 0!==e?n(e):o}for(var u=null,c=1!==Math.abs(a-s),h=0;h<r.length;h+=1){var d=l(i[h]);if(d!==l(r[h])){u=h,c=c||d!==l(r[h+1]);break}}return null===u?null:{index:u,multiple:c}}(a||[],e||[],t);void 0!==(null==i?void 0:i.index)&&(null==n||n(i.index),h(e[i.index])),s(e)}),[e]),[c]}var b=n(16089),x="object"===("undefined"==typeof navigator?"undefined":(0,r.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),E=function(e,t,n,i){var r=(0,p.useRef)(!1),a=(0,p.useRef)(null);function s(){clearTimeout(a.current),r.current=!0,a.current=setTimeout((function(){r.current=!1}),50)}var o=(0,p.useRef)({top:e,bottom:t,left:n,right:i});return o.current.top=e,o.current.bottom=t,o.current.left=n,o.current.right=i,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e?t<0&&o.current.left||t>0&&o.current.right:t<0&&o.current.top||t>0&&o.current.bottom;return n&&i?(clearTimeout(a.current),r.current=!1):i&&!r.current||s(),!r.current&&i}};function w(e,t,n,i,r,a,s){var o=(0,p.useRef)(0),l=(0,p.useRef)(null),u=(0,p.useRef)(null),c=(0,p.useRef)(!1),h=E(t,n,i,r);var d=(0,p.useRef)(null),f=(0,p.useRef)(null);return[function(t){if(e){b.Z.cancel(f.current),f.current=(0,b.Z)((function(){d.current=null}),2);var n=t.deltaX,i=t.deltaY,r=t.shiftKey,p=n,m=i;("sx"===d.current||!d.current&&r&&i&&!n)&&(p=i,m=0,d.current="sx");var g=Math.abs(p),_=Math.abs(m);null===d.current&&(d.current=a&&g>_?"x":"y"),"y"===d.current?function(e,t){if(b.Z.cancel(l.current),!h(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,o.current+=t,u.current=t,x||n.preventDefault(),l.current=(0,b.Z)((function(){var e=c.current?10:1;s(o.current*e,!1),o.current=0})))}}(t,m):function(e,t){s(t,!0),x||e.preventDefault()}(t,p)}},function(t){e&&(c.current=t.detail===u.current)}]}var T=n(67732),S=n(83652),A=function(){function e(){(0,T.Z)(this,e),(0,s.Z)(this,"maps",void 0),(0,s.Z)(this,"id",0),(0,s.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,S.Z)(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function C(e){var t=parseFloat(e);return isNaN(t)?0:t}var L=14/15;function R(e){return Math.floor(Math.pow(e,.5))}function I(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var D=p.forwardRef((function(e,t){var n=e.prefixCls,i=e.rtl,r=e.scrollOffset,l=e.scrollRange,u=e.onStartMove,h=e.onStopMove,d=e.onScroll,f=e.horizontal,m=e.spinSize,g=e.containerSize,_=e.style,v=e.thumbStyle,y=e.showScrollBar,x=p.useState(!1),E=(0,o.Z)(x,2),w=E[0],T=E[1],S=p.useState(null),A=(0,o.Z)(S,2),C=A[0],L=A[1],R=p.useState(null),D=(0,o.Z)(R,2),k=D[0],M=D[1],P=!i,O=p.useRef(),N=p.useRef(),F=p.useState(y),B=(0,o.Z)(F,2),U=B[0],G=B[1],z=p.useRef(),j=function(){!0!==y&&!1!==y&&(clearTimeout(z.current),G(!0),z.current=setTimeout((function(){G(!1)}),3e3))},H=l-g||0,V=g-m||0,W=p.useMemo((function(){return 0===r||0===H?0:r/H*V}),[r,H,V]),Z=p.useRef({top:W,dragging:w,pageY:C,startTop:k});Z.current={top:W,dragging:w,pageY:C,startTop:k};var K=function(e){T(!0),L(I(e,f)),M(Z.current.top),u(),e.stopPropagation(),e.preventDefault()};p.useEffect((function(){var e=function(e){e.preventDefault()},t=O.current,n=N.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",K,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",K)}}),[]);var q=p.useRef();q.current=H;var X=p.useRef();X.current=V,p.useEffect((function(){if(w){var e,t=function(t){var n=Z.current,i=n.dragging,r=n.pageY,a=n.startTop;b.Z.cancel(e);var s=O.current.getBoundingClientRect(),o=g/(f?s.width:s.height);if(i){var l=(I(t,f)-r)*o,u=a;!P&&f?u-=l:u+=l;var c=q.current,h=X.current,p=h?u/h:0,m=Math.ceil(p*c);m=Math.max(m,0),m=Math.min(m,c),e=(0,b.Z)((function(){d(m,f)}))}},n=function(){T(!1),h()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),b.Z.cancel(e)}}}),[w]),p.useEffect((function(){return j(),function(){clearTimeout(z.current)}}),[r]),p.useImperativeHandle(t,(function(){return{delayHidden:j}}));var Y="".concat(n,"-scrollbar"),Q={position:"absolute",visibility:U?null:"hidden"},$={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return f?(Object.assign(Q,{height:8,left:0,right:0,bottom:0}),Object.assign($,(0,s.Z)({height:"100%",width:m},P?"left":"right",W))):(Object.assign(Q,(0,s.Z)({width:8,top:0,bottom:0},P?"right":"left",0)),Object.assign($,{width:"100%",height:m,top:W})),p.createElement("div",{ref:O,className:c()(Y,(0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(Y,"-horizontal"),f),"".concat(Y,"-vertical"),!f),"".concat(Y,"-visible"),U)),style:(0,a.Z)((0,a.Z)({},Q),_),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:j},p.createElement("div",{ref:N,className:c()("".concat(Y,"-thumb"),(0,s.Z)({},"".concat(Y,"-thumb-moving"),w)),style:(0,a.Z)((0,a.Z)({},$),v),onMouseDown:K}))}));function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,20),Math.floor(n)}var M=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],P=[],O={overflowY:"auto",overflowAnchor:"none"};function N(e,t){var n=e.prefixCls,u=void 0===n?"rc-virtual-list":n,g=e.className,x=e.height,T=e.itemHeight,S=e.fullHeight,N=void 0===S||S,F=e.style,B=e.data,U=e.children,G=e.itemKey,z=e.virtual,j=e.direction,H=e.scrollWidth,V=e.component,W=void 0===V?"div":V,Z=e.onScroll,K=e.onVirtualScroll,q=e.onVisibleChange,X=e.innerProps,Y=e.extraRender,Q=e.styles,$=e.showScrollBar,J=void 0===$?"optional":$,ee=(0,l.Z)(e,M),te=p.useCallback((function(e){return"function"==typeof G?G(e):null==e?void 0:e[G]}),[G]),ne=function(e,t,n){var i=p.useState(0),r=(0,o.Z)(i,2),a=r[0],s=r[1],l=(0,p.useRef)(new Map),u=(0,p.useRef)(new A),c=(0,p.useRef)(0);function h(){c.current+=1}function d(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h();var t=function(){var e=!1;l.current.forEach((function(t,n){if(t&&t.offsetParent){var i=t.offsetHeight,r=getComputedStyle(t),a=r.marginTop,s=r.marginBottom,o=i+C(a)+C(s);u.current.get(n)!==o&&(u.current.set(n,o),e=!0)}})),e&&s((function(e){return e+1}))};if(e)t();else{c.current+=1;var n=c.current;Promise.resolve().then((function(){n===c.current&&t()}))}}return(0,p.useEffect)((function(){return h}),[]),[function(i,r){var a=e(i),s=l.current.get(a);r?(l.current.set(a,r),d()):l.current.delete(a),!s!=!r&&(r?null==t||t(i):null==n||n(i))},d,u.current,a]}(te,null,null),ie=(0,o.Z)(ne,4),re=ie[0],ae=ie[1],se=ie[2],oe=ie[3],le=!(!1===z||!x||!T),ue=p.useMemo((function(){return Object.values(se.maps).reduce((function(e,t){return e+t}),0)}),[se.id,se.maps]),ce=le&&B&&(Math.max(T*B.length,ue)>x||!!H),he="rtl"===j,de=c()(u,(0,s.Z)({},"".concat(u,"-rtl"),he),g),fe=B||P,pe=(0,p.useRef)(),me=(0,p.useRef)(),ge=(0,p.useRef)(),_e=(0,p.useState)(0),ve=(0,o.Z)(_e,2),ye=ve[0],be=ve[1],xe=(0,p.useState)(0),Ee=(0,o.Z)(xe,2),we=Ee[0],Te=Ee[1],Se=(0,p.useState)(!1),Ae=(0,o.Z)(Se,2),Ce=Ae[0],Le=Ae[1],Re=function(){Le(!0)},Ie=function(){Le(!1)},De={getKey:te};function ke(e){be((function(t){var n=function(e){var t=e;Number.isNaN(Qe.current)||(t=Math.min(t,Qe.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return pe.current.scrollTop=n,n}))}var Me=(0,p.useRef)({start:0,end:fe.length}),Pe=(0,p.useRef)(),Oe=y(fe,te),Ne=(0,o.Z)(Oe,1)[0];Pe.current=Ne;var Fe=p.useMemo((function(){if(!le)return{scrollHeight:void 0,start:0,end:fe.length-1,offset:void 0};var e;if(!ce)return{scrollHeight:(null===(e=me.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:fe.length-1,offset:void 0};for(var t,n,i,r=0,a=fe.length,s=0;s<a;s+=1){var o=fe[s],l=te(o),u=se.get(l),c=r+(void 0===u?T:u);c>=ye&&void 0===t&&(t=s,n=r),c>ye+x&&void 0===i&&(i=s),r=c}return void 0===t&&(t=0,n=0,i=Math.ceil(x/T)),void 0===i&&(i=fe.length-1),{scrollHeight:r,start:t,end:i=Math.min(i+1,fe.length-1),offset:n}}),[ce,le,ye,fe,oe,x]),Be=Fe.scrollHeight,Ue=Fe.start,Ge=Fe.end,ze=Fe.offset;Me.current.start=Ue,Me.current.end=Ge,p.useLayoutEffect((function(){var e=se.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),i=fe[Ue];if(i&&void 0===n)if(te(i)===t){var r=se.get(t)-T;ke((function(e){return e+r}))}}se.resetRecord()}),[Be]);var je=p.useState({width:0,height:x}),He=(0,o.Z)(je,2),Ve=He[0],We=He[1],Ze=(0,p.useRef)(),Ke=(0,p.useRef)(),qe=p.useMemo((function(){return k(Ve.width,H)}),[Ve.width,H]),Xe=p.useMemo((function(){return k(Ve.height,Be)}),[Ve.height,Be]),Ye=Be-x,Qe=(0,p.useRef)(Ye);Qe.current=Ye;var $e=ye<=0,Je=ye>=Ye,et=we<=0,tt=we>=H,nt=E($e,Je,et,tt),it=function(){return{x:he?-we:we,y:ye}},rt=(0,p.useRef)(it()),at=(0,d.zX)((function(e){if(K){var t=(0,a.Z)((0,a.Z)({},it()),e);rt.current.x===t.x&&rt.current.y===t.y||(K(t),rt.current=t)}}));function st(e,t){var n=e;t?((0,m.flushSync)((function(){Te(n)})),at()):ke(n)}var ot=function(e){var t=e,n=H?H-Ve.width:0;return t=Math.max(t,0),t=Math.min(t,n)},lt=(0,d.zX)((function(e,t){t?((0,m.flushSync)((function(){Te((function(t){return ot(t+(he?-e:e))}))})),at()):ke((function(t){return t+e}))})),ut=w(le,$e,Je,et,tt,!!H,lt),ct=(0,o.Z)(ut,2),ht=ct[0],dt=ct[1];!function(e,t,n){var i,r=(0,p.useRef)(!1),a=(0,p.useRef)(0),s=(0,p.useRef)(0),o=(0,p.useRef)(null),l=(0,p.useRef)(null),u=function(e){if(r.current){var t=Math.ceil(e.touches[0].pageX),i=Math.ceil(e.touches[0].pageY),o=a.current-t,u=s.current-i,c=Math.abs(o)>Math.abs(u);c?a.current=t:s.current=i;var h=n(c,c?o:u,!1,e);h&&e.preventDefault(),clearInterval(l.current),h&&(l.current=setInterval((function(){c?o*=L:u*=L;var e=Math.floor(c?o:u);(!n(c,e,!0)||Math.abs(e)<=.1)&&clearInterval(l.current)}),16))}},c=function(){r.current=!1,i()},h=function(e){i(),1!==e.touches.length||r.current||(r.current=!0,a.current=Math.ceil(e.touches[0].pageX),s.current=Math.ceil(e.touches[0].pageY),o.current=e.target,o.current.addEventListener("touchmove",u,{passive:!1}),o.current.addEventListener("touchend",c,{passive:!0}))};i=function(){o.current&&(o.current.removeEventListener("touchmove",u),o.current.removeEventListener("touchend",c))},(0,f.Z)((function(){return e&&t.current.addEventListener("touchstart",h,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",h),i(),clearInterval(l.current)}}),[e])}(le,pe,(function(e,t,n,i){var r=i;return!nt(e,t,n)&&((!r||!r._virtualHandled)&&(r&&(r._virtualHandled=!0),ht({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))})),function(e,t,n){p.useEffect((function(){var i=t.current;if(e&&i){var r,a,s=!1,o=function(){b.Z.cancel(r)},l=function e(){o(),r=(0,b.Z)((function(){n(a),e()}))},u=function(){s=!1,o()},c=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,s=!0)}},h=function(e){if(s){var t=I(e,!1),n=i.getBoundingClientRect(),r=n.top,u=n.bottom;t<=r?(a=-R(r-t),l()):t>=u?(a=R(t-u),l()):o()}};return i.addEventListener("mousedown",c),i.ownerDocument.addEventListener("mouseup",u),i.ownerDocument.addEventListener("mousemove",h),i.ownerDocument.addEventListener("dragend",u),function(){i.removeEventListener("mousedown",c),i.ownerDocument.removeEventListener("mouseup",u),i.ownerDocument.removeEventListener("mousemove",h),i.ownerDocument.removeEventListener("dragend",u),o()}}}),[e])}(ce,pe,(function(e){ke((function(t){return t+e}))})),(0,f.Z)((function(){function e(e){var t=$e&&e.detail<0,n=Je&&e.detail>0;!le||t||n||e.preventDefault()}var t=pe.current;return t.addEventListener("wheel",ht,{passive:!1}),t.addEventListener("DOMMouseScroll",dt,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",ht),t.removeEventListener("DOMMouseScroll",dt),t.removeEventListener("MozMousePixelScroll",e)}}),[le,$e,Je]),(0,f.Z)((function(){if(H){var e=ot(we);Te(e),at({x:e})}}),[Ve.width,H]);var ft=function(){var e,t;null===(e=Ze.current)||void 0===e||e.delayHidden(),null===(t=Ke.current)||void 0===t||t.delayHidden()},pt=function(e,t,n,i,s,l,u,c){var h=p.useRef(),d=p.useState(null),m=(0,o.Z)(d,2),g=m[0],_=m[1];return(0,f.Z)((function(){if(g&&g.times<10){if(!e.current)return void _((function(e){return(0,a.Z)({},e)}));l();var r=g.targetAlign,o=g.originAlign,c=g.index,h=g.offset,d=e.current.clientHeight,f=!1,p=r,m=null;if(d){for(var v=r||o,y=0,b=0,x=0,E=Math.min(t.length-1,c),w=0;w<=E;w+=1){var T=s(t[w]);b=y;var S=n.get(T);y=x=b+(void 0===S?i:S)}for(var A="top"===v?h:d-h,C=E;C>=0;C-=1){var L=s(t[C]),R=n.get(L);if(void 0===R){f=!0;break}if((A-=R)<=0)break}switch(v){case"top":m=b-h;break;case"bottom":m=x-d+h;break;default:var I=e.current.scrollTop;b<I?p="top":x>I+d&&(p="bottom")}null!==m&&u(m),m!==g.lastTop&&(f=!0)}f&&_((0,a.Z)((0,a.Z)({},g),{},{times:g.times+1,targetAlign:p,lastTop:m}))}}),[g,e.current]),function(e){if(null!=e){if(b.Z.cancel(h.current),"number"==typeof e)u(e);else if(e&&"object"===(0,r.Z)(e)){var n,i=e.align;n="index"in e?e.index:t.findIndex((function(t){return s(t)===e.key}));var a=e.offset;_({times:0,index:n,offset:void 0===a?0:a,originAlign:i})}}else c()}}(pe,fe,se,T,te,(function(){return ae(!0)}),ke,ft);p.useImperativeHandle(t,(function(){return{nativeElement:ge.current,getScrollInfo:it,scrollTo:function(e){var t;(t=e)&&"object"===(0,r.Z)(t)&&("left"in t||"top"in t)?(void 0!==e.left&&Te(ot(e.left)),pt(e.top)):pt(e)}}})),(0,f.Z)((function(){if(q){var e=fe.slice(Ue,Ge+1);q(e,fe)}}),[Ue,Ge,fe]);var mt=function(e,t,n,i){var r=p.useMemo((function(){return[new Map,[]]}),[e,n.id,i]),a=(0,o.Z)(r,2),s=a[0],l=a[1];return function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,o=s.get(r),u=s.get(a);if(void 0===o||void 0===u)for(var c=e.length,h=l.length;h<c;h+=1){var d,f=e[h],p=t(f);s.set(p,h);var m=null!==(d=n.get(p))&&void 0!==d?d:i;if(l[h]=(l[h-1]||0)+m,p===r&&(o=h),p===a&&(u=h),void 0!==o&&void 0!==u)break}return{top:l[o-1]||0,bottom:l[u]}}}(fe,te,se,T),gt=null==Y?void 0:Y({start:Ue,end:Ge,virtual:ce,offsetX:we,offsetY:ze,rtl:he,getSize:mt}),_t=function(e,t,n,i,r,a,s,o){var l=o.getKey;return e.slice(t,n+1).map((function(e,n){var o=s(e,t+n,{style:{width:i},offsetX:r}),u=l(e);return p.createElement(v,{key:u,setRef:function(t){return a(e,t)}},o)}))}(fe,Ue,Ge,H,we,re,U,De),vt=null;x&&(vt=(0,a.Z)((0,s.Z)({},N?"height":"maxHeight",x),O),le&&(vt.overflowY="hidden",H&&(vt.overflowX="hidden"),Ce&&(vt.pointerEvents="none")));var yt={};return he&&(yt.dir="rtl"),p.createElement("div",(0,i.Z)({ref:ge,style:(0,a.Z)((0,a.Z)({},F),{},{position:"relative"}),className:de},yt,ee),p.createElement(h.Z,{onResize:function(e){We({width:e.offsetWidth,height:e.offsetHeight})}},p.createElement(W,{className:"".concat(u,"-holder"),style:vt,ref:pe,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==ye&&ke(t),null==Z||Z(e),at()},onMouseEnter:ft},p.createElement(_,{prefixCls:u,height:Be,offsetX:we,offsetY:ze,scrollWidth:H,onInnerResize:ae,ref:me,innerProps:X,rtl:he,extra:gt},_t))),ce&&Be>x&&p.createElement(D,{ref:Ze,prefixCls:u,scrollOffset:ye,scrollRange:Be,rtl:he,onScroll:st,onStartMove:Re,onStopMove:Ie,spinSize:Xe,containerSize:Ve.height,style:null==Q?void 0:Q.verticalScrollBar,thumbStyle:null==Q?void 0:Q.verticalScrollBarThumb,showScrollBar:J}),ce&&H>Ve.width&&p.createElement(D,{ref:Ke,prefixCls:u,scrollOffset:we,scrollRange:H,rtl:he,onScroll:st,onStartMove:Re,onStopMove:Ie,spinSize:qe,containerSize:Ve.width,horizontal:!0,style:null==Q?void 0:Q.horizontalScrollBar,thumbStyle:null==Q?void 0:Q.horizontalScrollBarThumb,showScrollBar:J}))}var F=p.forwardRef(N);F.displayName="List";var B=F},83145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var i=a(n(59301)),r=a(n(25769));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function l(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?f(e):t}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(){var e,n;u(this,t);for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return m(f(n=h(this,(e=d(t)).call.apply(e,[this].concat(s)))),"onClick",(function(e){var t=n.props,a=t.text,s=t.onCopy,o=t.children,l=t.options,u=i.default.Children.only(o),c=(0,r.default)(a,l);s&&s(a,c),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,a,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),n=t,a=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=l(e,["text","onCopy","options","children"]),r=i.default.Children.only(t);return i.default.cloneElement(r,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}],a&&c(n.prototype,a),s&&c(n,s),t}(i.default.PureComponent);t.CopyToClipboard=g,m(g,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(e,t,n){"use strict";var i=n(83145).CopyToClipboard;i.CopyToClipboard=i,e.exports=i},76374:function(e,t,n){"use strict";var i=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,a=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),s="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(a):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var o=["top","right","bottom","left","width","height","size","weight"],l="undefined"!=typeof MutationObserver,u=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,r=0;function a(){n&&(n=!1,e()),i&&l()}function o(){s(a)}function l(){var e=Date.now();if(n){if(e-r<2)return;i=!0}else n=!0,i=!1,setTimeout(o,t);r=e}return l}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&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)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;o.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},h=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||a},d=v(0,0,0,0);function f(e){return parseFloat(e)||0}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+f(e["border-"+n+"-width"])}),0)}function m(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return d;var i=h(e).getComputedStyle(e),r=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n],a=e["padding-"+r];t[r]=f(a)}return t}(i),a=r.left+r.right,s=r.top+r.bottom,o=f(i.width),l=f(i.height);if("border-box"===i.boxSizing&&(Math.round(o+a)!==t&&(o-=p(i,"left","right")+a),Math.round(l+s)!==n&&(l-=p(i,"top","bottom")+s)),!function(e){return e===h(e).document.documentElement}(e)){var u=Math.round(o+a)-t,c=Math.round(l+s)-n;1!==Math.abs(u)&&(o-=u),1!==Math.abs(c)&&(l-=c)}return v(r.left,r.top,o,l)}var g="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof h(e).SVGGraphicsElement}:function(e){return e instanceof h(e).SVGElement&&"function"==typeof e.getBBox};function _(e){return r?g(e)?function(e){var t=e.getBBox();return v(0,0,t.width,t.height)}(e):m(e):d}function v(e,t,n,i){return{x:e,y:t,width:n,height:i}}var y=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=_(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),b=function(e,t){var n,i,r,a,s,o,l,u=(i=(n=t).x,r=n.y,a=n.width,s=n.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(o.prototype),c(l,{x:i,y:r,width:a,height:s,top:r,right:i+a,bottom:s+r,left:i}),l);c(this,{target:e,contentRect:u})},x=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new i,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof h(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new y(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof h(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new b(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),E="undefined"!=typeof WeakMap?new WeakMap:new i,w=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),i=new x(t,n,this);E.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){w.prototype[e]=function(){var t;return(t=E.get(this))[e].apply(t,arguments)}}));var T=void 0!==a.ResizeObserver?a.ResizeObserver:w;t.Z=T},27774:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SizeSensorId=t.SensorTabIndex=t.SensorClassName=void 0;t.SizeSensorId="size-sensor-id";t.SensorClassName="size-sensor-object";t.SensorTabIndex="-1"},79301:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,n=null;return function(){for(var i=this,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];clearTimeout(n),n=setTimeout((function(){e.apply(i,a)}),t)}}},79789:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=1;t.default=function(){return"".concat(n++)}},47242:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ver=t.clear=t.bind=void 0;var i=n(95270);t.bind=function(e,t){var n=(0,i.getSensor)(e);return n.bind(t),function(){n.unbind(t)}};t.clear=function(e){var t=(0,i.getSensor)(e);(0,i.removeSensor)(t)};t.ver="1.0.2"},95270:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeSensor=t.getSensor=t.Sensors=void 0;var i,r=(i=n(79789))&&i.__esModule?i:{default:i},a=n(57829),s=n(27774);var o={};function l(e){e&&o[e]&&delete o[e]}t.Sensors=o;t.getSensor=function(e){var t=e.getAttribute(s.SizeSensorId);if(t&&o[t])return o[t];var n=(0,r.default)();e.setAttribute(s.SizeSensorId,n);var i=(0,a.createSensor)(e,(function(){return l(n)}));return o[n]=i,i};t.removeSensor=function(e){var t=e.element.getAttribute(s.SizeSensorId);e.destroy(),l(t)}},57829:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSensor=void 0;var i=n(20953),r=n(55202),a="undefined"!=typeof ResizeObserver?r.createSensor:i.createSensor;t.createSensor=a},20953:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSensor=void 0;var i,r=(i=n(79301))&&i.__esModule?i:{default:i},a=n(27774);t.createSensor=function(e,t){var n=void 0,i=[],s=(0,r.default)((function(){i.forEach((function(t){t(e)}))})),o=function(){n&&n.parentNode&&(n.contentDocument&&n.contentDocument.defaultView.removeEventListener("resize",s),n.parentNode.removeChild(n),e.removeAttribute(a.SizeSensorId),n=void 0,i=[],t&&t())};return{element:e,bind:function(t){n||(n=function(){"static"===getComputedStyle(e).position&&(e.style.position="relative");var t=document.createElement("object");return t.onload=function(){t.contentDocument.defaultView.addEventListener("resize",s),s()},t.style.display="block",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.height="100%",t.style.width="100%",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.opacity="0",t.setAttribute("class",a.SensorClassName),t.setAttribute("tabindex",a.SensorTabIndex),t.type="text/html",e.appendChild(t),t.data="about:blank",t}()),-1===i.indexOf(t)&&i.push(t)},destroy:o,unbind:function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),0===i.length&&n&&o()}}}},55202:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSensor=void 0;var i,r=n(27774),a=(i=n(79301))&&i.__esModule?i:{default:i};t.createSensor=function(e,t){var n=void 0,i=[],s=(0,a.default)((function(){i.forEach((function(t){t(e)}))})),o=function(){n.disconnect(),i=[],n=void 0,e.removeAttribute(r.SizeSensorId),t&&t()};return{element:e,bind:function(t){var r;n||((r=new ResizeObserver(s)).observe(e),s(),n=r),-1===i.indexOf(t)&&i.push(t)},destroy:o,unbind:function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),0===i.length&&n&&o()}}}},98040:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],i=0;i<e.rangeCount;i++)n.push(e.getRangeAt(i));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},82059:function(e){var t=arguments[3],n=arguments[4],i=arguments[5],r=JSON.stringify;e.exports=function(e,a){for(var s,o=Object.keys(i),l=0,u=o.length;l<u;l++){var c=o[l],h=i[c].exports;if(h===e||h&&h.default===e){s=c;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var d={};for(l=0,u=o.length;l<u;l++){d[c=o[l]]=c}n[s]=["function(require,module,exports){"+e+"(self); }",d]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[s]=s,n[f]=["function(require,module,exports){var f = require("+r(s)+");(f.default ? f.default : f)(self);}",p];var m={};!function e(t){for(var i in m[t]=!0,n[t][1]){var r=n[t][1][i];m[r]||e(r)}}(f);var g="("+t+")({"+Object.keys(m).map((function(e){return r(e)+":["+n[e][0]+","+r(n[e][1])+"]"})).join(",")+"},{},["+r(f)+"])",_=window.URL||window.webkitURL||window.mozURL||window.msURL,v=new Blob([g],{type:"text/javascript"});if(a&&a.bare)return v;var y=_.createObjectURL(v),b=new Worker(y);return b.objectURL=y,b}},93314:function(e){"use strict";e.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=="},96908:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAA8CAYAAADogBFvAAAAAXNSR0IArs4c6QAADzxJREFUeF7tnQl4VcUVx3/3JSEBARFEFllcQAMJuKDUD7FqtVbFtUqtS6ufS1soxaW1Si0KBaFVWy2ittqqdQ9xpYq4tLgVFWUThYQlJIEkkJXs63u333lzL+/mrfeF9/KSeM/35Xv3zZw5c+bM/83MOTN3ouGQY4EuZAGtC+niqOJYAAeQDgi6lAU0fUayHqCR5gJXEriS/T6TICkZNOMzIN/gFx7/8vvLiFxDtpfP4G2Xb5Ej6SaPKddav6mPtb5g9e/PF9nSvmTVlpD1S36Sr63WOj1ukD/d+PR+b1NpAekmj5Gve8Dd5lc2ivK4G2lzV4K7Eo/8eSrQ3ZW424rw6J/ST1utTb2jtkuhLAplwgDS7BDj09txdgFqgsjCbwVOKMCYAPH+IAzABIDf8qPYz+OygMus0+8HFQDmYDpaypj1mp+m/qKbgMoKQO+zxwIyCzhNPhOIQQFrAas/uK3l5dlt/SEY9bbn0ZsrS1obynfXNJQXFTeUbPugua5utQZrM7PZHgU2EsIaHJAJUcWp1JYFklKgVx/fX0oqpPSBgw6BASOh/xAlxgC+u6WJqh0bqdi2nrb66gI0sjQXL2W8xHpb9XUykwPITjZ43KuTpcnBw2HA4TBwFBw81Dt66+42aoq2U7FjAw0Ve8R52KxpLB6v86KWjTvuetmswAGkTUN1W7aDBsHIieiHjkVDlhpuavbkU7ThE9wtjQLMbTosyFzGc5pGoD/RyQ13ANnJBk9YdSm9YVg6+tB0NC2ZtqZ6dn/1P+rKirwqaRqrknVuSM9mZ8J0FD2CetmJ1MipO74WkPXn0VOg72CvY1ZRuJU9uRvQPW4ZLes0jdszlvG3+CoRWroDyERZPtH1Dk1HH56B5vHQWFvJzrUf42lrUaMlPJ4BMxOxtnQAmWhgJLL+3gPQR5+E1qsPDdXl5G9YjUdipIreGpzGFUOfpb4zVXQA2ZnW7op1paSiH30qWlIqdVWlFGz6Al1ipmqkXH0wnD0ym8bOUt0BZGdZuivXk9IH/ajJaK4Uasr3UJizUQX/Fb2WOZ7LtfniosefHEDG38bdo4bUvuijJqG5XFQU5VOSv22/3hr8NTObWzqjIQ4gO8PK3aWO3v3RR57gHR13blpHQ121FZTTM7N5Od5NcQAZbwt3N/mDjvDu8jQ11rHj6/XoskevqKxXMuOPfZHyeDbJAWQ8rdsdZct2zYjj0VJS2bu7gLLiXdZRMiszmx/Hs1kOIONp3e4qO60/+rBx6O5WdmzeRHOTz8lO0pg2fhkr4tU0B5Dxsmx3lytTd99B1FZVUZC31dqanMzxTNDmsz9gGcumOoCMpTV7kixXEvrwCV4HZ1vuZlqamqytu2VCNn+NR3MdQMbDqj1Epj5wBFqfgVSU7qWkWB3CENKgEhibme39jCklBpCysf/H3aohrY1w64CYNqrLCJOziRJg1hN+qqtjJklJQx88xrudmJuzBY+cVveBcmlmNr/qmODQpRIHyPuKlVYtjXBL/1i3K7HyDh4Gp94IU2+Ee0+A+pgPJJ3WPn3QEWgpvSkpKaaiosJabxsuJk7IYksslXEAGUtrmrIW5sHAkerb7UO6NSBJ6wcDhnvXkFu354HlDK8GKzOzOS+WJnQAGUtrmrIW5atXCHoCIDXwDDwSlyuJvIICGhran7OIdRjIAaQDyIgW0PsNRkvtR2l5OaXlAcuPmIaBuh4gp1wP/QYrI338ODRUBRpM0+Cc36p0OVT6nwd9PIcdAydcqr7nroL8NXDi5TBmKoyepPgL16n0dS+3dzgGjoaTjY0If7n+Wow+GdK/p1Jr9sC+Ihg1SX0X3Xob6+K3F0FLg0r/egUUbWovSRy8SdNh5PEw4jho2Ae71sOuDbDhVaWvP1nbWLIZvvo3TLwQvjtDvdQlaf+eB2Uxeuu1V2/oP4yGhnryCn3etqmWS+PmjGUsiYhsGwxdD5C/WwsjJirV7xkX3KjyPvZSY+poqoXbBvqaetzF8HPjDMAbc2HIWDjlp8FNsfldePIaH+iTU2FxIRxkyHvgu5D3afCyM5dDprF8emuBN4jM6TPDm/zZG+HTf/l4xpwG1z/nXaMFpYIv4fHpUGVEJEwmaxu/eBFyP4Br/t5exMPnwZb3bUDADouGPmiU9+3FnLxC3BZvW0rHMgzUswEpI5O8Q9LaDAVroHgzDE2H0SdB6kGqJyryYdFJ0GicbLnsfjjLOGn1yT/ghRmBPSajmgBXLg+Qwwd3j4WzboXTDV4J95jkPZxghH2e+xl89ozKEVDdlKVu8RAq/lqNikm91Eg++GiVXlsGD52tRr1ggCz+BgaPAXk/20oxBSTo/YagJfdiV8lequuMEd9SnwYxCQP1bECKwerK4ZELQUYbk2RbbNZbMOQYlbJyMSy/Wz3LdDjvG/XcWAN3Hg6t7XYp4IxZ8CNjmSCj7NJp7cEQyamRH8m8zT7H54WZ8MkTPhlyO4ZM+xcvUGkb3oDHLw8OSDP1m3fgw0ehtlSBWUb2ysL2eh3It7T+iMddVV1LUVnQMFZMwkA9H5CPXQqb3gzsChlVBBSyHm2uh7ljFHiFbn4Pjj1DPT/1U5Bp0Uq/XQ1HnKxSnrgC1r8aHSAvnAfn3aXKfPYsPHN9cKiYywIJrC+a5Ft/WqfsSDIOBITWsnJjRr/DaG1pIbewJKjUWISBejYgZTqeOzZ0l9zyPhxzusp/7BLY9JZ6FifjhhfUc85/YckPfDKsI6iMRnNGq3t+rBRphJyzBuQgrNBD34etHwTXcfLVcN3TKu/d++H136lnKyDlx3TXkcGdv1iB0ZTT7zDv0/aiMppaWoNKP9AwUM8G5Fdvwt8MjzuY+ab/Bc40dr+yfw2rDEdRRgMBlXSArAFl9KwyzgVaR7f3HoDX5gRKjgTIh6rV2lZow+uBSwJTojhX489R32QUltHYH5A7P4P7T4s19ILLk2k7JY3SqhpK99WFqvOAwkA9G5Af/R1emhW6s865HS5ZpPJXLYXsW328Fy+EH9yhvi+/B1YafH/YCoceqdLnZUBpu6NZKj0cICVgLvnRkoSCFk8OBOSXy+DJq6OV1jH+5F6Q1p/G5mZ2lAQJxxlSDyQMFHtATpgGR56iVNvyHmz7KLDxstcrXqpQUx3cdoiPJ5ZhnzUvwNPXhjb+tLth2lyV/86f4I3f+3jF8Zmfq+6SLNsB96TDUVPgNx8qHmnXg2cFlx0OkDIyPrhPrV2FJNbqe8MvtK4S3go2Zcv6Vta5nUGicp9B3vuBcooraXMHfxHxQMJAsQfkRQvg3DuVeazeq9Vgo06EOz9XKXu3wvwMX651fbXgeCgxPF5reQlgLzSCvuHikOJpSiwxFF3zBEy5TuU+exN8aqzXTP5fvgkZxvrxz2fC5CvhtJ+p3KevgzXPRw9IKWHd6w41yoYDmH8csrMAKTql9vWGqoqr6qisaw6pZUfDQLEH5Hd+Atc+qRRdmw3/vCpQaStPzn9gybk+nl+8BhMvUN+XXgCb3wksf+1T8J1rVHo4QMoux7xxwcMfElwXUJt7zg+cDnmr29clux+/MDxoGW0zzlVBc9lNmTMy9Nov0hpy1goY/31Vl3/Ix6rB8ZfACT9UKRJe+vw59ZxIQMq0nZJGbUMzBRVhL7XoUBgo9oCUoPMdxu6GBKQXTIByy4VaKWnwm4/VVpnQf5fAy7/2dcP0B+FMY90XbMo9fCLM+UJNpZEAKflfZqndGH8SZ0acGiEJSC82wjhWPokH3pvnA62ZJ/G+rJsDZZop1nWmePni7VvpuIvg56+oFNlynJ8JzX5OgswCd63zbUH+5Xuw/ePEA1KWGvIOt9vNlr21eDyhz3p2JAwUe0CKyWavhHRjfVVXoUAni38x8ik/geHGFC33yMgIZu2wcWfDr972dZ/slnz+PNTuhaNPhUvuVd6vSeFGSPGQBbjrXoH3/gxl22BIOpz0I593LXIevQi+ttRpBc/5c+ECI2hupt8rMcGvQgPSGk6SsFHO+2rPXLxyk2a8DrLeFirdrtaHEryXy0ZlmTD5Kt9uzTcrVXDfpESOkKKD7G3rOruqmqhuCv9qjcvF+RlZhDBuoAnjA0iJ1ckoaR4wCNV1794HrxsBYivPze/CsWcGLyUgWz5XAVMoHCAFiEInXhZcloBkxQKQvehQJFP6wh2+Lb78L+C+KaH5JUeWE7Ks8KdZaeqqZaFDRsCMN3z79qEk7t4IMjo21XQdQLpSvP8QoKaxlcJ9odeRorCmsSVjHBPtvhQWH0CKJtKRVz3mO4BgNXhFgQrHyC8/GMmhUNlTPvWG9rnVJarcphX2DleIByrOxxVL1Mhsxv5EqkyVWbNh4/Lw4JLc2e/4TvbI3raM2pFo6k1wxkwYPNa3z2wFpJSXeOf5v1d751bdJE/WqfJDkeWBf+A90SOkTNtJvdA9bWwpa8ET4RWNaMJA8QOk2WF9DlEHGmS6FhDszVX7rXao76EwdJy6yF2OjJXLieUIFKqzpPMlHCWjdsFadWTMDglQFhVAnwFqi/HOEYHrPTtywvFIBx96FAzPVODbk6PW3XbCQQdad0fLiz11D7urW9nXHP4eqmjCQPEHZEcb3NFysR49JMxz5SNKm9VPgZzYcQjE4ZOzKy1u8qtt3Jmv8fCEZcyOZDoHkJEsNHcjDBuvuO6bCvlG/DRSuW9Dvly74tHZUumOOG3LUWo7L4U5gAwHHHGsxMESkvOKC40DEd8GsEXRxqI6D1VNka+P1ODtzGzOD7t66XGX3sdyypaguATHhbJvg1UPR9FN3x7WxjbYsc/ezSqRwkA9b4QclqE8aiEJeH/5UseQITs5F81X/+tQSPa6g73f0zHpPaqUhMa3VrppDRMkNxscKQzU8wDZo7q6+zSmtFGntN6GcwOECwM5gOw+fd6lNW31QG6lADLytTHhwkAOILt0N3cv5XZWe6gXZNqhEGEgB5B2jOfw2LLAvmad3bX2pu1QYSAHkLZM7TDZsYD4NDn2YpJeccHCQA4g7Vja4bFtgeJ6D5WNNqdtcXD8TgM5gLRtaofRjgWa3LC9yl5M0jtK+p0GcgBpx8oOT1QWyKt209Aa2ds2hbpczM7Iwrvr4AAyKlM7zHYsEKVz0+5uIAeQdizs8Ni2gIyL8icxSbeNnZv9go0wkANI26Z2GKOxwJ56D+VRODdmGMgBZDRWdnhtW6C6WWeX/Zjk/jDQ/wHkSLPJ/mcrgQAAAABJRU5ErkJggg=="},57177:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},4811:function(e,t,n){var i=n(22652);function r(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=r=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=r=function(e,t,n){var r=i(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},e.exports.__esModule=!0,e.exports.default=e.exports),r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},22652:function(e,t,n){var i=n(34577);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},19251:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var i=n(3208);function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=(0,i.Z)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,s=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw s}}}}},44523:function(e,t,n){"use strict";n.d(t,{ZP:function(){return cl}});const i=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},r=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=a},a=Number.MAX_SAFE_INTEGER||9007199254740991;let s=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),o=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.ASSET_LIST_LOAD_ERROR="assetListLoadError",e.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",e.ASSET_LIST_PARSING_ERROR="assetListParsingError",e.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.ATTACH_MEDIA_ERROR="attachMediaError",e.UNKNOWN="unknown",e}({}),l=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.MEDIA_ENDED="hlsMediaEnded",e.STALL_RESOLVED="hlsStallResolved",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFERED_TO_END="hlsBufferedToEnd",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",e.ASSET_LIST_LOADING="hlsAssetListLoading",e.ASSET_LIST_LOADED="hlsAssetListLoaded",e.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",e.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",e.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",e.INTERSTITIAL_STARTED="hlsInterstitialStarted",e.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",e.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",e.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",e.INTERSTITIAL_ENDED="hlsInterstitialEnded",e.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",e.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",e.EVENT_CUE_ENTER="hlsEventCueEnter",e}({});var u="manifest",c="level",h="audioTrack",d="subtitleTrack",f="main",p="audio",m="subtitle";class g{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class _{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new g(e),this.fast_=new g(t),this.defaultTTFB_=i,this.ttfb_=new g(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new g(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new g(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new g(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){const n=(e=Math.max(e,this.minDelayMs_))/1e3,i=8*t/n;this.fast_.sample(n,i),this.slow_.sample(n,i)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(null,arguments)}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class E{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=w,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const w=function(){},T={trace:w,debug:w,log:w,warn:w,info:w,error:w};function S(){return y({},T)}function A(e,t,n){return t[e]?t[e].bind(t):function(e,t){const n=self.console[e];return n?n.bind(self.console,`${t?"["+t+"] ":""}[${e}] >`):w}(e,n)}const C=S();const L=C;function R(e=!0){if("undefined"==typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function I(e,t){const n=Object.keys(e),i=Object.keys(t),r=n.length,a=i.length;return!r||!a||r===a&&!n.some((e=>-1===i.indexOf(e)))}function D(e,t=!1){if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(e);if(t){const e=n.indexOf("\0");return-1!==e?n.substring(0,e):n}return n.replace(/\0/g,"")}const n=e.length;let i,r,a,s="",o=0;for(;o<n;){if(i=e[o++],0===i&&t)return s;if(0!==i&&3!==i)switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(i);break;case 12:case 13:r=e[o++],s+=String.fromCharCode((31&i)<<6|63&r);break;case 14:r=e[o++],a=e[o++],s+=String.fromCharCode((15&i)<<12|(63&r)<<6|(63&a)<<0)}}return s}function k(e){let t="";for(let n=0;n<e.length;n++){let i=e[n].toString(16);i.length<2&&(i="0"+i),t+=i}return t}function M(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O,N={exports:{}};var F,B,U,G,z,j=(O||(O=1,F=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,B=/^(?=([^\/?#]*))\1([^]*)$/,U=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,N.exports=z={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var i=z.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=z.normalizePath(i.path),z.buildURLFromParts(i)}var r=z.parseURL(t);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return n.alwaysNormalize?(r.path=z.normalizePath(r.path),z.buildURLFromParts(r)):t;var a=z.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var s=B.exec(a.path);a.netLoc=s[1],a.path=s[2]}a.netLoc&&!a.path&&(a.path="/");var o={scheme:a.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(o.netLoc=a.netLoc,"/"!==r.path[0]))if(r.path){var l=a.path,u=l.substring(0,l.lastIndexOf("/")+1)+r.path;o.path=z.normalizePath(u)}else o.path=a.path,r.params||(o.params=a.params,r.query||(o.query=a.query));return null===o.path&&(o.path=n.alwaysNormalize?z.normalizePath(r.path):r.path),z.buildURLFromParts(o)},parseURL:function(e){var t=F.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(U,"");e.length!==(e=e.replace(G,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}}),N.exports);class H{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var V="audio",W="video",Z="audiovideo";class K{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof e&&(e={url:e}),this.base=e,function(e,t){const n=Q(e,t);n&&(n.enumerable=!0,Object.defineProperty(e,t,n))}(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;i=1===n.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[V]:null,[W]:null,[Z]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new H),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=j.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[V]=null,e[W]=null,e[Z]=null}}function q(e){return"initSegment"!==e.sn}class X extends K{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(i(e)&&i(t))return t-e}return null}get bitrate(){return this.byteLength?8*this.byteLength/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 e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length){const t=this._decryptdata=this.levelkeys[e[0]]||null;if(t)return t.getDecryptData(this.sn)}}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const e=i(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var t;const e=Object.keys(this.levelkeys),n=e.length;if(n>1||1===n&&null!=(t=this.levelkeys[e[0]])&&t.encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){i(e)?this._programDateTime=e:this._programDateTime=this.rawProgramDateTime=null}get ref(){return q(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;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,n,i,r,a=!1){const{elementaryStreams:s}=this,o=s[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,n),o.startDTS=Math.min(o.startDTS,i),o.endDTS=Math.max(o.endDTS,r)):s[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:a}}}class Y extends K{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Q(e,t){const n=Object.getPrototypeOf(e);if(n){const e=Object.getOwnPropertyDescriptor(n,t);return e||Q(n,t)}}const $=Math.pow(2,32)-1,J=[].push,ee={video:1,audio:2,id3:3,text:4};function te(e){return String.fromCharCode.apply(null,e)}function ne(e,t){const n=e[t]<<8|e[t+1];return n<0?65536+n:n}function ie(e,t){const n=ae(e,t);return n<0?4294967296+n:n}function re(e,t){let n=ie(e,t);return n*=Math.pow(2,32),n+=ie(e,t+4),n}function ae(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function se(e,t){const n=[];if(!t.length)return n;const i=e.byteLength;for(let r=0;r<i;){const a=ie(e,r),s=a>1?r+a:i;if(te(e.subarray(r+4,r+8))===t[0])if(1===t.length)n.push(e.subarray(r+8,s));else{const i=se(e.subarray(r+8,s),t.slice(1));i.length&&J.apply(n,i)}r=s}return n}function oe(e){const t=[],n=e[0];let i=8;const r=ie(e,i);i+=4;let a=0,s=0;0===n?(a=ie(e,i),s=ie(e,i+4),i+=8):(a=re(e,i),s=re(e,i+8),i+=16),i+=2;let o=e.length+s;const l=ne(e,i);i+=2;for(let n=0;n<l;n++){let n=i;const a=ie(e,n);n+=4;const s=2147483647&a;if(1===(2147483648&a)>>>31)return L.warn("SIDX has hierarchical references (not supported)"),null;const l=ie(e,n);n+=4,t.push({referenceSize:s,subsegmentDuration:l,info:{duration:l/r,start:o,end:o+s-1}}),o+=s,n+=4,i=n}return{earliestPresentationTime:a,timescale:r,version:n,referencesCount:l,references:t}}function le(e){const t=[],n=se(e,["moov","trak"]);for(let e=0;e<n.length;e++){const i=n[e],r=se(i,["tkhd"])[0];if(r){let e=r[0];const n=ie(r,0===e?12:20),a=se(i,["mdia","mdhd"])[0];if(a){e=a[0];const r=ie(a,0===e?12:20),s=se(i,["mdia","hdlr"])[0];if(s){const e=te(s.subarray(8,12)),a={soun:V,vide:W}[e],o=ue(se(i,["mdia","minf","stbl","stsd"])[0]);a?(t[n]={timescale:r,type:a,stsd:o},t[a]=x({timescale:r,id:n},o)):t[n]={timescale:r,type:e,stsd:o}}}}}return se(e,["moov","mvex","trex"]).forEach((e=>{const n=ie(e,4),i=t[n];i&&(i.default={duration:ie(e,12),flags:ie(e,20)})})),t}function ue(e){const t=e.subarray(8),n=t.subarray(86),i=te(t.subarray(4,8));let r,a=i;const s="enca"===i||"encv"===i;if(s){const e=se(t,[i])[0];se(e.subarray("enca"===i?28:78),["sinf"]).forEach((e=>{const t=se(e,["schm"])[0];if(t){const n=te(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=se(e,["frma"])[0];t&&(a=te(t))}}}))}const o=a;switch(a){case"avc1":case"avc2":case"avc3":case"avc4":{const e=se(n,["avcC"])[0];e&&e.length>3&&(a+="."+de(e[1])+de(e[2])+de(e[3]),r=ce("avc1"===o?"dva1":"dvav",n));break}case"mp4a":{const e=se(t,[i])[0],n=se(e.subarray(28),["esds"])[0];if(n&&n.length>7){let e=4;if(3!==n[e++])break;e=he(n,e),e+=2;const t=n[e++];if(128&t&&(e+=2),64&t&&(e+=n[e++]),4!==n[e++])break;e=he(n,e);const i=n[e++];if(64!==i)break;if(a+="."+de(i),e+=12,5!==n[e++])break;e=he(n,e);const r=n[e++];let s=(248&r)>>3;31===s&&(s+=1+((7&r)<<3)+((224&n[e])>>5)),a+="."+s}break}case"hvc1":case"hev1":{const e=se(n,["hvcC"])[0];if(e&&e.length>12){const t=e[1],n=["","A","B","C"][t>>6],i=31&t,r=ie(e,2),s=(32&t)>>5?"H":"L",o=e[12],l=e.subarray(6,12);a+="."+n+i,a+="."+function(e){let t=0;for(let n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}(r).toString(16).toUpperCase(),a+="."+s+o;let u="";for(let e=l.length;e--;){const t=l[e];if(t||u){u="."+t.toString(16).toUpperCase()+u}}a+=u}r=ce("hev1"==o?"dvhe":"dvh1",n);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":a=ce(a,n)||a;break;case"vp09":{const e=se(n,["vpcC"])[0];if(e&&e.length>6){const t=e[4],n=e[5],i=e[6]>>4&15;a+="."+fe(t)+"."+fe(n)+"."+fe(i)}break}case"av01":{const e=se(n,["av1C"])[0];if(e&&e.length>2){const t=e[1]>>>5,i=31&e[1],s=e[2]>>>7?"H":"M",o=(64&e[2])>>6,l=(32&e[2])>>5,u=2===t&&o?l?12:10:o?10:8,c=(16&e[2])>>4,h=(8&e[2])>>3,d=(4&e[2])>>2,f=3&e[2],p=1,m=1,g=1,_=0;a+="."+t+"."+fe(i)+s+"."+fe(u)+"."+c+"."+h+d+f+"."+fe(p)+"."+fe(m)+"."+fe(g)+"."+_,r=ce("dav1",n)}break}}return{codec:a,encrypted:s,supplemental:r}}function ce(e,t){const n=se(t,["dvvC"]),i=n.length?n[0]:se(t,["dvcC"])[0];if(i){const t=i[2]>>1&127,n=i[2]<<5&32|i[3]>>3&31;return e+"."+fe(t)+"."+fe(n)}}function he(e,t){const n=t+5;for(;128&e[t++]&&t<n;);return t}function de(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}function fe(e){return(e<10?"0":"")+e}function pe(e){const t=se(e,["schm"])[0];if(t){const n=te(t.subarray(4,8));if("cbcs"===n||"cenc"===n)return se(e,["schi","tenc"])[0]}return null}function me(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function ge(e,t){const n=[],i=t.samples,r=t.timescale,a=t.id;let s=!1;return se(i,["moof"]).map((o=>{const l=o.byteOffset-8;se(o,["traf"]).map((o=>{const u=se(o,["tfdt"]).map((e=>{const t=e[0];let n=ie(e,4);return 1===t&&(n*=Math.pow(2,32),n+=ie(e,8)),n/r}))[0];return void 0!==u&&(e=u),se(o,["tfhd"]).map((u=>{const c=ie(u,4),h=16777215&ie(u,0);let d=0;const f=0!=(16&h);let p=0;const m=0!=(32&h);let g=8;c===a&&(0!=(1&h)&&(g+=8),0!=(2&h)&&(g+=4),0!=(8&h)&&(d=ie(u,g),g+=4),f&&(p=ie(u,g),g+=4),m&&(g+=4),"video"===t.type&&(s=_e(t.codec)),se(o,["trun"]).map((a=>{const o=a[0],u=16777215&ie(a,0),c=0!=(1&u);let h=0;const f=0!=(4&u),m=0!=(256&u);let g=0;const _=0!=(512&u);let v=0;const y=0!=(1024&u),b=0!=(2048&u);let x=0;const E=ie(a,4);let w=8;c&&(h=ie(a,w),w+=4),f&&(w+=4);let T=h+l;for(let l=0;l<E;l++){if(m?(g=ie(a,w),w+=4):g=d,_?(v=ie(a,w),w+=4):v=p,y&&(w+=4),b&&(x=0===o?ie(a,w):ae(a,w),w+=4),t.type===W){let t=0;for(;t<v;){const a=ie(i,T);if(T+=4,ve(s,i[T])){ye(i.subarray(T,T+a),s?2:1,e+x/r,n)}T+=a,t+=a+4}}e+=g/r}})))}))}))})),n}function _e(e){if(!e)return!1;const t=e.substring(0,4);return"hvc1"===t||"hev1"===t||"dvh1"===t||"dvhe"===t}function ve(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6===(31&t)}function ye(e,t,n,i){const r=be(e);let a=0;a+=t;let s=0,o=0,l=0;for(;a<r.length;){s=0;do{if(a>=r.length)break;l=r[a++],s+=l}while(255===l);o=0;do{if(a>=r.length)break;l=r[a++],o+=l}while(255===l);const e=r.length-a;let t=a;if(o<e)a+=o;else if(o>e){L.error(`Malformed SEI payload. ${o} is too small, only ${e} bytes left to parse.`);break}if(4===s){if(181===r[t++]){const e=ne(r,t);if(t+=2,49===e){const e=ie(r,t);if(t+=4,1195456820===e){const e=r[t++];if(3===e){const a=r[t++],o=64&a,l=o?2+3*(31&a):0,u=new Uint8Array(l);if(o){u[0]=a;for(let e=1;e<l;e++)u[e]=r[t++]}i.push({type:e,payloadType:s,pts:n,bytes:u})}}}}}else if(5===s&&o>16){const e=[];for(let n=0;n<16;n++){const i=r[t++].toString(16);e.push(1==i.length?"0"+i:i),3!==n&&5!==n&&7!==n&&9!==n||e.push("-")}const a=o-16,l=new Uint8Array(a);for(let e=0;e<a;e++)l[e]=r[t++];i.push({payloadType:s,pts:n,uuid:e.join(""),userData:D(l),userDataBytes:l})}}}function be(e){const t=e.byteLength,n=[];let i=1;for(;i<t-2;)0===e[i]&&0===e[i+1]&&3===e[i+2]?(n.push(i+2),i+=2):i++;if(0===n.length)return e;const r=t-n.length,a=new Uint8Array(r);let s=0;for(i=0;i<r;s++,i++)s===n[0]&&(s++,n.shift()),a[i]=e[s];return a}function xe(e,t,n){if(16!==e.byteLength)throw new RangeError("Invalid system id");let i,r,a;i=0,r=new Uint8Array,a=new Uint8Array;const s=new Uint8Array(4);return n.byteLength>0&&new DataView(s.buffer).setUint32(0,n.byteLength,!1),function(e,...t){const n=t.length;let i=8,r=n;for(;r--;)i+=t[r].byteLength;const a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=255&i,a.set(e,4),r=0,i=8;r<n;r++)a.set(t[r],i),i+=t[r].byteLength;return a}([112,115,115,104],new Uint8Array([0,0,0,0]),e,a,r,s,n)}function Ee(e){const t=e.getUint32(0),n=e.byteOffset,i=e.byteLength;if(i<t)return{offset:n,size:i};if(1886614376!==e.getUint32(4))return{offset:n,size:t};const r=e.getUint32(8)>>>24;if(0!==r&&1!==r)return{offset:n,size:t};const a=e.buffer,s=k(new Uint8Array(a,n+12,16));let o=null,l=null,u=0;if(0===r)u=28;else{const r=e.getUint32(28);if(!r||i<32+16*r)return{offset:n,size:t};o=[];for(let e=0;e<r;e++)o.push(new Uint8Array(a,n+32+16*e,16));u=32+16*r}if(!u)return{offset:n,size:t};const c=e.getUint32(u);return t-32<c?{offset:n,size:t}:(l=new Uint8Array(a,n+u+4,c),{version:r,systemId:s,kids:o,data:l,offset:n,size:t})}const we=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Te={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 Se(e,t){const n=Te[t];return!!n&&!!n[e.slice(0,4)]}function Ae(e,t,n=!0){return!e.split(",").some((e=>!Ce(e,t,n)))}function Ce(e,t,n=!0){var i;const r=R(n);return null!=(i=null==r?void 0:r.isTypeSupported(Le(e,t)))&&i}function Le(e,t){return`${t}/mp4;codecs=${e}`}function Re(e){if(e){const t=e.substring(0,4);return Te.video[t]}return 2}function Ie(e){const t=we();return e.split(",").reduce(((e,n)=>{const i=t&&_e(n)?9:Te.video[n];return i?(2*i+e)/(e?3:2):(Te.audio[n]+e)/(e?2:1)}),0)}const De={};const ke=/flac|opus|mp4a\.40\.34/i;function Me(e,t=!0){return e.replace(ke,(e=>function(e,t=!0){if(De[e])return De[e];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[e];for(let r=0;r<n.length;r++){var i;if(Ce(n[r],"audio",t))return De[e]=n[r],n[r];if("mp3"===n[r]&&null!=(i=R(t))&&i.isTypeSupported("audio/mpeg"))return""}return e}(e.toLowerCase(),t)))}function Pe(e,t){if(e&&(e.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(e))&&(Oe(e,"audio")||Oe(e,"video")))return e;if(t){const n=t.split(",");if(n.length>1){if(e)for(let t=n.length;t--;)if(n[t].substring(0,4)===e.substring(0,4))return n[t];return n[0]}}return t||e}function Oe(e,t){return Se(e,t)&&Ce(e,t)}function Ne(e){if(e.startsWith("av01.")){const t=e.split("."),n=["0","111","01","01","01","0"];for(let e=t.length;e>4&&e<10;e++)t[e]=n[e-4];return t.join(".")}return e}function Fe(e){const t=R(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Be(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Ue={supported:!1,smooth:!1,powerEfficient:!1},Ge={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function ze(e,t){return{supported:!1,configurations:t,decodingInfoResults:[Ue],error:e}}function je(e,t,n,r,a,s){const o=e.videoCodec,l=e.audioCodec?e.audioGroups:null,u=null==s?void 0:s.audioCodec,c=null==s?void 0:s.channels,h=c?parseInt(c):u?1/0:2;let d=null;if(null!=l&&l.length)try{d=1===l.length&&l[0]?t.groups[l[0]].channels:l.reduce(((e,n)=>{if(n){const i=t.groups[n];if(!i)throw new Error(`Audio track group ${n} not found`);Object.keys(i.channels).forEach((t=>{e[t]=(e[t]||0)+i.channels[t]}))}return e}),{2:0})}catch(e){return!0}return void 0!==o&&(o.split(",").some((e=>_e(e)))||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(a,8e6))||!!d&&i(h)&&Object.keys(d).some((e=>parseInt(e)>h))}function He(e,t,n,i={}){const r=e.videoCodec;if(!r&&!e.audioCodec||!n)return Promise.resolve(Ge);const a=[],s=function(e){var t;const n=null==(t=e.videoCodec)?void 0:t.split(","),i=We(e),r=e.width||640,a=e.height||480,s=e.frameRate||30,o=e.videoRange.toLowerCase();return n?n.map((e=>{const t={contentType:Le(Ne(e),"video"),width:r,height:a,bitrate:i,framerate:s};return"sdr"!==o&&(t.transferFunction=o),t})):[]}(e),o=s.length,l=function(e,t,n){var i;const r=null==(i=e.audioCodec)?void 0:i.split(","),a=We(e);if(r&&e.audioGroups)return e.audioGroups.reduce(((e,i)=>{var s;const o=i?null==(s=t.groups[i])?void 0:s.tracks:null;return o?o.reduce(((e,t)=>{if(t.groupId===i){const i=parseFloat(t.channels||"");r.forEach((t=>{const r={contentType:Le(t,"audio"),bitrate:n?Ve(t,a):a};i&&(r.channels=""+i),e.push(r)}))}return e}),e):e}),[]);return[]}(e,t,o>0),u=l.length;for(let e=o||1*u||1;e--;){const t={type:"media-source"};if(o&&(t.video=s[e%o]),u){t.audio=l[e%u];const n=t.audio.bitrate;t.video&&n&&(t.video.bitrate-=n)}a.push(t)}if(r){const e=navigator.userAgent;if(r.split(",").some((e=>_e(e)))&&we())return Promise.resolve(ze(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${e})`),a))}return Promise.all(a.map((e=>{const t=function(e){let t="";const{audio:n,video:i}=e;if(i){t+=`${Be(i.contentType)}_r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${Math.ceil(i.bitrate/1e5)}`}if(n){t+=`${i?"_":""}${Be(n.contentType)}_c${n.channels}`}return t}(e);return i[t]||(i[t]=n.decodingInfo(e))}))).then((e=>({supported:!e.some((e=>!e.supported)),configurations:a,decodingInfoResults:e}))).catch((e=>({supported:!1,configurations:a,decodingInfoResults:[],error:e})))}function Ve(e,t){if(t<=1)return 1;let n=128e3;return"ec-3"===e?n=768e3:"ac-3"===e&&(n=64e4),Math.min(t/2,n)}function We(e){return 1e3*Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)/1e3)||1}const Ze=["NONE","TYPE-0","TYPE-1",null];const Ke=["SDR","PQ","HLG"];var qe="",Xe="YES",Ye="v2";function Qe(e){const{canSkipUntil:t,canSkipDateRanges:n,age:i}=e;return t&&i<t/2?n?Ye:Xe:qe}class $e{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Je{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((e=>!!e)).map((e=>e.substring(0,4))).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=null==(t=e.supplemental)?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return et(this._audioGroups,e)}hasSubtitleGroup(e){return et(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t)if("audio"===e){let e=this._audioGroups;e||(e=this._audioGroups=[]),-1===e.indexOf(t)&&e.push(t)}else if("text"===e){let e=this._subtitleGroups;e||(e=this._subtitleGroups=[]),-1===e.indexOf(t)&&e.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 null==(e=this.audioGroups)?void 0:e[0]}get textGroupId(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}addFallback(){}}function et(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function tt(e,t){let n=!1,i=[];if(e&&(n="SDR"!==e,i=[e]),t){i=t.allowedVideoRanges||Ke.slice(0);const e="SDR"!==i.join("")&&!t.videoCodec;n=void 0!==t.preferHDR?t.preferHDR:e&&function(){if("function"==typeof matchMedia){const e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),n||(i=["SDR"])}return{preferHDR:n,allowedVideoRanges:i}}const nt=(e,t)=>JSON.stringify(e,(e=>{const t=new WeakSet;return(n,i)=>{if(e&&(i=e(n,i)),"object"==typeof i&&null!==i){if(t.has(i))return;t.add(i)}return i}})(t));function it(e,t){L.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function rt(e){return e.reduce(((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function at(e){if(!e)return e;const{lang:t,assocLang:n,characteristics:i,channels:r,audioCodec:a}=e;return{lang:t,assocLang:n,characteristics:i,channels:r,audioCodec:a}}function st(e,t,n){if("attrs"in e){const n=t.indexOf(e);if(-1!==n)return n}for(let i=0;i<t.length;i++){if(ot(e,t[i],n))return i}return-1}function ot(e,t,n){const{groupId:i,name:r,lang:a,assocLang:s,default:o}=e,l=e.forced;return(void 0===i||t.groupId===i)&&(void 0===r||t.name===r)&&(void 0===a||function(e,t="--"){if(e.length===t.length)return e===t;return e.startsWith(t)||t.startsWith(e)}(a,t.lang))&&(void 0===a||t.assocLang===s)&&(void 0===o||t.default===o)&&(void 0===l||t.forced===l)&&(!("characteristics"in e)||function(e,t=""){const n=e.split(","),i=t.split(",");return n.length===i.length&&!n.some((e=>-1===i.indexOf(e)))}(e.characteristics||"",t.characteristics))&&(void 0===n||n(e,t))}function lt(e,t){const{audioCodec:n,channels:i}=e;return!(void 0!==n&&(t.audioCodec||"").substring(0,4)!==n.substring(0,4)||void 0!==i&&i!==(t.channels||"2"))}function ut(e,t,n){for(let i=t;i>-1;i--)if(n(e[i]))return i;for(let i=t+1;i<e.length;i++)if(n(e[i]))return i;return-1}function ct(e,t){var n;return!!e&&e!==(null==(n=t.loadLevelObj)?void 0:n.uri)}const ht=function(e,t){let n=0,i=e.length-1,r=null,a=null;for(;n<=i;){r=(n+i)/2|0,a=e[r];const s=t(a);if(s>0)n=r+1;else{if(!(s<0))return a;i=r-1}}return null};function dt(e,t,n=0,i=0,r=.005){let a=null;if(e){a=t[1+e.sn-t[0].sn]||null;const i=e.endDTS-n;i>0&&i<15e-7&&(n+=15e-7),a&&e.level!==a.level&&a.end<=e.end&&(a=t[2+e.sn-t[0].sn]||null)}else 0===n&&0===t[0].start&&(a=t[0]);if(a&&((!e||e.level===a.level)&&0===ft(n,i,a)||function(e,t,n){if(t&&0===t.start&&t.level<e.level&&(t.endPTS||0)>0){const i=t.tagList.reduce(((e,t)=>("INF"===t[0]&&(e+=parseFloat(t[1])),e)),n);return e.start<=i}return!1}(a,e,Math.min(r,i))))return a;const s=ht(t,ft.bind(null,n,i));return!s||s===e&&a?a:s}function ft(e=0,t=0,n){if(n.start<=e&&n.start+n.duration>e)return 0;const i=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-i<=e?1:n.start-i>e&&n.start?-1:0}function pt(e,t,n){const i=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-i>e}function mt(e,t,n){if(e&&e.startCC<=t&&e.endCC>=t){let i=e.fragments;const{fragmentHint:r}=e;let a;return r&&(i=i.concat(r)),ht(i,(e=>e.cc<t?1:e.cc>t?-1:(a=e,e.end<=n?1:e.start>n?-1:0))),a||null}return null}function gt(e){switch(e.details){case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_TIMEOUT:case o.LEVEL_LOAD_TIMEOUT:case o.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function _t(e){return e.details.startsWith("key")}function vt(e){return _t(e)&&!!e.frag&&!e.frag.decryptdata}function yt(e,t){const n=gt(t);return e.default[(n?"timeout":"error")+"Retry"]}function bt(e,t){const n="linear"===e.backoff?1:Math.pow(2,t);return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function xt(e){return x(x({},e),{errorRetry:null,timeoutRetry:null})}function Et(e,t,n,i){if(!e)return!1;const r=null==i?void 0:i.code,a=t<e.maxNumRetry&&(function(e){return wt(e)||!!e&&(e<400||e>499)}(r)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,i,a):a}function wt(e){return 0===e&&!1===navigator.onLine}var Tt=0,St=2,At=3,Ct=5,Lt=0,Rt=1,It=2,Dt=4;function kt(e){const t={action:Tt,flags:Lt};return e&&(t.resolved=!0),t}var Mt="NOT_LOADED",Pt="APPENDING",Ot="PARTIAL",Nt="OK";class Ft{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let t=n.length;t--;){const i=n[t];if(!i)break;if(i.start<=e&&e<=i.end&&i.loaded)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let a=r.length;a--;){const s=i[r[a]];if((null==s?void 0:s.body.type)===t&&(!n||s.buffered)){const t=s.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const a=(null==i?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach((i=>{const s=this.fragments[i];if(!s)return;if(a>=s.body.sn)return;if(!s.buffered&&(!s.loaded||r))return void(s.body.type===n&&this.removeFragment(s.body));const o=s.range[e];o&&(0!==o.time.length?o.time.some((e=>{const n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(s.body),n})):this.removeFragment(s.body))}))}detectPartialFragments(e){const t=this.timeRanges;if(!t||"initSegment"===e.frag.sn)return;const n=e.frag,i=Ut(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const a=!n.relurl;if(Object.keys(t).forEach((i=>{const s=n.elementaryStreams[i];if(!s)return;const o=t[i],l=a||!0===s.partial;r.range[i]=this.getBufferedTimes(n,e.part,l,o)})),r.loaded=null,Object.keys(r.range).length){r.buffered=!0;(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),Bt(r)||this.removeParts(n.sn-1,n.type)}else this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Gt(n,(t=>t.fragment.sn>=e)))}fragBuffered(e,t){const n=Ut(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},a=e.start,s=e.end,o=e.minEndPTS||s,l=e.maxStartPTS||a;for(let e=0;e<i.length;e++){const t=i.start(e)-this.bufferPadding,n=i.end(e)+this.bufferPadding;if(l>=t&&o<=n){r.time.push({startPTS:Math.max(a,i.start(e)),endPTS:Math.min(s,i.end(e))});break}if(a<n&&s>t){const t=Math.max(a,i.start(e)),n=Math.min(s,i.end(e));n>t&&(r.partial=!0,r.time.push({startPTS:t,endPTS:n}))}else if(s<=t)break}return r}getPartialFragment(e){let t,n,i,r=null,a=0;const{bufferPadding:s,fragments:o}=this;return Object.keys(o).forEach((l=>{const u=o[l];u&&Bt(u)&&(n=u.body.start-s,i=u.body.end+s,e>=n&&e<=i&&(t=Math.min(e-n,i-e),a<=t&&(r=u.body,a=t)))})),r}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||Bt(t))}getState(e){const t=Ut(e),n=this.fragments[t];return n?n.buffered?Bt(n)?Ot:Nt:Pt:Mt}isTimeBuffered(e,t,n){let i,r;for(let a=0;a<n.length;a++){if(i=n.start(a)-this.bufferPadding,r=n.end(a)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if("initSegment"===t.frag.sn||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=Ut(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:a}=t;if("initSegment"===n.sn)return;const s=n.type;if(i){let e=this.activePartLists[s];e||(this.activePartLists[s]=e=[]),e.push(i)}this.timeRanges=r;const o=r[a];this.detectEvictedFragments(a,o,s,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ut(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((null==r?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach((a=>{const s=this.fragments[a];if(!s)return;const o=s.body;o.type!==n||i&&!o.gap||o.start<t&&o.end>e&&(s.buffered||r)&&this.removeFragment(o)}))}removeFragment(e){const t=Ut(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const t=e.sn;this.activePartLists[e.type]=Gt(n,(e=>e.fragment.sn!==t))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=null==(e=this.hls)||null==(e=e.latestLevelDetails)?void 0:e.partList;t&&t.forEach((e=>e.clearElementaryStreamInfo()))}}function Bt(e){var t,n,i;return e.buffered&&!!(e.body.gap||null!=(t=e.range.video)&&t.partial||null!=(n=e.range.audio)&&n.partial||null!=(i=e.range.audiovideo)&&i.partial)}function Ut(e){return`${e.type}_${e.level}_${e.sn}`}function Gt(e,t){return e.filter((e=>{const n=t(e);return n||e.clearElementaryStreamInfo(),n}))}var zt=0,jt=1;class Ht{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case zt:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case jt:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class Vt{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let e=0;e<4;e++)n[e]=t.getUint32(4*e);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],a=n[2],s=n[3],o=this.invSubMix,l=o[0],u=o[1],c=o[2],h=o[3],d=new Uint32Array(256);let f=0,p=0,m=0;for(m=0;m<256;m++)d[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){let n=p^p<<1^p<<2^p<<3^p<<4;n=n>>>8^255&n^99,e[f]=n,t[n]=f;const o=d[f],m=d[o],g=d[m];let _=257*d[n]^16843008*n;i[f]=_<<24|_>>>8,r[f]=_<<16|_>>>16,a[f]=_<<8|_>>>24,s[f]=_,_=16843009*g^65537*m^257*o^16843008*f,l[n]=_<<24|_>>>8,u[n]=_<<16|_>>>16,c[n]=_<<8|_>>>24,h[n]=_,f?(f=o^d[d[d[g^o]]],p^=d[d[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);const a=this.ksRows=4*(r+6+1);let s,o;const l=this.keySchedule=new Uint32Array(a),u=this.invKeySchedule=new Uint32Array(a),c=this.sBox,h=this.rcon,d=this.invSubMix,f=d[0],p=d[1],m=d[2],g=d[3];let _,v;for(s=0;s<a;s++)s<r?_=l[s]=t[s]:(v=_,s%r==0?(v=v<<8|v>>>24,v=c[v>>>24]<<24|c[v>>>16&255]<<16|c[v>>>8&255]<<8|c[255&v],v^=h[s/r|0]<<24):r>6&&s%r==4&&(v=c[v>>>24]<<24|c[v>>>16&255]<<16|c[v>>>8&255]<<8|c[255&v]),l[s]=_=(l[s-r]^v)>>>0);for(o=0;o<a;o++)s=a-o,v=3&o?l[s]:l[s-4],u[o]=o<4||s<=4?v:f[c[v>>>24]]^p[c[v>>>16&255]]^m[c[v>>>8&255]]^g[c[255&v]],u[o]=u[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,a=this.invSBox,s=this.invSubMix,o=s[0],l=s[1],u=s[2],c=s[3],h=this.uint8ArrayToUint32Array_(n);let d=h[0],f=h[1],p=h[2],m=h[3];const g=new Int32Array(e),_=new Int32Array(g.length);let v,y,b,x,E,w,T,S,A,C,L,R,I,D;const k=this.networkToHostOrderSwap;for(;t<g.length;){for(A=k(g[t]),C=k(g[t+1]),L=k(g[t+2]),R=k(g[t+3]),E=A^r[0],w=R^r[1],T=L^r[2],S=C^r[3],I=4,D=1;D<i;D++)v=o[E>>>24]^l[w>>16&255]^u[T>>8&255]^c[255&S]^r[I],y=o[w>>>24]^l[T>>16&255]^u[S>>8&255]^c[255&E]^r[I+1],b=o[T>>>24]^l[S>>16&255]^u[E>>8&255]^c[255&w]^r[I+2],x=o[S>>>24]^l[E>>16&255]^u[w>>8&255]^c[255&T]^r[I+3],E=v,w=y,T=b,S=x,I+=4;v=a[E>>>24]<<24^a[w>>16&255]<<16^a[T>>8&255]<<8^a[255&S]^r[I],y=a[w>>>24]<<24^a[T>>16&255]<<16^a[S>>8&255]<<8^a[255&E]^r[I+1],b=a[T>>>24]<<24^a[S>>16&255]<<16^a[E>>8&255]<<8^a[255&w]^r[I+2],x=a[S>>>24]<<24^a[E>>16&255]<<16^a[w>>8&255]<<8^a[255&T]^r[I+3],_[t]=k(v^d),_[t+1]=k(x^f),_[t+2]=k(b^p),_[t+3]=k(y^m),d=A,f=C,p=L,m=R,t+=4}return _.buffer}}class Wt{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=function(e){switch(e){case zt:return"AES-CBC";case jt:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${e}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}class Zt{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 e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(e){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,n=t&&new DataView(e.buffer).getUint8(t-1);return n?e.slice(0,t-n):e}(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise(((r,a)=>{const s=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(s,t,n,i);const o=this.flush();o?r(o.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:a,remainderData:s}=this;if(i!==zt||16!==t.byteLength)return L.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),s&&(e=me(s,e),this.remainderData=null);const o=this.getValidChunk(e);if(!o.length)return null;r&&(n=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Vt),l.expandKey(t);const u=a;return this.currentResult=l.decrypt(o.buffer,0,n),this.currentIV=o.slice(-16).buffer,u||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new Wt(this.subtle,t,i)}return this.fastAesKey.expandKey().then((t=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new Ht(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,t)})).catch((r=>(L.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i))))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const r=this.flush();if(r)return r.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%16;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(L.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Kt=Math.pow(2,17);class qt{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new Qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(n?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,a=i.loader;return new Promise(((l,u)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some((e=>"GAP"===e[0])))return void u(Yt(e));e.gap=!1}const c=this.loader=r?new r(i):new a(i),h=Xt(e);e.loader=c;const d=xt(i.fragLoadPolicy.default),f={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:Kt};e.stats=c.stats;const p={onSuccess:(t,n,i,r)=>{this.resetLoader(e,c);let a=t.data;i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(a.slice(0,16)),a=a.slice(16)),l({frag:e,part:null,payload:a,networkDetails:r})},onError:(t,i,r,a)=>{this.resetLoader(e,c),u(new Qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:x({url:n,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:r,stats:a}))},onAbort:(t,n,i)=>{this.resetLoader(e,c),u(new Qt({type:s.NETWORK_ERROR,details:o.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:(t,n,i)=>{this.resetLoader(e,c),u(new Qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${f.timeout}ms`),networkDetails:i,stats:t}))}};t&&(p.onProgress=(n,i,r,a)=>t({frag:e,part:null,payload:r,networkDetails:a})),c.load(h,f,p)}))}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,a=i.loader;return new Promise(((l,u)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void u(Yt(e,t));const c=this.loader=r?new r(i):new a(i),h=Xt(e,t);e.loader=c;const d=xt(i.fragLoadPolicy.default),f={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Kt};t.stats=c.stats,c.load(h,f,{onSuccess:(i,r,a,s)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const o={frag:e,part:t,payload:i.data,networkDetails:s};n(o),l(o)},onError:(n,i,r,a)=>{this.resetLoader(e,c),u(new Qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:x({url:h.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:r,stats:a}))},onAbort:(n,i,r)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),u(new Qt({type:s.NETWORK_ERROR,details:o.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:r,stats:n}))},onTimeout:(n,i,r)=>{this.resetLoader(e,c),u(new Qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${f.timeout}ms`),networkDetails:r,stats:n}))}})}))}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const i=Math.round(e.duration/t.duration),a=Math.min(Math.round(n.loaded/r),i),s=(i-a)*Math.round(n.loaded/a);n.total=n.loaded+s}else n.total=Math.max(n.loaded,n.total);const a=n.loading,s=i.loading;a.start?a.first+=s.first-s.start:(a.start=s.start,a.first=s.first),a.end=s.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Xt(e,t=null){const n=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},a=n.byteRangeStartOffset,s=n.byteRangeEndOffset;if(i(a)&&i(s)){var o;let t=a,n=s;if("initSegment"===e.sn&&("AES-128"===(l=null==(o=e.decryptdata)?void 0:o.method)||"AES-256"===l)){const e=s-a;e%16&&(n=s+(16-e%16)),0!==a&&(r.resetIV=!0,t=a-16)}r.rangeStart=t,r.rangeEnd=n}var l;return r}function Yt(e,t){const n=new Error(`GAP ${e.gap?"tag":"attribute"} found`),i={type:s.MEDIA_ERROR,details:o.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(i.part=t),(t||e).stats.aborted=!0,new Qt(i)}class Qt extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class $t extends E{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&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Jt{constructor(e,t,n,i=0,r=-1,a=!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={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=a}}const en={length:0,start:()=>0,end:()=>0};class tn{static isBuffered(e,t){if(e){const n=tn.getBuffered(e);for(let e=n.length;e--;)if(t>=n.start(e)&&t<=n.end(e))return!0}return!1}static bufferedRanges(e){if(e){const t=tn.getBuffered(e);return tn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=tn.bufferedRanges(e);if(i.length)return tn.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort(((e,t)=>e.start-t.start||t.end-e.end));let i=-1,r=[];if(n)for(let a=0;a<e.length;a++){t>=e[a].start&&t<=e[a].end&&(i=a);const s=r.length;if(s){const t=r[s-1].end;e[a].start-t<n?e[a].end>t&&(r[s-1].end=e[a].end):r.push(e[a])}else r.push(e[a])}else r=e;let a,s=0,o=t,l=t;for(let e=0;e<r.length;e++){const u=r[e].start,c=r[e].end;if(-1===i&&t>=u&&t<=c&&(i=e),t+n>=u&&t<c)o=u,l=c,s=l-t;else if(t+n<u){a=u;break}}return{len:s,start:o||0,end:l||0,nextStart:a,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||en}catch(e){return L.log("failed to get media.buffered",e),en}}}const nn=/\{\$([a-zA-Z0-9-_]+)\}/g;function rn(e){return nn.test(e)}function an(e,t){if(null!==e.variableList||e.hasVariableRefs){const n=e.variableList;return t.replace(nn,(t=>{const i=t.substring(2,t.length-1),r=null==n?void 0:n[i];return void 0===r?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),t):r}))}return t}function sn(e,t,n){let i,r,a=e.variableList;if(a||(e.variableList=a={}),"QUERYPARAM"in t){i=t.QUERYPARAM;try{const e=new self.URL(n).searchParams;if(!e.has(i))throw new Error(`"${i}" does not match any query parameter in URI: "${n}"`);r=e.get(i)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`))}}else i=t.NAME,r=t.VALUE;i in a?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):a[i]=r||""}function on(e,t,n){const i=t.IMPORT;if(n&&i in n){let t=e.variableList;t||(e.variableList=t={}),t[i]=n[i]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}const ln=/^(\d+)x(\d+)$/,un=/(.+?)=(".*?"|.*?)(?:,|$)/g;class cn{constructor(e,t){"string"==typeof e&&(e=cn.parseAttrList(e,t)),y(this,e)}get clientAttrs(){return Object.keys(this).filter((e=>"X-"===e.substring(0,2)))}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=(1&t.length?"0":"")+t;const n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(2*e,2*e+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce(((e,t)=>(e[t.toLowerCase()]=!0,e)),t)}bool(e){return"YES"===this[e]}decimalResolution(e){const t=ln.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={};for(un.lastIndex=0;null!==(n=un.exec(e));){const r=n[1].trim();let a=n[2];const s=0===a.indexOf('"')&&a.lastIndexOf('"')===a.length-1;let o=!1;if(s)a=a.slice(1,-1);else switch(r){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":o=!0}if(t&&(s||o))a=an(t,a);else if(!o&&!s)switch(r){case"CLOSED-CAPTIONS":if("NONE"===a)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":L.warn(`${e}: attribute ${r} is missing quotes`)}i[r]=a}return i}}function hn(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e||"SCTE35-CMD"===e}class dn{constructor(e,t,n=0){var r;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=(null==t?void 0:t.tagAnchor)||null,this.tagOrder=null!=(r=null==t?void 0:t.tagOrder)?r:n,t){const n=t.attr;for(const t in n)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==n[t]){L.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=y(new cn({}),n,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 e=(null==t?void 0:t.endDate)||new Date(this.attr["END-DATE"]);i(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return void 0===e?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 null===e||null===e.programDateTime?(L.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 null!==t?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*t):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(i(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"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&i(this.startDate.getTime())&&(null===this.duration||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)}}class fn{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)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some((t=>{let n=t.decryptdata;return n||(t.setKeyFormat(e.keyFormat),n=t.decryptdata),!!n&&e.matches(n)}))}get hasProgramDateTime(){return!!this.fragments.length&&i(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(-1!==t){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return null!=(e=this.partList)&&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 pn(e,t){return e.length===t.length&&!e.some(((e,n)=>e!==t[n]))}function mn(e,t){return!e&&!t||!(!e||!t)&&pn(e,t)}function gn(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e}function _n(e){switch(e){case"AES-128":case"AES-256":return zt;case"AES-256-CTR":return jt;default:throw new Error(`invalid full segment method ${e}`)}}function vn(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function yn(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}function bn(e){const t=function(e,t,n){const i=e[t];e[t]=e[n],e[n]=i};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function xn(e){const t=e.split(":");let n=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),i=e[e.length-1].split(",");if(2===i.length){const t="base64"===i[0],r=i[1];t?(e.splice(-1,1),n=vn(r)):n=function(e){const t=yn(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}(r)}}return n}const En="undefined"!=typeof self?self:void 0;var wn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Tn="org.w3.clearkey",Sn="com.apple.streamingkeydelivery",An="com.microsoft.playready",Cn="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Ln(e){switch(e){case Sn:return wn.FAIRPLAY;case An:return wn.PLAYREADY;case Cn:return wn.WIDEVINE;case Tn:return wn.CLEARKEY}}function Rn(e){switch(e){case wn.FAIRPLAY:return Sn;case wn.PLAYREADY:return An;case wn.WIDEVINE:return Cn;case wn.CLEARKEY:return Tn}}function In(e){const{drmSystems:t,widevineLicenseUrl:n}=e,i=t?[wn.FAIRPLAY,wn.WIDEVINE,wn.PLAYREADY,wn.CLEARKEY].filter((e=>!!t[e])):[];return!i[wn.WIDEVINE]&&n&&i.push(wn.WIDEVINE),i}const Dn=null!=En&&null!=(kn=En.navigator)&&kn.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var kn;let Mn={};class Pn{static clearKeyUriToKeyIdMap(){Mn={}}static setKeyIdForUri(e,t){Mn[e]=t}constructor(e,t,n,i=[1],r=null,a){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&!gn(e),null!=a&&a.startsWith("0x")&&(this.keyId=new Uint8Array(M(a)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&pn(e.keyFormatVersions,this.keyFormatVersions)&&mn(e.iv,this.iv)&&mn(e.keyId,this.keyId)}isSupported(){if(this.method){if(gn(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case Sn:case Cn:case An:case Tn:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(gn(this.method)){let t=this.iv;t||("number"!=typeof e&&(L.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),t=function(e){const t=new Uint8Array(16);for(let n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}(e));return new Pn(this.method,this.uri,"identity",this.keyFormatVersions,t)}if(this.pssh&&this.keyId)return this;const t=xn(this.uri);if(t)switch(this.keyFormat){case Cn:if(this.pssh=t,!this.keyId){const e=function(e){const t=[];if(e instanceof ArrayBuffer){const n=e.byteLength;let i=0;for(;i+32<n;){const n=Ee(new DataView(e,i));t.push(n),i+=n.size}}return t}(t.buffer);if(e.length){var n;const t=e[0];this.keyId=null!=(n=t.kids)&&n.length?t.kids[0]:null}}if(!this.keyId){const e=t.length-22;this.keyId=t.subarray(e,e+16)}break;case An:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=xe(e,0,t),this.keyId=function(e){const t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=String.fromCharCode.apply(null,Array.from(t)),i=n.substring(n.indexOf("<"),n.length),r=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(r){const e=r.childNodes[0]?r.childNodes[0].nodeValue:r.getAttribute("VALUE");if(e){const t=vn(e).subarray(0,16);return bn(t),t}}return null}(t);break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Mn[this.uri];if(!e){const t=Object.keys(Mn).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);new DataView(e.buffer,12,4).setUint32(0,t),Pn.setKeyIdForUri(this.uri,e)}this.keyId=e}return this}}const On=/#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,Nn=/#EXT-X-MEDIA:(.*)/g,Fn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Bn=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Un=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 Gn{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return j.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Fn.test(e)}static parseMasterPlaylist(e,t){const n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:rn(e)},i=[];if(On.lastIndex=0,!e.startsWith("#EXTM3U"))return n.playlistParsingError=new Error("no EXTM3U delimiter"),n;let r;for(;null!=(r=On.exec(e));)if(r[1]){var a;const e=new cn(r[1],n),s=an(n,r[2]),o={attrs:e,bitrate:e.decimalInteger("BANDWIDTH")||e.decimalInteger("AVERAGE-BANDWIDTH"),name:e.NAME,url:Gn.resolve(s,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),Wn(e.CODECS,o);const u=e["SUPPLEMENTAL-CODECS"];u&&(o.supplemental={},Wn(u,o.supplemental)),null!=(a=o.unknownCodecs)&&a.length||i.push(o),n.levels.push(o)}else if(r[3]){const e=r[3],i=r[4];switch(e){case"SESSION-DATA":{const e=new cn(i,n),t=e["DATA-ID"];t&&(null===n.sessionData&&(n.sessionData={}),n.sessionData[t]=e);break}case"SESSION-KEY":{const e=Hn(i,t,n);e.encrypted&&e.isSupported()?(null===n.sessionKeys&&(n.sessionKeys=[]),n.sessionKeys.push(e)):L.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${i}"`);break}case"DEFINE":sn(n,new cn(i,n),t);break;case"CONTENT-STEERING":{const e=new cn(i,n);n.contentSteering={uri:Gn.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":n.startTimeOffset=Vn(i)}}const s=i.length>0&&i.length<n.levels.length;return n.levels=s?i:n.levels,0===n.levels.length&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(e,t,n){let i;const r={},a=n.levels,s={AUDIO:a.map((e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:a.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(Nn.lastIndex=0;null!==(i=Nn.exec(e));){const e=new cn(i[1],n),a=e.TYPE;if(a){const n=s[a],i=r[a]||[];r[a]=i;const l=e.LANGUAGE,u=e["ASSOC-LANGUAGE"],c=e.CHANNELS,h=e.CHARACTERISTICS,d=e["INSTREAM-ID"],f={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",name:e.NAME||l||"",type:a,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:l,url:e.URI?Gn.resolve(e.URI,t):""};if(u&&(f.assocLang=u),c&&(f.channels=c),h&&(f.characteristics=h),d&&(f.instreamId=d),null!=n&&n.length){const e=Gn.findGroup(n,f.groupId)||n[0];Zn(f,e,"audioCodec"),Zn(f,e,"textCodec")}i.push(f)}}return r}static parseLevelPlaylist(e,t,n,r,a,s){var o;const l={url:t},u=new fn(t),c=u.fragments,h=[];let d,f,p,m,g=null,_=0,v=0,b=0,x=0,E=0,w=null,T=new X(r,l),S=-1,A=!1,C=null;if(Bn.lastIndex=0,u.m3u8=e,u.hasVariableRefs=rn(e),"#EXTM3U"!==(null==(o=Bn.exec(e))?void 0:o[0]))return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;null!==(d=Bn.exec(e));){A&&(A=!1,T=new X(r,l),T.playlistOffset=b,T.setStart(b),T.sn=_,T.cc=x,E&&(T.bitrate=E),T.level=n,g&&(T.initSegment=g,g.rawProgramDateTime&&(T.rawProgramDateTime=g.rawProgramDateTime,g.rawProgramDateTime=null),C&&(T.setByteRange(C),C=null)));const e=d[1];if(e){T.duration=parseFloat(e);const t=(" "+d[2]).slice(1);T.title=t||null,T.tagList.push(t?["INF",e,t]:["INF",e])}else if(d[3]){if(i(T.duration)){T.playlistOffset=b,T.setStart(b),p&&Xn(T,p,u),T.sn=_,T.level=n,T.cc=x,c.push(T);const e=(" "+d[3]).slice(1);T.relurl=an(u,e),Kn(T,w,h),w=T,b+=T.duration,_++,v=0,A=!0}}else{if(d=d[0].match(Un),!d){L.warn("No matches on slow regex match for level playlist!");continue}for(f=1;f<d.length&&void 0===d[f];f++);const e=(" "+d[f]).slice(1),a=(" "+d[f+1]).slice(1),o=d[f+2]?(" "+d[f+2]).slice(1):null;switch(e){case"BYTERANGE":w?T.setByteRange(a,w):T.setByteRange(a);break;case"PROGRAM-DATE-TIME":T.rawProgramDateTime=a,T.tagList.push(["PROGRAM-DATE-TIME",a]),-1===S&&(S=c.length);break;case"PLAYLIST-TYPE":u.type&&Yn(u,e,d),u.type=a.toUpperCase();break;case"MEDIA-SEQUENCE":0!==u.startSN?Yn(u,e,d):c.length>0&&Qn(u,e,d),_=u.startSN=parseInt(a);break;case"SKIP":{u.skippedSegments&&Yn(u,e,d);const t=new cn(a,u),n=t.decimalInteger("SKIPPED-SEGMENTS");if(i(n)){u.skippedSegments+=n;for(let e=n;e--;)c.push(null);_+=n}const r=t.enumeratedString("RECENTLY-REMOVED-DATERANGES");r&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(r.split("\t")));break}case"TARGETDURATION":0!==u.targetduration&&Yn(u,e,d),u.targetduration=Math.max(parseInt(a),1);break;case"VERSION":null!==u.version&&Yn(u,e,d),u.version=parseInt(a);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||Yn(u,e,d),u.live=!1;break;case"#":(a||o)&&T.tagList.push(o?[a,o]:[a]);break;case"DISCONTINUITY":x++,T.tagList.push(["DIS"]);break;case"GAP":T.gap=!0,T.tagList.push([e]);break;case"BITRATE":T.tagList.push([e,a]),E=1e3*parseInt(a),i(E)?T.bitrate=E:E=0;break;case"DATERANGE":{const e=new cn(a,u),t=new dn(e,u.dateRanges[e.ID],u.dateRangeTagCount);u.dateRangeTagCount++,t.isValid||u.skippedSegments?u.dateRanges[t.id]=t:L.warn(`Ignoring invalid DATERANGE tag: "${a}"`),T.tagList.push(["EXT-X-DATERANGE",a]);break}case"DEFINE":{const e=new cn(a,u);"IMPORT"in e?on(u,e,s):sn(u,e,t)}break;case"DISCONTINUITY-SEQUENCE":0!==u.startCC?Yn(u,e,d):c.length>0&&Qn(u,e,d),u.startCC=x=parseInt(a);break;case"KEY":{const e=Hn(a,t,u);if(e.isSupported()){if("NONE"===e.method){p=void 0;break}p||(p={});const t=p[e.keyFormat];null!=t&&t.matches(e)||(t&&(p=y({},p)),p[e.keyFormat]=e)}else L.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${a}"`);break}case"START":u.startTimeOffset=Vn(a);break;case"MAP":{const e=new cn(a,u);if(T.duration){const t=new X(r,l);qn(t,e,n,p),g=t,T.initSegment=g,g.rawProgramDateTime&&!T.rawProgramDateTime&&(T.rawProgramDateTime=g.rawProgramDateTime)}else{const t=T.byteRangeEndOffset;if(t){const e=T.byteRangeStartOffset;C=`${t-e}@${e}`}else C=null;qn(T,e,n,p),g=T,A=!0}g.cc=x;break}case"SERVER-CONTROL":m&&Yn(u,e,d),m=new cn(a),u.canBlockReload=m.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=m.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&m.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=m.optionalFloat("PART-HOLD-BACK",0),u.holdBack=m.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{u.partTarget&&Yn(u,e,d);const t=new cn(a);u.partTarget=t.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=u.partList;e||(e=u.partList=[]);const t=v>0?e[e.length-1]:void 0,n=v++,i=new cn(a,u),r=new Y(i,T,l,n,t);e.push(r),T.duration+=r.duration;break}case"PRELOAD-HINT":{const e=new cn(a,u);u.preloadHint=e;break}case"RENDITION-REPORT":{const e=new cn(a,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(e);break}default:L.warn(`line parsed but not handled: ${d}`)}}}w&&!w.relurl?(c.pop(),b-=w.duration,u.partList&&(u.fragmentHint=w)):u.partList&&(Kn(T,w,h),T.cc=x,u.fragmentHint=T,p&&Xn(T,p,u)),u.targetduration||(u.playlistParsingError=new Error("Missing Target Duration"));const R=c.length,I=c[0],D=c[R-1];if(b+=u.skippedSegments*u.targetduration,b>0&&R&&D){u.averagetargetduration=b/R;const e=D.sn;u.endSN="initSegment"!==e?e:0,u.live||(D.endList=!0),S>0&&(!function(e,t){let n=e[t];for(let i=t;i--;){const t=e[i];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(c,S),I&&h.unshift(I))}return u.fragmentHint&&(b+=u.fragmentHint.duration),u.totalduration=b,h.length&&u.dateRangeTagCount&&I&&zn(h,u),u.endCC=x,u}}function zn(e,t){let n=e.length;if(!n){if(!t.hasProgramDateTime)return;{const i=t.fragments[t.fragments.length-1];e.push(i),n++}}const i=e[n-1],r=t.live?1/0:t.totalduration,a=Object.keys(t.dateRanges);for(let o=a.length;o--;){const l=t.dateRanges[a[o]],u=l.startDate.getTime();l.tagAnchor=i.ref;for(let i=n;i--;){var s;if((null==(s=e[i])?void 0:s.sn)<t.startSN)break;const n=jn(t,u,e,i,r);if(-1!==n){l.tagAnchor=t.fragments[n].ref;break}}}}function jn(e,t,n,i,r){const a=n[i];if(a){const o=a.programDateTime;if(t>=o||0===i){var s;if(t<=o+1e3*(((null==(s=n[i+1])?void 0:s.start)||r)-a.start)){const r=n[i].sn-e.startSN;if(r<0)return-1;const a=e.fragments;if(a.length>n.length){for(let s=(n[i+1]||a[a.length-1]).sn-e.startSN;s>r;s--){const e=a[s].programDateTime;if(t>=e&&t<e+1e3*a[s].duration)return s}}return r}}}return-1}function Hn(e,t,n){var i,r;const a=new cn(e,n),s=null!=(i=a.METHOD)?i:"",o=a.URI,l=a.hexadecimalInteger("IV"),u=a.KEYFORMATVERSIONS,c=null!=(r=a.KEYFORMAT)?r:"identity";o&&a.IV&&!l&&L.error(`Invalid IV: ${a.IV}`);const h=o?Gn.resolve(o,t):"",d=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Pn(s,h,c,d,l,a.KEYID)}function Vn(e){const t=new cn(e).decimalFloatingPoint("TIME-OFFSET");return i(t)?t:null}function Wn(e,t){let n=(e||"").split(/[ ,]+/).filter((e=>e));["video","audio","text"].forEach((e=>{const i=n.filter((t=>Se(t,e)));i.length&&(t[`${e}Codec`]=i.map((e=>e.split("/")[0])).join(","),n=n.filter((e=>-1===i.indexOf(e))))})),t.unknownCodecs=n}function Zn(e,t,n){const i=t[n];i&&(e[n]=i)}function Kn(e,t,n){e.rawProgramDateTime?n.push(e):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime)}function qn(e,t,n,i){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn="initSegment",i&&(e.levelkeys=i),e.initSegment=null}function Xn(e,t,n){e.levelkeys=t;const{encryptedFragments:i}=n;i.length&&i[i.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||i.push(e)}function Yn(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${n[0]})`)}function Qn(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${n[0]})`)}function $n(e,t){const n=t.startPTS;if(i(n)){let i,r=0;t.sn>e.sn?(r=n-e.start,i=e):(r=e.start-n,i=t),i.duration!==r&&i.setDuration(r)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.setStart(e.start+(e.minEndPTS-e.start)):t.setStart(e.start+e.duration)}else t.setStart(Math.max(e.start-t.duration,0))}function Jn(e,t,n,r,a,s,o){r-n<=0&&(o.warn("Fragment should have a positive duration",t),r=n+t.duration,s=a+t.duration);let l=n,u=r;const c=t.startPTS,h=t.endPTS;if(i(c)){const d=Math.abs(c-n);e&&d>e.totalduration?o.warn(`media timestamps and playlist times differ by ${d}s for level ${t.level} ${e.url}`):i(t.deltaPTS)?t.deltaPTS=Math.max(d,t.deltaPTS):t.deltaPTS=d,l=Math.max(n,c),n=Math.min(n,c),a=void 0!==t.startDTS?Math.min(a,t.startDTS):a,u=Math.min(r,h),r=Math.max(r,h),s=void 0!==t.endDTS?Math.max(s,t.endDTS):s}const d=n-t.start;0!==t.start&&t.setStart(n),t.setDuration(r-t.start),t.startPTS=n,t.maxStartPTS=l,t.startDTS=a,t.endPTS=r,t.minEndPTS=u,t.endDTS=s;const f=t.sn;if(!e||f<e.startSN||f>e.endSN)return 0;let p;const m=f-e.startSN,g=e.fragments;for(g[m]=t,p=m;p>0;p--)$n(g[p],g[p-1]);for(p=m;p<g.length-1;p++)$n(g[p],g[p+1]);return e.fragmentHint&&$n(g[g.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,d}function ei(e,t,n){if(e===t)return;let r=null;const a=e.fragments;for(let e=a.length-1;e>=0;e--){const t=a[e].initSegment;if(t){r=t;break}}let s;e.fragmentHint&&delete e.fragmentHint.endPTS,function(e,t,n){const i=t.skippedSegments,r=Math.max(e.startSN,t.startSN)-t.startSN,a=(e.fragmentHint?1:0)+(i?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,s=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let u=r;u<=a;u++){const r=l[s+u];let a=o[u];if(i&&!a&&r&&(a=t.fragments[u]=r),r&&a){n(r,a,u,o);const i=r.relurl,s=a.relurl;if(i&&ui(i,s))return void(t.playlistParsingError=ti(`media sequence mismatch ${a.sn}:`,e,t,r,a));if(r.cc!==a.cc)return void(t.playlistParsingError=ti(`discontinuity sequence mismatch (${r.cc}!=${a.cc})`,e,t,r,a))}}}(e,t,((e,n,a,o)=>{if((!t.startCC||t.skippedSegments)&&n.cc!==e.cc){const i=e.cc-n.cc;for(let e=a;e<o.length;e++)o[e].cc+=i;t.endCC=o[o.length-1].cc}i(e.startPTS)&&i(e.endPTS)&&(n.setStart(n.startPTS=e.startPTS),n.startDTS=e.startDTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.setDuration(e.endPTS-e.startPTS),n.duration&&(s=n),t.PTSKnown=t.alignedSliding=!0),e.hasStreams&&(n.elementaryStreams=e.elementaryStreams),n.loader=e.loader,e.hasStats&&(n.stats=e.stats),e.initSegment&&(n.initSegment=e.initSegment,r=e.initSegment)}));const o=t.fragments,l=t.fragmentHint?o.concat(t.fragmentHint):o;if(r&&l.forEach((e=>{var t;!e||e.initSegment&&e.initSegment.relurl!==(null==(t=r)?void 0:t.relurl)||(e.initSegment=r)})),t.skippedSegments){if(t.deltaUpdateFailed=o.some((e=>!e)),t.deltaUpdateFailed){n.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)o.shift();t.startSN=o[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=function(e,t,n){const{dateRanges:i,recentlyRemovedDateranges:r}=t,a=y({},e);r&&r.forEach((e=>{delete a[e]}));const s=Object.keys(a).length;if(!s)return i;return Object.keys(i).forEach((e=>{const t=a[e],r=new dn(i[e].attr,t);r.isValid?(a[e]=r,t||(r.tagOrder+=s)):n.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${nt(i[e].attr)}"`)})),a}(e.dateRanges,t,n));const i=e.fragments.filter((e=>e.rawProgramDateTime));if(e.hasProgramDateTime&&!t.hasProgramDateTime)for(let e=1;e<l.length;e++)null===l[e].programDateTime&&Kn(l[e],l[e-1],i);zn(i,t)}t.endCC=o[o.length-1].cc}if(!t.startCC){var u;const n=ai(e,t.startSN-1);t.startCC=null!=(u=null==n?void 0:n.cc)?u:o[0].cc}!function(e,t,n){if(e&&t){let i=0;for(let r=0,a=e.length;r<=a;r++){const a=e[r],s=t[r+i];a&&s&&a.index===s.index&&a.fragment.sn===s.fragment.sn?n(a,s):i--}}}(e.partList,t.partList,((e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),s?Jn(t,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS,n):ni(e,t),o.length&&(t.totalduration=t.edge-o[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const c=t.advancedDateTime;if(t.advanced&&c){const e=t.edge;t.driftStart||(t.driftStartTime=c,t.driftStart=e),t.driftEndTime=c,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime;-1===t.requestScheduled&&(t.requestScheduled=e.requestScheduled)}function ti(e,t,n,i,r){return new Error(`${e} ${r.url}\nPlaylist starting @${t.startSN}\n${t.m3u8}\n\nPlaylist starting @${n.startSN}\n${n.m3u8}`)}function ni(e,t,n=!0){const i=t.startSN+t.skippedSegments-e.startSN,r=e.fragments,a=i>=0;let s=0;if(a&&i<r.length)s=r[i].start;else if(a&&t.startSN===e.endSN+1)s=e.fragmentEnd;else if(a&&n)s=e.fragmentStart+i*t.levelTargetDuration;else{if(t.skippedSegments||0!==t.fragmentStart)return;s=e.fragmentStart}ii(t,s)}function ii(e,t){if(t){const n=e.fragments;for(let i=e.skippedSegments;i<n.length;i++)n[i].addStart(t);e.fragmentHint&&e.fragmentHint.addStart(t)}}function ri(e,t=1/0){let n=1e3*e.targetduration;if(e.updated){const i=e.fragments,r=4;if(i.length&&n*r>t){const e=1e3*i[i.length-1].duration;e<n&&(n=e)}}else n/=2;return Math.round(n)}function ai(e,t,n){if(!e)return null;let i=e.fragments[t-e.startSN];return i||(i=e.fragmentHint,i&&i.sn===t?i:t<e.startSN&&n&&n.sn===t?n:null)}function si(e,t,n){return e?oi(e.partList,t,n):null}function oi(e,t,n){if(e)for(let i=e.length;i--;){const r=e[i];if(r.index===n&&r.fragment.sn===t)return r}return null}function li(e){e.forEach(((e,t)=>{var n;null==(n=e.details)||n.fragments.forEach((e=>{e.level=t,e.initSegment&&(e.initSegment.level=t)}))}))}function ui(e,t){return!(e===t||!t)&&ci(e)!==ci(t)}function ci(e){return e.replace(/\?[^?]*$/,"")}function hi(e,t){for(let i=0,r=e.length;i<r;i++){var n;if((null==(n=e[i])?void 0:n.cc)===t)return e[i]}return null}function di(e,t){const n=e.start+t;e.startPTS=n,e.setStart(n),e.endPTS=n+e.duration}function fi(e,t){const n=t.fragments;for(let t=0,i=n.length;t<i;t++)di(n[t],e);t.fragmentHint&&di(t.fragmentHint,e),t.alignedSliding=!0}function pi(e,t){if(!function(e,t){return!!(e&&t.startCC<e.endCC&&t.endCC>e.startCC)}(t,e))return;const n=Math.min(t.endCC,e.endCC),i=hi(t.fragments,n),r=hi(e.fragments,n);if(!i||!r)return;L.log(`Aligning playlist at start of dicontinuity sequence ${n}`);fi(i.start-r.start,e)}function mi(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const n=e.fragments,i=t.fragments;if(!n.length||!i.length)return;let r,a;const s=Math.min(t.endCC,e.endCC);t.startCC<s&&e.startCC<s&&(r=hi(i,s),a=hi(n,s)),r&&a||(r=i[Math.floor(i.length/2)],a=hi(n,r.cc)||n[Math.floor(n.length/2)]);const o=r.programDateTime,l=a.programDateTime;if(!o||!l)return;fi((l-o)/1e3-(a.start-r.start),e)}function gi(e,t,n){_i(e,t,n),e.addEventListener(t,n)}function _i(e,t,n){e.removeEventListener(t,n)}const vi=function(e){let t="";const n=e.length;for(let i=0;i<n;i++)t+=`[${e.start(i).toFixed(3)}-${e.end(i).toFixed(3)}]`;return t},yi="STOPPED",bi="IDLE",xi="KEY_LOADING",Ei="FRAG_LOADING",wi="FRAG_LOADING_WAITING_RETRY",Ti="WAITING_TRACK",Si="PARSING",Ai="PARSED",Ci="ENDED",Li="ERROR",Ri="WAITING_INIT_PTS",Ii="WAITING_LEVEL";class Di extends $t{constructor(e,t,n,r,a){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=yi,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:e,fragCurrent:t,media:n,mediaBuffer:r,state:a}=this,s=n?n.currentTime:0,o=tn.bufferInfo(r||n,s,e.maxBufferHole),l=!o.len;if(this.log(`Media seeking to ${i(s)?s.toFixed(3):s}, state: ${a}, ${l?"out of":"in"} buffer`),this.state===Ci)this.resetLoadingState();else if(t){const n=e.maxFragLookUpTolerance,i=t.start-n,r=t.start+t.duration+n;if(l||r<o.start||i>o.end){const e=s>r;(s<i||e)&&(e&&t.loader&&(this.log(`Cancelling fragment load for seek (sn: ${t.sn})`),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(n){this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0);if(s>this.lastCurrentTime&&(this.lastCurrentTime=s),!this.loadingParts){const e=Math.max(o.end,s),t=this.shouldLoadParts(this.getLevelDetails(),e);t&&(this.log(`LL-Part loading ON after seeking to ${s.toFixed(2)} with buffer @${e.toFixed(2)}`),this.loadingParts=t)}}this.hls.hasEnoughToStart||(this.log(`Setting ${l?"startPosition":"nextLoadPosition"} to ${s} for seek without enough to start`),this.nextLoadPosition=s,l&&(this.startPosition=s)),l&&this.state===bi&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=a,this.hls=e,this.fragmentLoader=new qt(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Zt(e.config)}registerListeners(){const{hls:e}=this;e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===yi)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=yi}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return-1===t&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=tn.bufferedInfo(r,e.start,0));const a=e.nextStart;if(a&&a>i&&a<t.edge)return!1;if(this.media.currentTime<e.start)return!1;const s=t.partList;if(null!=s&&s.length){const e=s[s.length-1];return tn.isBuffered(this.media,e.start+e.duration/2)}const o=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){if(this.levels&&null!==this.levelLastLoaded)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;var t;return e?(null==(t=this.getLevelDetails())?void 0:t.appliedTimelineOffset)||e:0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;gi(n,"seeking",this.onMediaSeeking),gi(n,"ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===yi&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(null!==i){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),_i(i,"seeking",this.onMediaSeeking),_i(i,"ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n)return this.resetLoadingState(),void this.resetTransmuxer();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=yi,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){this._doFragLoad(e,t,n,(e=>{const t=e.frag;if(this.fragContextChanged(t))return this.warn(`${t.type} sn: ${t.sn}${e.part?" part: "+e.part.index:""} of ${this.fragInfo(t,!1,e.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(t);t.stats.chunkCount++,this._handleFragmentLoadProgress(e)})).then((e=>{if(!e)return;const t=this.state,n=e.frag;this.fragContextChanged(n)?(t===Ei||!this.fragCurrent&&t===Si)&&(this.fragmentTracker.removeFragment(n),this.state=bi):("payload"in e&&(this.log(`Loaded ${n.type} sn: ${n.sn} of ${this.playlistLabel()} ${n.level}`),this.hls.trigger(l.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e))})).catch((t=>{this.state!==yi&&this.state!==Li&&(this.warn(`Frag error: ${(null==t?void 0:t.message)||t}`),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Pt){const t=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=Math.max(e.duration,i?i.len:this.config.maxBufferLength),a=this.backtrackFragment;(1===(a?e.sn-a.sn:0)||this.reduceMaxBufferLength(r,e.duration))&&n.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===Ot&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(null==t?void 0:t.live)&&"EVENT"!==t.type&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(l.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((e=>{const t=null==e?void 0:e.frag;if(!t||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return e})).then((e=>{const{hls:t}=this,{frag:n,payload:i}=e,r=n.decryptdata;if(i&&i.byteLength>0&&null!=r&&r.key&&r.iv&&gn(r.method)){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer,_n(r.method)).catch((e=>{throw t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:n}),e})).then((i=>{const r=self.performance.now();return t.trigger(l.FRAG_DECRYPTED,{frag:n,payload:i,stats:{tstart:a,tdecrypt:r}}),e.payload=i,this.completeInitSegmentLoad(e)}))}return this.completeInitSegmentLoad(e)})).catch((t=>{this.state!==yi&&this.state!==Li&&(this.warn(t),this.resetFragmentLoading(e))}))}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==yi&&(this.state=bi),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var n,i;const r=e.tracks;if(r&&!t.encrypted&&(null!=(n=r.audio)&&n.encrypted||null!=(i=r.video)&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const e=this.media,n=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${e?"attached mediaKeys: "+e.mediaKeys:"detached"})`);return this.warn(n.message),!e||e.mediaKeys?!1:(this.hls.trigger(l.ERROR,{type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_KEYS,fatal:!1,error:n,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?vi(tn.getBuffered(n)):"(detached)"})`),q(e)){var i;if(e.type!==m){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return void(this.state=bi)}const t=null==(i=this.levels)?void 0:i[e.level];null!=t&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=bi}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,a=!r||0===r.length||r.some((e=>!e)),s=new Jt(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!a);t.flush(s)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var a;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(!e.encrypted||null!=(a=e.decryptdata)&&a.key)e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));else if(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=xi,this.fragCurrent=e,o=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(l.KEY_LOADED,e),this.state===xi&&(this.state=bi),e})),this.hls.trigger(l.KEY_LOADING,{frag:e}),null===this.fragCurrent)return this.log("context changed in KEY_LOADING"),Promise.resolve(null);const u=this.fragPrevious;if(q(e)&&(!u||e.sn!==u.sn)){const n=this.shouldLoadParts(t.details,e.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?"ON":"OFF"} loading sn ${null==u?void 0:u.sn}->${e.sn}`),this.loadingParts=n)}if(n=Math.max(e.start,n||0),this.loadingParts&&q(e)){const i=s.partList;if(i&&r){n>s.fragmentEnd&&s.fragmentHint&&(e=s.fragmentHint);const a=this.getNextPart(i,e,n);if(a>-1){const u=i[a];let c;return e=this.fragCurrent=u.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${u.index} (${a}/${i.length-1}) of ${this.fragInfo(e,!1,u)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=u.start+u.duration,this.state=Ei,c=o?o.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(e,u,t,r))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,u,t,r).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(l.FRAG_LOADING,{frag:e,part:u,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):c}if(!e.url||this.loadedEndOfParts(i,n))return Promise.resolve(null)}}var c;if(q(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${null==(c=s.partList)?void 0:c.filter((e=>e.loaded)).map((e=>`[${e.start}-${e.end}]`))}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),i(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ei;const h=this.config.progressive;let d;return d=h&&o?o.then((t=>!t||this.fragContextChanged(t.frag)?null:this.fragmentLoader.load(e,r))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,h?r:void 0),o]).then((([e])=>(!h&&r&&r(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(l.FRAG_LOADING,{frag:e,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):d}doFragPartsLoad(e,t,n,i){return new Promise(((r,a)=>{var s;const o=[],u=null==(s=n.details)?void 0:s.partList,c=t=>{this.fragmentLoader.loadPart(e,t,i).then((i=>{o[t.index]=i;const a=i.part;this.hls.trigger(l.FRAG_LOADED,i);const s=si(n.details,e.sn,t.index+1)||oi(u,e.sn,t.index+1);if(!s)return r({frag:e,part:a,partsLoaded:o});c(s)})).catch(a)};c(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===o.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===s.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(l.ERROR,t)}else this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Si)return void(this.fragCurrent||this.state===yi||this.state===Li||(this.state=bi));const{frag:n,part:i,level:r}=t,a=self.performance.now();n.stats.parsing.end=a,i&&(i.stats.parsing.end=a);const s=this.getLevelDetails(),o=s&&n.sn>s.endSN||this.shouldLoadParts(s,n.end);o!==this.loadingParts&&(this.log(`LL-Part loading ${o?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=o),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var n;const r=e.partList[0];if(r.fragment.type===m)return!1;if(t>=r.end+((null==(n=e.fragmentHint)?void 0:n.duration)||0)){var i;if((this.hls.hasEnoughToStart?(null==(i=this.media)?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:a}=e;if(null==t||!t[i])return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const s=t[i],o=s.details,l=a>-1?si(o,r,a):null,u=l?l.fragment:ai(o,r,n);return u?(n&&n!==u&&(u.stats=n.stats),{frag:u,part:l,level:s}):null}bufferFragmentData(e,t,n,i,r){if(this.state!==Si)return;const{data1:a,data2:s}=e;let o=a;if(s&&(o=me(a,s)),!o.length)return;const u=this.initPTS[t.cc],c=u?-u.baseTime/u.timescale:void 0,h={type:e.type,frag:t,part:n,chunkMeta:i,offset:c,parent:t.type,data:o};if(this.hls.trigger(l.BUFFER_APPENDING,h),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!tn.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const n=t.currentTime,i=tn.bufferInfo(t,n,0),r=e.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*r),s=Math.max(Math.min(e.start-a,i.end-a),n+a);e.start-s>a&&this.flushMainBuffer(s,e.start)}getFwdBufferInfo(e,t){var n;const r=this.getLoadPosition();if(!i(r))return null;const a=this.lastCurrentTime>r||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,a)}getFwdBufferInfoAtPos(e,t,n,i){const r=tn.bufferInfo(e,t,i);if(0===r.len&&void 0!==r.nextStart){const a=this.fragmentTracker.getBufferedFrag(t,n);if(a&&(r.nextStart<=a.end||a.gap)){const n=Math.max(Math.min(r.nextStart,a.end)-t,i);return tn.bufferInfo(e,t,n)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return n=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-3*t,n.maxMaxBufferLength/2,i);return r>=i&&(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0)}getAppendedFrag(e,t=f){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,a=n[0].start,s=r.lowLatencyMode&&!!t.partList;let o=null;if(t.live){const n=r.initialLiveManifestSize;if(i<n)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${n})`),null;if(!t.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||e<a){var l;s&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(t);const n=this.hls.startPosition,i=this.hls.liveSyncPosition,r=o?(-1!==n&&n>=a?n:i)||o.start:e;this.log(`Setting startPosition to ${r} to match start frag at live edge. mainStart: ${n} liveSyncPosition: ${i} frag.start: ${null==(l=o)?void 0:l.start}`),this.startPosition=this.nextLoadPosition=r}}else e<=a&&(o=n[0]);if(!o){const n=this.loadingParts?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,n,t)}let u=this.filterReplacedPrimary(o,t);if(!u&&o){const e=o.sn-t.startSN;u=this.filterReplacedPrimary(n[e+1]||null,t)}return this.mapToInitFragWhenRequired(u)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Nt||n===Ot&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let a=null;if(e.gap&&(a=this.getNextFragment(this.nextLoadPosition,t),a&&!a.gap&&n.nextStart)){const e=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(null!==e&&n.len+e.len>=r){const e=a.sn;return this.loopSn!==e&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e}`),this.loopSn=e),null}}return this.loopSn=void 0,a}get primaryPrefetch(){if(ki(this.config)){var e;if(null==(e=this.hls.interstitialsManager)||null==(e=e.playingItem)?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(ki(this.config)&&e.type!==m){const n=this.hls.interstitialsManager,i=null==n?void 0:n.bufferingItem;if(i){const n=i.event;if(n){if(n.appendInPlace||Math.abs(e.start-i.start)>1||0===i.start)return null}else{if(e.end<=i.start&&!1===(null==t?void 0:t.live))return null;if(e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}}const r=null==n?void 0:n.playerQueue;if(r)for(let t=r.length;t--;){const n=r[t].interstitial;if(n.appendInPlace&&e.start>=n.startTime&&e.end<=n.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,n){let i=-1,r=!1,a=!0;for(let s=0,o=e.length;s<o;s++){const o=e[s];if(a=a&&!o.independent,i>-1&&n<o.start)break;const l=o.loaded;l?i=-1:(r||(o.independent||a)&&o.fragment===t)&&(o.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${o.start}`),i=s),r=l}return i}loadedEndOfParts(e,t){let n;for(let i=e.length;i--;){if(n=e[i],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=function(e,t,n){if(null===t||!Array.isArray(e)||!e.length||!i(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;for(let i=0;i<e.length;++i){const r=e[i];if(pt(t,n,r))return r}return null}(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){const a=t[i-e.startSN];n.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=mt(e,n.cc,n.end),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(r=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:a,endSN:s}=n;const{fragmentHint:o}=n,{maxFragLookUpTolerance:l}=i,u=n.partList,c=!!(this.loadingParts&&null!=u&&u.length&&o);let h;if(c&&!this.bitrateTest&&u[u.length-1].fragment.sn===o.sn&&(a=a.concat(o),s=o.sn),e<t){var d;h=dt(r,a,e,e<this.lastCurrentTime||e>t-l||null!=(d=this.media)&&d.paused||!this.startFragRequested?0:l)}else h=a[a.length-1];if(h){const e=h.sn-n.startSN,t=this.fragmentTracker.getState(h);if((t===Nt||t===Ot&&h.gap)&&(r=h),r&&h.sn===r.sn&&(!c||u[0].fragment.sn>h.sn||!n.live)){if(h.level===r.level){const t=a[e+1];h=h.sn<s&&this.fragmentTracker.getState(t)!==Nt?t:null}}}return h}alignPlaylists(e,t,n){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const a=e.fragmentStart,s=!t,o=e.alignedSliding&&i(a);if(s||!o&&!a){!function(e,t){e&&(pi(t,e),t.alignedSliding||mi(t,e),t.alignedSliding||t.skippedSegments||ni(e,t,!1))}(n,e);const i=e.fragmentStart;return this.log(`Live playlist sliding: ${i.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),i}return a}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const r=this.timelineOffset;if(-1===n){const a=null!==this.startTimeOffset,s=a?this.startTimeOffset:e.startTimeOffset;null!==s&&i(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${a?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+r}this.nextLoadPosition=n+r}getLoadPosition(){var e;const{media:t}=this;let n=0;return null!=(e=this.hls)&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&q(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===wi)||(this.state=bi)}onFragmentOrKeyLoadError(e,t){var n;if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;var r;if(this.fragContextChanged(i))return void this.warn(`Frag load error must match current frag to retry ${i.url} > ${null==(r=this.fragCurrent)?void 0:r.url}`);const a=t.details===o.FRAG_GAP;a&&this.fragmentTracker.fragBuffered(i,!0);const s=t.errorAction;if(!s)return void(this.state=Li);const{action:l,flags:u,retryCount:c=0,retryConfig:h}=s,d=!!h,f=d&&l===Ct,p=d&&!s.resolved&&u===Rt,m=null==(n=this.hls.latestLevelDetails)?void 0:n.live;if(!f&&p&&q(i)&&!i.endList&&m&&!vt(t))this.resetFragmentErrors(e),this.treatAsGap(i),s.resolved=!0;else if((f||p)&&c<h.maxNumRetry){var g;const n=wt(null==(g=t.response)?void 0:g.code),r=bt(h,c);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+r,this.state=wi,s.resolved=!0,n)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(t.reason="offline");this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${c+1}/${h.maxNumRetry} in ${r}ms`)}else if(h){if(this.resetFragmentErrors(e),!(c<h.maxNumRetry))return void this.warn(`${t.details} reached or exceeded max retry (${c})`);a||l===At||(s.resolved=!0)}else this.state=l===St?Ii:Li;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!wt(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=bi)}reduceLengthAndFlushBuffer(e){if(this.state===Si||this.state===Ai){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(null==t?void 0:t.duration)||10);const a=!r;return a&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===p&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==yi&&(this.state=bi)}afterBufferFlushed(e,t,n){if(!e)return;const i=tn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===Ci&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==yi&&(this.state=bi)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;null!=t&&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.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${-1===e.level?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r)return void this.warn("level.details undefined");var a;if(!Object.keys(e.elementaryStreams).reduce(((t,a)=>{const s=e.elementaryStreams[a];if(s){const o=s.endPTS-s.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${a} duration reliably (${o})`),t||!1;const u=i?0:Jn(r,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS,this);return this.hls.trigger(l.LEVEL_PTS_UPDATED,{details:r,level:n,drift:u,type:a,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}),!1)&&(0===n.fragmentError&&this.treatAsGap(e,n),null===(null==(a=this.transmuxer)?void 0:a.error))){const t=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Ai,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(l.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===f?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${(null!=(i=t&&!n?e.startPTS:(n||e).start)?i:NaN).toFixed(3)}-${(null!=(r=t&&!n?e.endPTS:(n||e).end)?r:NaN).toFixed(3)}]${n&&"main"===e.type?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;null==(e=this.transmuxer)||e.reset()}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function ki(e){return!!e.interstitialsController&&!1!==e.enableInterstitialPlayback}class Mi{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;return e.length?(n=1===e.length?e[0]:function(e,t){const n=new Uint8Array(t);let i=0;for(let t=0;t<e.length;t++){const r=e[t];n.set(r,i),i+=r.length}return n}(e,t),this.reset(),n):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Pi,Oi={exports:{}};var Ni=(Pi||(Pi=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,i,a,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,a||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,s=new Array(a);r<a;r++)s[r]=i[r].fn;return s},o.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},o.prototype.emit=function(e,t,i,r,a,s){var o=n?n+e:e;if(!this._events[o])return!1;var l,u,c=this._events[o],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,i),!0;case 4:return c.fn.call(c.context,t,i,r),!0;case 5:return c.fn.call(c.context,t,i,r,a),!0;case 6:return c.fn.call(c.context,t,i,r,a,s),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,i);break;case 4:c[u].fn.call(c[u].context,t,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},o.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,i,r){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||r&&!o.once||i&&o.context!==i||s(this,a);else{for(var l=0,u=[],c=o.length;l<c;l++)(o[l].fn!==t||r&&!o[l].once||i&&o[l].context!==i)&&u.push(o[l]);u.length?this._events[a]=1===u.length?u[0]:u:s(this,a)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(Oi)),Oi.exports),Fi=P(Ni);const Bi="1.6.12",Ui={};function Gi(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function zi(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function ji(e,t){let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n}function Hi(e,t){const n=t;let i=0;for(;zi(e,t);){i+=10;i+=ji(e,t+6),Gi(e,t+10)&&(i+=10),t+=i}if(i>0)return e.subarray(n,n+i)}function Vi(e,t){return 255===e[t]&&240==(246&e[t+1])}function Wi(e,t){return 1&e[t+1]?7:9}function Zi(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Ki(e,t){return t+1<e.length&&Vi(e,t)}function qi(e,t){if(Ki(e,t)){const n=Wi(e,t);if(t+n>=e.length)return!1;const i=Zi(e,t);if(i<=n)return!1;const r=t+i;return r===e.length||Ki(e,r)}return!1}function Xi(e,t,n,i,r){if(!e.samplerate){const a=function(e,t,n,i){const r=t[n+2],a=r>>2&15;if(a>12){const t=new Error(`invalid ADTS sampling index:${a}`);return void e.emit(l.ERROR,l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message})}const u=1+(r>>6&3),c=t[n+3]>>6&3|(1&r)<<2,h="mp4a.40."+u,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][a];let f=a;5!==u&&29!==u||(f-=3);const p=[u<<3|(14&f)>>1,(1&f)<<7|c<<3];return L.log(`manifest codec:${i}, parsed codec:${h}, channels:${c}, rate:${d} (ADTS object type:${u} sampling index:${a})`),{config:p,samplerate:d,channelCount:c,codec:h,parsedCodec:h,manifestCodec:i}}(t,n,i,r);if(!a)return;y(e,a)}}function Yi(e){return 9216e4/e}function Qi(e,t,n,i,r){const a=i+r*Yi(e.samplerate),s=function(e,t){const n=Wi(e,t);if(t+n<=e.length){const i=Zi(e,t)-n;if(i>0)return{headerLength:n,frameLength:i}}}(t,n);let o;if(s){const{frameLength:i,headerLength:r}=s,l=r+i,u=Math.max(0,n+l-t.length);u?(o=new Uint8Array(l-r),o.set(t.subarray(n+r,t.length),0)):o=t.subarray(n+r,n+l);const c={unit:o,pts:a};return u||e.samples.push(c),{sample:c,length:l,missing:u}}const l=t.length-n;o=new Uint8Array(l),o.set(t.subarray(n,t.length),0);return{sample:{unit:o,pts:a},length:l,missing:-1}}function $i(e,t){return zi(e,t)&&ji(e,t+6)+10<=e.length-t}function Ji(e,t=0,n=1/0){return function(e,t,n,i){const r=function(e){return e instanceof ArrayBuffer?e:e.buffer}(e);let a=1;"BYTES_PER_ELEMENT"in i&&(a=i.BYTES_PER_ELEMENT);const s=(h=e,h&&h.buffer instanceof ArrayBuffer&&void 0!==h.byteLength&&void 0!==h.byteOffset?e.byteOffset:0),o=(s+e.byteLength)/a,l=(s+t)/a,u=Math.floor(Math.max(0,Math.min(l,o))),c=Math.floor(Math.min(u+Math.max(n,0),o));var h;return new i(r,u,c-u)}(e,t,n,Uint8Array)}function er(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(3!==e.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=e.data.subarray(1).indexOf(0);if(-1===n)return;const i=D(Ji(e.data,1,n)),r=e.data[2+n],a=e.data.subarray(3+n).indexOf(0);if(-1===a)return;const s=D(Ji(e.data,3+n,a));let o;return o="--\x3e"===i?D(Ji(e.data,4+n+a)):function(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}(e.data.subarray(4+n+a)),t.mimeType=i,t.pictureType=r,t.description=s,t.data=o,t}function tr(e){return"PRIV"===e.type?function(e){if(e.size<2)return;const t=D(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}(e):"W"===e.type[0]?function(e){if("WXXX"===e.type){if(e.size<2)return;let t=1;const n=D(e.data.subarray(t),!0);t+=n.length+1;const i=D(e.data.subarray(t));return{key:e.type,info:n,data:i}}const t=D(e.data);return{key:e.type,info:"",data:t}}(e):"APIC"===e.type?er(e):function(e){if(e.size<2)return;if("TXXX"===e.type){let t=1;const n=D(e.data.subarray(t),!0);t+=n.length+1;const i=D(e.data.subarray(t));return{key:e.type,info:n,data:i}}const t=D(e.data.subarray(1));return{key:e.type,info:"",data:t}}(e)}function nr(e){const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=ji(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function ir(e){let t=0;const n=[];for(;zi(e,t);){const i=ji(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;const r=t+i;for(;t+10<r;){const i=nr(e.subarray(t)),r=tr(i);r&&n.push(r),t+=i.size+10}Gi(e,t)&&(t+=10)}return n}function rr(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}function ar(e){if(8===e.data.byteLength){const t=new Uint8Array(e.data),n=1&t[3];let i=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return i/=45,n&&(i+=47721858.84),Math.round(i)}}function sr(e){const t=ir(e);for(let e=0;e<t.length;e++){const n=t[e];if(rr(n))return ar(n)}}let or=function(e){return e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3",e.misbklv="urn:misb:KLV:bin:1910.1",e}({});function lr(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class ur{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=me(this.cachedData,e),this.cachedData=null);let n,r=Hi(e,0),a=r?r.length:0;const s=this._audioTrack,o=this._id3Track,l=r?sr(r):void 0,u=e.length;for((null===this.basePTS||0===this.frameIndex&&i(l))&&(this.basePTS=cr(l,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:or.audioId3,duration:Number.POSITIVE_INFINITY});a<u;){if(this.canParse(e,a)){const t=this.appendFrame(s,e,a);t?(this.frameIndex++,this.lastPTS=t.sample.pts,a+=t.length,n=a):a=u}else $i(e,a)?(r=Hi(e,a),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:or.audioId3,duration:Number.POSITIVE_INFINITY}),a+=r.length,n=a):a++;if(a===u&&n!==u){const t=e.slice(n);this.cachedData?this.cachedData=me(this.cachedData,t):this.cachedData=t}}return{audioTrack:s,videoTrack:lr(),id3Track:o,textTrack:lr()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:lr(),id3Track:this._id3Track,textTrack:lr()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const cr=(e,t,n)=>{if(i(e))return 90*e;return 9e4*t+(n?9e4*n.baseTime/n.timescale:0)};let hr=null;const dr=[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],fr=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],pr=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],mr=[0,1,1,4];function gr(e,t,n,i,r){if(n+24>t.length)return;const a=_r(t,n);if(a&&n+a.frameLength<=t.length){const s=i+r*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:t.subarray(n,n+a.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}function _r(e,t){const n=e[t+1]>>3&3,i=e[t+1]>>1&3,r=e[t+2]>>4&15,a=e[t+2]>>2&3;if(1!==n&&0!==r&&15!==r&&3!==a){const s=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*dr[14*(3===n?3-i:3===i?3:4)+r-1],u=fr[3*(3===n?0:2===n?1:2)+a],c=3===o?1:2,h=pr[n][i],d=mr[i],f=8*h*d,p=Math.floor(h*l/u+s)*d;if(null===hr){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);hr=e?parseInt(e[1]):0}return!!hr&&hr<=87&&2===i&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:u,channelCount:c,frameLength:p,samplesPerFrame:f}}}function vr(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function yr(e,t){return t+1<e.length&&vr(e,t)}function br(e,t){if(t+1<e.length&&vr(e,t)){const n=4,i=_r(e,t);let r=n;null!=i&&i.frameLength&&(r=i.frameLength);const a=t+r;return a===e.length||yr(e,a)}return!1}const xr=(e,t)=>{let n=0,i=5;t+=i;const r=new Uint32Array(1),a=new Uint32Array(1),s=new Uint8Array(1);for(;i>0;){s[0]=e[t];const o=Math.min(i,8),l=8-o;a[0]=4278190080>>>24+l<<l,r[0]=(s[0]&a[0])>>l,n=n?n<<o|r[0]:r[0],t+=1,i-=o}return n};class Er extends ur{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=wr(e,t,n,this.basePTS,this.frameIndex);if(-1!==i){return{sample:e.samples[e.samples.length-1],length:i,missing:0}}}static probe(e){if(!e)return!1;const t=Hi(e,0);if(!t)return!1;const n=t.length;return 11===e[n]&&119===e[n+1]&&void 0!==sr(t)&&xr(e,n)<16}}function wr(e,t,n,i,r){if(n+8>t.length)return-1;if(11!==t[n]||119!==t[n+1])return-1;const a=t[n+4]>>6;if(a>=3)return-1;const s=[48e3,44100,32e3][a],o=63&t[n+4],l=2*[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][3*o+a];if(n+l>t.length)return-1;const u=t[n+6]>>5;let c=0;2===u?c+=2:(1&u&&1!==u&&(c+=2),4&u&&(c+=2));const h=(t[n+6]<<8|t[n+7])>>12-c&1,d=[2,1,2,3,3,4,4,5][u]+h,f=t[n+5]>>3,p=7&t[n+5],m=new Uint8Array([a<<6|f<<1|p>>2,(3&p)<<6|u<<3|h<<2|o>>4,o<<4&224]),g=i+r*(1536/s*9e4),_=t.subarray(n,n+l);return e.config=m,e.channelCount=d,e.samplerate=s,e.samples.push({unit:_,pts:g}),l}const Tr=/\/emsg[-/]ID3/i;function Sr(e,t){return i(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale}class Ar{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Zt(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,zt)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),a=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(a).then((r=>{const a=new Uint8Array(r);i.set(a,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})).catch(n)}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t);let i=0;for(let t=32;t<e.length-16;t+=160,i+=16)n.set(e.subarray(t,t+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let t=32;t<e.length-16;t+=160,i+=16)e.set(n.subarray(i,i+16),t);return e}decryptAvcSample(e,t,n,i,r){const a=be(r.data),s=this.getAvcEncryptedData(a);this.decryptBuffer(s.buffer).then((s=>{r.data=this.getAvcDecryptedUnit(a,s),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})).catch(i)}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void i();const r=e[t].units;for(;!(n>=r.length);n++){const a=r[n];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(e,t,n,i,a),this.decrypter.isSync())))return}}}}class Cr{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n,i=this.VideoSample;if(i&&0!==i.units.length||(i=e[e.length-1]),null!=(t=i)&&t.units){const e=i.units;n=e[e.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const n=t.samples,i=n.length;if(!i)return void t.dropped++;{const t=n[i-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const a=r,s=[];let o,l,u,c=0,h=-1,d=0;for(-1===r&&(h=0,d=this.getNALuType(t,0),r=0,c=1);c<i;)if(o=t[c++],r)if(1!==r)if(o)if(1===o){if(l=c-r-1,h>=0){const e={data:t.subarray(h,l),type:d};s.push(e)}else{const n=this.getLastNalUnit(e.samples);n&&(a&&c<=4-a&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-a)),l>0&&(n.data=me(n.data,t.subarray(0,l)),n.state=0))}c<i?(u=this.getNALuType(t,c),h=c,d=u,r=0):r=-1}else r=0;else r=3;else r=o?0:2;else r=o?0:1;if(h>=0&&r>=0){const e={data:t.subarray(h,i),type:d,state:r};s.push(e)}if(0===s.length){const n=this.getLastNalUnit(e.samples);n&&(n.data=me(n.data,t))}return e.naluState=r,s}}class Lr{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(0===r)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&L.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(0!=(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 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Rr extends Cr{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let a,s=this.VideoSample,o=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach((i=>{var r,l;switch(i.type){case 1:{let t=!1;a=!0;const r=i.data;if(o&&r.length>4){const e=this.readSliceType(r);2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var u;if(t)null!=(u=s)&&u.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null);s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=t;break}case 5:a=!0,null!=(r=s)&&r.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:a=!0,ye(i.data,1,n.pts,t.samples);break;case 7:{var c,h;a=!0,o=!0;const t=i.data,n=this.readSPS(t);if(!e.sps||e.width!==n.width||e.height!==n.height||(null==(c=e.pixelRatio)?void 0:c[0])!==n.pixelRatio[0]||(null==(h=e.pixelRatio)?void 0:h[1])!==n.pixelRatio[1]){e.width=n.width,e.height=n.height,e.pixelRatio=n.pixelRatio,e.sps=[t];const i=t.subarray(1,4);let r="avc1.";for(let e=0;e<3;e++){let t=i[e].toString(16);t.length<2&&(t="0"+t),r+=t}e.codec=r}break}case 8:a=!0,e.pps=[i.data];break;case 9:a=!0,e.audFound=!0,null!=(l=s)&&l.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:a=!0;break;default:a=!1}if(s&&a){s.units.push(i)}})),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return 31&e[t]}readSliceType(e){const t=new Lr(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n,i=8,r=8;for(let a=0;a<e;a++)0!==r&&(n=t.readEG(),r=(i+n+256)%256),i=0===r?i:r}readSPS(e){const t=new Lr(e);let n,i,r,a=0,s=0,o=0,l=0;const u=t.readUByte.bind(t),c=t.readBits.bind(t),h=t.readUEG.bind(t),d=t.readBoolean.bind(t),f=t.skipBits.bind(t),p=t.skipEG.bind(t),m=t.skipUEG.bind(t),g=this.skipScalingList.bind(this);u();const _=u();if(c(5),f(3),u(),m(),100===_||110===_||122===_||244===_||44===_||83===_||86===_||118===_||128===_){const e=h();if(3===e&&f(1),m(),m(),f(1),d())for(i=3!==e?8:12,r=0;r<i;r++)d()&&g(r<6?16:64,t)}m();const v=h();if(0===v)h();else if(1===v)for(f(1),p(),p(),n=h(),r=0;r<n;r++)p();m(),f(1);const y=h(),b=h(),x=c(1);0===x&&f(1),f(1),d()&&(a=h(),s=h(),o=h(),l=h());let E=[1,1];if(d()&&d()){switch(u()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[u()<<8|u(),u()<<8|u()]}}return{width:Math.ceil(16*(y+1)-2*a-2*s),height:(2-x)*(b+1)*16-(x?2:4)*(o+l),pixelRatio:E}}}class Ir extends Cr{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let a,s=this.VideoSample,o=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach((i=>{var r,l;switch(i.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,a=!0;break;case 16:case 17:case 18:case 21:var u;if(a=!0,o)null!=(u=s)&&u.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null);s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:a=!0,null!=(r=s)&&r.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:a=!0,ye(i.data,2,n.pts,t.samples);break;case 32:a=!0,e.vps||("object"!=typeof e.params&&(e.params={}),e.params=y(e.params,this.readVPS(i.data)),this.initVPS=i.data),e.vps=[i.data];break;case 33:if(a=!0,o=!0,void 0===e.vps||e.vps[0]===this.initVPS||void 0===e.sps||this.matchSPS(e.sps[0],i.data)||(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const t=this.readSPS(i.data);e.width=t.width,e.height=t.height,e.pixelRatio=t.pixelRatio,e.codec=t.codecString,e.sps=[],"object"!=typeof e.params&&(e.params={});for(const n in t.params)e.params[n]=t.params[n]}this.pushParameterSet(e.sps,i.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(a=!0,"object"==typeof e.params){if(!e.pps){e.pps=[];const t=this.readPPS(i.data);for(const n in t)e.params[n]=t[n]}this.pushParameterSet(e.pps,i.data,e.vps)}break;case 35:a=!0,e.audFound=!0,null!=(l=s)&&l.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:a=!1}if(s&&a){s.units.push(i)}})),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(126&e[t])>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&3===e[i]&&0===e[i-1]&&0===e[i-2]||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Lr(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);return{numTemporalLayers:t.readBits(3)+1,temporalIdNested:t.readBoolean()}}readSPS(e){const t=new Lr(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),a=t.readBits(5),s=t.readUByte(),o=t.readUByte(),l=t.readUByte(),u=t.readUByte(),c=t.readUByte(),h=t.readUByte(),d=t.readUByte(),f=t.readUByte(),p=t.readUByte(),m=t.readUByte(),g=t.readUByte(),_=[],v=[];for(let e=0;e<n;e++)_.push(t.readBoolean()),v.push(t.readBoolean());if(n>0)for(let e=n;e<8;e++)t.readBits(2);for(let e=0;e<n;e++)_[e]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),v[e]&&t.readUByte();t.readUEG();const y=t.readUEG();3==y&&t.skipBits(1);const b=t.readUEG(),x=t.readUEG(),E=t.readBoolean();let w=0,T=0,S=0,A=0;E&&(w+=t.readUEG(),T+=t.readUEG(),S+=t.readUEG(),A+=t.readUEG());const C=t.readUEG(),L=t.readUEG(),R=t.readUEG();for(let e=t.readBoolean()?0:n;e<=n;e++)t.skipUEG(),t.skipUEG(),t.skipUEG();t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.readBoolean()){if(t.readBoolean())for(let e=0;e<4;e++)for(let n=0;n<(3===e?2:6);n++){if(t.readBoolean()){const n=Math.min(64,1<<4+(e<<1));e>1&&t.readEG();for(let e=0;e<n;e++)t.readEG()}else t.readUEG()}}t.readBoolean(),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const I=t.readUEG();let D=0;for(let e=0;e<I;e++){let n=!1;if(0!==e&&(n=t.readBoolean()),n){e===I&&t.readUEG(),t.readBoolean(),t.readUEG();let n=0;for(let e=0;e<=D;e++){const e=t.readBoolean();let i=!1;e||(i=t.readBoolean()),(e||i)&&n++}D=n}else{const e=t.readUEG(),n=t.readUEG();D=e+n;for(let n=0;n<e;n++)t.readUEG(),t.readBoolean();for(let e=0;e<n;e++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const e=t.readUEG();for(let n=0;n<e;n++){for(let e=0;e<R+4;e++)t.readBits(1);t.readBits(1)}}let k=0,M=1,P=1,O=!0,N=1,F=0;t.readBoolean(),t.readBoolean();let B=!1;if(t.readBoolean()){if(t.readBoolean()){const e=t.readUByte();e>0&&e<16?(M=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],P=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):255===e&&(M=t.readBits(16),P=t.readBits(16))}t.readBoolean()&&t.readBoolean();if(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(),B=t.readBoolean(),B&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG());if(t.readBoolean()){N=t.readBits(32),F=t.readBits(32);t.readBoolean()&&t.readUEG();if(t.readBoolean()){const e=t.readBoolean(),i=t.readBoolean();let r=!1;(e||i)&&(r=t.readBoolean(),r&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),r&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let a=0;a<=n;a++){O=t.readBoolean();let n=!1;O||t.readBoolean()?t.readEG():n=t.readBoolean();const a=n?1:t.readUEG()+1;if(e)for(let e=0;e<a;e++)t.readUEG(),t.readUEG(),r&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(i)for(let e=0;e<a;e++)t.readUEG(),t.readUEG(),r&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),k=t.readUEG())}let U=b,G=x;if(E){let e=1,t=1;1===y?e=t=2:2==y&&(e=2),U=b-e*T-e*w,G=x-t*A-t*S}const z=i?["A","B","C"][i]:"",j=s<<24|o<<16|l<<8|u;let H=0;for(let e=0;e<32;e++)H=(H|(j>>e&1)<<31-e)>>>0;let V=H.toString(16);1===a&&"2"===V&&(V="6");return{codecString:`hvc1.${z}${a}.${V}.${r?"H":"L"}${g}.B0`,params:{general_tier_flag:r,general_profile_idc:a,general_profile_space:i,general_profile_compatibility_flags:[s,o,l,u],general_constraint_indicator_flags:[c,h,d,f,p,m],general_level_idc:g,bit_depth:C+8,bit_depth_luma_minus8:C,bit_depth_chroma_minus8:L,min_spatial_segmentation_idc:k,chroma_format_idc:y,frame_rate:{fixed:O,fps:F/N}},width:U,height:G,pixelRatio:[M,P]}}readPPS(e){const t=new Lr(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 r=1;return i&&n?r=0:i?r=3:n&&(r=2),{parallelismType:r}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Dr=188;class kr{constructor(e,t,n,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=kr.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),-1!==n}static syncOffset(e){const t=e.length;let n=Math.min(940,t-Dr)+1,i=0;for(;i<n;){let r=!1,a=-1,s=0;for(let o=i;o<t;o+=Dr){if(71!==e[o]||t-o!==Dr&&71!==e[o+Dr]){if(s)return-1;break}if(s++,-1===a&&(a=o,0!==a&&(n=Math.min(a+18612,e.length-Dr)+1)),r||(r=0===Mr(e,o)),r&&s>1&&(0===a&&s>2||o+Dr>n))return a}i++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:ee[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=kr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=kr.createTrack("audio",i),this._id3Track=kr.createTrack("id3"),this._txtTrack=kr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){let r;n||(this.sampleAes=null);const a=this._videoTrack,s=this._audioTrack,o=this._id3Track,l=this._txtTrack;let u=a.pid,c=a.pesData,h=s.pid,d=o.pid,f=s.pesData,p=o.pesData,m=null,g=this.pmtParsed,_=this._pmtId,v=e.length;if(this.remainderData&&(v=(e=me(this.remainderData,e)).length,this.remainderData=null),v<Dr&&!i)return this.remainderData=e,{audioTrack:s,videoTrack:a,id3Track:o,textTrack:l};const y=Math.max(0,kr.syncOffset(e));v-=(v-y)%Dr,v<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,v,e.buffer.byteLength-v));let b=0;for(let t=y;t<v;t+=Dr)if(71===e[t]){const i=!!(64&e[t+1]),v=Mr(e,t);let b;if((48&e[t+3])>>4>1){if(b=t+5+e[t+4],b===t+Dr)continue}else b=t+4;switch(v){case u:i&&(c&&(r=Br(c,this.logger))&&(this.readyVideoParser(a.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(a,l,r,!1)),c={data:[],size:0}),c&&(c.data.push(e.subarray(b,t+Dr)),c.size+=t+Dr-b);break;case h:if(i){if(f&&(r=Br(f,this.logger)))switch(s.segmentCodec){case"aac":this.parseAACPES(s,r);break;case"mp3":this.parseMPEGPES(s,r);break;case"ac3":this.parseAC3PES(s,r)}f={data:[],size:0}}f&&(f.data.push(e.subarray(b,t+Dr)),f.size+=t+Dr-b);break;case d:i&&(p&&(r=Br(p,this.logger))&&this.parseID3PES(o,r),p={data:[],size:0}),p&&(p.data.push(e.subarray(b,t+Dr)),p.size+=t+Dr-b);break;case 0:i&&(b+=e[b]+1),_=this._pmtId=Pr(e,b);break;case _:{i&&(b+=e[b]+1);const r=Or(e,b,this.typeSupported,n,this.observer,this.logger);u=r.videoPid,u>0&&(a.pid=u,a.segmentCodec=r.segmentVideoCodec),h=r.audioPid,h>0&&(s.pid=h,s.segmentCodec=r.segmentAudioCodec),d=r.id3Pid,d>0&&(o.pid=d),null===m||g||(this.logger.warn(`MPEG-TS PMT found at ${t} after unknown PID '${m}'. Backtracking to sync byte @${y} to parse all TS packets.`),m=null,t=y-188),g=this.pmtParsed=!0;break}case 17:case 8191:break;default:m=v}}else b++;b>0&&Nr(this.observer,new Error(`Found ${b} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=c,s.pesData=f,o.pesData=p;const x={audioTrack:s,videoTrack:a,id3Track:o,textTrack:l};return i&&this.extractRemainingSamples(x),x}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,a=n.pesData,s=t.pesData,o=i.pesData;let l;if(a&&(l=Br(a,this.logger))?(this.readyVideoParser(n.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(n,r,l,!0),n.pesData=null)):n.pesData=a,s&&(l=Br(s,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l)}t.pesData=null}else null!=s&&s.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=s;o&&(l=Br(o,this.logger))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=o}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new Ar(this.observer,this.config,t);return this.decrypt(i,r)}readyVideoParser(e){null===this.videoParser&&("avc"===e?this.videoParser=new Rr:"hevc"===e&&(this.videoParser=new Ir))}decrypt(e,t){return new Promise((n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&"aac"===i.segmentCodec?t.decryptAacSamples(i.samples,0,(()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,(()=>{n(e)})):n(e)})):r.samples&&t.decryptAvcSamples(r.samples,0,0,(()=>{n(e)}))}))}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r,a,s,o=t.data;if(i){this.aacOverFlow=null;const t=i.missing,r=i.sample.unit.byteLength;if(-1===t)o=me(i.sample.unit,o);else{const a=r-t;i.sample.unit.set(o.subarray(0,t),a),e.samples.push(i.sample),n=i.missing}}for(r=n,a=o.length;r<a-1&&!Ki(o,r);r++);if(r!==n){let e;const t=r<a-1;if(e=t?`AAC PES did not start with ADTS header,offset:${r}`:"No ADTS header found in AAC PES",Nr(this.observer,new Error(e),t,this.logger),!t)return}if(Xi(e,this.observer,o,r,this.audioCodec),void 0!==t.pts)s=t.pts;else{if(!i)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=Yi(e.samplerate);s=i.sample.pts+t}}let l,u=0;for(;r<a;){if(l=Qi(e,o,r,s,u),r+=l.length,l.missing){this.aacOverFlow=l;break}for(u++;r<a-1&&!Ki(o,r);r++);}}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,a=0;const s=t.pts;if(void 0!==s)for(;a<i;)if(yr(n,a)){const t=gr(e,n,a,s,r);if(!t)break;a+=t.length,r++}else a++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(void 0===i)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const r=n.length;let a,s=0,o=0;for(;o<r&&(a=wr(e,n,o,i,s++))>0;)o+=a}}parseID3PES(e,t){if(void 0===t.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=y({},t,{type:this._videoTrack?or.emsg:or.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Mr(e,t){return((31&e[t+1])<<8)+e[t+2]}function Pr(e,t){return(31&e[t+10])<<8|e[t+11]}function Or(e,t,n,i,r,a){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<o;){const o=Mr(e,t),l=(15&e[t+3])<<8|e[t+4];switch(e[t]){case 207:if(!i){Fr("ADTS AAC",a);break}case 15:-1===s.audioPid&&(s.audioPid=o);break;case 21:-1===s.id3Pid&&(s.id3Pid=o);break;case 219:if(!i){Fr("H.264",a);break}case 27:-1===s.videoPid&&(s.videoPid=o);break;case 3:case 4:n.mpeg||n.mp3?-1===s.audioPid&&(s.audioPid=o,s.segmentAudioCodec="mp3"):a.log("MPEG audio found, not supported in this browser");break;case 193:if(!i){Fr("AC-3",a);break}case 129:n.ac3?-1===s.audioPid&&(s.audioPid=o,s.segmentAudioCodec="ac3"):a.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===s.audioPid&&l>0){let i=t+5,r=l;for(;r>2;){if(106===e[i])!0!==n.ac3?a.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=o,s.segmentAudioCodec="ac3");const t=e[i+1]+2;i+=t,r-=t}}break;case 194:case 135:return Nr(r,new Error("Unsupported EC-3 in M2TS found"),void 0,a),s;case 36:-1===s.videoPid&&(s.videoPid=o,s.segmentVideoCodec="hevc",a.log("HEVC in M2TS found"))}t+=l+5}return s}function Nr(e,t,n,i){i.warn(`parsing error: ${t.message}`),e.emit(l.ERROR,l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:t,reason:t.message})}function Fr(e,t){t.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function Br(e,t){let n,i,r,a,s,o=0;const l=e.data;if(!e||0===e.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=me(l[0],l[1]),l.splice(1,1);n=l[0];if(1===(n[0]<<16)+(n[1]<<8)+n[2]){if(i=(n[4]<<8)+n[5],i&&i>e.size-6)return null;const u=n[7];192&u&&(a=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&u?(s=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+128*(255&n[17])+(254&n[18])/2,a-s>54e5&&(t.warn(`${Math.round((a-s)/9e4)}s delta between PTS and DTS, align them`),a=s)):s=a),r=n[8];let c=r+9;if(e.size<=c)return null;e.size-=c;const h=new Uint8Array(e.size);for(let e=0,t=l.length;e<t;e++){n=l[e];let t=n.byteLength;if(c){if(c>t){c-=t;continue}n=n.subarray(c),t-=c,c=0}h.set(n,o),o+=t}return i&&(i-=r+3),{data:h,pts:a,dts:s,len:i}}return null}class Ur{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)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(2===t)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(3===t)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])}}}const Gr=Math.pow(2,32)-1;class zr{static init(){let e;for(e in zr.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:[]},zr.types)zr.types.hasOwnProperty(e)&&(zr.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);zr.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);zr.STTS=zr.STSC=zr.STCO=r,zr.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),zr.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),zr.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),zr.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);zr.FTYP=zr.box(zr.types.ftyp,a,o,a,s),zr.DINF=zr.box(zr.types.dinf,zr.box(zr.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=255&n,a.set(e,4),i=0,n=8;i<r;i++)a.set(t[i],n),n+=t[i].byteLength;return a}static hdlr(e){return zr.box(zr.types.hdlr,zr.HDLR_TYPES[e])}static mdat(e){return zr.box(zr.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Gr+1)),i=Math.floor(t%(Gr+1));return zr.box(zr.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,255&e,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}static mdia(e){return zr.box(zr.types.mdia,zr.mdhd(e.timescale||0,e.duration||0),zr.hdlr(e.type),zr.minf(e))}static mfhd(e){return zr.box(zr.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?zr.box(zr.types.minf,zr.box(zr.types.smhd,zr.SMHD),zr.DINF,zr.stbl(e)):zr.box(zr.types.minf,zr.box(zr.types.vmhd,zr.VMHD),zr.DINF,zr.stbl(e))}static moof(e,t,n){return zr.box(zr.types.moof,zr.mfhd(e),zr.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=zr.trak(e[t]);return zr.box.apply(null,[zr.types.moov,zr.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(zr.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=zr.trex(e[t]);return zr.box.apply(null,[zr.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Gr+1)),i=Math.floor(t%(Gr+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,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 zr.box(zr.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return zr.box(zr.types.sdtp,n)}static stbl(e){return zr.box(zr.types.stbl,zr.stsd(e),zr.box(zr.types.stts,zr.STTS),zr.box(zr.types.stsc,zr.STSC),zr.box(zr.types.stsz,zr.STSZ),zr.box(zr.types.stco,zr.STCO))}static avc1(e){let t,n,i,r=[],a=[];for(t=0;t<e.sps.length;t++)n=e.sps[t],i=n.byteLength,r.push(i>>>8&255),r.push(255&i),r=r.concat(Array.prototype.slice.call(n));for(t=0;t<e.pps.length;t++)n=e.pps[t],i=n.byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));const s=zr.box(zr.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|e.sps.length].concat(r).concat([e.pps.length]).concat(a))),o=e.width,l=e.height,u=e.pixelRatio[0],c=e.pixelRatio[1];return zr.box(zr.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,o>>8&255,255&o,l>>8&255,255&l,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]),s,zr.box(zr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),zr.box(zr.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,c>>24,c>>16&255,c>>8&255,255&c])))}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,255&t,0,0])}static mp4a(e){return zr.box(zr.types.mp4a,zr.audioStsd(e),zr.box(zr.types.esds,zr.esds(e)))}static mp3(e){return zr.box(zr.types[".mp3"],zr.audioStsd(e))}static ac3(e){return zr.box(zr.types["ac-3"],zr.audioStsd(e),zr.box(zr.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if("audio"===e.type){if("aac"===t)return zr.box(zr.types.stsd,zr.STSD,zr.mp4a(e));if("ac3"===t&&e.config)return zr.box(zr.types.stsd,zr.STSD,zr.ac3(e));if("mp3"===t&&"mp3"===e.codec)return zr.box(zr.types.stsd,zr.STSD,zr.mp3(e))}else{if(!e.pps||!e.sps)throw new Error("video track missing pps or sps");if("avc"===t)return zr.box(zr.types.stsd,zr.STSD,zr.avc1(e));if("hevc"===t&&e.vps)return zr.box(zr.types.stsd,zr.STSD,zr.hvc1(e))}throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,a=Math.floor(n/(Gr+1)),s=Math.floor(n%(Gr+1));return zr.box(zr.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,255&t,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,r>>8&255,255&r,0,0]))}static traf(e,t){const n=zr.sdtp(e),i=e.id,r=Math.floor(t/(Gr+1)),a=Math.floor(t%(Gr+1));return zr.box(zr.types.traf,zr.box(zr.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),zr.box(zr.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a])),zr.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,zr.box(zr.types.trak,zr.tkhd(e),zr.mdia(e))}static trex(e){const t=e.id;return zr.box(zr.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,a=new Uint8Array(r);let s,o,l,u,c,h;for(t+=8+r,a.set(["video"===e.type?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),s=0;s<i;s++)o=n[s],l=o.duration,u=o.size,c=o.flags,h=o.cts,a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*s);return zr.box(zr.types.trun,a)}static initSegment(e){zr.types||zr.init();const t=zr.moov(e);return me(zr.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],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),3|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let r=i.length;for(let e=0;e<n.length;e+=1){r+=3;for(let t=0;t<n[e].length;t+=1)r+=2+n[e][t].length}const a=new Uint8Array(r);a.set(i,0),r=i.length;const s=n.length-1;for(let e=0;e<n.length;e+=1){a.set(new Uint8Array([32+e|(e===s?128:0),0,n[e].length]),r),r+=3;for(let t=0;t<n[e].length;t+=1)a.set(new Uint8Array([n[e][t].length>>8,255&n[e][t].length]),r),r+=2,a.set(n[e][t],r),r+=n[e][t].length}const o=zr.box(zr.types.hvcC,a),l=e.width,u=e.height,c=e.pixelRatio[0],h=e.pixelRatio[1];return zr.box(zr.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,l>>8&255,255&l,u>>8&255,255&u,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,zr.box(zr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),zr.box(zr.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,h>>24,h>>16&255,h>>8&255,255&h])))}}zr.types=void 0,zr.HDLR_TYPES=void 0,zr.STTS=void 0,zr.STSC=void 0,zr.STCO=void 0,zr.STSZ=void 0,zr.VMHD=void 0,zr.SMHD=void 0,zr.STSD=void 0,zr.FTYP=void 0,zr.DINF=void 0;function jr(e,t,n=1,i=!1){const r=e*t*n;return i?Math.round(r):r}function Hr(e,t=!1){return jr(e,1e3,1/9e4,t)}let Vr,Wr=null,Zr=null;function Kr(e,t,n,i){return{duration:t,size:n,cts:i,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class qr extends E{constructor(e,t,n,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,null===Wr){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Wr=e?parseInt(e[1]):0}if(null===Zr){const e=navigator.userAgent.match(/Safari\/(\d+)/i);Zr=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce(((e,i)=>{let r=i.pts,a=r-e;return a<-4294967296&&(t=!0,r=Xr(r,n),a=r-e),a>0?e:r}),n);return t&&this.debug("PTS rollover detected"),i}remux(e,t,n,i,r,a,s,o){let l,u,c,h,d,f,m=r,g=r;const _=e.pid>-1,v=t.pid>-1,y=t.samples.length,b=e.samples.length>0,x=s&&y>0||y>1;if((!_||b)&&(!v||x)||this.ISGenerated||s){if(this.ISGenerated){var E,w,T,S;const e=this.videoTrackConfig;(e&&(t.width!==e.width||t.height!==e.height||(null==(E=t.pixelRatio)?void 0:E[0])!==(null==(w=e.pixelRatio)?void 0:w[0])||(null==(T=t.pixelRatio)?void 0:T[1])!==(null==(S=e.pixelRatio)?void 0:S[1]))||!e&&x||null===this.nextAudioTs&&b)&&this.resetInitSegment()}this.ISGenerated||(c=this.generateIS(e,t,r,a));const n=this.isVideoContiguous;let i,s=-1;if(x&&(s=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!n&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,s>0){this.warn(`Dropped ${s} out of ${y} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(s),t.dropped+=s,g+=(t.samples[0].pts-e)/t.inputTimeScale,i=g}else-1===s&&(this.warn(`No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(b&&x){const n=this.getVideoStartPts(t.samples),i=(Xr(e.samples[0].pts,n)-n)/t.inputTimeScale;m+=Math.max(0,i),g+=Math.max(0,-i)}if(b){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),c=this.generateIS(e,t,r,a)),u=this.remuxAudio(e,m,this.isAudioContiguous,a,v||x||o===p?g:void 0),x){const i=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),c=this.generateIS(e,t,r,a)),l=this.remuxVideo(t,g,n,i)}}else x&&(l=this.remuxVideo(t,g,n,0));l&&(l.firstKeyFrame=s,l.independent=-1!==s,l.firstKeyFramePTS=i)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(d=Yr(n,r,this._initPTS,this._initDTS)),i.samples.length&&(h=Qr(i,r,this._initPTS))),{audio:u,video:l,initSegment:c,independent:f,text:h,id3:d}}generateIS(e,t,n,i){const r=e.samples,a=t.samples,s=this.typeSupported,o={},l=this._initPTS;let u,c,h,d=!l||i,f="audio/mp4",p=-1;if(d&&(u=c=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":s.mpeg?(f="audio/mpeg",e.codec=""):s.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&s.mpeg?new Uint8Array(0):zr.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(p=e.id,h=e.inputTimeScale,l&&h===l.timescale?d=!1:u=c=r[0].pts-Math.round(h*n))}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:zr.initSegment([t]),metadata:{width:t.width,height:t.height}},d)if(p=t.id,h=t.inputTimeScale,l&&h===l.timescale)d=!1;else{const e=this.getVideoStartPts(a),t=Math.round(h*n);c=Math.min(c,Xr(a[0].dts,e)-t),u=Math.min(u,e-t)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,d?(l&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${n} ${u/h} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${u/h} (${u}/${h}) trackId: ${p}`),this._initPTS={baseTime:u,timescale:h,trackId:p},this._initDTS={baseTime:c,timescale:h,trackId:p}):u=h=void 0,{tracks:o,initPTS:u,timescale:h,trackId:p}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,a=e.samples,u=[],c=a.length,h=this._initPTS,d=h.baseTime*r/h.timescale;let f,p,m=this.nextVideoTs,g=8,_=this.videoSampleDuration,v=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=!1;if(!n||null===m){const e=d+t*r,i=a[0].pts-Xr(a[0].dts,a[0].pts);Wr&&null!==m&&Math.abs(e-i-(m+d))<15e3?n=!0:m=e-i-d}const E=m+d;for(let e=0;e<c;e++){const t=a[e];t.pts=Xr(t.pts,E),t.dts=Xr(t.dts,E),t.dts<a[e>0?e-1:e].dts&&(x=!0)}x&&a.sort((function(e,t){const n=e.dts-t.dts,i=e.pts-t.pts;return n||i})),f=a[0].dts,p=a[a.length-1].dts;const w=p-f,T=w?Math.round(w/(c-1)):_||e.inputTimeScale/30;if(n){const n=f-E,i=n>T,r=n<-1;if((i||r)&&(i?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Hr(n,!0)} ms (${n}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Hr(-n,!0)} ms (${n}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!r||E>=a[0].pts||Wr)){f=E;const e=a[0].pts-n;if(i)a[0].dts=f,a[0].pts=e;else{let t=!0;for(let i=0;i<a.length&&!(a[i].dts>e&&t);i++){const e=a[i].pts;if(a[i].dts-=n,a[i].pts-=n,i<a.length-1){const n=a[i+1].pts;t=n<=a[i].pts==n<=e}}}this.log(`Video: Initial PTS/DTS adjusted: ${Hr(e,!0)}/${Hr(f,!0)}, delta: ${Hr(n,!0)} ms`)}}f=Math.max(0,f);let S=0,A=0,C=f;for(let e=0;e<c;e++){const t=a[e],n=t.units,i=n.length;let r=0;for(let e=0;e<i;e++)r+=n[e].data.length;A+=r,S+=i,t.length=r,t.dts<C?(t.dts=C,C+=T/4|0||1):C=t.dts,v=Math.min(t.pts,v),b=Math.max(t.pts,b)}p=a[c-1].dts;const L=A+4*S+8;let R;try{R=new Uint8Array(L)}catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:s.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:L,reason:`fail allocating video mdat ${L}`})}const I=new DataView(R.buffer);I.setUint32(0,L),R.set(zr.types.mdat,4);let D=!1,k=Number.POSITIVE_INFINITY,M=Number.POSITIVE_INFINITY,P=Number.NEGATIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(let e=0;e<c;e++){const t=a[e],n=t.units;let s,o=0;for(let e=0,t=n.length;e<t;e++){const t=n[e],i=t.data,r=t.data.byteLength;I.setUint32(g,r),g+=4,R.set(i,g),g+=r,o+=4+r}if(e<c-1)_=a[e+1].dts-t.dts,s=a[e+1].pts-t.pts;else{const n=this.config,o=e>0?t.dts-a[e-1].dts:T;if(s=e>0?t.pts-a[e-1].pts:T,n.stretchShortVideoTrack&&null!==this.nextAudioTs){const e=Math.floor(n.maxBufferHole*r),a=(i?v+i*r:this.nextAudioTs+d)-t.pts;a>e?(_=a-o,_<0?_=o:D=!0,this.log(`It is approximately ${a/90} ms to the next segment; using duration ${_/90} ms for the last video frame.`)):_=o}else _=o}const l=Math.round(t.pts-t.dts);k=Math.min(k,_),P=Math.max(P,_),M=Math.min(M,s),O=Math.max(O,s),u.push(Kr(t.key,_,o,l))}if(u.length)if(Wr){if(Wr<70){const e=u[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(Zr&&O-M<P-k&&T/P<.025&&0===u[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=f;for(let t=0,n=u.length;t<n;t++){const i=e+u[t].duration,r=e+u[t].cts;if(t<n-1){const e=i+u[t+1].cts;u[t].duration=e-r}else u[t].duration=t?u[t-1].duration:T;u[t].cts=0,e=i}}_=D||!_?T:_;const N=p+_;this.nextVideoTs=m=N-d,this.videoSampleDuration=_,this.isVideoContiguous=!0;const F={data1:zr.moof(e.sequenceNumber++,f,y(e,{samples:u})),data2:R,startPTS:(v-d)/r,endPTS:(b+_-d)/r,startDTS:(f-d)/r,endDTS:m/r,type:"video",hasAudio:!1,hasVideo:!0,nb:u.length,dropped:e.dropped};return e.samples=[],e.dropped=0,F}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(e,t,n,i,r){const a=e.inputTimeScale,u=a/(e.samplerate?e.samplerate:a),c=this.getSamplesPerFrame(e),h=c*u,d=this._initPTS,f="mp3"===e.segmentCodec&&this.typeSupported.mpeg,p=[],m=void 0!==r;let g=e.samples,_=f?0:8,v=this.nextAudioTs||-1;const b=d.baseTime*a/d.timescale,x=b+t*a;if(this.isAudioContiguous=n=n||g.length&&v>0&&(i&&Math.abs(x-(v+b))<9e3||Math.abs(Xr(g[0].pts,x)-(v+b))<20*h),g.forEach((function(e){e.pts=Xr(e.pts,x)})),!n||v<0){if(g=g.filter((e=>e.pts>=0)),!g.length)return;v=0===r?0:i&&!m?Math.max(0,x-b):g[0].pts-b}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let n=0,i=v+b;n<g.length;n++){const r=g[n],s=r.pts,o=s-i,l=Math.abs(1e3*o/a);if(o<=-t*h&&m)0===n&&(this.warn(`Audio frame @ ${(s/a).toFixed(3)}s overlaps marker by ${Math.round(1e3*o/a)} ms.`),this.nextAudioTs=v=s-b,i=s);else if(o>=t*h&&l<1e4&&m){let t=Math.round(o/h);for(i=s-t*h;i<0&&t&&h;)t--,i+=h;0===n&&(this.nextAudioTs=v=i-b),this.warn(`Injecting ${t} audio frames @ ${((i-b)/a).toFixed(3)}s due to ${Math.round(1e3*o/a)} ms gap.`);for(let a=0;a<t;a++){let t=Ur.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);t||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),t=r.unit.subarray()),g.splice(n,0,{unit:t,pts:i}),i+=h,n++}}r.pts=i,i+=h}}let E,w=null,T=null,S=0,A=g.length;for(;A--;)S+=g[A].unit.byteLength;for(let t=0,i=g.length;t<i;t++){const i=g[t],r=i.unit;let a=i.pts;if(null!==T){p[t-1].duration=Math.round((a-T)/u)}else{if(n&&"aac"===e.segmentCodec&&(a=v+b),w=a,!(S>0))return;S+=_;try{E=new Uint8Array(S)}catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:s.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:S,reason:`fail allocating audio mdat ${S}`})}if(!f){new DataView(E.buffer).setUint32(0,S),E.set(zr.types.mdat,4)}}E.set(r,_);const h=r.byteLength;_+=h,p.push(Kr(!0,c,h,0)),T=a}const C=p.length;if(!C)return;const L=p[p.length-1];v=T-b,this.nextAudioTs=v+u*L.duration;const R=f?new Uint8Array(0):zr.moof(e.sequenceNumber++,w/u,y({},e,{samples:p}));e.samples=[];const I=(w-b)/a,D=v/a,k={data1:R,data2:E,startPTS:I,endPTS:D,startDTS:I,endDTS:D,type:"audio",hasAudio:!0,hasVideo:!1,nb:C};return this.isAudioContiguous=!0,k}}function Xr(e,t){let n;if(null===t)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}function Yr(e,t,n,i){const r=e.samples.length;if(!r)return;const a=e.inputTimeScale;for(let s=0;s<r;s++){const r=e.samples[s];r.pts=Xr(r.pts-n.baseTime*a/n.timescale,t*a)/a,r.dts=Xr(r.dts-i.baseTime*a/i.timescale,t*a)/a}const s=e.samples;return e.samples=[],{samples:s}}function Qr(e,t,n){const i=e.samples.length;if(!i)return;const r=e.inputTimeScale;for(let a=0;a<i;a++){const i=e.samples[a];i.pts=Xr(i.pts-n.baseTime*r/n.timescale,t*r)/r}e.samples.sort(((e,t)=>e.pts-t.pts));const a=e.samples;return e.samples=[],{samples:a}}function $r(e,t,n=!1){return void 0!==(null==e?void 0:e.start)?(e.start+(n?e.duration:0))/e.timescale:t}function Jr(e,t,n){const i=e.codec;if(i&&i.length>4)return i;if(t===V){if("ec-3"===i||"ac-3"===i||"alac"===i)return i;if("fLaC"===i||"Opus"===i){return Me(i,!1)}return n.warn(`Unhandled audio codec "${i}" in mp4 MAP`),i||"mp4a"}return n.warn(`Unhandled video codec "${i}" in mp4 MAP`),i||"avc1"}try{Vr=self.performance.now.bind(self.performance)}catch(e){Vr=Date.now}const ea=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=lr("video",1),a=this.audioTrack=lr("audio",1),s=this.txtTrack=lr("text",1);if(this.id3Track=lr("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=le(e);if(o.video){const{id:e,timescale:t,codec:n,supplemental:i}=o.video;r.id=e,r.timescale=s.timescale=t,r.codec=n,r.supplemental=i}if(o.audio){const{id:e,timescale:t,codec:n}=o.audio;a.id=e,a.timescale=t,a.codec=n}s.id=ee.text,r.sampleDuration=0,r.duration=a.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return function(e){const t=e.byteLength;for(let n=0;n<t;){const i=ie(e,n);if(i>8&&109===e[n+4]&&111===e[n+5]&&111===e[n+6]&&102===e[n+7])return!0;n=i>1?n+i:t}return!1}(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=me(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},n=se(e,["moof"]);if(n.length<2)return t.remainder=e,t;const i=n[n.length-1];return t.valid=e.slice(0,i.byteOffset-8),t.remainder=e.slice(i.byteOffset-8),t}(n);this.remainderData=t.remainder,i.samples=t.valid||new Uint8Array}else i.samples=n;const a=this.extractID3Track(i,t);return r.samples=ge(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=ge(e,t),{videoTrack:t,audioTrack:lr(),id3Track:i,textTrack:lr()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=se(e.samples,["emsg"]);i&&i.forEach((e=>{const i=function(e){const t=e[0];let n="",i="",a=0,s=0,o=0,l=0,u=0,c=0;if(0===t){for(;"\0"!==te(e.subarray(c,c+1));)n+=te(e.subarray(c,c+1)),c+=1;for(n+=te(e.subarray(c,c+1)),c+=1;"\0"!==te(e.subarray(c,c+1));)i+=te(e.subarray(c,c+1)),c+=1;i+=te(e.subarray(c,c+1)),c+=1,a=ie(e,12),s=ie(e,16),l=ie(e,20),u=ie(e,24),c=28}else if(1===t){c+=4,a=ie(e,c),c+=4;const t=ie(e,c);c+=4;const s=ie(e,c);for(c+=4,o=2**32*t+s,r(o)||(o=Number.MAX_SAFE_INTEGER,L.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=ie(e,c),c+=4,u=ie(e,c),c+=4;"\0"!==te(e.subarray(c,c+1));)n+=te(e.subarray(c,c+1)),c+=1;for(n+=te(e.subarray(c,c+1)),c+=1;"\0"!==te(e.subarray(c,c+1));)i+=te(e.subarray(c,c+1)),c+=1;i+=te(e.subarray(c,c+1)),c+=1}return{schemeIdUri:n,value:i,timeScale:a,presentationTime:o,presentationTimeDelta:s,eventDuration:l,id:u,payload:e.subarray(c,e.byteLength)}}(e);if(Tr.test(i.schemeIdUri)){const e=Sr(i,t);let r=4294967295===i.eventDuration?Number.POSITIVE_INFINITY:i.eventDuration/i.timeScale;r<=.001&&(r=Number.POSITIVE_INFINITY);const a=i.payload;n.samples.push({data:a,len:a.byteLength,dts:e,pts:e,type:or.emsg,duration:r})}else if(this.config.enableEmsgKLVMetadata&&i.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const e=Sr(i,t);n.samples.push({data:i.payload,len:i.payload.byteLength,dts:e,pts:e,type:or.misbklv,duration:Number.POSITIVE_INFINITY})}}))}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class extends E{constructor(e,t,n,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:i}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:r,video:a}=this.initData=le(e);if(t)!function(e,t){if(!e||!t)return;const n=t.keyId;n&&t.isCommonEncryption&&se(e,["moov","trak"]).forEach((e=>{const t=se(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let i=se(t,["enca"]);const r=i.length>0;r||(i=se(t,["encv"])),i.forEach((e=>{se(r?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=pe(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(L.log(`[eme] Patching keyId in 'enc${r?"a":"v"}>sinf>>tenc' box: ${k(e)} -> ${k(n)}`),t.set(n,8))}}))}))}))}(e,t);else{const e=r||a;null!=e&&e.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${e.codec}")!`)}r&&(n=Jr(r,V,this)),a&&(i=Jr(a,W,this));const s={};r&&a?s.audiovideo={container:"video/mp4",codec:n+","+i,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:r?s.audio={container:"audio/mp4",codec:n,encrypted:r.encrypted,initSegment:e,id:"audio"}:a?s.video={container:"video/mp4",codec:i,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,n,r,a,s){var o,l;let{initPTS:u,lastEndTime:c}=this;const h={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};i(c)||(c=this.lastEndTime=a||0);const d=t.samples;if(!d.length)return h;const f={initPTS:void 0,timescale:void 0,trackId:void 0};let p=this.initData;if(null!=(o=p)&&o.length||(this.generateInitSegment(d),p=this.initData),null==(l=p)||!l.length)return this.warn("Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const m=function(e,t,n){const r={},a=se(e,["moof","traf"]);for(let e=0;e<a.length;e++){const s=a[e],o=se(s,["tfhd"])[0],l=ie(o,4),u=t[l];if(!u)continue;r[l]||(r[l]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type});const c=r[l],h=se(s,["tfdt"])[0];if(h){const e=h[0];let t=ie(h,4);1===e&&(t===$?n.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(t*=$+1,t+=ie(h,8))),i(t)&&(!i(c.start)||t<c.start)&&(c.start=t)}const d=u.default,f=ie(o,0)|(null==d?void 0:d.flags);let p=(null==d?void 0:d.duration)||0;8&f&&(p=ie(o,2&f?12:8));const m=se(s,["trun"]);let g=c.start||0,_=0,v=p;for(let e=0;e<m.length;e++){const t=m[e],n=ie(t,4),i=c.sampleCount;c.sampleCount+=n;const r=1&t[3],a=4&t[3],s=1&t[2],o=2&t[2],l=4&t[2],u=8&t[2];let h=8,d=n;for(r&&(h+=4),a&&n&&(1&t[h+1]||void 0!==c.keyFrameIndex||(c.keyFrameIndex=i),h+=4,s?(v=ie(t,h),h+=4):v=p,o&&(h+=4),u&&(h+=4),g+=v,_+=v,d--);d--;)s?(v=ie(t,h),h+=4):v=p,o&&(h+=4),l&&(1&t[h+1]||void 0===c.keyFrameIndex&&(c.keyFrameIndex=c.sampleCount-(d+1),c.keyFrameStart=g),h+=4),u&&(h+=4),g+=v,_+=v;!_&&p&&(_+=p*n)}c.duration+=_}if(!Object.keys(r).some((e=>r[e].duration))){let t=1/0,n=0;const a=se(e,["sidx"]);for(let e=0;e<a.length;e++){const i=oe(a[e]);if(null!=i&&i.references){t=Math.min(t,i.earliestPresentationTime/i.timescale);const e=i.references.reduce(((e,t)=>e+t.info.duration||0),0);n=Math.max(n,e+i.earliestPresentationTime/i.timescale)}}n&&i(n)&&Object.keys(r).forEach((e=>{r[e].duration||(r[e].duration=n*r[e].timescale-r[e].start)}))}return r}(d,p,this),g=p.audio?m[p.audio.id]:null,_=p.video?m[p.video.id]:null,v=$r(_,1/0),y=$r(g,1/0),b=$r(_,0,!0),x=$r(g,0,!0);let E=a,w=0;const T=g&&(!_||!u&&y<v||u&&u.trackId===p.audio.id),S=T?g:_;if(S){const e=S.timescale,t=S.start-a*e,n=T?p.audio.id:p.video.id;E=S.start/e,w=T?x-y:b-v,!s&&u||!function(e,t,n,i){if(null===e)return!0;const r=Math.max(i,1),a=t-e.baseTime/e.timescale;return Math.abs(a-n)>r}(u,E,a,w)&&e===u.timescale||(u&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${a} ${t/e} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${a} offset: ${E-a} (${t}/${e}) trackId: ${n}`),u=null,f.initPTS=t,f.timescale=e,f.trackId=n)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${a}`);u?(f.initPTS=u.baseTime,f.timescale=u.timescale,f.trackId=u.trackId):(f.timescale&&void 0!==f.trackId&&void 0!==f.initPTS||(this.warn("Could not set initPTS"),f.initPTS=E,f.timescale=1,f.trackId=-1),this.initPTS=u={baseTime:f.initPTS,timescale:f.timescale,trackId:f.trackId});const A=E-u.baseTime/u.timescale,C=A+w;w>0?this.lastEndTime=C:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const L=!!p.audio,R=!!p.video;let I="";L&&(I+="audio"),R&&(I+="video");const D={data1:d,startPTS:A,startDTS:A,endPTS:C,endDTS:C,type:I,hasAudio:L,hasVideo:R,nb:1,dropped:0,encrypted:!!p.audio&&p.audio.encrypted||!!p.video&&p.video.encrypted};h.audio=L&&!R?D:void 0,h.video=R?D:void 0;const k=null==_?void 0:_.sampleCount;if(k){const e=_.keyFrameIndex,t=-1!==e;D.nb=k,D.dropped=0===e||this.isVideoContiguous?0:t?e:k,D.independent=t,D.firstKeyFrame=e,t&&_.keyFrameStart&&(D.firstKeyFramePTS=(_.keyFrameStart-u.baseTime)/u.timescale),this.isVideoContiguous||(h.independent=t),this.isVideoContiguous||(this.isVideoContiguous=t),D.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${e}/${k} dropped: ${D.dropped} start: ${D.firstKeyFramePTS||"NA"}`)}return h.initSegment=f,h.id3=Yr(n,a,u,u),r.samples.length&&(h.text=Qr(r,a,u)),h}}},{demux:kr,remux:qr},{demux:class extends ur{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=Hi(e,0);let i=(null==n?void 0:n.length)||0;if(br(e,i))return!1;for(let n=e.length;i<n;i++)if(qi(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&Vi(e,t)&&Zi(e,t)<=e.length-t}(e,t)}appendFrame(e,t,n){Xi(e,this.observer,t,n,e.manifestCodec);const i=Qi(e,t,n,this.basePTS,this.frameIndex);if(i&&0===i.missing)return i}},remux:qr},{demux:class extends ur{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Hi(e,0);let n=(null==t?void 0:t.length)||0;if(t&&11===e[n]&&119===e[n+1]&&void 0!==sr(t)&&xr(e,n)<=16)return!1;for(let t=e.length;n<t;n++)if(br(e,n))return L.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return vr(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,n){if(null!==this.basePTS)return gr(e,t,n,this.basePTS,this.frameIndex)}},remux:qr}];ea.splice(2,0,{demux:Er,remux:qr});class ta{constructor(e,t,n,i,r,a){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=Vr();let a=new Uint8Array(e);const{currentTransmuxState:u,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:h,discontinuity:d,trackSwitch:f,accurateTimeOffset:p,timeOffset:m,initSegmentChange:g}=i||u,{audioCodec:_,videoCodec:v,defaultInitPts:y,duration:b,initSegmentData:x}=c,E=function(e,t){let n=null;e.byteLength>0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(n=t);return n}(a,t);if(E&&gn(E.method)){const e=this.getDecrypter(),t=_n(E.method);if(!e.isSync())return this.asyncResult=!0,this.decryptionPromise=e.webCryptoDecrypt(a,E.key.buffer,E.iv.buffer,t).then((e=>{const t=this.push(e,null,n);return this.decryptionPromise=null,t})),this.decryptionPromise;{let i=e.softwareDecrypt(a,E.key.buffer,E.iv.buffer,t);if(n.part>-1){const t=e.flush();i=t?t.buffer:t}if(!i)return r.executeEnd=Vr(),na(n);a=new Uint8Array(i)}}const w=this.needsProbing(d,f);if(w){const e=this.configureTransmuxer(a);if(e)return this.logger.warn(`[transmuxer] ${e.message}`),this.observer.emit(l.ERROR,l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),r.executeEnd=Vr(),na(n)}(d||f||g||w)&&this.resetInitSegment(x,_,v,b,t),(d||g||w)&&this.resetInitialTimestamp(y),h||this.resetContiguity();const T=this.transmux(a,E,m,p,n);this.asyncResult=ia(T);const S=this.currentTransmuxState;return S.contiguous=!0,S.discontinuity=!1,S.trackSwitch=!1,r.executeEnd=Vr(),T}flush(e){const t=e.transmuxing;t.executeStart=Vr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then((()=>this.flush(e)));const a=[],{timeOffset:s}=i;if(n){const t=n.flush();t&&a.push(this.push(t.buffer,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l){t.executeEnd=Vr();const n=[na(e)];return this.asyncResult?Promise.resolve(n):n}const u=o.flush(s);return ia(u)?(this.asyncResult=!0,u.then((t=>(this.flushRemux(a,t,e),a)))):(this.flushRemux(a,u,e),this.asyncResult?Promise.resolve(a):a)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:a,textTrack:s}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===f?"level":"track"} ${n.level}`);const u=this.remuxer.remux(i,r,a,s,l,o,!0,this.id);e.push({remuxResult:u,chunkMeta:n}),n.transmuxing.executeEnd=Vr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:a,remuxer:s}=this;a&&s&&(a.resetInitSegment(e,t,n,i),s.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let a;return a=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,i,r):this.transmuxUnencrypted(e,n,i,r),a}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:a,id3Track:s,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,a,s,o,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,i,!1,this.id),chunkMeta:r})))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let t=0,n=ea.length;t<n;t++){var a;if(null!=(a=ea[t].demux)&&a.probe(e,this.logger)){r=ea[t];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const s=this.demuxer,o=this.remuxer,l=r.remux,u=r.demux;o&&o instanceof l||(this.remuxer=new l(n,t,i,this.logger)),s&&s instanceof u||(this.demuxer=new u(n,t,i,this.logger),this.probe=u.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Zt(this.config)),e}}const na=e=>({remuxResult:{},chunkMeta:e});function ia(e){return"then"in e&&e.then instanceof Function}class ra{constructor(e,t,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r||null}}class aa{constructor(e,t,n,i,r,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=a}}let sa=0;class oa{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=sa++,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=e=>{const t=e.data,n=this.hls;if(n&&null!=t&&t.event&&t.instanceNo===this.instanceNo)switch(t.event){case"init":{var i;const e=null==(i=this.workerContext)?void 0:i.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":n.logger[t.data.logType]&&n.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.part=this.part,t.data.id=this.id,n.trigger(t.event,t.data)}},this.onWorkerError=e=>{if(!this.hls)return;const t=new Error(`${e.message} (${e.filename}:${e.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:t})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const a=(e,t)=>{(t=t||{}).frag=this.frag||void 0,e===l.ERROR&&(t.parent=this.id,t.part=this.part,this.error=t.error),this.hls.trigger(e,t)};this.observer=new Fi,this.observer.on(l.FRAG_DECRYPTED,a),this.observer.on(l.ERROR,a);const u=Fe(r.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const n=this.hls.logger;if(r.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{r.workerPath?(n.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=function(e){const t=Ui[e];if(t)return t.clientCount++,t;const n=new self.URL(e,self.location.href).href,i={worker:new self.Worker(n),scriptURL:n,clientCount:1};return Ui[e]=i,i}(r.workerPath)):(n.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=Ui[Bi];if(e)return e.clientCount++,e;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),n=self.URL.createObjectURL(t),i={worker:new self.Worker(n),objectURL:n,clientCount:1};return Ui[Bi]=i,i}());const{worker:e}=this.workerContext;e.addEventListener("message",this.onWorkerMessage),e.addEventListener("error",this.onWorkerError),e.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:u,id:t,config:nt(r)})}catch(i){n.warn(`Error setting up "${t}" Web Worker, fallback to inline`,i),this.terminateWorker(),this.error=null,this.transmuxer=new ta(this.observer,u,r,"",t,e.logger)}return}}this.transmuxer=new ta(this.observer,u,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=sa++;const t=this.hls.config,n=Fe(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:nt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),function(e){const t=Ui[e||Bi];if(t&&1==t.clientCount--){const{worker:n,objectURL:i}=t;delete Ui[e||Bi],i&&self.URL.revokeObjectURL(i),n.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,a,s,o,l,u){var c,h;l.transmuxing.start=self.performance.now();const{instanceNo:d,transmuxer:p}=this,m=a?a.start:r.start,g=r.decryptdata,_=this.frag,v=!(_&&r.cc===_.cc),y=!(_&&l.level===_.level),b=_?l.sn-_.sn:-1,x=this.part?l.part-this.part.index:-1,E=0===b&&l.id>1&&l.id===(null==_?void 0:_.stats.chunkCount),w=!y&&(1===b||0===b&&(1===x||E&&x<=0)),T=self.performance.now();(y||b||0===r.stats.parsing.start)&&(r.stats.parsing.start=T),!a||!x&&w||(a.stats.parsing.start=T);const S=!(_&&(null==(c=r.initSegment)?void 0:c.url)===(null==(h=_.initSegment)?void 0:h.url)),A=new aa(v,w,o,y,m,S);if(!w||v||S){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===f?"level":"track"}: ${l.level} id: ${l.id}\n discontinuity: ${v}\n trackSwitch: ${y}\n contiguous: ${w}\n accurateTimeOffset: ${o}\n timeOffset: ${m}\n initSegmentChange: ${S}`);const e=new ra(n,i,t,s,u);this.configureTransmuxer(e)}if(this.frag=r,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:d,cmd:"demux",data:e,decryptdata:g,chunkMeta:l,state:A},e instanceof ArrayBuffer?[e]:[]);else if(p){const t=p.push(e,g,l,A);ia(t)?t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")})):this.handleTransmuxComplete(t)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const t=n.flush(e);ia(t)?t.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")})):this.handleFlushResult(t,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class la extends E{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(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=null==t?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n<i.length;n++){const a=i[n];let s;try{s=new self.URL(a.URI,t.url).href}catch(e){this.warn(`Could not construct new URL for Rendition Report: ${e}`),s=a.URI||""}if(s===e){r=n;break}s===e.substring(0,s.length)&&(r=n)}if(-1!==r){const e=i[r],a=parseInt(e["LAST-MSN"])||t.lastPartSn;let s=parseInt(e["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);s>=0&&e>t.partTarget&&(s+=1)}const o=n&&Qe(n);return new $e(a,s>=0?s:void 0,o)}}}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(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,a=self.performance.now(),u=r.loading.first?Math.max(0,a-r.loading.first):0;i.advancedDateTime=Date.now()-u;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const e=Math.max(c||0,0);i.appliedTimelineOffset=e,i.fragments.forEach((t=>{t.setStart(t.playlistOffset+e)}))}if(i.live||null!=n&&n.live){const c="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){ei(n,i,this);const e=i.playlistParsingError;if(e){this.warn(e);const n=this.hls;if(!n.config.ignorePlaylistParsingErrors){var h;const{networkDetails:a}=t;return void n.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:e,reason:e.message,level:t.level||void 0,parent:null==(h=i.fragments[0])?void 0:h.type,networkDetails:a,stats:r})}i.playlistParsingError=null}}-1===i.requestScheduled&&(i.requestScheduled=r.loading.start);const d=this.hls.mainForwardBufferInfo,f=d?d.end-d.len:0,p=ri(i,1e3*(i.edge-f));if(i.requestScheduled+p<a?i.requestScheduled=a:i.requestScheduled+=p,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let m,g,_;if(i.canBlockReload&&i.endSN&&i.advanced){const e=this.hls.config.lowLatencyMode,r=i.lastPartSn,s=i.endSN,o=i.lastPartIndex,l=r===s;-1!==o?l?(g=s+1,_=e?0:o):(g=r,_=e?o+1:i.maxPartIndex):g=s+1;const u=i.age,h=u+i.ageHeader;let d=Math.min(h-i.partTarget,1.5*i.targetduration);if(d>0){if(h>3*i.targetduration)this.log(`Playlist last advanced ${u.toFixed(2)}s ago. Omitting segment and part directives.`),g=void 0,_=void 0;else if(null!=n&&n.tuneInGoal&&h-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${d} with playlist age: ${i.age}`),d=0;else{const e=Math.floor(d/i.targetduration);if(g+=e,void 0!==_){_+=Math.round(d%i.targetduration/i.partTarget)}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${u.toFixed(2)}s goal: ${d} skip sn ${e} to part ${_}`)}i.tuneInGoal=d}if(m=this.getDeliveryDirectives(i,t.deliveryDirectives,g,_),e||!l)return i.requestScheduled=a,void this.loadingPlaylist(c,m)}else(i.canBlockReload||i.canSkipUntil)&&(m=this.getDeliveryDirectives(i,t.deliveryDirectives,g,_));m&&void 0!==g&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(p-2*u,p/2)),this.scheduleLoading(c,m,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i)return void this.loadingPlaylist(e,t);const r=self.performance.now(),a=i.requestScheduled;if(r>=a)return void this.loadingPlaylist(e,t);const s=a-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(s)} ms`),this.clearTimer(),this.timer=self.setTimeout((()=>this.loadingPlaylist(e,t)),s)}getDeliveryDirectives(e,t,n,i){let r=Qe(e);return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=qe),new $e(n,i,r)}checkRetry(e){const t=e.details,n=gt(e),i=e.errorAction,{action:r,retryCount:a=0,retryConfig:s}=i||{},o=!!i&&!!s&&(r===Ct||!i.resolved&&r===St);if(o){var l;if(a>=s.maxNumRetry)return!1;if(n&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${s.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=bt(s,a);this.clearTimer(),this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${a+1}/${s.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,i.resolved=!0}return o}}function ua(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ca(e[n].attrs,t[n].attrs))return!1;return!0}function ca(e,t,n){const i=e["STABLE-RENDITION-ID"];return i&&!n?i===t["STABLE-RENDITION-ID"]:!(n||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((n=>e[n]!==t[n]))}function ha(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}class da{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(null===this.queues||null===this.tracks)return;const i=this.queues[t];i.push(e),1!==i.length||n||this.executeNext(t)}appendBlocker(e){return new Promise((t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)}))}prependBlocker(e){return new Promise((t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}}))}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach((e=>{var t;const n=null==(t=e[0])?void 0:t.label;"async-blocker"!==n&&"async-blocker-prepend"!==n||(e[0].execute(),e.splice(0,1))}))}unblockAudio(e){if(null===this.queues)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(null===this.queues||null===this.tracks)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(t){var n;if(i.onError(t),null===this.queues||null===this.tracks)return;const r=null==(n=this.tracks[e])?void 0:n.buffer;null!=r&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){null!==this.queues&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return(null==(t=this.queues)?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return null===e||null===t?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(e){var t,n;return null!=(t=this.queues)&&t[e]||null!=(n=this.tracks)&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=null==(t=this.tracks)?void 0:t[e],i=null==n?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return(null==(t=this.queues)?void 0:t[e].map((e=>e.label)).join(", "))||""}}const fa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,pa="HlsJsTrackRemovedError";class ma extends Error{constructor(e){super(e),this.name=pa}}function ga(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach((t=>{e.removeChild(t)}))}function _a(e){return"audio"===e?1:0}class va{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(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.BUFFER_CODECS,this.onBufferCodecs,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&i(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)return void(this.clientRect=null);const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter(((t,n)=>this.isLevelAllowed(t)&&n<=e));return this.clientRect=null,va.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,n){if(null==e||!e.length)return-1;let i=e.length-1;const r=Math.max(t,n);for(let t=0;t<e.length;t+=1){const n=e[t];if((n.width>=r||n.height>=r)&&(a=n,!(s=e[t+1])||a.width!==s.width||a.height!==s.height)){i=t;break}}var a,s;return i}}const ya={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},ba={HLS:"h"};class xa{constructor(e,t){Array.isArray(e)&&(e=e.map((e=>e instanceof xa?e:new xa(e)))),this.value=e,this.params=t}}function Ea(e,t,n,i){return new Error(`failed to ${e} "${r=t,Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":"object"==typeof r?JSON.stringify(r):String(r)}" as ${n}`,{cause:i});var r}function wa(e,t,n){return Ea("serialize",e,t,n)}class Ta{constructor(e){this.description=e}}const Sa="Bare Item";function Aa(e){if(!1===ArrayBuffer.isView(e))throw wa(e,"Byte Sequence");return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function Ca(e){if(function(e){return e<-999999999999999||999999999999999<e}(e))throw wa(e,"Integer");return e.toString()}function La(e,t){if(e<0)return-La(-e,t);const n=Math.pow(10,t);if(Math.abs(e*n%1-.5)<Number.EPSILON){const t=Math.floor(e*n);return(t%2==0?t:t+1)/n}return Math.round(e*n)/n}function Ra(e){const t=La(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw wa(e,"Decimal");const n=t.toString();return n.includes(".")?n:`${n}.0`}const Ia=/[\x00-\x1f\x7f]+/;function Da(e){const t=(n=e).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw wa(t,"Token");return t}function ka(e){switch(typeof e){case"number":if(!i(e))throw wa(e,Sa);return Number.isInteger(e)?Ca(e):Ra(e);case"string":return function(e){if(Ia.test(e))throw wa(e,"String");return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return Da(e);case"boolean":return function(e){if("boolean"!=typeof e)throw wa(e,"Boolean");return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${Ca(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return Aa(e);if(e instanceof Ta)return Da(e);default:throw wa(e,Sa)}}function Ma(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw wa(e,"Key");return e}function Pa(e){return null==e?"":Object.entries(e).map((([e,t])=>!0===t?`;${Ma(e)}`:`;${Ma(e)}=${ka(t)}`)).join("")}function Oa(e){return e instanceof xa?`${ka(e.value)}${Pa(e.params)}`:ka(e)}function Na(e,t={whitespace:!0}){if("object"!=typeof e||null==e)throw wa(e,"Dict");const n=e instanceof Map?e.entries():Object.entries(e),i=(null==t?void 0:t.whitespace)?" ":"";return Array.from(n).map((([e,t])=>{t instanceof xa==!1&&(t=new xa(t));let n=Ma(e);var i;return!0===t.value?n+=Pa(t.params):(n+="=",Array.isArray(t.value)?n+=`(${(i=t).value.map(Oa).join(" ")})${Pa(i.params)}`:n+=Oa(t)),n})).join(`,${i}`)}function Fa(e,t){return Na(e,t)}const Ba="CMCD-Object",Ua="CMCD-Request",Ga="CMCD-Session",za="CMCD-Status",ja={br:Ba,ab:Ba,d:Ba,ot:Ba,tb:Ba,tpb:Ba,lb:Ba,tab:Ba,lab:Ba,url:Ba,pb:Ua,bl:Ua,tbl:Ua,dl:Ua,ltc:Ua,mtp:Ua,nor:Ua,nrr:Ua,rc:Ua,sn:Ua,sta:Ua,su:Ua,ttfb:Ua,ttfbb:Ua,ttlb:Ua,cmsdd:Ua,cmsds:Ua,smrt:Ua,df:Ua,cs:Ua,ts:Ua,cid:Ga,pr:Ga,sf:Ga,sid:Ga,st:Ga,v:Ga,msd:Ga,bs:za,bsd:za,cdn:za,rtp:za,bg:za,pt:za,ec:za,e:za},Ha=Ua;function Va(e,t){const n={};if(!e)return n;const i=Object.keys(e),r=t?(a=t,Object.keys(a).reduce(((e,t)=>{var n;return null===(n=a[t])||void 0===n||n.forEach((n=>e[n]=t)),e}),{})):{};var a;return i.reduce(((t,n)=>{var i;const a=ja[n]||r[n]||Ha;return(null!==(i=t[a])&&void 0!==i?i:t[a]={})[n]=e[n],t}),n)}const Wa="event";const Za=e=>Math.round(e),Ka=(e,t)=>Array.isArray(e)?e.map((e=>Ka(e,t))):e instanceof xa&&"string"==typeof e.value?new xa(Ka(e.value,t),e.params):(t.baseUrl&&(e=function(e,t){const n=new URL(e),i=new URL(t);if(n.origin!==i.origin)return e;const r=n.pathname.split("/").slice(1),a=i.pathname.split("/").slice(1,-1);for(;r[0]===a[0];)r.shift(),a.shift();for(;a.length;)a.shift(),r.unshift("..");return r.join("/")+n.search+n.hash}(e,t.baseUrl)),1===t.version?encodeURIComponent(e):e),qa=e=>100*Za(e/100),Xa={br:Za,d:Za,bl:qa,dl:qa,mtp:qa,nor:(e,t)=>{let n=e;return t.version>=2&&(e instanceof xa&&"string"==typeof e.value?n=new xa([e]):"string"==typeof e&&(n=[e])),Ka(n,t)},rtp:qa,tb:Za},Ya="request",Qa="response",$a=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],Ja=["e"],es=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function ts(e){return es.test(e)}const ns=["d","dl","nor","ot","rtp","su"];const is=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];const rs=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function as(e){return rs.includes(e)||ts(e)}const ss={[Qa]:function(e){return $a.includes(e)||ns.includes(e)||is.includes(e)||ts(e)},[Wa]:function(e){return $a.includes(e)||Ja.includes(e)||ts(e)},[Ya]:function(e){return $a.includes(e)||ns.includes(e)||ts(e)}};function os(e,t={}){const n={};if(null==e||"object"!=typeof e)return n;const r=t.version||e.v||1,a=t.reportingMode||Ya,s=1===r?as:ss[a];let o=Object.keys(e).filter(s);const l=t.filter;"function"==typeof l&&(o=o.filter(l));const u=a===Qa||a===Wa;u&&!o.includes("ts")&&o.push("ts"),r>1&&!o.includes("v")&&o.push("v");const c=y({},Xa,t.formatters),h={version:r,reportingMode:a,baseUrl:t.baseUrl};return o.sort().forEach((t=>{let a=e[t];const s=c[t];if("function"==typeof s&&(a=s(a,h)),"v"===t){if(1===r)return;a=r}"pr"==t&&1===a||(u&&"ts"===t&&!i(a)&&(a=Date.now()),function(e){return"number"==typeof e?i(e):null!=e&&""!==e&&!1!==e}(a)&&(function(e){return["ot","sf","st","e","sta"].includes(e)}(t)&&"string"==typeof a&&(a=new Ta(a)),n[t]=a))})),n}function ls(e,t,n){return y(e,function(e,t={}){const n={};if(!e)return n;const i=Va(os(e,t),null==t?void 0:t.customHeaderMap);return Object.entries(i).reduce(((e,[t,n])=>{const i=Fa(n,{whitespace:!1});return i&&(e[t]=i),e}),n)}(t,n))}function us(e,t={}){if(!e)return"";const n=function(e,t={}){return e?Fa(os(e,t),{whitespace:!1}):""}(e,t);return encodeURIComponent(n)}const cs=/CMCD=[^&#]+/;function hs(e,t,n){const i=function(e,t={}){return e?`CMCD=${us(e,t)}`:""}(t,n);if(!i)return e;if(cs.test(e))return e.replace(cs,i);const r=e.includes("?")?"&":"?";return`${e}${r}${i}`}function ds(e,t,n,i){e&&Object.keys(t).forEach((r=>{const a=e.filter((e=>e.groupId===r)).map((e=>{const a=y({},e);return a.details=void 0,a.attrs=new cn(a.attrs),a.url=a.attrs.URI=fs(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),a.groupId=a.attrs["GROUP-ID"]=t[r],a.attrs["PATHWAY-ID"]=i,a}));e.push(...a)}))}function fs(e,t,n,i){const{HOST:r,PARAMS:a,[n]:s}=i;let o;t&&(o=null==s?void 0:s[t],o&&(e=o));const l=new self.URL(e);return r&&!o&&(l.host=r),a&&Object.keys(a).sort().forEach((e=>{e&&l.searchParams.set(e,a[e])})),l.href}class ps extends E{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=ps.CDMCleanupPromise?[ps.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=e=>{const{initDataType:t,initData:n}=e,i=`"${e.type}" event: init data type: "${t}"`;if(this.debug(i),null!==n){if(!this.keyFormatPromise){let e=Object.keys(this.keySystemAccessPromises);e.length||(e=In(this.config));const t=e.map(Rn).filter((e=>!!e));this.keyFormatPromise=this.getKeyFormatPromise(t)}this.keyFormatPromise.then((r=>{const a=Ln(r);if("sinf"!==t||a!==wn.FAIRPLAY)return void this.log(`Ignoring "${e.type}" event with init data type: "${t}" for selected key-system ${a}`);let s;try{const e=te(new Uint8Array(n)),t=pe(vn(JSON.parse(e).sinf));if(!t)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");s=new Uint8Array(t.subarray(8,24))}catch(e){return void this.warn(`${i} Failed to parse sinf: ${e}`)}const o=k(s),{keyIdToKeySessionPromise:l,mediaKeySessions:u}=this;let c=l[o];for(let e=0;e<u.length;e++){const i=u[e],r=i.decryptdata;if(!r.keyId)continue;const a=k(r.keyId);if(pn(s,r.keyId)||-1!==r.uri.replace(/-/g,"").indexOf(o)){if(c=l[a],!c)continue;if(r.pssh)break;delete l[a],r.pssh=new Uint8Array(n),r.keyId=s,c=l[o]=c.then((()=>this.generateRequestWithPreferredKeySession(i,t,n,"encrypted-event-key-match"))),c.catch((e=>this.handleError(e)));break}}c||this.handleError(new Error(`Key ID ${o} not encountered in playlist. Key-system sessions ${u.length}.`))})).catch((e=>this.handleError(e)))}},this.onWaitingForKey=e=>{this.log(`"${e.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(l.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(l.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(l.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(l.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(l.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(l.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=null==t?void 0:t[e];return i?i.licenseUrl:e===wn.WIDEVINE&&n?n:void 0}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(void 0===t)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=null==t?void 0:t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(e,t,n)=>!!e&&n.indexOf(e)===t,i=t.map((e=>e.audioCodec)).filter(n),r=t.map((e=>e.videoCodec)).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise(((t,n)=>{const a=e=>{const l=e.shift();this.getMediaKeysPromise(l,i,r).then((e=>t({keySystem:l,mediaKeys:e}))).catch((t=>{e.length?a(e):n(t instanceof _s?t:new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};a(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!=typeof n){let e=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===Dn&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return n(e,t)}getMediaKeysPromise(e,t,n){var i;const r=function(e,t,n,i){let r;switch(e){case wn.FAIRPLAY:r=["cenc","sinf"];break;case wn.WIDEVINE:case wn.PLAYREADY:r=["cenc"];break;case wn.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,n,i){return[{initDataTypes:e,persistentState:i.persistentState||"optional",distinctiveIdentifier:i.distinctiveIdentifier||"optional",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs=${e}`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null}))),videoCapabilities:n.map((e=>({contentType:`video/mp4; codecs=${e}`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null})))}]}(r,t,n,i)}(e,t,n,this.config.drmSystemOptions||{});let a=this.keySystemAccessPromises[e],s=null==(i=a)?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${nt(r)}`),s=this.requestMediaKeySystemAccess(e,r);const t=a=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),s.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const i=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const r=t.mediaKeys=n.createMediaKeys().then((n=>(this.log(`Media-keys created for "${e}"`),t.hasMediaKeys=!0,i.then((t=>t?this.setMediaKeysServerCertificate(n,e,t):n)))));return r.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),r}))}return s.then((()=>a.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${k(e.keyId||[])} keyUri: ${e.uri}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=ms(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${k(e.decryptdata.keyId||[])}\n } (data length: ${t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map((e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys}))).filter((({hasMediaKeys:e})=>!!e)).map((({keySystem:e})=>Rn(e))).filter((e=>!!e))}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then((({keySystem:e,mediaKeys:t})=>this.attemptSetMediaKeys(e,t)))}selectKeySystem(e){return new Promise(((t,n)=>{this.getKeySystemSelectionPromise(e).then((({keySystem:e})=>{const i=Rn(e);i?t(i):n(new Error(`Unable to find format for key-system "${e}"`))})).catch(n)}))}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=In(this.config),n=e.map(Ln).filter((e=>!!e&&-1!==t.indexOf(e)));return this.selectKeySystem(n)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let n=0;n<t.length;n++){const i=gs(e,t[n]);if(i)return i}}loadKey(e){const t=e.keyInfo.decryptdata,n=ms(t),i=this.bannedKeyIds[n];if(i||"internal-error"===this.getKeyStatus(t)){const n=vs(i||"internal-error",t);return this.handleError(n,e.frag),Promise.reject(n)}const r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);const a=this.keyIdToKeySessionPromise[n];if(!a){const i=this.getKeySystemForKeyPromise(t).then((({keySystem:n,mediaKeys:i})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(n,i).then((()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:n,mediaKeys:i,decryptdata:t}))))))).then((e=>{const n=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(e,"cenc",n,"playlist-key")}));return i.catch((t=>this.handleError(t,e.frag))),this.keyIdToKeySessionPromise[n]=i,i}return a.catch((n=>{if(n instanceof _s){const i=x({},n.data);"internal-error"===this.getKeyStatus(t)&&(i.decryptdata=t);const r=new _s(i,n.message);this.handleError(r,e.frag)}})),a}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof _s){t&&(e.data.frag=t);const n=e.data.decryptdata;this.error(`${e.message}${n?` (${k(n.keyId||[])})`:""}`),this.hls.trigger(l.ERROR,e.data)}else this.error(e.message),this.hls.trigger(l.ERROR,{type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=ms(e),n=this.keyIdToKeySessionPromise[t];if(!n){const t=Ln(e.keyFormat),n=t?[t]:In(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=In(this.config)),0===e.length)throw new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${nt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then((()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.mediaKeys=t,this.setMediaKeysQueue.push(i),i.then((()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===n.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,n,i){var r;const a=null==(r=this.config.drmSystems)||null==(r=r[e.keySystem])?void 0:r.generateRequest;if(a)try{const i=a.call(this.hls,t,n,e);if(!i)throw new Error("Invalid response from configured generateRequest filter");t=i.initDataType,n=i.initData?i.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(e){if(this.warn(e.message),this.hls&&this.hls.config.debug)throw e}if(null===n)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const l=ms(e.decryptdata),u=e.decryptdata.uri;this.log(`Generating key-session request for "${i}" keyId: ${l} URI: ${u} (init data type: ${t} length: ${n.byteLength})`);const c=new Fi,h=e._onmessage=t=>{const n=e.mediaKeysSession;if(!n)return void c.emit("error",new Error("invalid state"));const{messageType:i,message:r}=t;this.log(`"${i}" message event for session "${n.sessionId}" message size: ${r.byteLength}`),"license-request"===i||"license-renewal"===i?this.renewLicense(e,r).catch((e=>{c.eventNames().length?c.emit("error",e):this.handleError(e)})):"license-release"===i?e.keySystem===wn.FAIRPLAY&&this.updateKeySession(e,yn("acknowledged")).then((()=>this.removeSession(e))).catch((e=>this.handleError(e))):this.warn(`unhandled media key message type "${i}"`)},d=(e,t)=>{let n;t.keyStatus=e,e.startsWith("usable")?c.emit("resolved"):"internal-error"===e||"output-restricted"===e||"output-downscaled"===e?n=vs(e,t.decryptdata):"expired"===e?n=new Error(`key expired (keyId: ${l})`):"released"===e?n=new Error("key released"):"status-pending"===e||this.warn(`unhandled key status change "${e}" (keyId: ${l})`),n&&(c.eventNames().length?c.emit("error",n):this.handleError(n))},f=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void c.emit("error",new Error("invalid state"));const n=this.getKeyStatuses(e);if(!Object.keys(n).some((e=>"status-pending"!==n[e])))return;if("expired"===n[l])return this.log(`Expired key ${nt(n)} in key-session "${e.mediaKeysSession.sessionId}"`),void this.renewKeySession(e);let i=n[l];if(i)d(i,e);else{var r;const t=0;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(r=e.keyStatusTimeouts)[l]||(r[l]=self.setTimeout((()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const n=this.getKeyStatus(e.decryptdata);if(n&&"status-pending"!==n)return this.log(`No status for keyId ${l} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${n} from other session.`),d(n,e);this.log(`key status for ${l} in key-session "${e.mediaKeysSession.sessionId}" timed out after ${t}ms`),i="internal-error",d(i,e)}),t)),this.log(`No status for keyId ${l} (${nt(n)}).`)}};gi(e.mediaKeysSession,"message",h),gi(e.mediaKeysSession,"keystatuseschange",f);const p=new Promise(((e,t)=>{c.on("error",t),c.on("resolved",e)}));return e.mediaKeysSession.generateRequest(t,n).then((()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${l} URI: ${u}`)})).catch((t=>{throw new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_SESSION,error:t,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${t}`)})).then((()=>p)).catch((t=>(c.removeAllListeners(),this.removeSession(e).then((()=>{throw t}))))).then((()=>(c.removeAllListeners(),e)))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach(((n,i)=>{if("string"==typeof i&&"object"==typeof n){const e=i;i=n,n=e}const r="buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);e.keySystem===wn.PLAYREADY&&16===r.length&&bn(r);const a=k(r);"internal-error"===n&&(this.bannedKeyIds[a]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${a} key-session "${e.mediaKeysSession.sessionId}"`),t[a]=n})),t}fetchServerCertificate(e){const t=this.config,n=new(0,t.loader)(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise(((r,a)=>{const l={responseType:"arraybuffer",url:i},u=t.certLoadPolicy.default,c={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(e,t,n,i)=>{r(e.data)},onError:(t,n,r,u)=>{a(new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:x({url:l.url,data:void 0},t)},`"${e}" certificate request failed (${i}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,r)=>{a(new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(e,t,n)=>{a(new Error("aborted"))}};n.load(l,c,h)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise(((i,r)=>{e.setServerCertificate(n).then((r=>{this.log(`setServerCertificate ${r?"success":"not supported by CDM"} (${n.byteLength}) on "${t}"`),i(e)})).catch((e=>{r(new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((t=>{throw new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:t,fatal:!1},t.message)}))))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=(new DOMParser).parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let t;for(let n=0,i=r.length;n<i;n++){var a,s;t=r[n];const i=null==(a=t.querySelector("name"))?void 0:a.textContent,o=null==(s=t.querySelector("value"))?void 0:s.textContent;i&&o&&e.setRequestHeader(i,o)}}const o=i.querySelector("Challenge"),l=null==o?void 0:o.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return yn(atob(l))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then((()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)})).catch((a=>{if(!n.decryptdata)throw a;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)})).then((n=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:n||i}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise(((i,r)=>{const a=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${a}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(4===l.readyState)if(200===l.status){this._requestLicenseFailureCount=0;let t=l.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const n=this.config.licenseResponseCallback;if(n)try{t=n.call(this.hls,l,a,e)}catch(e){this.error(e)}i(t)}else{const u=n.errorRetry,c=u?u.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||l.status>=400&&l.status<500)r(new _s({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:l,response:{url:a,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${a}). Status: ${l.status} (${l.statusText})`));else{const n=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,a,e,t).then((({xhr:t,licenseChallenge:n})=>{e.keySystem==wn.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(t,n)),t.send(n)})).catch(r)}))}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,gi(n,"encrypted",this.onMediaEncrypted),gi(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(_i(e,"encrypted",this.onMediaEncrypted),_i(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Pn.clearKeyUriToKeyIdMap();const i=n.length;ps.CDMCleanupPromise=Promise.all(n.map((e=>this.removeSession(e))).concat((null==t||null==(e=t.setMediaKeys(null))?void 0:e.catch((e=>{this.log(`Could not clear media keys: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${e}`)})})))||Promise.resolve())).catch((e=>{this.log(`Could not close sessions and clear media keys: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${e}`)})})).then((()=>{i&&this.log("finished closing key sessions and clearing media keys")}))}onManifestLoading(){this.keyFormatPromise=null,this.bannedKeyIds={}}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n,decryptdata:i}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${k((null==i?void 0:i.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{keyStatusTimeouts:a}=e;a&&Object.keys(a).forEach((e=>self.clearTimeout(a[e])));const{drmSystemOptions:u}=this.config,c=function(e){var t;return!(!e||"persistent-license"!==e.sessionType&&(null==(t=e.sessionTypes)||!t.some((e=>"persistent-license"===e))))}(u)?new Promise(((e,n)=>{self.setTimeout((()=>n(new Error("MediaKeySession.remove() timeout"))),8e3),t.remove().then(e).catch(n)})):Promise.resolve();return c.catch((e=>{this.log(`Could not remove session: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${e}`)})})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`),this.hls&&this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${e}`)})}))}return Promise.resolve()}}function ms(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return k(e.keyId)}function gs(e,t){return e.keyId&&t.mediaKeysSession.keyStatuses.has(e.keyId)?t.mediaKeysSession.keyStatuses.get(e.keyId):e.matches(t.decryptdata)?t.keyStatus:void 0}ps.CDMCleanupPromise=void 0;class _s 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}}function vs(e,t){const n="output-restricted"===e,i=n?o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:o.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new _s({type:s.KEY_SYSTEM_ERROR,details:i,fatal:!1,decryptdata:t},n?"HDCP level output restricted":`key status changed to "${e}"`)}function ys(e,t){let n;try{n=new Event("addtrack")}catch(e){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function bs(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(n){L.debug(`[texttrack-utils]: ${n}`);try{const n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(e){L.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`)}}"disabled"===n&&(e.mode=n)}function xs(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues)for(let n=e.cues.length;n--;)t&&e.cues[n].removeEventListener("enter",t),e.removeCue(e.cues[n]);"disabled"===n&&(e.mode=n)}function Es(e,t,n,i){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&e.cues.length>0){const r=function(e,t,n){const i=[],r=function(e,t){if(t<=e[0].startTime)return 0;const n=e.length-1;if(t>e[n].endTime)return-1;let i,r=0,a=n;for(;r<=a;)if(i=Math.floor((a+r)/2),t<e[i].startTime)a=i-1;else{if(!(t>e[i].startTime&&r<n))return i;r=i+1}return e[r].startTime-t<t-e[a].startTime?r:a}(e,t);if(r>-1)for(let a=r,s=e.length;a<s;a++){const r=e[a];if(r.startTime>=t&&r.endTime<=n)i.push(r);else if(r.startTime>n)return i}return i}(e.cues,t,n);for(let t=0;t<r.length;t++)i&&!i(r[t])||e.removeCue(r[t])}"disabled"===r&&(e.mode=r)}function ws(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n];"subtitles"!==i.kind&&"captions"!==i.kind||!i.label||t.push(e[n])}return t}function Ts(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()}const Ss=.025;let As=function(e){return e[e.Point=0]="Point",e[e.Range=1]="Range",e}({});function Cs(e,t,n){return`${e.identifier}-${n+1}-${Ts(t)}`}class Ls{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,null==(e=this.assetListLoader)||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;if(e<=0||isNaN(n))return!1;if(0===n)return!0;return((null==(t=this.assetList[e])?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Rs(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime;return t-Rs(t,e)<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=i(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 Rs(e,t)}return e}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Ss))}set appendInPlace(e){this.appendInPlaceStarted?this.resetOnResume=!e:this.appendInPlaceDisabled=!e}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return t=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration: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"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?As.Range:As.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}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||null!==this.assetListResponse}toString(){return`["${(e=this).identifier}" ${e.cue.pre?"<pre>":e.cue.post?"<post>":""}${e.timelineStart.toFixed(2)}-${e.resumeTime.toFixed(2)}]`;var e}}function Rs(e,t){return e-t.start<t.duration/2&&!(Math.abs(e-(t.start+t.duration))<Ss)?t.start:t.start+t.duration}function Is(e,t,n){const i=new self.URL(e,n);return"data:"!==i.protocol&&i.searchParams.set("_HLS_primary_id",t),i}function Ds(e,t){for(;null!=(n=e.assetList[++t])&&n.error;)var n;return t}function ks(e){const t=e.timelineStart,n=e.duration||0;return`["${e.identifier}" ${t.toFixed(2)}-${(t+n).toFixed(2)}]`}class Ms{constructor(e,t,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(l.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;const a=()=>{this.hasDetails=!0};r.once(l.LEVEL_LOADED,a),r.once(l.AUDIO_TRACK_LOADED,a),r.once(l.SUBTITLE_TRACK_LOADED,a),r.on(l.MEDIA_ATTACHING,((e,{media:t})=>{this.removeMediaListeners(),this.mediaAttached=t;this.interstitial.playoutLimit&&(t.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(l.BUFFER_APPENDED,(()=>{const e=this.bufferedEnd;this.reachedPlayout(e)&&(this._bufferedEosTime=e,r.trigger(l.BUFFERED_TO_END,void 0))})))}))}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Is(t,e.config.primarySessionId||"").href}catch(e){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if(null!=(t=this.hls)&&t.bufferedToEnd)return!0;if(!e)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,r=tn.bufferInfo(e,i,0);return this.getAssetTime(r.end)>=n-.02}reachedPlayout(e){const t=this.interstitial.playoutLimit;return this.startOffset+e>=t}get destroyed(){var e;return!(null!=(e=this.hls)&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return(null==(e=this.hls)?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=tn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return(null==(e=this.hls)?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var e;this.mediaAttached&&(null!=(e=this.hls)&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),null==(t=this.hls)||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,null==(e=this.hls)||e.detachMedia()}resumeBuffering(){var e;null==(e=this.hls)||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.hls)||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),(null==(e=this.hls)?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=e=>delete e.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var i;null==(i=this.hls)||i.on(e,t)}once(e,t,n){var i;null==(i=this.hls)||i.once(e,t)}off(e,t,n){var i;null==(i=this.hls)||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${ks(this.assetItem)} ${null==(e=this.hls)?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class Ps extends E{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach((e=>e.reset())),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce(((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n),0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(void 0===t&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&null!=(r=i[n])&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&"primary"!==t&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const e=n[i].event;if(null!=e&&e.restrictions.jump&&!e.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if((null==(n=t[i].event)?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let e=0;e<i;e++){const r=n[e];if(!r.error){const n=r.timelineStart;if(t===n||t>n&&(t<n+(r.duration||0)||e===i-1))return e}}return 0}get assetIdAtEnd(){var e;const t=null==(e=this.items)||null==(e=e[this.length-1])?void 0:e.event;if(t){const e=t.assetList,n=e[e.length-1];if(n)return n.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,a=this.parseDateRanges(i,{url:n.url},t),s=Object.keys(i),o=r?r.filter((e=>!s.includes(e.identifier))):[];a.length&&a.sort(((e,t)=>{const n=e.cue.pre,i=e.cue.post,r=t.cue.pre,a=t.cue.post;if(n&&!r)return-1;if(r&&!n)return 1;if(i&&!a)return 1;if(a&&!i)return-1;if(!(n||r||i||a)){const n=e.startTime,i=t.startTime;if(n!==i)return n-i}return e.dateRange.tagOrder-t.dateRange.tagOrder})),this.events=a,o.forEach((e=>{this.removeEvent(e)})),this.updateSchedule(e,o)}updateSchedule(e,t=[],n=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const r=this.items,a=this.parseSchedule(i,e);(n||t.length||(null==r?void 0:r.length)!==a.length||a.some(((e,t)=>Math.abs(e.playout.start-r[t].playout.start)>.005||Math.abs(e.playout.end-r[t].playout.end)>.005)))&&(this.items=a,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let a=0;a<r.length;a++){const s=r[a],o=e[s];if(o.isInterstitial){let e=this.eventMap[s];e?e.setDateRange(o):(e=new Ls(o,t),this.eventMap[s]=e,!1===n&&(e.appendInPlace=n)),i.push(e)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.edge;let a=0;if((e=e.filter((e=>!(e.error||e.cue.once&&e.hasPlayed)))).length){this.resolveOffsets(e,t);let i=0,o=0;if(e.forEach(((t,s)=>{const l=t.cue.pre,u=t.cue.post,c=e[s-1]||null,h=t.appendInPlace,d=u?r:t.startOffset,f=t.duration,p=t.timelineOccupancy===As.Range?f:0,m=t.resumptionOffset,g=(null==c?void 0:c.startTime)===d,_=d+t.cumulativeDuration;let v=h?_+f:d+m;if(l||!u&&d<=0){const e=o;o+=p,t.timelineStart=_;const i=a;a+=f,n.push({event:t,start:_,end:v,playout:{start:i,end:a},integrated:{start:e,end:o}})}else{if(!(d<=r))return;{if(!g){const r=d-i;if(r>.033){const l=i,u=o;o+=r;const c=a;a+=r;const h={previousEvent:e[s-1]||null,nextEvent:t,start:l,end:l+r,playout:{start:c,end:a},integrated:{start:u,end:o}};n.push(h)}else r>0&&c&&(c.cumulativeDuration+=r,n[n.length-1].end=d)}u&&(v=_),t.timelineStart=_;const r=o;o+=p;const l=a;a+=f,n.push({event:t,start:_,end:v,playout:{start:l,end:a},integrated:{start:r,end:o}})}}const y=t.resumeTime;i=u||y>r?r:y})),i<r){var s;const e=i,t=o,l=r-i;o+=l;const u=a;a+=l,n.push({previousEvent:(null==(s=n[n.length-1])?void 0:s.event)||null,nextEvent:null,start:i,end:e+l,playout:{start:u,end:a},integrated:{start:t,end:o}})}this.setDurations(r,a,o)}else{const e=0;n.push({previousEvent:null,nextEvent:null,start:e,end:r,playout:{start:e,end:r},integrated:{start:e,end:r}}),this.setDurations(r,r,r)}return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,r=n.live?1/0:n.edge;let a=0,s=-1;e.forEach(((o,l)=>{const u=o.cue.pre,c=o.cue.post,h=u?0:c?r:o.startTime;this.updateAssetDurations(o);if(s===h?o.cumulativeDuration=a:(a=0,s=h),!c&&o.snapOptions.in&&(o.resumeAnchor=dt(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)}if(!o.appendInPlace&&l+1<e.length){e[l+1].startTime-e[l].resumeTime<.033&&(e[l+1].appendInPlace=!1,e[l+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`))}const d=i(o.resumeOffset)?o.resumeOffset:o.duration;a+=d}))}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;if(Math.abs(n-i)>Ss)return this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1;return!Object.keys(t).some((i=>{const r=t[i].details,a=r.edge;if(n>=a)return this.log(`"${e.identifier}" resumption ${n} past ${i} playlist end ${a}`),!1;const s=dt(null,r.fragments,n);if(!s)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${i} playlist (${r.fragStart}-${r.fragmentEnd})`),!0;const o="audio"===i?.175:0;return!(Math.abs(s.start-n)<Ss+o||Math.abs(s.end-n)<Ss+o)&&(this.log(`"${e.identifier}" resumption ${n} not aligned with ${i} fragment bounds (${s.start}-${s.end} sn: ${s.sn} cc: ${s.cc})`),!0)}))}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;for(let a=0;a<e.assetList.length;a++){const s=e.assetList[a],o=t+n;s.startOffset=n,s.timelineStart=o,i||(i=null===s.duration),r||(r=!!s.error);n+=s.error?0:s.duration||0}e.duration=i&&!r?Math.max(n,e.duration):n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Os(e){return`[${e.event?'"'+e.event.identifier+'"':"primary"}: ${e.start.toFixed(2)}-${e.end.toFixed(2)}]`}class Ns{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=Is(n,this.hls.sessionId,e.baseUrl)}catch(t){const i=this.assignAssetListError(e,o.ASSET_LIST_LOAD_ERROR,t,n);return void this.hls.trigger(l.ERROR,i)}t&&"data:"!==i.protocol&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,a=new(0,r.loader)(r),s={responseType:"json",url:i.href},u=r.interstitialAssetListLoadPolicy.default,c={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(t,n,i,r)=>{const a=t.data,s=null==a?void 0:a.ASSETS;if(Array.isArray(s))e.assetListResponse=a,this.hls.trigger(l.ASSET_LIST_LOADED,{event:e,assetListResponse:a,networkDetails:r});else{const t=this.assignAssetListError(e,o.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),i.url,n,r);this.hls.trigger(l.ERROR,t)}},onError:(t,n,i,r)=>{const a=this.assignAssetListError(e,o.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${t.code} ${t.text} (${n.url})`),n.url,r,i);this.hls.trigger(l.ERROR,a)},onTimeout:(t,n,i)=>{const r=this.assignAssetListError(e,o.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${n.url})`),n.url,t,i);this.hls.trigger(l.ERROR,r)}};return a.load(s,c,h),this.hls.trigger(l.ASSET_LIST_LOADING,{event:e}),a}assignAssetListError(e,t,n,i,r,a){return e.error=n,{type:s.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:a,stats:r}}}function Fs(e){null==e||e.play().catch((()=>{}))}function Bs(e,t){return`[${e}] Advancing timeline position to ${t}`}class Us{constructor(e){this.buffered=void 0;const t=(t,n,i)=>{if((n>>>=0)>i-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${i})`);return e[n][t]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Gs={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},zs=e=>String.fromCharCode(Gs[e]||e),js=15,Hs=100,Vs={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ws={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Zs={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Ks={25:2,26:4,29:6,30:8,31:10,27:13,28:15},qs=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Xs{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"==typeof t?t():t;L.log(`${this.time} [${e}] ${n}`)}}}const Ys=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Qs{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!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 $s{constructor(){this.uchar=" ",this.penState=new Qs}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 Js{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Qs,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<Hs;e++)this.chars.push(new $s);this.logger=e}equals(e){for(let t=0;t<Hs;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Hs;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Hs;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>Hs&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Hs)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].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=zs(e);this.pos>=Hs?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<Hs;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<Hs;n++){const i=this.chars[n].uchar;" "!==i&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e);this.chars[this.pos].setPenState(this.currPenState)}}class eo{constructor(e){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<js;t++)this.rows.push(new Js(e));this.logger=e}reset(){for(let e=0;e<js;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let n=0;n<js;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<js;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<js;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e);this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>"pacData = "+nt(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<js;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){const i=n.rows[e].cueStartTime,r=this.logger.time;if(null!==i&&null!==r&&i<r)for(let i=0;i<this.nrRollUpRows;i++)this.rows[t-this.nrRollUpRows+i+1].copy(n.rows[e+i])}}this.currRow=t;const n=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,i=Math.max(t-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,(()=>"bkgData = "+nt(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let n=0;n<js;n++){const r=this.rows[n].getTextString();r&&(i=n+1,e?t.push("Row "+i+": '"+r+"'"):t.push(r.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}getTextAndFormat(){return this.rows}}class to{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new eo(n),this.nonDisplayedMemory=new eo(n),this.lastOutputScreen=new eo(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],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)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>t+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(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"),"MODE_TEXT"!==this.mode&&(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"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+nt(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?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.cueStartTime=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 no{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const i=this.logger=new Xs;this.channels=[null,new to(e,t,i),new to(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let e=0;e<t.length;e+=2){const n=127&t[e],i=127&t[e+1];let r=!1,a=null;if(0===n&&0===i)continue;this.logger.log(3,(()=>"["+Ys([t[e],t[e+1]])+"] -> ("+Ys([n,i])+")"));const s=this.cmdHistory;if(n>=16&&n<=31){if(ro(n,i,s)){io(null,null,s),this.logger.log(3,(()=>"Repeated command ("+Ys([n,i])+") is dropped"));continue}io(n,i,this.cmdHistory),r=this.parseCmd(n,i),r||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i))}else io(null,null,s);if(!r&&(a=this.parseChars(n,i),a)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(a)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||a||this.logger.log(2,(()=>"Couldn't parse cleaned data "+Ys([n,i])+" orig: "+Ys([t[e],t[e+1]])))}}parseCmd(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;const n=20===e||21===e||23===e?1:2,i=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((17===e||25===e)&&t>=32&&t<=47){if(n=17===e?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return!!i&&(i.ccMIDROW(t),this.logger.log(3,(()=>"MIDROW ("+Ys([e,t])+")")),!0)}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;const i=e<=23?1:2;n=t>=64&&t<=95?1===i?Vs[e]:Zs[e]:1===i?Ws[e]:Ks[e];const r=this.channels[i];return!!r&&(r.setPAC(this.interpretPAC(n,t)),this.currentChannel=i,!0)}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,i.underline=1==(1&n),n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((n-16)/2),i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let e;e=17===r?t+80:18===r?t+112:t+144,this.logger.log(2,(()=>"Special char '"+zs(e)+"' in channel "+n)),i=[e]}else e>=32&&e<=127&&(i=0===t?[e]:[e,t]);return i&&this.logger.log(3,(()=>"Char codes = "+Ys(i).join(","))),i}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let n;const i={};16===e||24===e?(n=Math.floor((t-32)/2),i.background=qs[n],t%2==1&&(i.background=i.background+"_semi")):45===t?i.background="transparent":(i.foreground="black",47===t&&(i.underline=!0));const r=e<=23?1:2;return this.channels[r].setBkgData(i),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}io(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function io(e,t,n){n.a=e,n.b=t}function ro(e,t,n){return n.a===e&&n.b===t}var ao=function(){if(null!=En&&En.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function n(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const n=t.toLowerCase();return!!~e.indexOf(n)&&n}function i(e){return n(t,e)}function r(e,...t){let n=1;for(;n<arguments.length;n++){const t=arguments[n];for(const n in t)e[n]=t[n]}return e}function a(t,a,s){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let u="",c=!1,h=t,d=a,f=s,p=null,m="",g=!0,_="auto",v="start",y=50,b="middle",x=50,E="middle";Object.defineProperty(o,"id",r({},l,{get:function(){return u},set:function(e){u=""+e}})),Object.defineProperty(o,"pauseOnExit",r({},l,{get:function(){return c},set:function(e){c=!!e}})),Object.defineProperty(o,"startTime",r({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",r({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",r({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",r({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",r({},l,{get:function(){return m},set:function(t){const i=function(t){return n(e,t)}(t);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");m=i,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",r({},l,{get:function(){return g},set:function(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",r({},l,{get:function(){return _},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",r({},l,{get:function(){return v},set:function(e){const t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",r({},l,{get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},l,{get:function(){return b},set:function(e){const t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},l,{get:function(){return x},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");x=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},l,{get:function(){return E},set:function(e){const t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class so{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function oo(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(i||0)}const n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}class lo{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function uo(e,t,n,i){const r=i?e.split(i):[e];for(const e in r){if("string"!=typeof r[e])continue;const i=r[e].split(n);if(2!==i.length)continue;t(i[0],i[1])}}const co=new ao(0,0,""),ho="middle"===co.align?"middle":"center";function fo(e,t,n){const i=e;function r(){const t=oo(e);if(null===t)throw new Error("Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=r(),a(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.slice(3),a(),t.endTime=r(),a(),function(e,t){const i=new lo;uo(e,(function(e,t){let r;switch(e){case"region":for(let r=n.length-1;r>=0;r--)if(n[r].id===t){i.set(e,n[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":r=t.split(","),i.integer(e,r[0]),i.percent(e,r[0])&&i.set("snapToLines",!1),i.alt(e,r[0],["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start",ho,"end"]);break;case"position":r=t.split(","),i.percent(e,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start",ho,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",ho,"end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");let r=i.get("line","auto");"auto"===r&&-1===co.line&&(r=-1),t.line=r,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",ho);let a=i.get("position","auto");"auto"===a&&50===co.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}(e,t)}function po(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class mo{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new so,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function n(){let e=t.buffer,n=0;for(e=po(e);n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;const i=e.slice(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.slice(n),i}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=n();const i=e.match(/^()?WEBVTT([ \t].*)?$/);if(null==i||!i[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let i=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(i?i=!1:e=n(),t.state){case"HEADER":/:/.test(e)?uo(e,(function(e,t){}),/:/):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new ao(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{fo(e,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const n=-1!==e.indexOf("--\x3e");if(!e||n&&(i=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const go=/\r\n|\n\r|\n|\r/g,_o=function(e,t,n=0){return e.slice(n,n+t.length)===t};function vo(e,t,n){return Ts(e.toString())+Ts(t.toString())+Ts(n)}function yo(e,t,n,r,a,s,o){const l=new mo,u=D(new Uint8Array(e)).trim().replace(go,"\n").split("\n"),c=[],h=t?function(e,t=1){return jr(e,9e4,1/t)}(t.baseTime,t.timescale):0;let d,f="00:00.000",p=0,m=0,g=!0;l.oncue=function(e){const i=n[r];let s=n.ccOffset;const o=(p-h)/9e4;if(null!=i&&i.new&&(void 0!==m?s=n.ccOffset=i.start:function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);for(;null!=(a=r)&&a.new;){var a;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n}(n,r,o)),o){if(!t)return void(d=new Error("Missing initPTS for VTT MPEGTS"));s=o-n.presentationOffset}const l=e.endTime-e.startTime,u=Xr(9e4*(e.startTime+s-m),9e4*a)/9e4;e.startTime=Math.max(u,0),e.endTime=Math.max(u+l,0);const f=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(f)),e.id||(e.id=vo(e.startTime,e.endTime,f)),e.endTime>0&&c.push(e)},l.onparsingerror=function(e){d=e},l.onflush=function(){d?o(d):s(c)},u.forEach((e=>{if(g){if(_o(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach((e=>{_o(e,"LOCAL:")?f=e.slice(6):_o(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{m=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),a=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(i(t)&&i(n)&&i(r)&&i(a)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=6e4*r,t+=36e5*a,t}(f)/1e3}catch(e){d=e}return}""===e&&(g=!1)}l.parse(e+"\n")})),l.flush()}const bo="stpp.ttml.im1t",xo=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Eo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,wo={left:"start",center:"center",right:"end",start:"start",end:"end"};function To(e,t,n,i){const r=se(new Uint8Array(e),["mdat"]);if(0===r.length)return void i(new Error("Could not parse IMSC1 mdat"));const a=r.map((e=>D(e))),s=function(e,t,n=1,i=!1){return jr(e,t,1/n,i)}(t.baseTime,1,t.timescale);try{a.forEach((e=>n(function(e,t){const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(r).reduce(((e,t)=>(e[t]=i.getAttribute(`ttp:${t}`)||r[t],e)),{}),s="preserve"!==i.getAttribute("xml:space"),o=Ao(So(i,"styling","style")),l=Ao(So(i,"layout","region")),u=So(i,"body","[begin]");return[].map.call(u,(e=>{const n=Co(e,s);if(!n||!e.hasAttribute("begin"))return null;const i=Io(e.getAttribute("begin"),a),r=Io(e.getAttribute("dur"),a);let u=Io(e.getAttribute("end"),a);if(null===i)throw Ro(e);if(null===u){if(null===r)throw Ro(e);u=i+r}const c=new ao(i-t,u-t,n);c.id=vo(c.startTime,c.endTime,c.text);const h=function(e,t,n){const i="http://www.w3.org/ns/ttml#styling";let r=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;s&&n.hasOwnProperty(s)&&(r=n[s]);return a.reduce(((n,a)=>{const s=Lo(t,i,a)||Lo(e,i,a)||Lo(r,i,a);return s&&(n[a]=s),n}),{})}(l[e.getAttribute("region")],o[e.getAttribute("style")],o),{textAlign:d}=h;if(d){const e=wo[d];e&&(c.lineAlign=e),c.align=d}return y(c,h),c})).filter((e=>null!==e))}(e,s))))}catch(e){i(e)}}function So(e,t,n){const i=e.getElementsByTagName(t)[0];return i?[].slice.call(i.querySelectorAll(n)):[]}function Ao(e){return e.reduce(((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function Co(e,t){return[].slice.call(e.childNodes).reduce(((e,n,i)=>{var r;return"br"===n.nodeName&&i?e+"\n":null!=(r=n.childNodes)&&r.length?Co(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function Lo(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function Ro(e){return new Error(`Could not parse ttml timestamp ${e}`)}function Io(e,t){if(!e)return null;let n=oo(e);return null===n&&(xo.test(e)?n=function(e,t){const n=xo.exec(e),i=(0|n[4])+(0|n[5])/t.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+i/t.frameRate}(e,t):Eo.test(e)&&(n=function(e,t){const n=Eo.exec(e),i=Number(n[1]);switch(n[2]){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/t.frameRate;case"t":return i/t.tickRate}return i}(e,t))),n}class Do{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(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function ko(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function Mo(e,t){return!!e&&e.kind===ko(t)&&ha(t,e)}const Po=/\s/,Oo={newCue(e,t,n,i){const r=[];let a,s,o,l,u;const c=self.VTTCue||self.TextTrackCue;for(let d=0;d<i.rows.length;d++)if(a=i.rows[d],o=!0,l=0,u="",!a.isEmpty()){var h;for(let e=0;e<a.chars.length;e++)Po.test(a.chars[e].uchar)&&o?l++:(u+=a.chars[e].uchar,o=!1);a.cueStartTime=t,t===n&&(n+=1e-4),l>=16?l--:l++;const i=po(u.trim()),f=vo(t,n,i);null!=e&&null!=(h=e.cues)&&h.getCueById(f)||(s=new c(t,n,i),s.id=f,s.line=d+1,s.align="left",s.position=10+Math.min(80,10*Math.floor(8*l/32)),r.push(s))}return e&&r.length&&(r.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),r.forEach((t=>bs(e,t)))),r}};const No=/(\d+)-(\d+)\/(\d+)/;class Fo{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||Bo,this.controller=new self.AbortController,this.stats=new H}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(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const a=function(e,t){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(y({},e.headers))};e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return n}(e,this.controller.signal),s="arraybuffer"===e.responseType,o=s?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,a),self.clearTimeout(this.requestTimeout),t.timeout=l&&i(l)?l:u,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))}),t.timeout);(ia(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then((n=>{var a;this.response=this.loader=n;const o=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))}),u-(o-r.loading.start)),!n.ok){const{status:e,statusText:t}=n;throw new Uo(t||"fetch, bad network response",e,n)}r.loading.first=o,r.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=No.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(i(e))return e}const n=e.get("Content-Length");if(n)return parseInt(n)}(n.headers)||r.total;const l=null==(a=this.callbacks)?void 0:a.onProgress;return l&&i(t.highWaterMark)?this.loadProgressively(n,r,e,t.highWaterMark,l):s?n.arrayBuffer():"json"===e.responseType?n.json():n.text()})).then((n=>{var a,s;const l=this.response;if(!l)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const u=n[o];u&&(r.loaded=r.total=u);const c={url:l.url,data:n,code:l.status},h=null==(a=this.callbacks)?void 0:a.onProgress;h&&!i(t.highWaterMark)&&h(r,e,n,l),null==(s=this.callbacks)||s.onSuccess(c,r,e,l)})).catch((t=>{var n;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const i=t&&t.code||0,a=t?t.message:null;null==(n=this.callbacks)||n.onError({code:i,text:a},e,t?t.details:null,r)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const a=new Mi,s=e.body.getReader(),o=()=>s.read().then((s=>{if(s.done)return a.dataLength&&r(t,n,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const l=s.value,u=l.length;return t.loaded+=u,u<i||a.dataLength?(a.push(l),a.dataLength>=i&&r(t,n,a.flush().buffer,e)):r(t,n,l.buffer,e),o()})).catch((()=>Promise.reject()));return o()}}function Bo(e,t){return new self.Request(e.url,t)}class Uo extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Go=/^age:\s*[\d.]+\s*$/im;class zo{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 H,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,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then((()=>{if(this.loader===n&&!this.stats.aborted)return r(n,t.url)})).catch((e=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",t.url,!0),r(n,t.url)})).then((()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)})).catch((e=>{var r;null==(r=this.callbacks)||r.onError({code:n.status,text:e.message},t,n,i)})):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:a,maxLoadTimeMs:s}=n.loadPolicy;if(r)for(const t in r)e.setRequestHeader(t,r[t]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=a&&i(a)?a:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===i)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const i=t.status,l="text"===t.responseType?t.responseText:null;if(i>=200&&i<300){const r=null!=l?l:t.response;if(null!=r){var a,s;n.loading.end=Math.max(self.performance.now(),n.loading.first);const o="arraybuffer"===t.responseType?r.byteLength:r.length;n.loaded=n.total=o,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first);const l=null==(a=this.callbacks)?void 0:a.onProgress;l&&l(n,e,r,t);const u={url:t.responseURL,data:r,code:i};return void(null==(s=this.callbacks)||s.onSuccess(u,n,e,t))}}const u=r.loadPolicy.errorRetry;var o;if(Et(u,n.retry,!1,{url:e.url,data:void 0,code:i}))this.retry(u);else L.error(`${i} while loading ${e.url}`),null==(o=this.callbacks)||o.onError({code:i,text:t.statusText},e,t,n)}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry;if(Et(e,this.stats.retry,!0))this.retry(e);else{var t;L.warn(`timeout while loading ${null==(t=this.context)?void 0:t.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=bt(e,n.retry),n.retry++,L.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==t?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Go.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 jo=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:zo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends E{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{var t;const{fragCurrent:n,partCurrent:r,hls:a}=this,{autoLevelEnabled:s,media:o}=a;if(!n||!o)return;const u=performance.now(),c=r?r.stats:n.stats,h=r?r.duration:n.duration,d=u-c.loading.start,f=a.minAutoLevel,p=n.level,m=this._nextAutoLevel;if(c.aborted||c.loaded&&c.loaded===c.total||p<=f)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!s)return;const g=m>-1&&m!==p,_=!!e||g;if(!_&&(o.paused||!o.playbackRate||!o.readyState))return;const v=a.mainForwardBufferInfo;if(!_&&null===v)return;const y=this.bwEstimator.getEstimateTTFB(),b=Math.abs(o.playbackRate);if(d<=Math.max(y,h/(2*b)*1e3))return;const x=v?v.len/b:0,E=c.loading.first?c.loading.first-c.loading.start:-1,w=c.loaded&&E>-1,T=this.getBwEstimate(),S=a.levels,A=S[p],C=Math.max(c.loaded,Math.round(h*(n.bitrate||A.averageBitrate)/8));let L=w?d-E:d;L<1&&w&&(L=Math.min(d,8*c.loaded/T));const R=w?1e3*c.loaded/L:0,I=y/1e3,D=R?(C-c.loaded)/R:8*C/T+I;if(D<=x)return;const k=R?8*R:T,M=!0===(null==(t=(null==e?void 0:e.details)||this.hls.latestLevelDetails)?void 0:t.live),P=this.hls.config.abrBandWidthUpFactor;let O,N=Number.POSITIVE_INFINITY;for(O=p-1;O>f;O--){const e=S[O].maxBitrate,t=!S[O].details||M;if(N=this.getTimeToLoadFrag(I,k,h*e,t),N<Math.min(x,h+I))break}if(N>=D)return;if(N>10*h)return;w?this.bwEstimator.sample(d-Math.min(y,E),c.loaded):this.bwEstimator.sampleTTFB(d);const F=S[O].maxBitrate;this.getBwEstimate()*P>F&&this.resetEstimator(F);const B=this.findBestLevel(F,f,O,0,x,1,1);B>-1&&(O=B),this.warn(`Fragment ${n.sn}${r?" part "+r.index:""} of level ${p} is loading too slowly;\n Fragment duration: ${n.duration.toFixed(3)}\n Time to underbuffer: ${x.toFixed(3)} s\n Estimated load time for current fragment: ${D.toFixed(3)} s\n Estimated load time for down switch fragment: ${N.toFixed(3)} s\n TTFB estimate: ${0|E} ms\n Current BW estimate: ${i(T)?0|T:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${O} @ ${0|F} bps`),a.nextLoadLevel=a.nextAutoLevel=O,this.clearTimer();const U=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===O&&O>0){const e=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${O>0?"and switching down":""}\n Fragment duration: ${n.duration.toFixed(3)} s\n Time to underbuffer: ${e.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,O>f){let t=this.findBestLevel(this.hls.levels[f].bitrate,f,O,0,e,1,1);-1===t&&(t=f),this.hls.nextLoadLevel=this.hls.nextAutoLevel=t,this.resetEstimator(this.hls.levels[t].bitrate)}}};g||D>2*N?U():this.timer=self.setInterval(U,1e3*N),a.trigger(l.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:r,stats:c})},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 _(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(l.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){var i;if(!n.bitrateTest)this.fragCurrent=n,this.partCurrent=null!=(i=t.part)?i:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case o.FRAG_LOAD_TIMEOUT:{const e=t.frag,{fragCurrent:n,partCurrent:i}=this;if(e&&n&&e.sn===n.sn&&e.level===n.level){const t=performance.now(),n=i?i.stats:e.stats,r=t-n.loading.start,a=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&a>-1){const e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(r-Math.min(e,a),n.loaded)}else this.bwEstimator.sampleTTFB(r)}break}}}getTimeToLoadFrag(e,t,n,i){return e+n/t+(i?e+this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,a=r.end-r.first;i(a)&&(this.lastLevelLoadSec=a/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===f&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const e=n?n.duration:t.duration,r=this.hls.levels[t.level],a=(r.loaded?r.loaded.bytes:0)+i.loaded,s=(r.loaded?r.loaded.duration:0)+e;r.loaded={bytes:a,duration:s},r.realBitrate=Math.round(8*a/s)}if(t.bitrateTest){const e={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(l.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=null!=i&&i.stats.loaded?i.stats:n.stats;if(r.aborted)return;if(this.ignoreFragment(n))return;const a=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==f||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const a=this.hls.firstLevel,s=Math.min(Math.max(a,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${s}`),s}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e;const i=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,i)&&t[e].loadError<=t[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:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:a}=n,s=t?t.duration:e?e.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let u=r.abrBandWidthFactor,c=r.abrBandWidthUpFactor;if(l){const e=this.findBestLevel(o,a,i,l,0,u,c);if(e>=0)return this.rebufferNotice=-1,e}let h=s?Math.min(s,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const e=this.bitrateTestDelay;if(e){h=(s?Math.min(s,r.maxLoadingDelay):r.maxLoadingDelay)-e,this.info(`bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*h)} ms`),u=c=1}}const d=this.findBestLevel(o,a,i,l,h,u,c);if(this.rebufferNotice!==d&&(this.rebufferNotice=d,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${d}`)),d>-1)return d;const f=n.levels[a],p=n.loadLevelObj;return p&&(null==f?void 0:f.bitrate)<p.bitrate?a:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,a,s,o){var l;const u=r+a,c=this.lastLoadedFragLevel,h=-1===c?this.hls.firstLevel:c,{fragCurrent:d,partCurrent:f}=this,{levels:p,allAudioTracks:m,loadLevel:g,config:_}=this.hls;if(1===p.length)return 0;const v=p[h],y=!(null==(l=this.hls.latestLevelDetails)||!l.live),b=-1===g||-1===c;let x,E="SDR",w=(null==v?void 0:v.frameRate)||0;const{audioPreference:T,videoPreference:S}=_,A=this.audioTracksByGroup||(this.audioTracksByGroup=rt(m));let C=-1;if(b){if(-1!==this.firstSelection)return this.firstSelection;const r=this.codecTiers||(this.codecTiers=function(e,t,n,i){return e.slice(n,i+1).reduce(((e,n,i)=>{if(!n.codecSet)return e;const r=n.audioGroups;let a=e[n.codecSet];a||(e[n.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:i,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,n.bitrate);const s=Math.min(n.height,n.width);return a.minHeight=Math.min(a.minHeight,s),a.minFramerate=Math.min(a.minFramerate,n.frameRate),a.minIndex=Math.min(a.minIndex,i),a.maxScore=Math.max(a.maxScore,n.score),a.fragmentError+=n.fragmentError,a.videoRanges[n.videoRange]=(a.videoRanges[n.videoRange]||0)+1,r&&r.forEach((e=>{if(!e)return;const n=t.groups[e];n&&(a.hasDefaultAudio=a.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach((e=>{a.channels[e]=(a.channels[e]||0)+n.channels[e]})))})),e}),{})}(p,A,t,n)),a=function(e,t,n,r,a){const s=Object.keys(e),o=null==r?void 0:r.channels,l=null==r?void 0:r.audioCodec,u=null==a?void 0:a.videoCodec,c=o&&2===parseInt(o);let h=!1,d=!1,f=1/0,p=1/0,m=1/0,g=1/0,_=0,v=[];const{preferHDR:y,allowedVideoRanges:b}=tt(t,a);for(let t=s.length;t--;){const n=e[s[t]];h||(h=n.channels[2]>0),f=Math.min(f,n.minHeight),p=Math.min(p,n.minFramerate),m=Math.min(m,n.minBitrate),b.filter((e=>n.videoRanges[e]>0)).length>0&&(d=!0)}f=i(f)?f:0,p=i(p)?p:0;const x=Math.max(1080,f),E=Math.max(30,p);m=i(m)?m:n,n=Math.max(m,n),d||(t=void 0);const w=s.length>1;return{codecSet:s.reduce(((t,i)=>{const r=e[i];if(i===t)return t;if(v=d?b.filter((e=>r.videoRanges[e]>0)):[],w){if(r.minBitrate>n)return it(i,`min bitrate of ${r.minBitrate} > current estimate of ${n}`),t;if(!r.hasDefaultAudio)return it(i,"no renditions with default or auto-select sound found"),t;if(l&&i.indexOf(l.substring(0,4))%5!=0)return it(i,`audio codec preference "${l}" not found`),t;if(o&&!c){if(!r.channels[o])return it(i,`no renditions with ${o} channel sound found (channels options: ${Object.keys(r.channels)})`),t}else if((!l||c)&&h&&0===r.channels[2])return it(i,"no renditions with stereo sound found"),t;if(r.minHeight>x)return it(i,`min resolution of ${r.minHeight} > maximum of ${x}`),t;if(r.minFramerate>E)return it(i,`min framerate of ${r.minFramerate} > maximum of ${E}`),t;if(!v.some((e=>r.videoRanges[e]>0)))return it(i,`no variants with VIDEO-RANGE of ${nt(v)} found`),t;if(u&&i.indexOf(u.substring(0,4))%5!=0)return it(i,`video codec preference "${u}" not found`),t;if(r.maxScore<_)return it(i,`max score of ${r.maxScore} < selected max of ${_}`),t}return t&&(Ie(i)>=Ie(t)||r.fragmentError>e[t].fragmentError)?t:(g=r.minIndex,_=r.maxScore,i)}),void 0),videoRanges:v,preferHDR:y,minFramerate:p,minBitrate:m,minIndex:g}}(r,E,e,T,S),{codecSet:s,videoRanges:o,minFramerate:l,minBitrate:u,minIndex:c,preferHDR:h}=a;C=c,x=s,E=h?o[o.length-1]:o[0],w=l,e=Math.max(e,u),this.log(`picked start tier ${nt(a)}`)}else x=null==v?void 0:v.codecSet,E=null==v?void 0:v.videoRange;const L=f?f.duration:d?d.duration:0,R=this.bwEstimator.getEstimateTTFB()/1e3,I=[];for(let l=n;l>=t;l--){var D;const t=p[l],d=l>h;if(!t)continue;if(_.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&je(t,A,E,w,e,T)?(t.supportedPromise=He(t,A,n,this.supportedCache),t.supportedPromise.then((e=>{if(!this.hls)return;t.supportedResult=e;const n=this.hls.levels,i=n.indexOf(t);e.error?this.warn(`MediaCapabilities decodingInfo error: "${e.error}" for level ${i} ${nt(e)}`):e.supported?e.decodingInfoResults.some((e=>!1===e.smooth||!1===e.powerEfficient))&&this.log(`MediaCapabilities decodingInfo for level ${i} not smooth or powerEfficient: ${nt(e)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${i} ${nt(e)}`),i>-1&&n.length>1&&(this.log(`Removing unsupported level ${i}`),this.hls.removeLevel(i),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))})).catch((e=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${e}`)}))):t.supportedResult=Ge}if((x&&t.codecSet!==x||E&&t.videoRange!==E||d&&w>t.frameRate||!d&&w>0&&w<t.frameRate||null!=(D=t.supportedResult)&&null!=(D=D.decodingInfoResults)&&D.some((e=>!1===e.smooth)))&&(!b||l!==C)){I.push(l);continue}const m=t.details,v=(f?null==m?void 0:m.partTarget:null==m?void 0:m.averagetargetduration)||L;let S;S=d?o*e:s*e;const k=L&&r>=2*L&&0===a?t.averageBitrate:t.maxBitrate,M=this.getTimeToLoadFrag(R,S,k*v,void 0===m);if(S>=k&&(l===c||0===t.loadError&&0===t.fragmentError)&&(M<=R||!i(M)||y&&!this.bitrateTestDelay||M<u)){const e=this.forcedAutoLevel;return l===g||-1!==e&&e===g||(I.length&&this.trace(`Skipped level(s) ${I.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${p[I[0]].codecs}" ${p[I[0]].videoRange}; not compatible with "${x}" ${E}`),this.info(`switch candidate:${h}->${l} adjustedbw(${Math.round(S)})-bitrate=${Math.round(S-k)} ttfb:${R.toFixed(1)} avgDuration:${v.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${M.toFixed(1)} firstSelection:${b} codecSet:${t.codecSet} videoRange:${t.videoRange} hls.loadLevel:${g}`)),b&&(this.firstSelection=l),l}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}},bufferController:class extends E{constructor(e,t){var n;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=e=>{var t;this.hls&&"open"===(null==(t=this.mediaSource)?void 0:t.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=e=>{const{media:t,mediaSource:n}=this;e&&this.log("Media source opened"),t&&n&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(l.MEDIA_ATTACHED,{media:t,mediaSource:n}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:e,_objectUrl:t}=this;e!==t&&this.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=(n=R(e.config.preferManagedMediaSource),"undefined"!=typeof self&&n===self.ManagedMediaSource),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(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.BUFFER_RESET,this.onBufferReset,this),e.on(l.BUFFER_APPENDING,this.onBufferAppending,this),e.on(l.BUFFER_CODECS,this.onBufferCodecs,this),e.on(l.BUFFER_EOS,this.onBufferEos,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.FRAG_PARSED,this.onFragParsed,this),e.on(l.FRAG_CHANGED,this.onFragChanged,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.BUFFER_RESET,this.onBufferReset,this),e.off(l.BUFFER_APPENDING,this.onBufferAppending,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.BUFFER_EOS,this.onBufferEos,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.FRAG_PARSED,this.onFragParsed,this),e.off(l.FRAG_CHANGED,this.onFragChanged,this),e.off(l.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const e=this.isUpdating();e||this.operationQueue.removeBlockers();const t=this.isQueued();(e||t)&&this.warn(`Transfering MediaSource with${t?" operations in queue":""}${e?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?y(n,i.tracks):this.sourceBuffers.forEach((e=>{const[t]=e;t&&(n[t]=y({},this.tracks[t]),this.removeBuffer(t)),e[0]=e[1]=null})),{media:e,mediaSource:t,tracks:n}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),null!=(n=this.transferData)&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media;this.transferData=this.overrides=void 0;const i=R(this.appendSource);if(i){const e=!!t.mediaSource;(e||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const r=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(r),e)this._objectUrl=n.src,this.attachTransferred();else{const e=this._objectUrl=self.URL.createObjectURL(r);if(this.appendSource)try{n.removeAttribute("src");const t=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||t&&r instanceof t,ga(n),function(e,t){const n=self.document.createElement("source");n.type="video/mp4",n.src=t,e.appendChild(n)}(n,e),n.load()}catch(t){n.src=e}else n.src=e}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${(null==(t=this.transferData)?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${null==(n=e.constructor)?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,a=r?r.length:0,s=()=>{Promise.resolve().then((()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()}))};if(i&&r&&a){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${nt(n,((e,t)=>"initSegment"===e?void 0:t))};\ntransfer tracks: ${nt(i,((e,t)=>"initSegment"===e?void 0:t))}}`),!I(i,n)){t.mediaSource=null,t.tracks=void 0;const r=e.currentTime,a=this.details,s=Math.max(r,(null==a?void 0:a.fragments[0].start)||0);return s-r>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${r} -> ${s}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${s} currentTime: ${r}`),this.onMediaDetaching(l.MEDIA_DETACHING,{}),this.onMediaAttaching(l.MEDIA_ATTACHING,t),void(e.currentTime=s))}this.transferData=void 0,r.forEach((e=>{const t=e,n=i[t];if(n){const e=n.buffer;if(e){const i=this.fragmentTracker,r=n.id;if(i.hasFragments(r)||i.hasParts(r)){const n=tn.getBuffered(e);i.detectEvictedFragments(t,n,r,null,!0)}const a=_a(t),s=[t,e];this.sourceBuffers[a]=s,e.updating&&this.operationQueue&&this.operationQueue.prependBlocker(t),this.trackSourceBuffer(t,n)}}})),s(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),s()}get mediaSourceOpenOrEnded(){var e;const t=null==(e=this.mediaSource)?void 0:e.readyState;return"open"===t||"ended"===t}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:a}=this;if(r){if(this.log("media source "+(n?"transferring":"detaching")),n)this.sourceBuffers.forEach((([e])=>{e&&this.removeBuffer(e)})),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const e="open"===r.readyState;try{const t=r.sourceBuffers;for(let n=t.length;n--;)e&&t[n].abort(),r.removeSourceBuffer(t[n]);e&&r.endOfStream()}catch(e){this.warn(`onMediaDetaching: ${e.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(a&&self.URL.revokeObjectURL(a),this.mediaSrc===a?(i.removeAttribute("src"),this.appendSource&&ga(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(l.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach((([e])=>{e&&this.resetBuffer(e)})),this.initTracks()}resetBuffer(e){var t;const n=null==(t=this.tracks[e])?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;null!=(i=this.mediaSource)&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(t){this.warn(`onBufferReset ${e}`,t)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[_a(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new da(this.tracks)}onBufferCodecs(e,t){var n;const i=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const a="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),s=!a&&this.sourceBufferCount&&this.media&&r.some((e=>!i[e]));a||s?this.warn(`Unsupported transition between "${Object.keys(i)}" and "${r}" SourceBuffers`):(r.forEach((e=>{var n,r;const a=t[e],{id:s,codec:o,levelCodec:l,container:u,metadata:c,supplemental:h}=a;let d=i[e];const f=null==(n=this.transferData)||null==(n=n.tracks)?void 0:n[e],p=null!=f&&f.buffer?f:d,m=(null==p?void 0:p.pendingCodec)||(null==p?void 0:p.codec),g=null==p?void 0:p.levelCodec;d||(d=i[e]={buffer:void 0,listeners:[],codec:o,supplemental:h,container:u,levelCodec:l,metadata:c,id:s});const _=Pe(m,g),v=null==_?void 0:_.replace(fa,"$1");let y=Pe(o,l);const b=null==(r=y)?void 0:r.replace(fa,"$1");y&&_&&v!==b&&("audio"===e.slice(0,5)&&(y=Me(y,this.appendSource)),this.log(`switching codec ${m} to ${y}`),y!==(d.pendingCodec||d.codec)&&(d.pendingCodec=y),d.container=u,this.appendChangeType(e,u,y))})),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&"main"===(null==(n=t.audio)?void 0:n.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))}get sourceBufferTracks(){return Object.keys(this.tracks).reduce(((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e}),{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const r=this.tracks[e];if(r){const a=r.buffer;null!=a&&a.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),a.changeType(i),r.codec=n,r.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+.05*e.duration;if(!0===(null==(t=this.fragmentTracker.getAppendedFrag(n,f))?void 0:t.gap))return;const r={label:"block-audio",execute:()=>{var e;const t=this.tracks.video;(this.lastVideoAppendEnd>i||null!=t&&t.buffer&&tn.isBuffered(t.buffer,i)||!0===(null==(e=this.fragmentTracker.getAppendedFrag(i,f))?void 0:e.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn("Error executing block-audio operation",e)}};this.blockedAudioAppend={op:r,frag:e},this.append(r,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:r,type:a,parent:u,frag:c,part:h,chunkMeta:d,offset:p}=t,m=d.buffering[a],{sn:g,cc:_}=c,v=self.performance.now();m.start=v;const y=c.stats.buffering,b=h?h.stats.buffering:null;0===y.start&&(y.start=v),b&&0===b.start&&(b.start=v);const x=n.audio;let E=!1;"audio"===a&&"audio/mpeg"===(null==x?void 0:x.container)&&(E=!this.lastMpegAudioChunk||1===d.id||this.lastMpegAudioChunk.sn!==d.sn,this.lastMpegAudioChunk=d);const w=n.video,T=null==w?void 0:w.buffer;if(T&&"initSegment"!==g){const e=h||c,t=this.blockedAudioAppend;if("audio"!==a||"main"===u||this.blockedAudioAppend||w.ending||w.ended){if("video"===a){const n=e.end;if(t){const e=t.frag.start;(n>e||n<this.lastVideoAppendEnd||tn.isBuffered(T,e))&&this.unblockAudio()}this.lastVideoAppendEnd=n}}else{const t=e.start+.05*e.duration,n=T.buffered,i=this.currentOp("video");n.length||i?!i&&!tn.isBuffered(T,t)&&this.lastVideoAppendEnd<t&&this.blockAudio(e):this.blockAudio(e)}}const S=(h||c).start,A={label:`append-${a}`,execute:()=>{var e;m.executeStart=self.performance.now();const t=null==(e=this.tracks[a])?void 0:e.buffer;t&&(E?this.updateTimestampOffset(t,S,.1,a,g,_):void 0!==p&&i(p)&&this.updateTimestampOffset(t,p,1e-6,a,g,_)),this.appendExecutor(r,a)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();m.executeEnd=m.end=e,0===y.first&&(y.first=e),b&&0===b.first&&(b.first=e);const t={};this.sourceBuffers.forEach((([e,n])=>{e&&(t[e]=tn.getBuffered(n))})),this.appendErrors[a]=0,"audio"===a||"video"===a?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(l.BUFFER_APPENDED,{type:a,frag:c,part:h,chunkMeta:d,parent:c.type,timeRanges:t})},onError:e=>{var t;const n={type:s.MEDIA_ERROR,parent:c.type,details:o.BUFFER_APPEND_ERROR,sourceBufferName:a,frag:c,part:h,chunkMeta:d,error:e,err:e,fatal:!1},i=null==(t=this.media)?void 0:t.error;if(e.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==e.name||"quota"in e)n.details=o.BUFFER_FULL_ERROR;else if(e.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!i)n.errorAction=kt(!0);else if(e.name===pa&&0===this.sourceBufferCount)n.errorAction=kt(!0);else{const e=++this.appendErrors[a];this.warn(`Failed ${e}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${a}" sourceBuffer (${i||"no media error"})`),(e>=this.hls.config.appendErrorMaxRetry||i)&&(n.fatal=!0)}this.hls.trigger(l.ERROR,n)}};this.log(`queuing "${a}" append sn: ${g}${h?" p: "+h.index:""} of ${c.type===f?"level":"track"} ${c.level} cc: ${_}`),this.append(A,a,this.isPending(this.tracks[a]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(l.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach((([e])=>{e&&this.append(this.getFlushOp(e,i,r),e)}))}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],a=i?i.elementaryStreams:n.elementaryStreams;a[Z]?r.push("audiovideo"):(a[V]&&r.push("audio"),a[W]&&r.push("video"));0===r.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers((()=>{const e=self.performance.now();n.stats.buffering.end=e,i&&(i.stats.buffering.end=e);const t=i?i.stats:n.stats;this.hls.trigger(l.FRAG_BUFFERED,{frag:n,part:i,stats:t,id:n.type})}),r).catch((e=>{this.warn(`Fragment buffered callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)}))}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some((([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1}))}onBufferEos(e,t){var n;this.sourceBuffers.forEach((([e])=>{if(e){const n=this.tracks[e];t.type&&t.type!==e||(n.ending=!0,n.ended||(n.ended=!0,this.log(`${e} buffer reached EOS`)))}}));const i=!1!==(null==(n=this.overrides)?void 0:n.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some((([e])=>{var t;return e&&!(null!=(t=this.tracks[e])&&t.ended)}))?i?(this.log("Queueing EOS"),this.blockUntilOpen((()=>{this.tracksEnded();const{mediaSource:e}=this;e&&"open"===e.readyState?(this.log("Calling mediaSource.endOfStream()"),e.endOfStream(),this.hls.trigger(l.BUFFERED_TO_END,void 0)):e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)}))):(this.tracksEnded(),this.hls.trigger(l.BUFFERED_TO_END,void 0)):"video"===t.type&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach((([e])=>{if(null!==e){const t=this.tracks[e];t&&(t.ending=!1)}}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen((()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)}))}onError(e,t){if(t.details===o.BUFFER_APPEND_ERROR&&t.frag){var n;const e=null==(n=t.errorAction)?void 0:n.nextAutoLevel;i(e)&&e!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||null===t)return;if(!this.sourceBufferCount)return;const r=e.config,a=n.currentTime,s=t.levelTargetDuration,o=t.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(i(o)&&o>=0){const e=Math.max(o,s),t=Math.floor(a/s)*s-e;this.flushBackBuffer(a,s,t)}const l=r.frontBufferFlushThreshold;if(i(l)&&l>0){const e=Math.max(r.maxBufferLength,l),t=Math.max(e,s),n=Math.floor(a/s)*s+t;this.flushFrontBuffer(a,s,n)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach((([e,t])=>{if(t){const r=tn.getBuffered(t);if(r.length>0&&n>r.start(0)){var i;this.hls.trigger(l.BACK_BUFFER_REACHED,{bufferEnd:n});const t=this.tracks[e];if(null!=(i=this.details)&&i.live)this.hls.trigger(l.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(null!=t&&t.ended)return void this.log(`Cannot flush ${e} back buffer while SourceBuffer is in ended state`);this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:e})}}}))}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach((([t,i])=>{if(i){const r=tn.getBuffered(i),a=r.length;if(a<2)return;const s=r.start(a-1),o=r.end(a-1);if(n>s||e>=s&&e<=o)return;this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:s,endOffset:1/0,type:t})}}))}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||"open"!==(null==n?void 0:n.readyState))return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&n.setLiveSeekableRange){const e=Math.max(0,t.fragmentStart);return{duration:1/0,start:e,end:Math.max(e,r)}}return{duration:1/0}}const a=null==(e=this.overrides)?void 0:e.duration;if(a)return i(a)?{duration:a}:null;const s=this.media.duration;return r>(i(n.duration)?n.duration:0)&&r>s||!i(s)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:n}){const r=this.mediaSource;this.media&&r&&"open"===r.readyState&&(r.duration!==e&&(i(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),void 0!==t&&void 0!==n&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${n}.`),r.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${nt(n)}`),this.tracksReady){var i;const e=null==(i=this.transferData)?void 0:i.tracks;e&&Object.keys(e).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach((([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}})),this.hls.trigger(l.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach((([e])=>{this.executeNext(e)}))}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const a=r,u=e[a];if(this.isPending(u)){const e=this.getTrackCodec(u,a),r=`${u.container};codecs=${e}`;u.codec=e,this.log(`creating sourceBuffer(${r})${this.currentOp(a)?" Queued":""} ${nt(u)}`);try{const e=n.addSourceBuffer(r),i=_a(a),s=[a,e];t[i]=s,u.buffer=e}catch(e){var i;return this.error(`error while trying to add sourceBuffer: ${e.message}`),this.shiftAndExecuteNext(a),null==(i=this.operationQueue)||i.removeBlockers(),delete this.tracks[a],void this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,sourceBufferName:a,mimeType:r,parent:u.id})}this.trackSourceBuffer(a,u)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&("video"===t||"audiovideo"===t)&&Ae(n,"video")&&(i=function(e,t){const n=[];if(e){const t=e.split(",");for(let e=0;e<t.length;e++)Se(t[e],"video")||n.push(t[e])}return t&&n.push(t),n.join(",")}(i,n));const r=Pe(i,e.levelCodec);return r?"audio"===t.slice(0,5)?Me(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",((e,t)=>{const n=t.removedRanges;null!=n&&n.length&&this.hls.trigger(l.BUFFER_FLUSHED,{type:e})}))}get mediaSrc(){var e,t;const n=(null==(e=this.media)||null==(t=e.querySelector)?void 0:t.call(e,"source"))||this.media;return null==n?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}updateTimestampOffset(e,t,n,i,r,a){const s=t-e.timestampOffset;Math.abs(s)>=n&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${a})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:r,mediaSource:a}=this,s=this.tracks[e],o=null==s?void 0:s.buffer;if(!r||!a||!o)return this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(e);const l=i(r.duration)?r.duration:1/0,u=i(a.duration)?a.duration:1/0,c=Math.max(0,t),h=Math.min(n,l,u);h>c&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${c},${h}] from the ${e} SourceBuffer`),o.remove(c,h)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=null==n?void 0:n.buffer;if(!i)throw new ma(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch((e=>{this.warn(`SourceBuffer blocked callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)}));else try{e()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${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)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map((e=>this.appendBlocker(e)));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then((t=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))}))}stepOperationQueue(e){e.forEach((e=>{var t;const n=null==(t=this.tracks[e])?void 0:t.buffer;n&&!n.updating&&this.shiftAndExecuteNext(e)}))}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce(((e,t)=>e+(this.isPending(this.tracks[t])?1:0)),0)}get sourceBufferCount(){return this.sourceBuffers.reduce(((e,[t])=>e+(t?1:0)),0)}get sourceBufferTypes(){return this.sourceBuffers.map((([e])=>e)).filter((e=>!!e))}addBufferListener(e,t,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const a=n.bind(this,e);i.listeners.push({event:t,listener:a}),r.addEventListener(t,a)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach((e=>{n.removeEventListener(e.event,e.listener)})),t.listeners.length=0)}},capLevelController:va,errorController:class extends E{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(l.ERROR,this.onError,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.ERROR,this.onError,this),e.off(l.ERROR,this.onErrorOut,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(null==e?void 0:e.type)===f?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,n=t.currentLevel;return null!=(e=t.loadLevelObj)&&e.details||-1===n?t.loadLevel:n}variantHasKey(e,t){if(e){var n;if(null!=(n=e.details)&&n.hasKey(t))return!0;const i=e.audioGroups;if(i){return this.hls.allAudioTracks.filter((e=>i.indexOf(e.groupId)>=0)).some((e=>{var n;return null==(n=e.details)?void 0:n.hasKey(t)}))}}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case o.FRAG_PARSING_ERROR:if(null!=(n=t.frag)&&n.gap)return void(t.errorAction=kt());case o.FRAG_GAP:case o.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=St);case o.LEVEL_EMPTY_ERROR:case o.LEVEL_PARSING_ERROR:{var a;const e=t.parent===f?t.level:i.loadLevel;t.details===o.LEVEL_EMPTY_ERROR&&null!=(a=t.context)&&null!=(a=a.levelDetails)&&a.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level)));case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.SUBTITLE_LOAD_ERROR:case o.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const e=i.loadLevelObj;if(e&&(r.type===h&&e.hasAudioGroup(r.groupId)||r.type===d&&e.hasSubtitleGroup(r.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=St,void(t.errorAction.flags=Rt)}return;case o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(t.errorAction={action:St,flags:It});case o.KEY_SYSTEM_SESSION_UPDATE_FAILED:case o.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case o.KEY_SYSTEM_NO_SESSION:return void(t.errorAction={action:St,flags:Dt});case o.BUFFER_ADD_CODEC_ERROR:case o.REMUX_ALLOC_ERROR:case o.BUFFER_APPEND_ERROR:var l;if(!t.errorAction)t.errorAction=this.getLevelSwitchAction(t,null!=(l=t.level)?l:i.loadLevel);return;case o.INTERNAL_EXCEPTION:case o.BUFFER_APPENDING_ERROR:case o.BUFFER_FULL_ERROR:case o.LEVEL_SWITCH_ERROR:case o.BUFFER_STALLED_ERROR:case o.BUFFER_SEEK_OVER_HOLE:case o.BUFFER_NUDGE_ON_STALL:return void(t.errorAction=kt())}t.type===s.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=kt())}getPlaylistRetryOrSwitchAction(e,t){const n=yt(this.hls.config.playlistLoadPolicy,e),i=this.playlistError++;if(Et(n,i,gt(e),e.response))return{action:Ct,flags:Lt,retryConfig:n,retryCount:i};const r=this.getLevelSwitchAction(e,t);return n&&(r.retryConfig=n,r.retryCount=i),r}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:a}=t.config,s=yt(_t(e)?a:r,e),l=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(i&&(e.details!==o.FRAG_GAP&&i.fragmentError++,!vt(e))){if(Et(s,l,gt(e),e.response))return{action:Ct,flags:Lt,retryConfig:s,retryCount:l}}const u=this.getLevelSwitchAction(e,n);return s&&(u.retryConfig=s,u.retryCount=l),u}getLevelSwitchAction(e,t){const n=this.hls;null==t&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,a;const t=e.details;i.loadError++,t===o.BUFFER_APPEND_ERROR&&i.fragmentError++;let u=-1;const{levels:c,loadLevel:g,minAutoLevel:_,maxAutoLevel:v}=n;n.autoLevelEnabled||n.config.preserveManualLevelOnError||(n.loadLevel=-1);const y=null==(r=e.frag)?void 0:r.type,b=(y===p&&t===o.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(t===o.BUFFER_ADD_CODEC_ERROR||t===o.BUFFER_APPEND_ERROR))&&c.some((({audioCodec:e})=>i.audioCodec!==e)),x="video"===e.sourceBufferName&&(t===o.BUFFER_ADD_CODEC_ERROR||t===o.BUFFER_APPEND_ERROR)&&c.some((({codecSet:e,audioCodec:t})=>i.codecSet!==e&&i.audioCodec===t)),{type:E,groupId:w}=null!=(a=e.context)?a:{};for(let n=c.length;n--;){const r=(n+g)%c.length;if(r!==g&&r>=_&&r<=v&&0===c[r].loadError){var s,l;const n=c[r];if(t===o.FRAG_GAP&&y===f&&e.frag){const t=c[r].details;if(t){const n=dt(e.frag,t.fragments,e.frag.start);if(null!=n&&n.gap)continue}}else{if(E===h&&n.hasAudioGroup(w)||E===d&&n.hasSubtitleGroup(w))continue;if(y===p&&null!=(s=i.audioGroups)&&s.some((e=>n.hasAudioGroup(e)))||y===m&&null!=(l=i.subtitleGroups)&&l.some((e=>n.hasSubtitleGroup(e)))||b&&i.audioCodec===n.audioCodec||x&&i.codecSet===n.codecSet||!b&&i.codecSet!==n.codecSet)continue}u=r;break}}if(u>-1&&n.loadLevel!==u)return e.levelRetry=!0,this.playlistError=0,{action:St,flags:Lt,nextAutoLevel:u}}return{action:St,flags:Rt}}onErrorOut(e,t){var n;switch(null==(n=t.errorAction)?void 0:n.action){case Tt:break;case St:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===o.FRAG_GAP?/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()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i}=n,r=n.nextAutoLevel;switch(i){case Lt:this.switchLevel(e,r);break;case It:{const i=this.getVariantLevelIndex(e.frag),r=t.levels[i],a=null==r?void 0:r.attrs["HDCP-LEVEL"];if(n.hdcpLevel=a,"NONE"===a)this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(a){t.maxHdcpLevel=Ze[Ze.indexOf(a)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Dt:{const t=e.decryptdata;if(t){const i=this.hls.levels,r=i.length;for(let n=r;n--;){var a,s;if(this.variantHasKey(i[n],t))this.log(`Banned key found in level ${n} (${i[n].bitrate}bps) or audio group "${null==(a=i[n].audioGroups)?void 0:a.join(",")}" (${null==(s=e.frag)?void 0:s.type} fragment) ${k(t.keyId||[])}`),i[n].fragmentError++,i[n].loadError++,this.log(`Removing level ${n} with key error (${e.error})`),this.hls.removeLevel(n)}const o=e.frag;if(this.hls.levels.length<r)n.resolved=!0;else if(o&&o.type!==f){const e=o.decryptdata;e&&!t.matches(e)&&(n.resolved=!0)}}break}}n.resolved||this.switchLevel(e,r)}switchLevel(e,t){if(void 0!==t&&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===o.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&"audiovideo"!==e.sourceBufferName)){const t=Be(e.mimeType),n=this.hls.levels;for(let i=n.length;i--;)n[i][`${e.sourceBufferName}Codec`]===t&&(this.log(`Removing level ${i} for ${e.details} ("${t}" not supported)`),this.hls.removeLevel(i))}}},fpsController:class{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(l.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(l.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(l.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const e=i-this.lastTime,r=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,s=1e3*r/e,o=this.hls;if(o.trigger(l.FPS_DROP,{currentDropped:r,currentDecoded:a,totalDroppedFrames:n}),s>0&&r>o.config.fpsDroppedMonitoringThreshold*a){let e=o.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(l.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},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:Dn,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},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},{cueHandler:Oo,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Di{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",m),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(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(l.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(l.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=bi,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragContextChanged(n)||(q(n)&&(this.fragPrevious=n),this.state=bi),!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let a;const s=n.start;for(let e=0;e<r.length;e++)if(s>=r[e].start&&s<=r[e].end){a=r[e];break}const o=n.start+n.duration;a?a.end=o:(a={start:s,end:o},r.push(a)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(0===n&&i!==Number.POSITIVE_INFINITY){const e=i-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach((t=>{for(let n=0;n<t.length;)if(t[n].end<=e)t.shift();else{if(!(t[n].start<e))break;t[n].start=e,n++}})),this.fragmentTracker.removeFragmentsInRange(n,e,m)}}onError(e,t){const n=t.frag;(null==n?void 0:n.type)===m&&(t.details===o.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==yi&&(this.state=bi))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){this.levels&&ua(this.levels,t)?this.levels=t.map((e=>new Je(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Je(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,m),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,null==(n=this.levels)||!n.length||-1===this.currentTrackId)return void this.clearInterval();const i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==yi&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:a,id:s}=t;if(!r)return void this.warn(`Subtitle tracks were reset while loading level ${s}`);const o=r[s];if(s>=r.length||!o)return;this.log(`Subtitle track ${s} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(a.live||null!=(n=o.details)&&n.live){if(a.deltaUpdateFailed)return;const e=this.mainDetails;if(!e)return void(this.startFragRequested=!1);const t=e.fragments[0];var c;if(o.details)u=this.alignPlaylists(a,o.details,null==(c=this.levelLastLoaded)?void 0:c.details),0===u&&t&&(u=t.start,ii(a,u));else a.hasProgramDateTime&&e.hasProgramDateTime?(mi(a,e),u=a.fragmentStart):t&&(u=t.start,ii(a,u));e&&!this.startFragRequested&&this.setStartPosition(e,u)}if(o.details=a,this.levelLastLoaded=o,s===i&&(this.hls.trigger(l.SUBTITLE_TRACK_UPDATED,{details:a,id:s,groupId:t.groupId}),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===bi)){dt(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&null!=i&&i.key&&i.iv&&gn(i.method)){const e=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,_n(i.method)).catch((e=>{throw r.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((n=>{const i=performance.now();r.trigger(l.FRAG_DECRYPTED,{frag:t,payload:n,stats:{tstart:e,tdecrypt:i}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=bi}))}}doTick(){if(this.media){if(this.state===bi){const{currentTrackId:e,levels:t}=this,n=null==t?void 0:t[e];if(!n||!t.length||!n.details)return;if(this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),a=tn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:s,len:o}=a,l=n.details;if(o>this.hls.maxBufferLength+l.levelTargetDuration)return;const u=l.fragments,c=u.length,h=l.edge;let d=null;const f=this.fragPrevious;if(s<h){const e=i.maxFragLookUpTolerance,t=s>h-e?0:e;d=dt(f,u,Math.max(u[0].start,s),t),!d&&f&&f.start<u[0].start&&(d=u[0])}else d=u[c-1];if(d=this.filterReplacedPrimary(d,n.details),!d)return;const p=u[d.sn-l.startSN-1];if(p&&p.cc===d.cc&&this.fragmentTracker.getState(p)===Mt&&(d=p),this.fragmentTracker.getState(d)===Mt){const e=this.mapToInitFragWhenRequired(d);e&&this.loadFragment(e,n,s)}}}else this.state=bi}loadFragment(e,t,n){q(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Us(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends la{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const t=ws(this.media.textTracks);for(let n=0;n<t.length;n++)if("hidden"===t[n].mode)e=t[n];else if("showing"===t[n].mode){e=t[n];break}const n=this.findTrackForTextTrack(e);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(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(l.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;ws(n.textTracks).forEach((e=>{xs(e)}))}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==i)return void this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${null==a?void 0:a.groupId}`);const s=a.details;a.details=t.details,this.log(`Subtitle track ${n} "${a.name}" lang:${a.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,s)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(null==i?void 0:i.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==i?void 0:i.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.subtitlePreference;if(!r&&t){this.selectDefaultTrack=!1;const n=st(t,e);if(n>-1)r=e[n];else{const e=st(t,this.tracks);r=this.tracks[e]}}let i=this.findTrackId(r);-1===i&&r&&(i=this.findTrackId(null));const a={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(l.SUBTITLE_TRACKS_UPDATED,a),-1!==i&&-1===this.trackId&&this.setSubtitleTrack(i)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if((!n||r.default)&&(n||e)&&(!e||ot(r,e)))return i}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 n=0;n<t.length;n++){if(ha(t[n],e))return n}}return-1}onError(e,t){!t.fatal&&t.context&&(t.context.type!==d||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||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(-1===e.id)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&ot(e,n))return n;const i=st(e,this.tracksInGroup);if(i>-1){const e=this.tracksInGroup[i];return this.setSubtitleTrack(i),e}if(n)return null;{const n=st(e,t);if(n>-1)return t[n]}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),a=e.details,s=null==a?void 0:a.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${s&&a.live?" age "+s.toFixed(1)+(a.type?" "+a.type||0:""):""} ${r}`),this.hls.trigger(l.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ws(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter((e=>ha(n,e)))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach((e=>{"disabled"!==e.mode&&e!==i&&(e.mode="disabled")})),i){const e=this.subtitleDisplay?"showing":"hidden";i.mode!==e&&(i.mode=e)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(e<-1||e>=t.length||!i(e))return void this.warn(`Invalid subtitle track id: ${e}`);this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r)return void this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:e});const a=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&a)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:o="",name:u,type:c,url:h}=r;this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:u,type:c,url:h});const d=this.switchParams(r.url,null==n?void 0:n.details,r.details);this.loadPlaylist(d)}},timelineController:class{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={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},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(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this),e.on(l.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(l.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this),e.off(l.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(l.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Do(this,"textTrack1"),t=new Do(this,"textTrack2"),n=new Do(this,"textTrack3"),i=new Do(this,"textTrack4");this.cea608Parser1=new no(1,e,t),this.cea608Parser2=new no(3,n,i)}addCues(e,t,n,i,r){let a=!1;for(let e=r.length;e--;){const i=r[e],l=(s=i[0],o=i[1],u=t,c=n,Math.min(o,c)-Math.max(s,u));if(l>=0&&(i[0]=Math.min(i[0],t),i[1]=Math.max(i[1],n),a=!0,l/(n-t)>.5))return}var s,o,u,c;if(a||r.push([t,n]),this.config.renderTextTracksNatively){const r=this.captionsTracks[e];this.Cues.newCue(r,t,n,i)}else{const r=this.Cues.newCue(null,t,n,i);this.hls.trigger(l.CUES_PARSED,{type:"captions",cues:r,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:a}){const{unparsedVttFrags:s}=this;n===f&&(this.initPTS[t.cc]={baseTime:i,timescale:r,trackId:a}),s.length&&(this.unparsedVttFrags=[],s.forEach((e=>{this.initPTS[e.frag.cc]?this.onFragLoaded(l.FRAG_LOADED,e):this.hls.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e.frag,error:new Error("Subtitle discontinuity domain does not match main")})})))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Mo(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:a}=t[e],s=this.getExistingTrack(r,a);if(s)n[e]=s,xs(n[e]),ys(n[e],i);else{const t=this.createTextTrack("captions",r,a);t&&(t[e]=!0,n[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach((e=>{xs(i[e]),delete i[e]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},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 e=0;e<t.length;e++)xs(t[e])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some((e=>e.textCodec===bo));if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(ua(this.tracks,n))return void(this.tracks=n);if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const e=this.media,t=e?ws(e.textTracks):null;if(this.tracks.forEach(((e,n)=>{let i;if(t){let n=null;for(let i=0;i<t.length;i++)if(t[i]&&Mo(t[i],e)){n=t[i],t[i]=null;break}n&&(i=n)}if(i)xs(i);else{const t=ko(e);i=this.createTextTrack(t,e.name,e.lang),i&&(i.mode="disabled")}i&&this.textTracks.push(i)})),null!=t&&t.length){const e=t.filter((e=>null!==e)).map((e=>e.label));e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const n=`textTrack${t[1]}`,i=this.captionsProperties[n];i&&(i.label=e.name,e.lang&&(i.languageCode=e.lang),i.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===f){var n,i;const{cea608Parser1:e,cea608Parser2:r,lastSn:a}=this,{cc:s,sn:o}=t.frag,l=null!=(n=null==(i=t.part)?void 0:i.index)?n:-1;e&&r&&(o!==a+1||o===a&&l!==this.lastPartIndex+1||s!==this.lastCc)&&(e.reset(),r.reset()),this.lastCc=s,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===m)if(i.byteLength){const e=n.decryptdata,r="stats"in t;if(null==e||!e.encrypted||r){const e=this.tracks[n.level],r=this.vttCCs;r[n.cc]||(r[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===bo?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;To(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),n.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{n.logger.log(`Failed to parse IMSC1: ${t}`),n.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:a}=this,s=r.length-1;if(!r[n.cc]&&-1===s)return void a.push(e);const o=this.hls;yo(null!=(t=n.initSegment)&&t.data?me(n.initSegment.data,new Uint8Array(i)).buffer:i,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,(e=>{this._appendCues(e,n.level),o.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})}),(t=>{const r="Missing initPTS for VTT MPEGTS"===t.message;r?a.push(e):this._fallbackToIMSC1(n,i),o.logger.log(`Failed to parse VTT cue: ${t}`),r&&s>n.cc||o.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})}))}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||To(t,this.initPTS[e.cc],(()=>{n.textCodec=bo,this._parseIMSC1(e,t)}),(()=>{n.textCodec="wvtt"}))}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach((e=>bs(n,e)))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(l.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===m&&this.onFragLoaded(l.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(n.type!==f||"NONE"!==this.closedCaptionsForLevel(n))for(let e=0;e<i.length;e++){const t=i[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();const n=this.extractCea608Data(t);this.cea608Parser1.addData(i[e].pts,n[0]),this.cea608Parser2.addData(i[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:a}=this;if(a&&!(a.currentTime<n)){if(!r||"video"===r){const{captionsTracks:e}=this;Object.keys(e).forEach((i=>Es(e[i],t,n)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==i){const{textTracks:e}=this;Object.keys(e).forEach((n=>Es(e[n],t,i)))}}}extractCea608Data(e){const t=[[],[]],n=31&e[0];let i=2;for(let r=0;r<n;r++){const n=e[i++],r=127&e[i++],a=127&e[i++];if(0===r&&0===a)continue;if(0!=(4&n)){const e=3&n;0!==e&&1!==e||(t[e].push(r),t[e].push(a))}}return t}},audioStreamController:class extends Di{constructor(e,t,n){super(e,t,n,"audio-stream-controller",p),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(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(l.BUFFER_RESET,this.onBufferReset,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(l.BUFFER_RESET,this.onBufferReset,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:a}){if(n===f){const e=t.cc,n=this.fragCurrent;if(this.initPTS[e]={baseTime:i,timescale:r,trackId:a},this.log(`InitPTS for cc: ${e} found from main: ${i/r} (${i}/${r}) trackId: ${a}`),this.mainAnchor=t,this.state===Ri){const n=this.waitingData;(!n&&!this.loadingParts||n&&n.frag.cc!==e)&&this.syncWithAnchor(t,null==n?void 0:n.frag)}else!this.hls.hasEnoughToStart&&n&&n.cc!==e?(n.abortRequests(),this.syncWithAnchor(t,n)):this.state===bi&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const i=(null==(n=this.mainFragLoading)?void 0:n.frag)||null;if(t&&(null==i?void 0:i.cc)===t.cc)return;const r=(i||e).cc,a=mt(this.getLevelDetails(),r,this.getLoadPosition());a&&(this.log(`Syncing with main frag at ${a.start} cc ${a.cc}`),this.startFragRequested=!1,this.nextLoadPosition=a.start,this.resetLoadingState(),this.state===bi&&this.doTickIdle())}startLoad(e,t){if(!this.levels)return this.startPosition=e,void(this.state=yi);const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=bi):this.state=Ti,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case bi:this.doTickIdle();break;case Ti:{const{levels:e,trackId:t}=this,n=null==e?void 0:e[t],i=null==n?void 0:n.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=Ri}break}case wi:this.checkRetryDate();break;case Ri:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:i,complete:r}=e,a=this.mainAnchor;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.state=Ei;const e={frag:t,part:n,payload:i.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(e),r&&super._handleFragmentLoadComplete(e)}else a&&a.cc!==e.frag.cc&&this.syncWithAnchor(a,e.frag)}else this.state=bi}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,a=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||null==n||!n[r])return;const s=n[r],o=s.details;if(!o||this.waitForLive(s)||this.waitForCdnTuneIn(o))return this.state=Ti,void(this.startFragRequested=!1);const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,V,p));const c=this.getFwdBufferInfo(u,p);if(null===c)return;if(!this.switchingTrack&&this._streamEnded(c,o))return t.trigger(l.BUFFER_EOS,{type:"audio"}),void(this.state=Ci);const h=c.len,d=t.maxBufferLength,m=o.fragments,g=m[0].start,_=this.getLoadPosition(),v=this.flushing?_:c.end;if(this.switchingTrack&&i){const e=_;o.PTSKnown&&e<g&&(c.end>g||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=g+.05)}if(h>=d&&!this.switchingTrack&&v<m[m.length-1].start)return;let y=this.getNextFragment(v,o);if(y&&this.isLoopLoading(y,v)&&(y=this.getNextFragmentLoopLoading(y,o,c,f,d)),!y)return void(this.bufferFlushed=!0);let b=(null==(e=this.mainFragLoading)?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&b&&q(y)&&!y.endList&&(!o.live||!this.loadingParts&&v<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(b)===Nt&&(this.mainFragLoading=b=null),b&&q(b))){if(y.start>b.end){const e=this.fragmentTracker.getFragAtPos(v,f);e&&e.end>b.end&&(b=e,this.mainFragLoading={frag:e,targetBufferTime:null})}if(y.start>b.end)return}this.loadFragment(y,s,v)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new Je(e)))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==yi&&(this.setInterval(100),this.state=bi,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(l.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:a,groupId:s,track:o}=t;if(!i)return void this.warn(`Audio tracks reset while loading track ${a} "${o.name}" of "${s}"`);const u=this.mainDetails;if(!u||r.endCC>u.endCC||u.expired)return this.cachedTrackLoadedData=t,void(this.state!==yi&&(this.state=Ti));this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${o.name}" of "${s}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const c=i[a];let h=0;if(r.live||null!=(n=c.details)&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;var d;if(c.details)h=this.alignPlaylists(r,c.details,null==(d=this.levelLastLoaded)?void 0:d.details);r.alignedSliding||(pi(r,u),r.alignedSliding||mi(r,u),h=r.fragmentStart)}c.details=r,this.levelLastLoaded=c,this.startFragRequested||this.setStartPosition(u,h),this.hls.trigger(l.AUDIO_TRACK_UPDATED,{details:r,id:a,groupId:t.groupId}),this.state!==Ti||this.waitForCdnTuneIn(r)||(this.state=bi),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:a,trackId:s,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const l=o[s];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const u=l.details;if(!u)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);const c=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let h=this.transmuxer;h||(h=this.transmuxer=new oa(this.hls,p,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const d=this.initPTS[n.cc],f=null==(t=n.initSegment)?void 0:t.data;if(void 0!==d){const e=!1,t=i?i.index:-1,a=-1!==t,s=new Jt(n.level,n.sn,n.stats.chunkCount,r.byteLength,t,a);h.push(r,f,c,"",n,i,u.totalduration,e,s,d)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${u.startSN} ,${u.endSN}],track ${s}`);const{cache:e}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Mi,complete:!1};e.push(new Uint8Array(r)),this.state!==yi&&(this.state=Ri)}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===f&&q(t.frag)&&(this.mainFragLoading=t,this.state===bi&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type===p)if(this.fragContextChanged(n))this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(q(n)){this.fragPrevious=n;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(l.AUDIO_TRACK_SWITCHED,x({},e)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}else this.audioOnly||n.type!==f||n.elementaryStreams.video||n.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(e,t){var n;if(t.fatal)this.state=Li;else switch(t.details){case o.FRAG_GAP:case o.FRAG_PARSING_ERROR:case o.FRAG_DECRYPT_ERROR:case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p,t);break;case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Ti||(null==(n=t.context)?void 0:n.type)!==h||(this.state=bi);break;case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case o.BUFFER_FULL_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case o.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushing(e,{type:t}){t!==W&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==W){this.flushing=!1,this.bufferFlushed=!0,this.state===Ci&&(this.state=bi);const e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,p),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:a}=e,s=this.getCurrentContext(a);if(!s)return void this.resetWhenMissingContext(a);const{frag:o,part:u,level:c}=s,{details:h}=c,{audio:d,text:f,id3:p,initSegment:m}=r;if(!this.fragContextChanged(o)&&h){if(this.state=Si,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=m&&m.tracks){const e=o.initSegment||o;if(this.unhandledEncryptionError(m,o))return;this._bufferInitSegment(c,m.tracks,e,a),i.trigger(l.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:m.tracks})}if(d){const{startPTS:e,endPTS:t,startDTS:n,endDTS:i}=d;u&&(u.elementaryStreams[V]={startPTS:e,endPTS:t,startDTS:n,endDTS:i}),o.setElementaryStreamInfo(V,e,t,n,i),this.bufferFragmentData(d,o,u,a)}if(null!=p&&null!=(t=p.samples)&&t.length){const e=y({id:n,frag:o,details:h},p);i.trigger(l.FRAG_PARSING_METADATA,e)}if(f){const e=y({id:n,frag:o,details:h},f);i.trigger(l.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,n,i){if(this.state!==Si)return;if(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio)return;const r=t.audio;r.id=p;const a=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${a}/${r.codec}]`),a&&1===a.split(",").length&&(r.levelCodec=a),this.hls.trigger(l.BUFFER_CODECS,t);const s=r.initSegment;if(null!=s&&s.byteLength){const e={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:s};this.hls.trigger(l.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);var r;if(this.switchingTrack||i===Mt||i===Ot)if(q(e))if(null!=(r=t.details)&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=Ri;const n=this.mainDetails;n&&n.fragmentStart!==t.details.fragmentStart&&mi(t.details,n)}else super.loadFragment(e,t,n);else this._loadInitSegment(e,t);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:a,channels:s}=this.bufferedTrack;ot({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:a,channels:s},e,lt)||(ct(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(l.AUDIO_TRACK_SWITCHED,x({},e))}},audioTrackController:class extends la{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(l.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==i)return void this.warn(`Audio track with id:${n} and group:${i} not found in active group ${null==a?void 0:a.groupId}`);const s=a.details;a.details=t.details,this.log(`Audio track ${n} "${a.name}" lang:${a.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,s)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(null==i?void 0:i.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==i?void 0:i.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.audioPreference;if(!r&&t){const n=st(t,e,lt);if(n>-1)r=e[n];else{const e=st(t,this.tracks);r=this.tracks[e]}}let i=this.findTrackId(r);-1===i&&r&&(i=this.findTrackId(null));const u={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(l.AUDIO_TRACKS_UPDATED,u);const c=this.trackId;if(-1!==i&&-1===c)this.setAudioTrack(i);else if(e.length&&-1===c){var a;const t=new Error(`No audio track selected for current audio group-ID(s): ${null==(a=this.groupIds)?void 0:a.join(",")} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}}onError(e,t){!t.fatal&&t.context&&(t.context.type!==h||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&ot(e,i,lt))return i;const r=st(e,this.tracksInGroup,lt);if(r>-1){const e=this.tracksInGroup[r];return this.setAudioTrack(r),e}if(i){let i=t.loadLevel;-1===i&&(i=t.firstAutoLevel);const r=function(e,t,n,i,r){const a=t[i],s=t.reduce(((e,t,n)=>{const i=t.uri;return(e[i]||(e[i]=[])).push(n),e}),{})[a.uri];s.length>1&&(i=Math.max.apply(Math,s));const o=a.videoRange,l=a.frameRate,u=a.codecSet.substring(0,4),c=ut(t,i,(t=>{if(t.videoRange!==o||t.frameRate!==l||t.codecSet.substring(0,4)!==u)return!1;const i=t.audioGroups,a=n.filter((e=>!i||-1!==i.indexOf(e.groupId)));return st(e,a,r)>-1}));return c>-1?c:ut(t,i,(t=>{const i=t.audioGroups,a=n.filter((e=>!i||-1!==i.indexOf(e.groupId)));return st(e,a,r)>-1}))}(e,t.levels,n,i,lt);if(-1===r)return null;t.nextLoadLevel=r}if(e.channels||e.audioCodec){const t=st(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn(`Invalid audio track id: ${e}`);this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;if(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(l.AUDIO_TRACK_SWITCHING,x({},i)),r)return;const a=this.switchParams(i.url,null==n?void 0:n.details,i.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if((!this.selectDefaultTrack||i.default)&&(!e||ot(e,i,lt)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:a,audioCodec:s,channels:o}=e;for(let e=0;e<t.length;e++){if(ot({name:n,lang:i,assocLang:r,characteristics:a,audioCodec:s,channels:o},t[e],lt))return 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}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&ct(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),a=e.details,s=null==a?void 0:a.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${s&&a.live?" age "+s.toFixed(1)+(a.type?" "+a.type||0:""):""} ${r}`),this.hls.trigger(l.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}},emeController:ps,cmcdController:class{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=e=>{try{this.apply(e,{ot:ya.MANIFEST,su:!this.initialized})}catch(e){this.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const{frag:t,part:n}=e,i=this.hls.levels[t.level],r=this.getObjectType(t),a={d:1e3*(n||t).duration,ot:r};r!==ya.VIDEO&&r!==ya.AUDIO&&r!=ya.MUXED||(a.br=i.bitrate/1e3,a.tb=this.getTopBandwidth(r)/1e3,a.bl=this.getBufferLength(r));const s=n?this.getNextPart(n):this.getNextFrag(t);null!=s&&s.url&&s.url!==t.url&&(a.nor=s.url),this.apply(e,a)}catch(e){this.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;null!=n&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHED,this.onMediaDetached,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHED,this.onMediaDetached,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(i=t.tracks.video)?void 0:i.buffer}createData(){var e;return{v:1,sf:ba.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){y(t,this.createData());const n=t.ot===ya.INIT||t.ot===ya.VIDEO||t.ot===ya.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce(((e,n)=>(i.includes(n)&&(e[n]=t[n]),e)),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ls(e.headers,t,r)):e.url=hs(e.url,t,r)}getNextFrag(e){var t;const n=null==(t=this.hls.levels[e.level])?void 0:t.details;if(n){const t=e.sn-n.startSN;return n.fragments[t+1]}}getNextPart(e){var t;const{index:n,fragment:i}=e,r=null==(t=this.hls.levels[i.level])||null==(t=t.details)?void 0:t.partList;if(r){const{sn:e}=i;for(let t=r.length-1;t>=0;t--){const i=r[t];if(i.index===n&&i.fragment.sn===e)return r[t+1]}}}getObjectType(e){const{type:t}=e;return"subtitle"===t?ya.TIMED_TEXT:"initSegment"===e.sn?ya.INIT:"audio"===t?ya.AUDIO:"main"===t?this.hls.audioTracks.length?ya.VIDEO:ya.MUXED:void 0}getTopBandwidth(e){let t,n=0;const i=this.hls;if(e===ya.AUDIO)t=i.audioTracks;else{const e=i.maxAutoLevel,n=e>-1?e+1:i.levels.length;t=i.levels.slice(0,n)}return t.forEach((e=>{e.bitrate>n&&(n=e.bitrate)})),n>0?n:NaN}getBufferLength(e){const t=this.media,n=e===ya.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!t)return NaN;return 1e3*tn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,i){t(e),this.loader.load(e,n,i)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,i){t(e),this.loader.load(e,n,i)}}}},contentSteeringController:class extends E{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(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&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=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(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((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((null==n?void 0:n.action)===St&&n.flags===Rt){const e=this.levels;let i=this._pathwayPriority,r=this.pathwayId;if(t.context){const{groupId:n,pathwayId:i,type:a}=t.context;n&&e?r=this.getPathwayForGroupId(n,a,r):i&&(r=i)}r in this.penalizedPathways||(this.penalizedPathways[r]=performance.now()),!i&&e&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==r),t.details!==o.BUFFER_APPEND_ERROR||t.fatal?n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${r} levels: ${e?e.length:e} priorities: ${nt(i)} penalized: ${nt(this.penalizedPathways)}`):n.resolved=!0}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this._pathwayPriority=e;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach((e=>{i-n[e]>3e5&&delete n[e]}));for(let i=0;i<e.length;i++){const r=e[i];if(r in n)continue;if(r===this.pathwayId)return;const a=this.hls.nextLoadLevel,s=this.hls.levels[a];if(t=this.getLevelsForPathway(r),t.length>0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,li(t),this.hls.trigger(l.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[a];s&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==s.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==s.bitrate&&this.log(`Unstable Pathways change from bitrate ${s.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let n=0;n<i.length;n++)if(t===h&&i[n].hasAudioGroup(e)||t===d&&i[n].hasSubtitleGroup(e))return i[n].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach((e=>{const{ID:r,"BASE-ID":a,"URI-REPLACEMENT":s}=e;if(t.some((e=>e.pathwayId===r)))return;const o=this.getLevelsForPathway(a).map((e=>{const t=new cn(e.attrs);t["PATHWAY-ID"]=r;const a=t.AUDIO&&`${t.AUDIO}_clone_${r}`,o=t.SUBTITLES&&`${t.SUBTITLES}_clone_${r}`;a&&(n[t.AUDIO]=a,t.AUDIO=a),o&&(i[t.SUBTITLES]=o,t.SUBTITLES=o);const l=fs(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",s),u=new Je({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:l,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let t=1;t<e.audioGroups.length;t++)u.addGroupId("audio",`${e.audioGroups[t]}_clone_${r}`);if(e.subtitleGroups)for(let t=1;t<e.subtitleGroups.length;t++)u.addGroupId("text",`${e.subtitleGroups[t]}_clone_${r}`);return u}));t.push(...o),ds(this.audioTracks,n,s,r),ds(this.subtitleTracks,i,s,r)}))}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;let i;this.loader&&this.loader.destroy(),this.loader=new n(t);try{i=new self.URL(e)}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==i.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+e)}const r={responseType:"json",url:i.href},a=t.steeringManifestLoadPolicy.default,s=a.errorRetry||a.timeoutRetry||{},o={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},u={onSuccess:(e,t,n,r)=>{this.log(`Loaded steering manifest: "${i}"`);const a=e.data;if(1!==(null==a?void 0:a.VERSION))return void this.log(`Steering VERSION ${a.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=a.TTL;const{"RELOAD-URI":s,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":u}=a;if(s)try{this.uri=new self.URL(s,i).href}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${s}`)}this.scheduleRefresh(this.uri||n.url),o&&this.clonePathways(o);const c={steeringManifest:a,url:i.toString()};this.hls.trigger(l.STEERING_MANIFEST_LOADED,c),u&&this.updatePathwayPriority(u)},onError:(e,t,n,i)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let r=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,r);else{const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(r=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,o,u)}scheduleRefresh(e,t=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var t;const n=null==(t=this.hls)?void 0:t.media;!n||n.ended?this.scheduleRefresh(e,1e3*this.timeToLoad):this.loadSteeringManifest(e)}),t)}},interstitialsController:class extends E{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 e=this.currentTime;if(void 0===e||this.playbackDisabled||!this.schedule)return;const t=e-this.timelinePos;if(Math.abs(t)<1/7056e5)return;const n=t<=-.01;this.timelinePos=e,this.bufferedPos=e;const i=this.playingItem;if(!i)return void this.checkBuffer();if(n){this.schedule.resetErrorsInRange(e,e-t)&&this.updateSchedule(!0)}if(this.checkBuffer(),n&&e<i.start||e>=i.end){var r;const t=this.findItemIndex(i);let a=this.schedule.findItemIndexAtTime(e);if(-1===a&&(a=t+(n?-1:1),this.log(`seeked ${n?"back ":""}to position not covered by schedule ${e} (resolving from ${t} to ${a})`)),!this.isInterstitial(i)&&null!=(r=this.media)&&r.paused&&(this.shouldPlay=!1),!n&&a>t){const e=this.schedule.findJumpRestrictedIndex(t+1,a);if(e>t)return void this.setSchedulePosition(e)}return void this.setSchedulePosition(a)}const a=this.playingAsset;if(!a){if(this.playingLastItem&&this.isInterstitial(i)){const t=i.event.assetList[0];t&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(e,t))}return}const s=a.timelineStart,o=a.duration||0;var l;(n&&e<s||e>=s+o)&&(null!=(l=i.event)&&l.appendInPlace&&(this.clearInterstitial(i.event,i),this.flushFrontBuffer(e)),this.setScheduleToAssetAtTime(e,a))},this.onTimeupdate=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled)return;if(!(e>this.timelinePos))return;this.timelinePos=e,e>this.bufferedPos&&this.checkBuffer();const t=this.playingItem;if(!t||this.playingLastItem)return;if(e>=t.end){this.timelinePos=t.end;const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}const n=this.playingAsset;if(!n)return;e>=n.timelineStart+(n.duration||0)&&this.setScheduleToAssetAtTime(e,n)},this.onScheduleUpdate=(e,t)=>{const n=this.schedule;if(!n)return;const i=this.playingItem,r=n.events||[],a=n.items||[],s=n.durations,o=e.map((e=>e.identifier)),u=!(!r.length&&!o.length);(u||t)&&this.log(`INTERSTITIALS_UPDATED (${r.length}): ${r}\nSchedule: ${a.map((e=>Os(e)))} pos: ${this.timelinePos}`),o.length&&this.log(`Removed events ${o}`);let c=null,h=null;i&&(c=this.updateItem(i,this.timelinePos),this.itemsMatch(i,c)?this.playingItem=c:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const d=this.bufferingItem;if(d&&(h=this.updateItem(d,this.bufferedPos),this.itemsMatch(d,h)?this.bufferingItem=h:d.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(d.event,null))),e.forEach((e=>{e.assetList.forEach((e=>{this.clearAssetPlayer(e.identifier,null)}))})),this.playerQueue.forEach((e=>{if(e.interstitial.appendInPlace){const t=e.assetItem.timelineStart,n=e.timelineOffset-t;if(n)try{e.timelineOffset=t}catch(i){Math.abs(n)>Ss&&this.warn(`${i} ("${e.assetId}" ${e.timelineOffset}->${t})`)}}})),u||t){if(this.hls.trigger(l.INTERSTITIALS_UPDATED,{events:r.slice(0),schedule:a.slice(0),durations:s,removedIds:o}),this.isInterstitial(i)&&o.includes(i.event.identifier))return this.warn(`Interstitial "${i.event.identifier}" removed while playing`),void this.primaryFallback(i.event);i&&this.trimInPlace(c,i),d&&h!==c&&this.trimInPlace(h,d),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Ns(e),this.schedule=new Ps(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(l.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(l.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(l.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(l.MEDIA_ENDED,this.onMediaEnded,this),e.on(l.ERROR,this.onError,this),e.on(l.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(l.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(l.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(l.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(l.MEDIA_ENDED,this.onMediaEnded,this),e.off(l.ERROR,this.onError,this),e.off(l.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;null==(e=this.getBufferingPlayer())||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.getBufferingPlayer())||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){_i(e,"play",this.onPlay),_i(e,"pause",this.onPause),_i(e,"seeking",this.onSeeking),_i(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;gi(n,"seeking",this.onSeeking),gi(n,"timeupdate",this.onTimeupdate),gi(n,"play",this.onPlay),gi(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,null===n)this.checkStart();else if(!i){this.clearScheduleState();const e=this.findItemIndex(n);this.setSchedulePosition(e)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const e=this.getBufferingPlayer();e&&(this.log(`Removing schedule state for detachedData and ${e}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,e.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=t=>t?e.getAssetPlayer(t.identifier):t,i=(t,i,a,s,o)=>{if(t){let l=t[i].start;const u=t.event;if(u){if("playout"===i||u.timelineOccupancy!==As.Point){const e=n(a);(null==e?void 0:e.interstitial)===u&&(l+=e.assetItem.startOffset+e[o])}}else{l+=("bufferedPos"===s?r():e[s])-t.start}return l}return 0},r=()=>{const t=e.bufferedPos;return t===Number.MAX_VALUE?a("primary"):Math.max(t,0)},a=t=>{var n,i;return null!=(n=e.primaryDetails)&&n.live?e.primaryDetails.edge:(null==(i=e.schedule)?void 0:i.durations[t])||0},s=(t,r)=>{var a,s;const o=e.effectivePlayingItem;if(null!=o&&null!=(a=o.event)&&a.restrictions.skip||!e.schedule)return;e.log(`seek to ${t} "${r}"`);const l=e.effectivePlayingItem,u=e.schedule.findItemIndexAtTime(t,r),c=null==(s=e.schedule.items)?void 0:s[u],h=e.getBufferingPlayer(),d=null==h?void 0:h.interstitial,f=null==d?void 0:d.appendInPlace,p=l&&e.itemsMatch(l,c);if(l&&(f||p)){const a=n(e.playingAsset),s=(null==a?void 0:a.media)||e.primaryMedia;if(s){const n="primary"===r?s.currentTime:i(l,r,e.playingAsset,"timelinePos","currentTime"),o=t-n,u=(f?n:s.currentTime)+o;if(u>=0&&(!a||f||u<=a.duration))return void(s.currentTime=u)}}if(c){let n=t;if("primary"!==r){const e=t-c[r].start;n=c.start+e}const i=!e.isInterstitial(c);if(e.isInterstitial(l)&&!l.event.appendInPlace||!i&&!c.event.appendInPlace){if(l){const a=e.findItemIndex(l);if(u>a){const t=e.schedule.findJumpRestrictedIndex(a+1,u);if(t>a)return void e.setSchedulePosition(t)}let s=0;if(i)e.timelinePos=n,e.checkBuffer();else{const e=c.event.assetList,n=t-(c[r]||c).start;for(let t=e.length;t--;){const i=e[t];if(i.duration&&n>=i.startOffset&&n<i.startOffset+i.duration){s=t;break}}}e.setSchedulePosition(u,s)}}else{const t=e.media||(f?null==h?void 0:h.media:null);t&&(t.currentTime=n)}}},o=()=>{const n=e.effectivePlayingItem;if(e.isInterstitial(n))return n;const i=t();return e.isInterstitial(i)?i:null},l={get bufferedEnd(){const n=t(),r=e.bufferingItem;var a;return r&&r===n&&(i(r,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-r.playout.start||(null==(a=e.bufferingAsset)?void 0:a.startOffset))||0},get currentTime(){const t=o(),n=e.effectivePlayingItem;return n&&n===t?i(n,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-n.playout.start:0},set currentTime(t){const n=o(),i=e.effectivePlayingItem;i&&i===n&&s(t+i.playout.start,"playout")},get duration(){const e=o();return e?e.playout.end-e.playout.start:0},get assetPlayers(){var t;const n=null==(t=o())?void 0:t.event.assetList;return n?n.map((t=>e.getAssetPlayer(t.identifier))):[]},get playingIndex(){var t;const n=null==(t=o())?void 0:t.event;return n&&e.effectivePlayingAsset?n.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return o()}};return this.manager={get events(){var t;return(null==(t=e.schedule)||null==(t=t.events)?void 0:t.slice(0))||[]},get schedule(){var t;return(null==(t=e.schedule)||null==(t=t.items)?void 0:t.slice(0))||[]},get interstitialPlayer(){return o()?l:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const n=t();return e.findItemIndex(n)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const t=e.effectivePlayingItem;return e.findItemIndex(t)},primary:{get bufferedEnd(){return r()},get currentTime(){const t=e.timelinePos;return t>0?t:0},set currentTime(e){s(e,"primary")},get duration(){return a("primary")},get seekableStart(){var t;return(null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(e){s(e,"integrated")},get duration(){return a("integrated")},get seekableStart(){var t;return((t,n)=>{var i;if(0!==t&&"primary"!==n&&null!=(i=e.schedule)&&i.length){var r;const i=e.schedule.findItemIndexAtTime(t),a=null==(r=e.schedule.items)?void 0:r[i];if(a)return t+(a[n].start-a.start)}return t})((null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0,"integrated")}},skip:()=>{const t=e.effectivePlayingItem,n=null==t?void 0:t.event;if(n&&!n.restrictions.skip){const i=e.findItemIndex(t);if(n.appendInPlace){const e=t.playout.start+t.event.duration;s(e+.001,"playout")}else e.advanceAfterAssetEnded(n,i,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=null==(e=this.schedule)?void 0:e.items;return!!(this.playbackStarted&&t&&n)&&this.findItemIndex(t)===n.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var e,t;if(null===this.mediaSelection)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let r=this.media;!r&&null!=(e=this.bufferingItem)&&null!=(e=e.event)&&e.appendInPlace&&(r=this.primaryMedia);const a=null==(t=r)?void 0:t.currentTime;return void 0!==a&&i(a)?a:void 0}get primaryMedia(){var e;return this.media||(null==(e=this.detachedData)?void 0:e.media)||null}isInterstitial(e){return!(null==e||!e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i)return void(this.detachedData={media:i});const n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${nt(n)}`),this.detachedData=n}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const a=this.hls,s=e!==a,o=s&&e.interstitial.appendInPlace,l=null==(n=this.detachedData)?void 0:n.mediaSource;let u;if(a.media)o&&(r=a.transferMedia(),this.detachedData=r),u="Primary";else if(l){const e=this.getBufferingPlayer();e?(r=e.transferMedia(),u=`${e}`):u="detached MediaSource"}else u="detached media";if(!r)if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${nt(r)}`);else if(!this.detachedData||a.media===t){const e=this.playerQueue;e.length>1&&e.forEach((e=>{if(s&&e.interstitial.appendInPlace!==o){const t=e.interstitial;this.clearInterstitial(e.interstitial,null),t.appendInPlace=!1,t.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${t}`)}})),this.hls.detachMedia(),this.detachedData={media:t}}const c=r&&"mediaSource"in r&&"closed"!==(null==(i=r.mediaSource)?void 0:i.readyState),h=c&&r?r:t;this.log(`${c?"transfering MediaSource":"attaching media"} to ${s?e:"Primary"} from ${u} (media.currentTime: ${t.currentTime})`);const d=this.schedule;if(h===r&&d){const t=s&&e.assetId===d.assetIdAtEnd;h.overrides={duration:d.duration,endOfStream:!s||t,cueRemoval:!s}}e.attachMedia(h)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=null==e?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(-1===n){const n=this.hls.startPosition;if(this.log(Bs("checkStart",n)),this.timelinePos=n,t.length&&t[0].cue.pre){const n=e.findEventIndex(t[0].identifier);this.setSchedulePosition(n)}else if(n>=0||!this.primaryLive){const t=this.timelinePos=n>0?n:0,i=e.findItemIndexAtTime(t);this.setSchedulePosition(i)}}else if(i&&!this.playingItem){const t=e.findItemIndex(i);this.setSchedulePosition(t)}}advanceAssetBuffering(e,t){const n=e.event,i=n.findAssetIndex(t),r=Ds(n,i);if(n.isAssetPastPlayoutLimit(r)){if(this.schedule){var a;const t=null==(a=this.schedule.items)?void 0:a[this.findItemIndex(e)+1];t&&this.bufferedToItem(t)}}else this.bufferedToEvent(e,r)}advanceAfterAssetEnded(e,t,n){const i=Ds(e,n);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const n=this.schedule.items;if(n){const i=t+1;if(i>=n.length)return void this.setSchedulePosition(-1);const r=e.resumeTime;this.timelinePos<r&&(this.log(Bs("advanceAfterAssetEnded",r)),this.timelinePos=r,e.appendInPlace&&this.advanceInPlace(r),this.checkBuffer(this.bufferedPos<r)),this.setSchedulePosition(i)}}}else{if(e.appendInPlace){const t=e.assetList[i];t&&this.advanceInPlace(t.timelineStart)}this.setSchedulePosition(t,i)}}setScheduleToAssetAtTime(e,t){const n=this.schedule;if(!n)return;const i=t.parentIdentifier,r=n.getEvent(i);if(r){const t=n.findEventIndex(i),a=n.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,t,a-1)}}setSchedulePosition(e,t){var n;const i=null==(n=this.schedule)?void 0:n.items;if(!i||this.playbackDisabled)return;const r=e>=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${r?Os(r):r}) pos: ${this.timelinePos}`);const a=this.waitingItem||this.playingItem,s=this.playingLastItem;if(this.isInterstitial(a)){const n=a.event,c=this.playingAsset,h=null==c?void 0:c.identifier,d=h?this.getAssetPlayer(h):null;if(d&&h&&(!this.eventItemsMatch(a,r)||void 0!==t&&h!==n.assetList[t].identifier)){var o;const t=n.findAssetIndex(c);if(this.log(`INTERSTITIAL_ASSET_ENDED ${t+1}/${n.assetList.length} ${ks(c)}`),this.endedAsset=c,this.playingAsset=null,this.hls.trigger(l.INTERSTITIAL_ASSET_ENDED,{asset:c,assetListIndex:t,event:n,schedule:i.slice(0),scheduleIndex:e,player:d}),a!==this.playingItem)return void(this.itemsMatch(a,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(n,this.findItemIndex(this.playingItem),t));this.retreiveMediaSource(h,r),!d.media||null!=(o=this.detachedData)&&o.mediaSource||d.detachMedia()}if(!this.eventItemsMatch(a,r)&&(this.endedItem=a,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${n} ${Os(a)}`),n.hasPlayed=!0,this.hls.trigger(l.INTERSTITIAL_ENDED,{event:n,schedule:i.slice(0),scheduleIndex:e}),n.cue.once)){var u;this.updateSchedule();const e=null==(u=this.schedule)?void 0:u.items;if(r&&e){const n=this.findItemIndex(r);this.advanceSchedule(n,e,t,a,s)}return}}this.advanceSchedule(e,i,t,a,s)}advanceSchedule(e,t,n,i,r){const a=this.schedule;if(!a)return;const s=t[e]||null,o=this.primaryMedia,u=this.playerQueue;if(u.length&&u.forEach((t=>{const n=t.interstitial,i=a.findEventIndex(n.identifier);(i<e||i>e+1)&&this.clearInterstitial(n,s)})),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const r=s.event;if(void 0===n){const t=Ds(r,(n=a.findAssetIndex(r,this.timelinePos))-1);if(r.isAssetPastPlayoutLimit(t)||r.appendInPlace&&this.timelinePos===s.end)return void this.advanceAfterAssetEnded(r,e,n);n=t}const u=this.waitingItem;this.assetsBuffered(s,o)||this.setBufferingItem(s);let c=this.preloadAssets(r,n);if(this.eventItemsMatch(s,u||i)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${Os(s)} ${r.appendInPlace?"append in place":""}`),this.hls.trigger(l.INTERSTITIAL_STARTED,{event:r,schedule:t.slice(0),scheduleIndex:e})),!r.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${r}`);if(r.assetListLoader&&(r.assetListLoader.destroy(),r.assetListLoader=void 0),!o)return void this.log(`Waiting for attachMedia to start Interstitial ${r}`);this.waitingItem=this.endedItem=null,this.playingItem=s;const h=r.assetList[n];if(!h)return void this.advanceAfterAssetEnded(r,e,n||0);if(c||(c=this.getAssetPlayer(h.identifier)),null===c||c.destroyed){const e=r.assetList.length;this.warn(`asset ${n+1}/${e} player destroyed ${r}`),c=this.createAssetPlayer(r,h,n),c.loadSource()}if(!this.eventItemsMatch(s,this.bufferingItem)&&r.appendInPlace&&this.isAssetBuffered(h))return;this.startAssetPlayer(c,n,t,e,o),this.shouldPlay&&Fs(c.media)}else s?(this.resumePrimary(s,e,i),this.shouldPlay&&Fs(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(a.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var e;return null==(e=this.mediaSelection)?void 0:e.main.details}get primaryLive(){var e;return!(null==(e=this.primaryDetails)||!e.live)}resumePrimary(e,t,n){var i,r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Os(e)}`),null==(i=this.detachedData)||!i.mediaSource){let n=this.timelinePos;(n<e.start||n>=e.end)&&(n=this.getPrimaryResumption(e,t),this.log(Bs("resumePrimary",n)),this.timelinePos=n),this.attachPrimary(n,e)}if(!n)return;const a=null==(r=this.schedule)?void 0:r.items;a&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Os(e)}`),this.hls.trigger(l.INTERSTITIALS_PRIMARY_RESUMED,{schedule:a.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const e=this.primaryDetails;if(0===t)return this.hls.startPosition;if(e&&(n<e.fragmentStart||n>e.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);if(null!=t&&t.hls)return t.hls.bufferedToEnd;return tn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.log(Bs("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs(((null==(n=i.mainForwardBufferInfo)?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),null==(e=this.schedule)||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(l.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(l.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(-1===t.level||!this.schedule)return;const n=this.hls.levels[t.level];if(!n.details)return;const i=x(x({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i)return void(this.altSelection=x(x({},this.altSelection),{},{audio:n}));const r=x(x({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i)return void(this.altSelection=x(x({},this.altSelection),{},{subtitles:n}));const r=x(x({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=at(t);this.playerQueue.forEach((({hls:e})=>e&&(e.setAudioOption(t)||e.setAudioOption(n))))}onSubtitleTrackSwitch(e,t){const n=at(t);this.playerQueue.forEach((({hls:e})=>e&&(e.setSubtitleOption(t)||-1!==t.id&&e.setSubtitleOption(n))))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const e=this.timelinePos;this.bufferedPos=e,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let e=0;e<t.length;e++){const i=t[e];if(i.cue.post){var n;const e=this.schedule.findEventIndex(i.identifier),t=null==(n=this.schedule.items)?void 0:n[e];this.isInterstitial(t)&&this.eventItemsMatch(t,this.bufferingItem)&&this.bufferedToItem(t,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}else this.shouldPlay=!1}updateItem(e,t){var n;const i=null==(n=this.schedule)?void 0:n.items;if(e&&i){return i[this.findItemIndex(e,t)]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach(((t,n)=>{e.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(t.identifier,null)}));const n=e.end+.25,i=tn.bufferInfo(this.primaryMedia,n,0);if(i.end>n||(i.nextStart||0)>n){this.log(`trim buffered interstitial ${Os(e)} (was ${Os(t)})`);const i=!0;this.attachPrimary(n,null,i),this.flushFrontBuffer(n)}}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===(null==(n=t.event)?void 0:n.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const n=this.mediaSelection;n&&(null==(t=this.schedule)||t.updateSchedule(n,[],e))}checkBuffer(e){var t;const n=null==(t=this.schedule)?void 0:t.items;if(!n)return;const i=tn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,n,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(1===t.length&&this.itemsMatch(t[0],r))return void(this.bufferedPos=e);const a=this.playingItem,s=this.findItemIndex(a);let o=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var l;const n=this.findItemIndex(r),i=Math.min(n+1,t.length-1),a=t[i];if((-1===o&&r&&e>=r.end||null!=(l=a.event)&&l.appendInPlace&&e+.01>=a.start)&&(o=i),this.isInterstitial(r)){const e=r.event;if(i-s>1&&!1===e.appendInPlace)return;if(0===e.assetList.length&&e.assetListLoader)return}if(this.bufferedPos=e,o>n&&o>s)this.bufferedToItem(a);else{const t=this.primaryDetails;this.primaryLive&&t&&e>t.edge-t.targetduration&&a.start<t.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(a)&&this.preloadAssets(a.event,0)}}else n&&a&&!this.itemsMatch(a,r)&&(o===s?this.bufferedToItem(a):o===s+1&&this.bufferedToItem(t[o]))}assetsBuffered(e,t){return 0!==e.event.assetList.length&&!e.event.assetList.some((e=>{const n=this.getAssetPlayer(e.identifier);return!(null!=n&&n.bufferedInPlaceToEnd(t))}))}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(e,t)&&n){const{items:i,events:r}=n;if(!i||!r)return t;const a=this.isInterstitial(e),s=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const o=s?s.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Os(e)}`+(t?` (${o.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(a){const t=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach(((e,n)=>{const i=this.getAssetPlayer(e.identifier);i&&(n===t&&i.loadSource(),i.resumeBuffering())}))}else this.hls.resumeBuffering(),this.playerQueue.forEach((e=>e.pauseBuffering()));this.hls.trigger(l.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled)if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(null!==n){this.bufferingAsset=null;const t=this.detachedData;if(t)if(t.mediaSource){const t=!0;this.attachPrimary(e.start,e,t)}else this.preloadPrimary(e);else this.preloadPrimary(e)}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=0===n.assetList.length&&!n.assetListLoader,r=n.cue.once;if(i||!r){const e=this.preloadAssets(n,t);if(null!=e&&e.interstitial.appendInPlace){const t=this.primaryMedia;t&&this.bufferAssetPlayer(e,t)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=0===i&&!e.assetListLoader,a=e.cue.once;if(r){const r=e.timelineStart;if(e.appendInPlace){var s;const t=this.playingItem;this.isInterstitial(t)||(null==t||null==(s=t.nextEvent)?void 0:s.identifier)!==e.identifier||this.flushFrontBuffer(r+.25)}let a,o=0;if(!this.playingItem&&this.primaryLive&&(o=this.hls.startPosition,-1===o&&(o=this.hls.liveSyncPosition||0)),o&&!e.cue.pre&&!e.cue.post){const e=o-r;e>0&&(a=Math.round(1e3*e)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${a?` live-start: ${o} start-offset: ${a}`:""}`),n)return this.createAsset(e,0,0,r,e.duration,n);const l=this.assetListLoader.loadAssetList(e,a);l&&(e.assetListLoader=l)}else if(!a&&i){for(let n=t;n<i;n++){const t=e.assetList[n],i=this.getAssetPlayerQueueIndex(t.identifier);-1!==i&&!this.playerQueue[i].destroyed||t.error||this.createAssetPlayer(e,t,n)}const n=e.assetList[t];if(n){const e=this.getAssetPlayer(n.identifier);return e&&e.loadSource(),e}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`);Object.keys(t).forEach((t=>{this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:t})}))}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t)for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n];return null}createAsset(e,t,n,i,r,a){const s={parentIdentifier:e.identifier,identifier:Cs(e,a,t),duration:r,startOffset:n,timelineStart:i,uri:a};return this.createAssetPlayer(e,s,t)}createAssetPlayer(e,t,n){const i=this.hls,r=i.userConfig;let a=r.videoPreference;const u=i.loadLevelObj||i.levels[i.currentLevel];(a||u)&&(a=y({},a),u.videoCodec&&(a.videoCodec=u.videoCodec),u.videoRange&&(a.allowedVideoRanges=[u.videoRange]));const c=i.audioTracks[i.audioTrack],h=i.subtitleTracks[i.subtitleTrack];let d=0;if(this.primaryLive||e.appendInPlace){const e=this.timelinePos-t.timelineStart;if(e>1){const n=t.duration;n&&e<n&&(d=e)}}const f=t.identifier,p=x(x({},r),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:d,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:c||r.audioPreference,subtitlePreference:h||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(p.timelineOffset=t.timelineStart));const m=p.cmcd;null!=m&&m.sessionId&&m.contentId&&(p.cmcd=y({},m,{contentId:Ts(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const g=new Ms(this.HlsPlayerClass,p,e,t);this.playerQueue.push(g),e.assetList[n]=t;let _=!0;const v=i=>{if(i.live){var r;const t=new Error(`Interstitials MUST be VOD assets ${e}`),i={fatal:!0,type:s.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},a=(null==(r=this.schedule)?void 0:r.findEventIndex(e.identifier))||-1;return void this.handleAssetItemError(i,e,a,n,t.message)}const a=i.edge-i.fragmentStart,l=t.duration;(_||null===l||a>l)&&(_=!1,this.log(`Interstitial asset "${f}" duration change ${l} > ${a}`),t.duration=a,this.updateSchedule())};g.on(l.LEVEL_UPDATED,((e,{details:t})=>v(t))),g.on(l.LEVEL_PTS_UPDATED,((e,{details:t})=>v(t))),g.on(l.EVENT_CUE_ENTER,(()=>this.onInterstitialCueEnter()));const b=(e,t)=>{const n=this.getAssetPlayer(f);if(n&&t.tracks){n.off(l.BUFFER_CODECS,b),n.tracks=t.tracks;const e=this.primaryMedia;this.bufferingAsset===n.assetItem&&e&&!n.media&&this.bufferAssetPlayer(n,e)}};g.on(l.BUFFER_CODECS,b);g.on(l.BUFFERED_TO_END,(()=>{var n;const i=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${i}`),!i||!this.schedule)return;const r=this.schedule.findEventIndex(e.identifier),a=null==(n=this.schedule.items)?void 0:n[r];this.isInterstitial(a)&&this.advanceAssetBuffering(a,t)}));const E=t=>()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;this.shouldPlay=!0;const n=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,t)};return g.once(l.MEDIA_ENDED,E(n)),g.once(l.PLAYOUT_LIMIT_REACHED,E(1/0)),g.on(l.ERROR,((t,i)=>{if(!this.schedule)return;const r=this.getAssetPlayer(f);if(i.details===o.BUFFER_STALLED_ERROR)return null!=r&&r.appendInPlace?void this.handleInPlaceStall(e):(this.onTimeupdate(),void this.checkBuffer(!0));this.handleAssetItemError(i,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${i.error} ${e}`)})),g.on(l.DESTROYING,(()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;const t=new Error(`Asset player destroyed unexpectedly ${f}`),i={fatal:!0,type:s.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};this.handleAssetItemError(i,e,this.schedule.findEventIndex(e.identifier),n,t.message)})),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${ks(t)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:g}),g}clearInterstitial(e,t){e.assetList.forEach((e=>{this.clearAssetPlayer(e.identifier,t)})),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(-1!==t){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(-1!==n){const e=this.playerQueue[n];this.log(`clear ${e} toSegment: ${t?Os(t):t}`),this.transferMediaFromPlayer(e,t),this.playerQueue.splice(n,1),e.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:a,assetItem:s,assetId:o}=e,u=a.assetList.length,c=this.playingAsset;this.endedAsset=null,this.playingAsset=s,c&&c.identifier===o||(c&&(this.clearAssetPlayer(c.identifier,n[i]),delete c.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${ks(s)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_STARTED,{asset:s,assetListIndex:t,event:a,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;if(!this.schedule)return;const{interstitial:r,assetItem:a}=e,l=this.schedule.findEventIndex(r.identifier),u=null==(n=this.schedule.items)?void 0:n[l];if(!u)return;e.loadSource(),this.setBufferingItem(u),this.bufferingAsset=a;const c=this.getBufferingPlayer();if(c===e)return;const h=r.appendInPlace;if(h&&!1===(null==c?void 0:c.interstitial.appendInPlace))return;const d=(null==c?void 0:c.tracks)||(null==(i=this.detachedData)?void 0:i.tracks)||this.requiredTracks;if(h&&a!==this.playingAsset){if(!e.tracks)return void this.log(`Waiting for track info before buffering ${e}`);if(d&&!I(d,e.tracks)){const t=new Error(`Asset ${ks(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(d)}')`),n={fatal:!0,type:s.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},i=r.findAssetIndex(a);return void this.handleAssetItemError(n,r,l,i,t.message)}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,n=this.primaryMedia;if(!t||!n)return;const i=n.currentTime,r=t.findAssetIndex(e,i),a=e.assetList[r];if(a){const s=this.getAssetPlayer(a.identifier);if(s){const o=s.currentTime||i-a.timelineStart,l=s.duration-o;if(this.warn(`Stalled at ${o} of ${o+l} in ${s} ${e} (media.currentTime: ${i})`),o&&(l/n.playbackRate<.5||s.bufferedInPlaceToEnd(n))&&s.hls){const n=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,r)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,i,r){if(e.details===o.BUFFER_STALLED_ERROR)return;const a=t.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${a?ks(a):a} ${e.error}`),!this.schedule)return;const s=(null==a?void 0:a.identifier)||"",u=this.getAssetPlayerQueueIndex(s),c=this.playerQueue[u]||null,h=this.schedule.items,d=y({},e,{fatal:!1,errorAction:kt(!0),asset:a,assetListIndex:i,event:t,schedule:h,scheduleIndex:n,player:c});if(this.hls.trigger(l.INTERSTITIAL_ASSET_ERROR,d),!e.fatal)return;const f=this.playingAsset,p=this.bufferingAsset,m=new Error(r);if(a&&(this.clearAssetPlayer(s,null),a.error=m),t.assetList.some((e=>!e.error)))for(let e=i;e<t.assetList.length;e++)this.resetAssetPlayer(t.assetList[e].identifier);else t.error=m;this.updateSchedule(!0),t.error?this.primaryFallback(t):f&&f.identifier===s?this.advanceAfterAssetEnded(t,n,i):p&&p.identifier===s&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,p)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${Os(n)} error: ${e.error}`);let i=this.timelinePos;-1===i&&(i=this.hls.startPosition);const r=this.updateItem(n,i);if(this.itemsMatch(n,r)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t)),!this.schedule)return;const a=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(a)}else this.checkStart()}onAssetListLoaded(e,t){var n,i;const r=t.event,a=r.identifier,s=t.assetListResponse.ASSETS;if(null==(n=this.schedule)||!n.hasEvent(a))return;const o=r.timelineStart,l=r.duration;let u=0;s.forEach(((e,t)=>{const n=parseFloat(e.DURATION);this.createAsset(r,t,u,o+u,n,e.URI),u+=n})),r.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${l}) ${r}`);const c=this.waitingItem,h=(null==c?void 0:c.event.identifier)===a;this.updateSchedule();const d=null==(i=this.bufferingItem)?void 0:i.event;if(h){var f;const e=this.schedule.findEventIndex(a),t=null==(f=this.schedule.items)?void 0:f[e];if(t){if(!this.playingItem&&this.timelinePos>t.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==e)return r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.updateSchedule(!0),void this.primaryFallback(r)}this.setBufferingItem(t)}this.setSchedulePosition(e)}else if((null==d?void 0:d.identifier)===a){const e=r.assetList[0];if(e){const t=this.getAssetPlayer(e.identifier);if(d.appendInPlace){const e=this.primaryMedia;t&&e&&this.bufferAssetPlayer(t,e)}else t&&t.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case o.ASSET_LIST_PARSING_ERROR:case o.ASSET_LIST_LOAD_ERROR:case o.ASSET_LIST_LOAD_TIMEOUT:{const e=t.interstitial;e&&(this.updateSchedule(!0),this.primaryFallback(e));break}case o.BUFFER_STALLED_ERROR:{const e=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(e)&&e.event.appendInPlace)return void this.handleInPlaceStall(e.event);this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function Ho(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(Ho):Object.keys(e).reduce(((t,n)=>(t[n]=Ho(e[n]),t)),{}):e}function Vo(e,t){const n=e.loader;if(n!==Fo&&n!==zo)t.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1})()&&(e.loader=Fo,e.progressive=!0,e.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class Wo extends $t{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;null!=(e=this.media)&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var e;this.hls&&(this.ended=(null==(e=this.media)?void 0:e.currentTime)||1,this.hls.trigger(l.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.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(100),this.mediaSource=t.mediaSource;const n=this.media=t.media;gi(n,"playing",this.onMediaPlaying),gi(n,"waiting",this.onMediaWaiting),gi(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(_i(n,"playing",this.onMediaPlaying),_i(n,"waiting",this.onMediaWaiting),_i(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(null==(e=this.media)||!e.readyState||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,i;const r=null==(n=this.hls)?void 0:n.config;if(!r)return;const a=this.media;if(!a)return;const{seeking:s}=a,o=this.seeking&&!s,u=!this.seeking&&s,c=a.paused&&!s||a.ended||0===a.playbackRate;if(this.seeking=s,e!==t)return t&&(this.ended=0),this.moved=!0,s||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!c&&e>t&&this.nudgeOnVideoHole(e,t)),void(0===this.waiting&&this.stallResolved(e));if(u||o)return void(o&&this.stallResolved(e));if(c)return this.nudgeRetry=0,this.stallResolved(e),void(!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(l.MEDIA_ENDED,{stalled:!1})));if(!tn.getBuffered(a).length)return void(this.nudgeRetry=0);const h=tn.bufferInfo(a,e,0),d=h.nextStart||0,f=this.fragmentTracker;if(s&&f&&this.hls){const t=Zo(this.hls.inFlightFragments,e),n=h.len>2,i=!d||t||d-e>2&&!f.getPartialFragment(e);if(n||i)return;this.moved=!1}const p=null==(i=this.hls)?void 0:i.latestLevelDetails;if(!this.moved&&null!==this.stalled&&f){if(!(h.len>0)&&!d)return;const t=Math.max(d,h.start||0)-e,n=!(null==p||!p.live)?2*p.targetduration:2,i=qo(e,f);if(t>0&&(t<=n||i))return void(a.paused||this._trySkipBufferHole(i))}const m=r.detectStallWithCurrentTimeMs,g=self.performance.now(),_=this.waiting;let v=this.stalled;if(null===v){if(!(_>0&&g-_<m))return void(this.stalled=g);v=this.stalled=_}const y=g-v;if(!s&&(y>=m||_)&&this.hls){var b;if("ended"===(null==(b=this.mediaSource)?void 0:b.readyState)&&(null==p||!p.live)&&Math.abs(e-((null==p?void 0:p.edge)||0))<1){if(this.ended)return;return this.ended=e||1,void this.hls.trigger(l.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(h),!this.media||!this.hls)return}const x=tn.bufferInfo(a,e,r.maxBufferHole);this._tryFixBufferStall(x,y,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(l.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(n=this.buffered.audio)&&n.length&&i&&i.length>1&&e>i.end(0)){const n=tn.bufferedInfo(tn.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const n=tn.timeRangesToArray(i),r=tn.bufferedInfo(n,t,0).bufferedIndex;if(r>-1&&r<n.length-1){const t=tn.bufferedInfo(n,e,0).bufferedIndex,i=n[r].end,a=n[r+1].start;if((-1===t||t>r)&&a-i<1&&e-i<2){const n=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${i} -> ${a} buffered index: ${t}`);this.warn(n.message),this.media.currentTime+=1e-6;let r=qo(e,this.fragmentTracker);r&&"fragment"in r?r=r.fragment:r||(r=void 0);const u=tn.bufferInfo(this.media,e,0);this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:r,buffer:u.len,bufferInfo:u})}}}}}_tryFixBufferStall(e,t,n){var i,r;const{fragmentTracker:a,media:s}=this,o=null==(i=this.hls)?void 0:i.config;if(!s||!a||!o)return;const l=null==(r=this.hls)?void 0:r.latestLevelDetails,u=qo(n,a);if(u||null!=l&&l.live&&n<l.fragmentStart){if(this._trySkipBufferHole(u)||!this.media)return}const c=e.buffered,h=this.adjacentTraversal(e,n);(c&&c.length>1&&e.len>o.maxBufferHole||e.nextStart&&(e.nextStart-n<o.maxBufferHole||h))&&(t>1e3*o.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,i=e.nextStart;if(n&&i){const e=n.getFragAtPos(t,f),r=n.getFragAtPos(i,f);if(e&&r)return r.sn-e.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&null!==r&&n&&t){this.stallReported=!0;const i=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${nt(e)})`);this.warn(i.message),t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_STALLED_ERROR,fatal:!1,error:i,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=null==(t=this.hls)?void 0:t.config;if(!i||!n||!r)return 0;const a=i.currentTime,u=tn.bufferInfo(i,a,0),c=a<u.start?u.start:u.nextStart;if(c&&this.hls){const t=u.len<=r.maxBufferHole,d=u.len>0&&u.len<1&&i.readyState<3,p=c-a;if(p>0&&(t||d)){if(p>r.maxBufferHole){let t=!1;if(0===a){const e=n.getAppendedFrag(0,f);e&&c<e.end&&(t=!0)}if(!t&&e){var h;if(null==(h=this.hls.loadLevelObj)||!h.details)return 0;if(Zo(this.hls.inFlightFragments,c))return 0;let t=!1,i=e.end;for(;i<c;){const e=qo(i,n);if(!e){t=!0;break}i+=e.duration}if(t)return 0}}const t=Math.max(c+.05,a+.1);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${t}`),this.moved=!0,i.currentTime=t,null==e||!e.gap){const n=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${t}`),i={type:s.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,buffer:u.len,bufferInfo:u};e&&("fragment"in e?i.part=e:i.frag=e),this.hls.trigger(l.ERROR,i)}return t}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=null==t?void 0:t.config;if(!n||!r)return 0;const a=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const u=a+(i+1)*r.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${a} to ${u}`);this.warn(c.message),n.currentTime=u,t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const n=new Error(`Playhead still not moving while enough data buffered @${a} after ${r.nudgeMaxRetry} nudges`);this.error(n.message),t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Zo(e,t){const n=Ko(e.main);if(n&&n.start<=t)return n;const i=Ko(e.audio);return i&&i.start<=t?i:null}function Ko(e){if(!e)return null;switch(e.state){case bi:case yi:case Ci:case Li:return null}return e.frag}function qo(e,t){return t.getAppendedFrag(e,f)||t.getPartialFragment(e)}function Xo(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function Yo(e,t,n,i,r){let a=new e(t,n,"");try{a.value=i,r&&(a.type=r)}catch(s){a=new e(t,n,nt(r?x({type:r},i):i))}return a}const Qo=(()=>{const e=Xo();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class $o{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(l.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var n;this.media=t.media,!1===(null==(n=t.overrides)?void 0:n.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){var e;const t=null==(e=this.hls)?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null;!!t.transferMedia||(this.id3Track&&(this.removeCues&&xs(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if("metadata"===n.kind&&"id3"===n.label)return ys(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:i}=this.hls.config;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=Xo();if(a)for(let e=0;e<r.length;e++){const t=r[e].type;if(t===or.emsg&&!n||!i)continue;const s=ir(r[e].data),o=r[e].pts;let l=o+r[e].duration;l>Qo&&(l=Qo);l-o<=0&&(l=o+.25);for(let e=0;e<s.length;e++){const n=s[e];if(!rr(n)){this.updateId3CueEnds(o,t);const e=Yo(a,o,l,n,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(e,t){var n;const i=null==(n=this.id3Track)?void 0:n.cues;if(i)for(let n=i.length;n--;){const r=i[n];r.type===t&&r.startTime<e&&r.endTime===Qo&&(r.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:s,enableID3MetadataCues:o}}=a;if(r&&(s||o)){let e;e="audio"===i?e=>e.type===or.audioId3&&o:"video"===i?e=>e.type===or.emsg&&s:e=>e.type===or.audioId3&&o||e.type===or.emsg&&s,Es(r,t,n,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:r,enableDateRangeMetadataCues:a,interstitialsController:s}=this.hls.config;if(!a)return;const o=Xo();if(n&&r&&!s){const{fragmentStart:t,fragmentEnd:i}=e;let r=this.assetCue;r?(r.startTime=t,r.endTime=i):o&&(r=this.assetCue=Yo(o,t,i,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),r&&(r.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(r),r.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:l}=this,{dateRanges:u}=e,c=Object.keys(u);let h=this.dateRangeCuesAppended;var d;if(l&&t)if(null!=(d=l.cues)&&d.length){const e=Object.keys(h).filter((e=>!c.includes(e)));for(let t=e.length;t--;){var f;const n=e[t],i=null==(f=h[n])?void 0:f.cues;delete h[n],i&&Object.keys(i).forEach((e=>{const t=i[e];if(t){t.removeEventListener("enter",this.onEventCueEnter);try{l.removeCue(t)}catch(e){}}}))}}else h=this.dateRangeCuesAppended={};const p=e.fragments[e.fragments.length-1];if(0!==c.length&&i(null==p?void 0:p.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let e=0;e<c.length;e++){const t=c[e],n=u[t],i=n.startTime,r=h[t],a=(null==r?void 0:r.cues)||{};let l=(null==r?void 0:r.durationKnown)||!1,d=Qo;const{duration:f,endDate:p}=n;if(p&&null!==f)d=i+f,l=!0;else if(n.endOnNext&&!l){const e=c.reduce(((e,t)=>{if(t!==n.id){const i=u[t];if(i.class===n.class&&i.startDate>n.startDate&&(!e||n.startDate<e.startDate))return i}return e}),null);e&&(d=e.startTime,l=!0)}const g=Object.keys(n.attr);for(let e=0;e<g.length;e++){const u=g[e];if("ID"===(m=u)||"CLASS"===m||"CUE"===m||"START-DATE"===m||"DURATION"===m||"END-DATE"===m||"END-ON-NEXT"===m)continue;const c=a[u];if(c)!l||null!=r&&r.durationKnown?Math.abs(c.startTime-i)>.01&&(c.startTime=i,c.endTime=d):c.endTime=d;else if(o){let e=n.attr[u];hn(u)&&(e=M(e));const r=Yo(o,i,d,{key:u,data:e},or.dateRange);r&&(r.id=t,this.id3Track.addCue(r),a[u]=r,s&&("X-ASSET-LIST"!==u&&"X-ASSET-URL"!==u||r.addEventListener("enter",this.onEventCueEnter)))}}h[t]={cues:a,dateRange:n,durationKnown:l}}var m}}}class Jo{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:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||1===r||!t.live)return;const a=this.targetLatency;if(null===a)return;const s=n-a;if(s<Math.min(this.maxLatency,a+t.targetduration)&&s>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,r)),n=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20,i=Math.min(t,Math.max(1,n));this.changeMediaPlaybackRate(e,i)}else 1!==e.playbackRate&&0!==e.playbackRate&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return(null==(e=this.hls)?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(void 0!==e.liveMaxLatencyDuration)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(null===e||null===this.hls)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:a,lowLatencyMode:s}=this.config,o=this.hls.userConfig;let l=s&&n||t;(this._targetLatencyUpdated||o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==r?r:a*i);const u=i;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,u)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(null===e||null===t)return null;const n=this.levelDetails;if(null===n)return null;const i=n.edge,r=e-t-this.edgeStalled,a=i-n.totalduration,s=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,r),s)}get drift(){const e=this.levelDetails;return null===e?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===o.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(n=this.levelDetails)&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&(null==(n=this.hls)||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(i=this.targetLatency)?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}class el extends la{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},a={};let s=!1,o=!1,l=!1;t.levels.forEach((e=>{const t=e.attrs;let{audioCodec:u,videoCodec:c}=e;u&&(e.audioCodec=u=Me(u,n)||void 0),c&&(c=e.videoCodec=function(e){const t=e.split(",");for(let e=0;e<t.length;e++){const n=t[e].split(".");n.length>2&&"avc1"===n[0]&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(",")}(c));const{width:h,height:d,unknownCodecs:f}=e,p=(null==f?void 0:f.length)||0;if(s||(s=!(!h||!d)),o||(o=!!c),l||(l=!!u),p||u&&!this.isAudioSupported(u)||c&&!this.isVideoSupported(c))return void this.log(`Some or all CODECS not supported "${t.CODECS}"`);const{CODECS:m,"FRAME-RATE":g,"HDCP-LEVEL":_,"PATHWAY-ID":v,RESOLUTION:y,"VIDEO-RANGE":b}=t,x=`${`${v||"."}-`}${e.bitrate}-${y}-${g}-${m}-${b}-${_}`;if(r[x])if(r[x].uri===e.url||e.attrs["PATHWAY-ID"])r[x].addGroupId("audio",t.AUDIO),r[x].addGroupId("text",t.SUBTITLES);else{const t=a[x]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const n=this.createLevel(e);r[x]=n,i.push(n)}else{const t=this.createLevel(e);r[x]=t,a[x]=1,i.push(t)}})),this.filterAndSortMediaOptions(i,t,s,o,l)}createLevel(e){const t=new Je(e),n=e.supplemental;if(null!=n&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const e=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=ze(e,[])}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,n,i,r){var a;let u=[],c=[],h=e;const d=(null==(a=t.stats)?void 0:a.parsing)||{};if((n||i)&&r&&(h=h.filter((({videoCodec:e,videoRange:t,width:n,height:i})=>{return(!!e||!(!n||!i))&&(!!(r=t)&&Ke.indexOf(r)>-1);var r}))),0===h.length)return Promise.resolve().then((()=>{if(this.hls){let e="no level with compatible codecs found in manifest",n=e;t.levels.length&&(n=`one or more CODECS in variant not supported: ${nt(t.levels.map((e=>e.attrs.CODECS)).filter(((e,t,n)=>n.indexOf(e)===t)))}`,this.warn(n),e+=` (${n})`);const i=new Error(e);this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:i,reason:n})}})),void(d.end=performance.now());t.audioTracks&&(u=t.audioTracks.filter((e=>!e.audioCodec||this.isAudioSupported(e.audioCodec))),tl(u)),t.subtitles&&(c=t.subtitles,tl(c));const f=h.slice(0);h.sort(((e,t)=>{if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return Ke.indexOf(e.videoRange)-Ke.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const n=Re(e.videoCodec),i=Re(t.videoCodec);if(n!==i)return i-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const n=Ie(e.codecSet),i=Ie(t.codecSet);if(n!==i)return i-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));let p=f[0];if(this.steering&&(h=this.steering.filterParsedLevels(h),h.length!==f.length))for(let e=0;e<f.length;e++)if(f[e].pathwayId===h[0].pathwayId){p=f[e];break}this._levels=h;for(let e=0;e<h.length;e++)if(h[e]===p){var m;this._firstLevel=e;const t=p.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${h.length} level(s) found, first bitrate: ${t}`),void 0===(null==(m=this.hls.userConfig)?void 0:m.abrEwmaDefaultEstimate)){const e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}const g=r&&!i,_=this.hls.config,v=!(!_.audioStreamController||!_.audioTrackController),y={levels:h,audioTracks:u,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:v&&!g&&u.some((e=>!!e.url))};d.end=performance.now(),this.hls.trigger(l.MANIFEST_PARSED,y)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const n=new Error("invalid level idx"),i=e<0;if(this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.LEVEL_SWITCH_ERROR,level:e,fatal:i,error:n,reason:n.message}),i)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,a=t[e],u=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,n===e&&i&&r===u)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${u?" with Pathway "+u:""} from level ${n}${r?" with Pathway "+r:""}`);const c={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(l.LEVEL_SWITCHING,c);const h=a.details;if(!h||h.live){const e=this.switchParams(a.uri,null==i?void 0:i.details,h);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter((e=>-1!==t.indexOf(e)));if(e.length<1)return void this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);this.steering.pathwayPriority=n}}onError(e,t){!t.fatal&&t.context&&t.context.type===c&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(void 0!==t&&t.type===f){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return;const n=this._levels[t.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,a=t.levelInfo;var s;if(!a)return this.warn(`Invalid level index ${i}`),void(null!=(s=t.deliveryDirectives)&&s.skip&&(r.deltaUpdateFailed=!0));if(a===this.currentLevel||t.withoutMultiVariant){0===a.fragmentError&&(a.loadError=0);let e=a.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(i,t,e)}else null!=(n=t.deliveryDirectives)&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],a=e.details,s=null==a?void 0:a.age;this.log(`Loading level index ${i}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${s&&a.live?" age "+s.toFixed(1)+(a.type?" "+a.type||0:""):""} ${n}`),this.hls.trigger(l.LEVEL_LOADING,{url:n,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(1===this._levels.length)return;const n=this._levels.filter(((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach((e=>e.level=-1))),!1)));li(n),this._levels=n,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(l.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(l.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function tl(e){const t={};e.forEach((e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}function nl(){return self.SourceBuffer||self.WebKitSourceBuffer}function il(){if(!R())return!1;const e=nl();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove}class rl extends Di{constructor(e,t,n){super(e,t,n,"stream-controller",f),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 e=this.media,t=e?e.currentTime:null;if(null===t||!i(t))return;if(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t))return;const n=this.getFwdBufferInfoAtPos(e,t,f,0);null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length at ${t} on "seeked" event ${n?n.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=i.startLevel;-1===e&&(i.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=i.firstAutoLevel),i.nextLoadLevel=e,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&-1===e&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=bi,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=yi}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ii:{const{levels:e,level:t}=this,n=null==e?void 0:e[t],i=null==n?void 0:n.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=bi;break}if(this.hls.nextLoadLevel!==this.level){this.state=bi;break}break}case wi:this.checkRetryDate()}this.state===bi&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),null!=(e=this.media)&&e.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(null===t||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(null==n||!n[r])return;const a=n[r],s=this.getMainFwdBufferInfo();if(null===s)return;const o=this.getLevelDetails();if(o&&this._streamEnded(s,o)){const e={};return 2===this.altAudio&&(e.type="video"),this.hls.trigger(l.BUFFER_EOS,e),void(this.state=Ci)}if(!this.buffering)return;e.loadLevel!==r&&-1===e.manualLevel&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const u=a.details;if(!u||this.state===Ii||this.waitForLive(a))return this.level=r,this.state=Ii,void(this.startFragRequested=!1);const c=s.len,h=this.getMaxBufferLength(a.maxBitrate);if(c>=h)return;this.backtrackFragment&&this.backtrackFragment.start>s.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:s.end;let p=this.getNextFragment(d,u);if(this.couldBacktrack&&!this.fragPrevious&&p&&q(p)&&this.fragmentTracker.getState(p)!==Nt){var m;const e=(null!=(m=this.backtrackFragment)?m:p).sn-u.startSN,t=u.fragments[e-1];t&&p.cc===t.cc&&(p=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&s.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,d)){if(!p.gap){const e=this.audioOnly&&!this.altAudio?V:W,t=(e===W?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,f)}p=this.getNextFragmentLoopLoading(p,u,s,f,h)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,a,d))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===Mt||i===Ot?q(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,f)}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(null!=t&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(null!=r&&r.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*r.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],i=this.fragLastKbps;n=i&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*i)+1:0}else n=0;const a=this.getBufferedFrag(t.currentTime+n);if(a){const e=this.followingBufferedFrag(a);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,i=Math.max(a.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(i,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 xi:case Ei:case wi:case Si:case Ai:this.state=bi}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,2===this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;gi(n,"playing",this.onMediaPlaying),gi(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(_i(n,"playing",this.onMediaPlaying),_i(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t);!!t.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(l.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,i=!1;for(let e=0;e<t.levels.length;e++){const r=t.levels[e].audioCodec;r&&(n=n||-1!==r.indexOf("mp4a.40.2"),i=i||-1!==r.indexOf("mp4a.40.5"))}this.audioCodecSwitch=n&&i&&!function(){var e;const t=nl();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==bi)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=Ii)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,a=t.level,s=t.details,o=s.totalduration;if(!i)return void this.warn(`Levels were reset while loading level ${a}`);this.log(`Level ${a} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${o}`);const u=t.levelInfo,c=this.fragCurrent;!c||this.state!==Ei&&this.state!==wi||c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(s.live||null!=(n=u.details)&&n.live){var d;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;h=this.alignPlaylists(s,u.details,null==(d=this.levelLastLoaded)?void 0:d.details)}if(u.details=s,this.levelLastLoaded=u,r||this.setStartPosition(s,h),this.hls.trigger(l.LEVEL_UPDATED,{details:s,level:a}),this.state===Ii){if(this.waitForCdnTuneIn(s))return;this.state=bi}r&&s.live&&this.synchronizeToLiveEdge(s),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),a=e.fragmentStart,s=e.edge,o=r>=a-t.maxFragLookUpTolerance&&r<=s;if(null!==i&&n.duration>i&&(r<i||!o)){const a=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!o&&n.readyState<4||r<s-a)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${s}, reset currentTime to : ${i.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var l;const e=tn.bufferInfo(n,i,0);if(null==(l=e.buffered)||!l.length)return void(n.currentTime=i);if(e.start<=r)return void(n.currentTime=i);const{nextStart:t}=tn.bufferedInfo(e.buffered,r,0);t&&(n.currentTime=t)}else n.currentTime=i}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:a}=this;if(!a)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const s=a[n.level];if(!s)return void this.warn(`Level ${n.level} not found on progress`);const o=s.details;if(!o)return this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),void this.fragmentTracker.removeFragment(n);const l=s.videoCodec,u=o.PTSKnown||!o.live,c=null==(t=n.initSegment)?void 0:t.data,h=this._getAudioCodec(s),d=this.transmuxer=this.transmuxer||new oa(this.hls,f,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=i?i.index:-1,m=-1!==p,g=new Jt(n.level,n.sn,n.stats.chunkCount,r.byteLength,p,m),_=this.initPTS[n.cc];d.push(r,c,h,l,n,i,o.totalduration,u,g,_)}onAudioTrackSwitching(e,t){const n=this.hls,i=2===this.altAudio;if(ct(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i)return this.fragmentTracker.removeAllFragments(),n.once(l.BUFFER_FLUSHED,(()=>{this.hls&&this.hls.trigger(l.AUDIO_TRACK_SWITCHED,t)})),void n.trigger(l.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});n.trigger(l.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=ct(t.url,this.hls);if(n){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,a=!1;for(const e in n){const t=n[e];if("main"===t.id){if(r=e,i=t,"video"===e){const t=n[e];t&&(this.videoBuffer=t.buffer)}}else a=!0}a&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===f;if(r){if(this.fragContextChanged(n))return this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Ai&&(this.state=bi));const e=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),q(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const a=this.media;a&&(!this._hasEnoughToStart&&tn.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal)this.state=Li;else switch(t.details){case o.FRAG_GAP:case o.FRAG_PARSING_ERROR:case o.FRAG_DECRYPT_ERROR:case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(f,t);break;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Ii||(null==(n=t.context)?void 0:n.type)!==c||(this.state=bi);break;case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:if("main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case o.BUFFER_FULL_ERROR:if("main"!==t.parent)return;if(this.reduceLengthAndFlushBuffer(t)){!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}break;case o.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onFragLoadEmergencyAborted(){this.state=bi,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==V||!this.altAudio){const e=(t===W?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,f),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking)return void this.log(`could not seek to ${n}, already seeking at ${t}`);const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),a=tn.getBuffered(e),s=a.length?a.start(0):0,o=s-n,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||o>0&&(o<l||this.loadingParts&&o<2*((null==r?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${o} to match buffer start`),n+=o,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${s}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then((e=>{const{hls:n}=this,i=null==e?void 0:e.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=bi,this.startFragRequested=!1,this.bitrateTest=!1;const r=i.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),n.trigger(l.FRAG_LOADED,e),i.bitrateTest=!1})).catch((t=>{this.state!==yi&&this.state!==Li&&(this.warn(t),this.resetFragmentLoading(e))}))}_handleTransmuxComplete(e){const t=this.playlistType,{hls:n}=this,{remuxResult:r,chunkMeta:a}=e,s=this.getCurrentContext(a);if(!s)return void this.resetWhenMissingContext(a);const{frag:o,part:u,level:c}=s,{video:h,text:d,id3:f,initSegment:p}=r,{details:m}=c,g=this.altAudio?void 0:r.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Si,p){const e=p.tracks;if(e){const i=o.initSegment||o;if(this.unhandledEncryptionError(p,o))return;this._bufferInitSegment(c,e,i,a),n.trigger(l.FRAG_PARSING_INIT_SEGMENT,{frag:i,id:t,tracks:e})}const r=p.initPTS,s=p.timescale,u=this.initPTS[o.cc];if(i(r)&&(!u||u.baseTime!==r||u.timescale!==s)){const e=p.trackId;this.initPTS[o.cc]={baseTime:r,timescale:s,trackId:e},n.trigger(l.INIT_PTS_FOUND,{frag:o,id:t,initPTS:r,timescale:s,trackId:e})}}if(h&&m){g&&"audiovideo"===h.type&&this.logMuxedErr(o);const e=m.fragments[o.sn-1-m.startSN],t=o.sn===m.startSN,n=!e||o.cc>e.cc;if(!1!==r.independent){const{startPTS:e,endPTS:i,startDTS:r,endDTS:s}=h;if(u)u.elementaryStreams[h.type]={startPTS:e,endPTS:i,startDTS:r,endDTS:s};else if(h.firstKeyFrame&&h.independent&&1===a.id&&!n&&(this.couldBacktrack=!0),h.dropped&&h.independent){const r=this.getMainFwdBufferInfo(),a=(r?r.end:this.getLoadPosition())+this.config.maxBufferHole,l=h.firstKeyFramePTS?h.firstKeyFramePTS:e;if(!t&&a<l-this.config.maxBufferHole&&!n)return void this.backtrack(o);n&&(o.gap=!0),o.setElementaryStreamInfo(h.type,o.start,i,o.start,s,!0)}else t&&e-(m.appliedTimelineOffset||0)>2&&(o.gap=!0);o.setElementaryStreamInfo(h.type,e,i,r,s),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(h,o,u,a,t||n)}else{if(!t&&!n)return void this.backtrack(o);o.gap=!0}}if(g){const{startPTS:e,endPTS:t,startDTS:n,endDTS:i}=g;u&&(u.elementaryStreams[V]={startPTS:e,endPTS:t,startDTS:n,endDTS:i}),o.setElementaryStreamInfo(V,e,t,n,i),this.bufferFragmentData(g,o,u,a)}if(m&&null!=f&&f.samples.length){const e={id:t,frag:o,details:m,samples:f.samples};n.trigger(l.FRAG_PARSING_METADATA,e)}if(m&&d){const e={id:t,frag:o,details:m,samples:d.samples};n.trigger(l.FRAG_PARSING_USERDATA,e)}}}logMuxedErr(e){this.warn(`${q(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==Si)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:a,audiovideo:s}=t;if(r){const n=e.audioCodec;let i=Pe(r.codec,n);"mp4a"===i&&(i="mp4a.40.5");const a=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){i&&(i=-1!==i.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const e=r.metadata;e&&"channelCount"in e&&1!==(e.channelCount||1)&&-1===a.indexOf("firefox")&&(i="mp4a.40.5")}i&&-1!==i.indexOf("mp4a.40.5")&&-1!==a.indexOf("android")&&"audio/mpeg"!==r.container&&(i="mp4a.40.2",this.log(`Android: force audio codec to ${i}`)),n&&n!==i&&this.log(`Swapping manifest audio codec "${n}" for "${i}"`),r.levelCodec=i,r.id=f,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${i||""}/${n||""}/${r.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=f;const n=a.codec;if(4===(null==n?void 0:n.length))switch(n){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e"}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n}]${a.codec!==n?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete t.audiovideo}s&&(this.log(`Init audiovideo buffer, container:${s.container}, codecs[level/parsed]=[${e.codecs}/${s.codec}]`),delete t.video,delete t.audio);const o=Object.keys(t);if(o.length){if(this.hls.trigger(l.BUFFER_CODECS,t),!this.hls)return;o.forEach((e=>{const r=t[e].initSegment;null!=r&&r.byteLength&&this.hls.trigger(l.BUFFER_APPENDING,{type:e,data:r,frag:n,part:null,chunkMeta:i,parent:n.type})}))}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,f)}get maxBufferLength(){const{levels:e,level:t}=this,n=null==e?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=bi}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const n=e.currentTime;if(tn.isBuffered(e,n)?t=this.getAppendedFrag(n):tn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,n=t.level;e&&t.sn===e.sn&&e.level===n||(this.fragPlaying=t,this.hls.trigger(l.FRAG_CHANGED,{frag:t}),e&&e.level===n||this.hls.trigger(l.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;return i(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;if(i(t)){const e=this.getLevelDetails(),n=this.currentFrag||(e?dt(null,e.fragments,t):null);if(n){const e=n.programDateTime;if(null!==e){const i=e+1e3*(t-n.start);return new Date(i)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class al extends E{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[n].loader;if(i){var t;if(e&&e!==(null==(t=i.context)?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=o.KEY_LOAD_ERROR,n,i,r){return new Qt({type:s.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,r=t.length;i<r;i++){const a=t[i];if(e.cc<=a.cc&&(!q(e)||!q(a)||e.sn<a.sn)||!n&&i==r-1)return this.emeController.selectKeySystemFormat(a).then((e=>{if(!this.emeController)return;a.setKeyFormat(e);const t=Ln(e);return t?this.emeController.getKeySystemAccess([t]):void 0}))}if(this.config.requireKeySystemAccessOnStart){const e=In(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const n=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,n))}const a=r.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));const s=sl(r);let l=this.keyIdToKeyInfo[s];if(null!=(n=l)&&n.decryptdata.key)return r.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if(this.emeController&&null!=(i=l)&&i.keyLoadPromise){switch(this.emeController.getKeyStatus(l.decryptdata)){case"usable":case"usable-in-future":return l.keyLoadPromise.then((t=>{const{keyInfo:n}=t;return r.key=n.decryptdata.key,{frag:e,keyInfo:n}}))}}switch(this.log(`${this.keyIdToKeyInfo[s]?"Rel":"L"}oading${r.keyId?" keyId: "+k(r.keyId):""} URI: ${r.uri} from ${e.type} ${e.level}`),l=this.keyIdToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===r.keyFormat?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);return(e.keyLoadPromise=i.then((t=>(e.mediaKeySessionContext=t,n)))).catch((n=>{throw e.keyLoadPromise=null,"data"in n&&(n.data.frag=t),n}))}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=new(0,n.loader)(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise(((r,a)=>{const s={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,n,i)=>{const{frag:s,keyInfo:l}=n,u=sl(l.decryptdata);if(!s.decryptdata||l!==this.keyIdToKeyInfo[u])return a(this.createKeyLoadError(s,o.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),i));l.decryptdata.key=s.decryptdata.key=new Uint8Array(e.data),s.keyLoader=null,l.loader=null,r({frag:s,keyInfo:l})},onError:(e,n,i,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,o.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),i,x({url:s.url,data:void 0},e)))},onTimeout:(e,n,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,o.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),i))},onAbort:(e,n,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,o.INTERNAL_ABORTED,new Error("key loading aborted"),i))}};i.load(s,u,c)}))}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null);const a=sl(n.decryptdata)||i;delete this.keyIdToKeyInfo[a],r&&r.destroy()}}function sl(e){if(e.keyFormat!==Sn){const t=e.keyId;if(t)return k(t)}return e.uri}function ol(e){const{type:t}=e;switch(t){case h:return p;case d:return m;default:return f}}function ll(e,t){let n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}class ul{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(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(l.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(l.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=new(n||i)(t);return this.loaders[e.type]=r,r}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:u,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:a,deliveryDirectives:s,levelInfo:o}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:c,url:a,deliveryDirectives:s,levelOrTrack:o})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:a,track:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:h,url:r,deliveryDirectives:a,levelOrTrack:s})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:a,track:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:d,url:r,deliveryDirectives:a,levelOrTrack:s})}onLevelsUpdated(e,t){const n=this.loaders[c];if(n){const e=n.context;e&&!t.levels.some((t=>t===e.levelOrTrack))&&(n.abort(),delete this.loaders[c])}}load(e){var t;const n=this.hls.config;let r,a=this.getInternalLoader(e);if(a){const t=this.hls.logger,n=a.context;if(n&&n.levelOrTrack===e.levelOrTrack&&(n.url===e.url||n.deliveryDirectives&&!e.deliveryDirectives))return void(n.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${n.url}`));t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),a.abort()}if(r=e.type===u?n.manifestLoadPolicy.default:y({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),a=this.createInternalLoader(e),i(null==(t=e.deliveryDirectives)?void 0:t.part)){let t;if(e.type===c&&null!==e.level?t=this.hls.levels[e.level].details:e.type===h&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===d&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,n=t.targetduration;if(e&&n){const t=1e3*Math.max(3*e,.8*n);r=y({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},l={onSuccess:(e,t,n,i)=>{const r=this.getInternalLoader(n);this.resetInternalLoader(n.type);const a=e.data;t.parsing.start=performance.now(),Gn.isMediaPlaylist(a)||n.type!==u?this.handleTrackOrLevelPlaylist(e,t,n,i||null,r):this.handleMasterPlaylist(e,t,n,i)},onError:(e,t,n,i)=>{this.handleNetworkError(t,n,!1,e,i)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}};a.load(e,o,l)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,a=e.data,s=ll(e,n),o=Gn.parseMasterPlaylist(a,s);if(o.playlistParsingError)return t.parsing.end=performance.now(),void this.handleManifestParsingError(e,n,o.playlistParsingError,i,t);const{contentSteering:u,levels:c,sessionData:h,sessionKeys:d,startTimeOffset:f,variableList:p}=o;this.variableList=p,c.forEach((e=>{const{unknownCodecs:t}=e;if(t){const{preferManagedMediaSource:n}=this.hls.config;let{audioCodec:i,videoCodec:r}=e;for(let a=t.length;a--;){const s=t[a];Ae(s,"audio",n)?(e.audioCodec=i=i?`${i},${s}`:s,Te.audio[i.substring(0,4)]=2,t.splice(a,1)):Ae(s,"video",n)&&(e.videoCodec=r=r?`${r},${s}`:s,Te.video[r.substring(0,4)]=2,t.splice(a,1))}}}));const{AUDIO:m=[],SUBTITLES:g,"CLOSED-CAPTIONS":_}=Gn.parseMasterPlaylistMedia(a,s,o);if(m.length){m.some((e=>!e.url))||!c[0].audioCodec||c[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new cn({}),bitrate:0,url:""}))}r.trigger(l.MANIFEST_LOADED,{levels:c,audioTracks:m,subtitles:g,captions:_,contentSteering:u,url:s,stats:t,networkDetails:i,sessionData:h,sessionKeys:d,startTimeOffset:f,variableList:p})}handleTrackOrLevelPlaylist(e,t,n,r,a){const s=this.hls,{id:o,level:c,type:h}=n,d=ll(e,n),f=i(c)?c:i(o)?o:0,p=ol(n),m=Gn.parseLevelPlaylist(e.data,d,f,p,0,this.variableList);if(h===u){const e={attrs:new cn({}),bitrate:0,details:m,name:"",url:d};m.requestScheduled=t.loading.start+ri(m,0),s.trigger(l.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:d,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=m,this.handlePlaylistLoaded(m,e,t,n,r,a)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.MANIFEST_PARSING_ERROR,fatal:t.type===u,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let a=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===c?a+=`: ${e.level} id: ${e.id}`:e.type!==h&&e.type!==d||(a+=` id: ${e.id} group-id: "${e.groupId}"`);const f=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let p=o.UNKNOWN,m=!1;const g=this.getInternalLoader(e);switch(e.type){case u:p=n?o.MANIFEST_LOAD_TIMEOUT:o.MANIFEST_LOAD_ERROR,m=!0;break;case c:p=n?o.LEVEL_LOAD_TIMEOUT:o.LEVEL_LOAD_ERROR,m=!1;break;case h:p=n?o.AUDIO_TRACK_LOAD_TIMEOUT:o.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case d:p=n?o.SUBTITLE_TRACK_LOAD_TIMEOUT:o.SUBTITLE_LOAD_ERROR,m=!1}g&&this.resetInternalLoader(e.type);const _={type:s.NETWORK_ERROR,details:p,fatal:m,url:e.url,loader:g,context:e,error:f,networkDetails:t,stats:r};if(i){const n=(null==t?void 0:t.url)||e.url;_.response=x({url:n,data:void 0},i)}this.hls.trigger(l.ERROR,_)}handlePlaylistLoaded(e,t,n,i,r,a){const p=this.hls,{type:m,level:g,levelOrTrack:_,id:v,groupId:y,deliveryDirectives:b}=i,x=ll(t,i),E=ol(i);let w="number"==typeof i.level&&E===f?g:void 0;const T=e.playlistParsingError;if(T){if(this.hls.logger.warn(`${T} ${e.url}`),!p.config.ignorePlaylistParsingErrors)return void p.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:x,error:T,reason:T.message,response:t,context:i,level:w,parent:E,networkDetails:r,stats:n});e.playlistParsingError=null}if(e.fragments.length)switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),a.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),m){case u:case c:if(w)if(_){if(_!==p.levels[w]){const e=p.levels.indexOf(_);e>-1&&(w=e)}}else w=0;p.trigger(l.LEVEL_LOADED,{details:e,levelInfo:_||p.levels[0],level:w||0,id:v||0,stats:n,networkDetails:r,deliveryDirectives:b,withoutMultiVariant:m===u});break;case h:p.trigger(l.AUDIO_TRACK_LOADED,{details:e,track:_,id:v||0,groupId:y||"",stats:n,networkDetails:r,deliveryDirectives:b});break;case d:p.trigger(l.SUBTITLE_TRACK_LOADED,{details:e,track:_,id:v||0,groupId:y||"",stats:n,networkDetails:r,deliveryDirectives:b})}else{const a=e.playlistParsingError=new Error("No Segments found in Playlist");p.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.LEVEL_EMPTY_ERROR,fatal:!1,url:x,error:a,reason:a.message,response:t,context:i,level:w,parent:E,networkDetails:r,stats:n})}}}class cl{static get version(){return Bi}static isMSESupported(){return il()}static isSupported(){return function(){if(!il())return!1;const e=R();return"function"==typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((t=>e.isTypeSupported(Le(t,"video"))))||["mp4a.40.2","fLaC"].some((t=>e.isTypeSupported(Le(t,"audio")))))}()}static getMediaSource(){return R()}static get Events(){return l}static get MetadataSchema(){return or}static get ErrorTypes(){return s}static get ErrorDetails(){return o}static get DefaultConfig(){return cl.defaultConfig?cl.defaultConfig:jo}static set DefaultConfig(e){cl.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 Fi,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=function(e,t,n){const i=S();if("object"==typeof console&&!0===e||"object"==typeof e){const r=["debug","log","info","warn","error"];r.forEach((t=>{i[t]=A(t,e,n)}));try{i.log(`Debug logs enabled for "${t}" in hls.js version 1.6.12`)}catch(e){return S()}r.forEach((t=>{C[t]=A(t,e)}))}else y(C,i);return i}(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=function(e,t,n){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=Ho(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const a=`${"level"===e?"playlist":e}LoadPolicy`,s=void 0===t[a],o=[];r.forEach((n=>{const r=`${e}Loading${n}`,l=t[r];if(void 0!==l&&s){o.push(r);const e=i[a].default;switch(t[a]={default:e},n){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),o.length&&n.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${a}": ${nt(t[a])}`)})),x(x({},i),t)}(cl.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Vo(n,t);const{abrController:i,bufferController:r,capLevelController:a,errorController:s,fpsController:o}=n,u=new s(this),c=this.abrController=new i(this),h=new Ft(this),d=n.interstitialsController,f=d?this.interstitialsController=new d(this,cl):null,p=this.bufferController=new r(this,h),m=this.capLevelController=new a(this),g=new o(this),_=new ul(this),v=n.contentSteeringController,b=v?new v(this):null,E=this.levelController=new el(this,b),w=new $o(this),T=new al(this.config,this.logger),L=this.streamController=new rl(this,h,T),R=this.gapController=new Wo(this,h);m.setStreamController(L),g.setStreamController(L);const I=[_,E,L];f&&I.splice(1,0,f),b&&I.splice(1,0,b),this.networkControllers=I;const D=[c,p,R,m,g,w,h];this.audioTrackController=this.createController(n.audioTrackController,I);const k=n.audioStreamController;k&&I.push(this.audioStreamController=new k(this,h,T)),this.subtitleTrackController=this.createController(n.subtitleTrackController,I);const M=n.subtitleStreamController;M&&I.push(this.subtititleStreamController=new M(this,h,T)),this.createController(n.timelineController,D),T.emeController=this.emeController=this.createController(n.emeController,D),this.cmcdController=this.createController(n.cmcdController,D),this.latencyController=this.createController(Jo,D),this.coreComponents=D,I.push(u);const P=u.onErrorOut;"function"==typeof P&&this.on(l.ERROR,P,u),this.on(l.MANIFEST_LOADED,_.onManifestLoaded,_)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),!this.triggeringException){this.triggeringException=!0;const n=e===l.ERROR;this.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,fatal:n,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(l.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.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 t=new Error(`attachMedia failed: invalid argument (${e})`);return void this.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.ATTACH_MEDIA_ERROR,fatal:!0,error:t})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(l.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(l.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(l.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=j.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(l.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),this.started&&this.networkControllers);n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!this.started&&this.networkControllers);e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach((e=>{e.resumeBuffering&&e.resumeBuffering()})))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach((e=>{e.pauseBuffering&&e.pauseBuffering()})))}get inFlightFragments(){const e={[f]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[p]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[m]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=null==e?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=function(){try{return crypto.randomUUID()}catch(e){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,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}}}()),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-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),-1!==e&&(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){(function(e){return Ze.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(i=-1===t&&null!=e&&e.length?e.length-1:t,n)for(let t=i;t--;){const i=e[t].attrs["HDCP-LEVEL"];if(i&&i<=n)return t}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return(null==(t=this.audioTrackController)?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return(null==(t=this.subtitleTrackController)?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}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!(null==(e=this.bufferController)||!e.bufferedToEnd)}get interstitialsManager(){var e;return(null==(e=this.interstitialsController)?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return He(e,rt(t),navigator.mediaCapabilities)}}cl.defaultConfig=void 0},16722:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});const i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,r=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,a=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return r(n.overflowY,t)||r(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},s=(e,t,n,i,r,a,s,o)=>a<e&&s>t||a>e&&s<t?0:a<=e&&o<=n||s>=t&&o>=n?a-e-i:s>t&&o<n||a<e&&o>n?s-t+r:0,o=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},l=(e,t)=>{var n,r,l,u;if("undefined"==typeof document)return[];const{scrollMode:c,block:h,inline:d,boundary:f,skipOverflowHiddenElements:p}=t,m="function"==typeof f?f:e=>e!==f;if(!i(e))throw new TypeError("Invalid target");const g=document.scrollingElement||document.documentElement,_=[];let v=e;for(;i(v)&&m(v);){if(v=o(v),v===g){_.push(v);break}null!=v&&v===document.body&&a(v)&&!a(document.documentElement)||null!=v&&a(v,p)&&_.push(v)}const y=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,b=null!=(u=null==(l=window.visualViewport)?void 0:l.height)?u:innerHeight,{scrollX:x,scrollY:E}=window,{height:w,width:T,top:S,right:A,bottom:C,left:L}=e.getBoundingClientRect(),{top:R,right:I,bottom:D,left:k}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let M="start"===h||"nearest"===h?S-R:"end"===h?C+D:S+w/2-R+D,P="center"===d?L+T/2-k+I:"end"===d?A+I:L-k;const O=[];for(let e=0;e<_.length;e++){const t=_[e],{height:n,width:i,top:r,right:o,bottom:l,left:u}=t.getBoundingClientRect();if("if-needed"===c&&S>=0&&L>=0&&C<=b&&A<=y&&(t===g&&!a(t)||S>=r&&C<=l&&L>=u&&A<=o))return O;const f=getComputedStyle(t),p=parseInt(f.borderLeftWidth,10),m=parseInt(f.borderTopWidth,10),v=parseInt(f.borderRightWidth,10),R=parseInt(f.borderBottomWidth,10);let I=0,D=0;const k="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-v:0,N="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-R:0,F="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)I="start"===h?M:"end"===h?M-b:"nearest"===h?s(E,E+b,b,m,R,E+M,E+M+w,w):M-b/2,D="start"===d?P:"center"===d?P-y/2:"end"===d?P-y:s(x,x+y,y,p,v,x+P,x+P+T,T),I=Math.max(0,I+E),D=Math.max(0,D+x);else{I="start"===h?M-r-m:"end"===h?M-l+R+N:"nearest"===h?s(r,l,n,m,R+N,M,M+w,w):M-(r+n/2)+N/2,D="start"===d?P-u-p:"center"===d?P-(u+i/2)+k/2:"end"===d?P-o+v+k:s(u,o,i,p,v+k,P,P+T,T);const{scrollLeft:e,scrollTop:a}=t;I=0===B?0:Math.max(0,Math.min(a+I/B,t.scrollHeight-n/B+N)),D=0===F?0:Math.max(0,Math.min(e+D/F,t.scrollWidth-i/F+k)),M+=a-I,P+=e-D}O.push({el:t,top:I,left:D})}return O};function u(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(l(e,t));const i="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:r,top:a,left:s}of l(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=a-n.top+n.bottom,t=s-n.left+n.right;r.scroll({top:e,left:t,behavior:i})}}}}]);