System.register(["./vendor-legacy.ab945ac3.js"],(function(e){"use strict";var t;return{setters:[function(e){t=e.U,e.V}],execute:function(){var i,n,r,a,o,s,l,u={},h={},c={},d=2311,f=function(){return d++},p="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:(i=navigator.userAgent,n={},r={},a=i.match(/Firefox\/([\d.]+)/),o=i.match(/MSIE\s([\d.]+)/)||i.match(/Trident\/.+?rv:(([\d.]+))/),s=i.match(/Edge\/([\d.]+)/),l=/micromessenger/i.test(i),a&&(r.firefox=!0,r.version=a[1]),o&&(r.ie=!0,r.version=o[1]),s&&(r.edge=!0,r.version=s[1]),l&&(r.weChat=!0),{browser:r,os:n,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!r.ie&&!r.edge,pointerEventsSupported:"onpointerdown"in window&&(r.edge||r.ie&&r.version>=11),domSupported:"undefined"!=typeof document}),g={},m={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},v={"[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},y=Object.prototype.toString,_=Array.prototype,x=_.forEach,b=_.filter,w=_.slice,T=_.map,S=_.reduce,M={};function A(e){if(null==e||"object"!=typeof e)return e;var t=e,i=y.call(e);if("[object Array]"===i){if(!B(e)){t=[];for(var n=0,r=e.length;n3&&(n=$.call(n,1));for(var a=t.length,o=0;o4&&(n=$.call(n,1,n.length-1));for(var a=n[n.length-1],o=t.length,s=0;s>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[s]+":0",r[l]+":0",n[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),e.appendChild(o),i.push(o)}return i}(t,a),s=function(e,t,i){for(var n=i?"invTrans":"trans",r=t[n],a=t.srcCoords,o=!0,s=[],l=[],u=0;u<4;u++){var h=e[u].getBoundingClientRect(),c=2*u,d=h.left,f=h.top;s.push(d,f),o=o&&a&&d===a[c]&&f===a[c+1],l.push(e[u].offsetLeft,e[u].offsetTop)}return o&&r?r:(t.srcCoords=s,t[n]=i?ue(l,s):ue(s,l))}(o,a,r);if(s)return s(e,i,n),!0}return!1}function de(e){return"CANVAS"===e.nodeName.toUpperCase()}re.transformLocalCoord=function(e,t,i,n,r){return ce(he,t,n,r,!0)&&ce(e,i,he[0],he[1])},re.transformCoordWithViewport=ce,re.isCanvasEl=de;var fe=ie;ne.Dispatcher=fe;var pe=p,ge=re,me=ge.isCanvasEl,ve=ge.transformCoordWithViewport,ye="undefined"!=typeof window&&!!window.addEventListener,_e=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xe=[];function be(e,t,i,n){return i=i||{},n||!pe.canvasSupported?we(e,t,i):pe.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(i.zrX=t.layerX,i.zrY=t.layerY):null!=t.offsetX?(i.zrX=t.offsetX,i.zrY=t.offsetY):we(e,t,i),i}function we(e,t,i){if(pe.domSupported&&e.getBoundingClientRect){var n=t.clientX,r=t.clientY;if(me(e)){var a=e.getBoundingClientRect();return i.zrX=n-a.left,void(i.zrY=r-a.top)}if(ve(xe,e,n,r))return i.zrX=xe[0],void(i.zrY=xe[1])}i.zrX=i.zrY=0}function Te(e){return e||window.event}var Se=ye?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};ne.clientToLocal=be,ne.getNativeEvent=Te,ne.normalizeEvent=function(e,t,i){if(null!=(t=Te(t)).zrX)return t;var n=t.type;if(n&&n.indexOf("touch")>=0){var r="touchend"!==n?t.targetTouches[0]:t.changedTouches[0];r&&be(e,r,t,i)}else be(e,t,t,i),t.zrDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3;var a=t.button;return null==t.which&&void 0!==a&&_e.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t},ne.addEventListener=function(e,t,i,n){ye?e.addEventListener(t,i,n):e.attachEvent("on"+t,i)},ne.removeEventListener=function(e,t,i,n){ye?e.removeEventListener(t,i,n):e.detachEvent("on"+t,i)},ne.stop=Se,ne.isMiddleOrRightButtonOnMouseUpDown=function(e){return 2===e.which||3===e.which},ne.notLeftMouse=function(e){return e.which>1};var Me=ne,Ae=function(){this._track=[]};function Ie(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}Ae.prototype={constructor:Ae,recognize:function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},clear:function(){return this._track.length=0,this},_doTrack:function(e,t,i){var n=e.touches;if(n){for(var r={points:[],touches:[],target:t,event:e},a=0,o=n.length;a1&&r&&r.length>1){var o=Ie(r)/Ie(a);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((n=r)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}},De=g,Ee=V,Le=J,Pe=ie,Ne=ne,Re=Ae,Oe="silent";function ke(){Ne.stop(this.event)}function ze(){}ze.prototype.dispose=function(){};var Be=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Fe=function(e,t,i,n){Pe.call(this),this.storage=e,this.painter=t,this.painterRoot=n,i=i||new ze,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,Le.call(this),this.setHandlerProxy(i)};function Ve(e,t,i){if(e[e.rectHover?"rectContain":"contain"](t,i)){for(var n,r=e;r;){if(r.clipPath&&!r.clipPath.contain(t,i))return!1;r.silent&&(n=!0),r=r.parent}return!n||Oe}return!1}function Ge(e,t,i){var n=e.painter;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}Fe.prototype={constructor:Fe,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(De.each(Be,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},mousemove:function(e){var t=e.zrX,i=e.zrY,n=Ge(this,t,i),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=n?{x:t,y:i}:this.findHover(t,i),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},mouseout:function(e){var t=e.zrEventControl,i=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!i&&this.trigger("globalout",{type:"globalout",event:e})},resize:function(e){this._hovered={}},dispatch:function(e,t){var i=this[e];i&&i.call(this,t)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},dispatchToElement:function(e,t,i){var n=(e=e||{}).target;if(!n||!n.silent){for(var r="on"+t,a=function(e,t,i){return{type:e,event:i,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:ke}}(t,e,i);n&&(n[r]&&(a.cancelBubble=n[r].call(n,a)),n.trigger(t,a),n=n.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer((function(e){"function"==typeof e[r]&&e[r].call(e,a),e.trigger&&e.trigger(t,a)})))}},findHover:function(e,t,i){for(var n=this.storage.getDisplayList(),r={x:e,y:t},a=n.length-1;a>=0;a--){var o;if(n[a]!==i&&!n[a].ignore&&(o=Ve(n[a],e,t))&&(!r.topTarget&&(r.topTarget=n[a]),o!==Oe)){r.target=n[a];break}}return r},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Re);var i=this._gestureMgr;"start"===t&&i.clear();var n=i.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&i.clear(),n){var r=n.type;e.gestureEvent=r,this.dispatchToElement({target:n.target},r,n.event)}}},De.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Fe.prototype[e]=function(t){var i,n,r=t.zrX,a=t.zrY,o=Ge(this,r,a);if("mouseup"===e&&o||(n=(i=this.findHover(r,a)).target),"mousedown"===e)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===e)this._upEl=n;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||Ee.dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}})),De.mixin(Fe,Pe),De.mixin(Fe,Le);var He=Fe,Ue={},We="undefined"==typeof Float32Array?Array:Float32Array;function je(){var e=new We(6);return Xe(e),e}function Xe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Ze(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}Ue.create=je,Ue.identity=Xe,Ue.copy=Ze,Ue.mul=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e},Ue.translate=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},Ue.rotate=function(e,t,i){var n=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=r*h+s*u,e[3]=-r*u+h*s,e[4]=h*a+u*l,e[5]=h*l-u*a,e},Ue.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=t[0]*n,e[1]=t[1]*r,e[2]=t[2]*n,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*r,e},Ue.invert=function(e,t){var i=t[0],n=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=i*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*r)*l,e[5]=(a*r-i*s)*l,e):null},Ue.clone=function(e){var t=je();return Ze(t,e),t};var qe=Ue,Ye=V,Ke=qe.identity,Qe=5e-5;function Je(e){return e>Qe||e<-5e-5}var $e=function(e){(e=e||{}).position||(this.position=[0,0]),null==e.rotation&&(this.rotation=0),e.scale||(this.scale=[1,1]),this.origin=this.origin||null},et=$e.prototype;et.transform=null,et.needLocalTransform=function(){return Je(this.rotation)||Je(this.position[0])||Je(this.position[1])||Je(this.scale[0]-1)||Je(this.scale[1]-1)};var tt=[];et.updateTransform=function(){var e=this.parent,t=e&&e.transform,i=this.needLocalTransform(),n=this.transform;if(i||t){n=n||qe.create(),i?this.getLocalTransform(n):Ke(n),t&&(i?qe.mul(n,e.transform,n):qe.copy(n,e.transform)),this.transform=n;var r=this.globalScaleRatio;if(null!=r&&1!==r){this.getGlobalScale(tt);var a=tt[0]<0?-1:1,o=tt[1]<0?-1:1,s=((tt[0]-a)*r+a)/tt[0]||0,l=((tt[1]-o)*r+o)/tt[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||qe.create(),qe.invert(this.invTransform,n)}else n&&Ke(n)},et.getLocalTransform=function(e){return $e.getLocalTransform(this,e)},et.setTransform=function(e){var t=this.transform,i=e.dpr||1;t?e.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):e.setTransform(i,0,0,i,0,0)},et.restoreTransform=function(e){var t=e.dpr||1;e.setTransform(t,0,0,t,0,0)};var it=[],nt=qe.create();et.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=this.position,r=this.scale;Je(t-1)&&(t=Math.sqrt(t)),Je(i-1)&&(i=Math.sqrt(i)),e[0]<0&&(t=-t),e[3]<0&&(i=-i),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=i,this.rotation=Math.atan2(-e[1]/i,e[0]/t)}},et.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(qe.mul(it,e.invTransform,t),t=it);var i=this.origin;i&&(i[0]||i[1])&&(nt[4]=i[0],nt[5]=i[1],qe.mul(it,t,nt),it[4]-=i[0],it[5]-=i[1],t=it),this.setLocalTransform(t)}},et.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},et.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&Ye.applyTransform(i,i,n),i},et.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&Ye.applyTransform(i,i,n),i},$e.getLocalTransform=function(e,t){Ke(t=t||[]);var i=e.origin,n=e.scale||[1,1],r=e.rotation||0,a=e.position||[0,0];return i&&(t[4]-=i[0],t[5]-=i[1]),qe.scale(t,t,n),r&&qe.rotate(t,t,r),i&&(t[4]+=i[0],t[5]+=i[1]),t[4]+=a[0],t[5]+=a[1],t};var rt=$e,at={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,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.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-at.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*at.bounceIn(2*e):.5*at.bounceOut(2*e-1)+.5}},ot=at;function st(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}st.prototype={constructor:st,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,r="string"==typeof n?ot[n]:n,a="function"==typeof r?r(i):i;return this.fire("frame",a),1===i?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 lt=st,ut={},ht=function(){this.head=null,this.tail=null,this._len=0},ct=ht.prototype;ct.insert=function(e){var t=new dt(e);return this.insertEntry(t),t},ct.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++},ct.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},ct.len=function(){return this._len},ct.clear=function(){this.head=this.tail=null,this._len=0};var dt=function(e){this.value=e,this.next,this.prev},ft=function(e){this._list=new ht,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},pt=ft.prototype;pt.put=function(e,t){var i=this._list,n=this._map,r=null;if(null==n[e]){var a=i.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new dt(t),o.key=e,i.insertEntry(o),n[e]=o}return r},pt.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},pt.clear=function(){this._list.clear(),this._map={}};var gt=ft,mt={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 vt(e){return(e=Math.round(e))<0?0:e>255?255:e}function yt(e){return e<0?0:e>1?1:e}function _t(e){return e.length&&"%"===e.charAt(e.length-1)?vt(parseFloat(e)/100*255):vt(parseInt(e,10))}function xt(e){return e.length&&"%"===e.charAt(e.length-1)?yt(parseFloat(e)/100):yt(parseFloat(e))}function bt(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function wt(e,t,i){return e+(t-e)*i}function Tt(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function St(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Mt=new gt(20),At=null;function It(e,t){At&&St(At,t),At=Mt.put(e,At||t.slice())}function Ct(e,t){if(e){t=t||[];var i=Mt.get(e);if(i)return St(t,i);var n,r=(e+="").replace(/ /g,"").toLowerCase();if(r in mt)return St(t,mt[r]),It(e,t),t;if("#"===r.charAt(0))return 4===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=4095?(Tt(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),It(e,t),t):void Tt(t,0,0,0,1):7===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=16777215?(Tt(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),It(e,t),t):void Tt(t,0,0,0,1):void 0;var a=r.indexOf("("),o=r.indexOf(")");if(-1!==a&&o+1===r.length){var s=r.substr(0,a),l=r.substr(a+1,o-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Tt(t,0,0,0,1);u=xt(l.pop());case"rgb":return 3!==l.length?void Tt(t,0,0,0,1):(Tt(t,_t(l[0]),_t(l[1]),_t(l[2]),u),It(e,t),t);case"hsla":return 4!==l.length?void Tt(t,0,0,0,1):(l[3]=xt(l[3]),Dt(l,t),It(e,t),t);case"hsl":return 3!==l.length?void Tt(t,0,0,0,1):(Dt(l,t),It(e,t),t);default:return}}Tt(t,0,0,0,1)}}function Dt(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=xt(e[1]),r=xt(e[2]),a=r<=.5?r*(n+1):r+n-r*n,o=2*r-a;return Tt(t=t||[],vt(255*bt(o,a,i+1/3)),vt(255*bt(o,a,i)),vt(255*bt(o,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Et(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),o=t[r],s=t[a],l=n-r;return i[0]=vt(wt(o[0],s[0],l)),i[1]=vt(wt(o[1],s[1],l)),i[2]=vt(wt(o[2],s[2],l)),i[3]=yt(wt(o[3],s[3],l)),i}}var Lt=Et;function Pt(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),o=Ct(t[r]),s=Ct(t[a]),l=n-r,u=Rt([vt(wt(o[0],s[0],l)),vt(wt(o[1],s[1],l)),vt(wt(o[2],s[2],l)),yt(wt(o[3],s[3],l))],"rgba");return i?{color:u,leftIndex:r,rightIndex:a,value:n}:u}}var Nt=Pt;function Rt(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}ut.parse=Ct,ut.lift=function(e,t){var i=Ct(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return Rt(i,4===i.length?"rgba":"rgb")}},ut.toHex=function(e){var t=Ct(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},ut.fastLerp=Et,ut.fastMapToColor=Lt,ut.lerp=Pt,ut.mapToColor=Nt,ut.modifyHSL=function(e,t,i,n){if(e=Ct(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=xt(i)),null!=n&&(e[2]=xt(n)),Rt(Dt(e),"rgba")},ut.modifyAlpha=function(e,t){if((e=Ct(e))&&null!=t)return e[3]=yt(t),Rt(e,"rgba")},ut.stringify=Rt;var Ot=lt,kt=ut,zt=g.isArrayLike,Bt=Array.prototype.slice;function Ft(e,t){return e[t]}function Vt(e,t,i){e[t]=i}function Gt(e,t,i){return(t-e)*i+e}function Ht(e,t,i){return i>.5?t:e}function Ut(e,t,i,n,r){var a=e.length;if(1===r)for(var o=0;or)e.length=r;else for(var a=n;a=0&&!(m[i]<=t);i--);i=Math.min(i,u-2)}else{for(i=D;it);i++);i=Math.min(i-1,u-2)}D=i,E=t;var n=m[i+1]-m[i];if(0!==n)if(S=(t-m[i])/n,l)if(A=v[i],M=v[0===i?i:i-1],I=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)Xt(M,A,I,C,S,S*S,S*S*S,o(e,r),g);else{if(f)a=Xt(M,A,I,C,S,S*S,S*S*S,L,1),a=Yt(L);else{if(p)return Ht(A,I,S);a=Zt(M,A,I,C,S,S*S,S*S*S)}s(e,r,a)}else if(d)Ut(v[i],v[i+1],S,o(e,r),g);else{var a;if(f)Ut(v[i],v[i+1],S,L,1),a=Yt(L);else{if(p)return Ht(v[i],v[i+1],S);a=Gt(v[i],v[i+1],S)}s(e,r,a)}},ondestroy:i});return t&&"spline"!==t&&(P.easing=t),P}}}var Qt=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||Ft,this._setter=n||Vt,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Qt.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==e&&i[n].push({time:0,value:qt(r)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e0&&e.animate(t,!1).when(null==r?500:r,s).delay(a||0)}function gi(e,t,i,n){if(t){var r={};r[t]={},r[t][i]=n,e.attr(r)}else e.attr(i,n)}di.prototype={constructor:di,animate:function(e,t){var i,n=!1,r=this,a=this.__zr;if(e){var o=e.split("."),s=r;n="shape"===o[0];for(var l=0,u=o.length;l=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new Li(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}}},Li.create=function(e){return new Li(e.x,e.y,e.width,e.height)};var Pi=Li,Ni=g,Ri=Ai,Oi=Pi,ki=function(e){for(var t in e=e||{},Ri.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};ki.prototype={constructor:ki,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},childOfName:function(e){for(var t=this._children,i=0;i=0&&(i.splice(n,0,e),this._doAdd(e))}return this},_doAdd:function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__storage,i=this.__zr;t&&t!==e.__storage&&(t.addToStorage(e),e instanceof ki&&e.addChildrenToStorage(t)),i&&i.refresh()},remove:function(e){var t=this.__zr,i=this.__storage,n=this._children,r=Ni.indexOf(n,e);return r<0||(n.splice(r,1),e.parent=null,i&&(i.delFromStorage(e),e instanceof ki&&e.delChildrenFromStorage(i)),t&&t.refresh()),this},removeAll:function(){var e,t,i=this._children,n=this.__storage;for(t=0;t=0;)r++;return r-t}function Fi(e,t,i,n,r){for(n===t&&n++;n>>1])<0?l=a:s=a+1;var u=n-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=o}}function Vi(e,t,i,n,r,a){var o=0,s=0,l=1;if(a(e,t[i+r])>0){for(s=n-r;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o>>1);a(e,t[i+h])>0?o=h+1:l=h}return l}function Gi(e,t,i,n,r,a){var o=0,s=0,l=1;if(a(e,t[i+r])<0){for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=n-r;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o>>1);a(e,t[i+h])<0?l=h:o=h+1}return l}function Hi(e,t){var i,n,r=7,a=0,o=[];function s(s){var l=i[s],u=n[s],h=i[s+1],c=n[s+1];n[s]=u+c,s===a-3&&(i[s+1]=i[s+2],n[s+1]=n[s+2]),a--;var d=Gi(e[h],e,l,u,0,t);l+=d,0!=(u-=d)&&0!==(c=Vi(e[l+u-1],e,h,c,c-1,t))&&(u<=c?function(i,n,a,s){var l=0;for(l=0;l=7||f>=7);if(p)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===n){for(l=0;l=0;l--)e[f+l]=e[d+l];if(0===n){v=!0;break}}if(e[c--]=o[h--],1==--s){v=!0;break}if(0!=(m=s-Vi(e[u],o,0,s,s-1,t))){for(s-=m,f=1+(c-=m),d=1+(h-=m),l=0;l=7||m>=7);if(v)break;p<0&&(p=0),p+=2}if((r=p)<1&&(r=1),1===s){for(f=1+(c-=n),d=1+(u-=n),l=n-1;l>=0;l--)e[f+l]=e[d+l];e[c]=o[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l=0;l--)e[f+l]=e[d+l];e[c]=o[h]}else for(d=c-(s-1),l=0;l1;){var e=a-2;if(e>=1&&n[e-1]<=n[e]+n[e+1]||e>=2&&n[e-2]<=n[e]+n[e-1])n[e-1]n[e+1])break;s(e)}},this.forceMergeRuns=function(){for(;a>1;){var e=a-2;e>0&&n[e-1]=32;)t|=1&e,e>>=1;return e+t}(r);do{if((a=Bi(e,i,n,t))s&&(l=s),Fi(e,i,i+l,i+a,t),a=l}o.pushRun(i,a),o.mergeRuns(),r-=a,i+=a}while(0!==r);o.forceMergeRuns()}}},Wi=g,ji=p,Xi=zi,Zi=Ui;function qi(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Yi=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Yi.prototype={constructor:Yi,traverse:function(e,t){for(var i=0;i=0&&(this.delFromStorage(e),this._roots.splice(r,1),e instanceof Xi&&e.delChildrenFromStorage(this))}},addToStorage:function(e){return e&&(e.__storage=this,e.dirty(!1)),this},delFromStorage:function(e){return e&&(e.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:qi};var Ki=Yi,Qi={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},Ji=function(e,t,i){return Qi.hasOwnProperty(t)?i*e.dpr:i},$i={ContextCachedBy:{NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},WILL_BE_RESTORED:9},en=Ji,tn=$i.ContextCachedBy,nn=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],rn=function(e){this.extendFrom(e,!1)};function an(e,t,i){var n=null==t.x?0:t.x,r=null==t.x2?1:t.x2,a=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(n=n*i.width+i.x,r=r*i.width+i.x,a=a*i.height+i.y,o=o*i.height+i.y),n=isNaN(n)?0:n,r=isNaN(r)?1:r,a=isNaN(a)?0:a,o=isNaN(o)?0:o,e.createLinearGradient(n,a,r,o)}function on(e,t,i){var n=i.width,r=i.height,a=Math.min(n,r),o=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(o=o*n+i.x,s=s*r+i.y,l*=a),e.createRadialGradient(o,s,0,o,s,l)}for(var sn=rn.prototype={constructor:rn,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(e,t,i){var n=this,r=i&&i.style,a=!r||e.__attrCachedBy!==tn.STYLE_BIND;e.__attrCachedBy=tn.STYLE_BIND;for(var o=0;o0},extendFrom:function(e,t){if(e)for(var i in e)!e.hasOwnProperty(i)||!0!==t&&(!1===t?this.hasOwnProperty(i):null==e[i])||(this[i]=e[i])},set:function(e,t){"string"==typeof e?this[e]=t:this.extendFrom(e,!0)},clone:function(){var e=new this.constructor;return e.extendFrom(this,!0),e},getGradient:function(e,t,i){for(var n=("radial"===t.type?on:an)(e,t,i),r=t.colorStops,a=0;a5e3&&(zn=0,kn={}),zn++,kn[i]=r,r}function Hn(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function Un(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function Wn(e,t,i){var n=t.textPosition,r=t.textDistance,a=i.x,o=i.y;r=r||0;var s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":a-=r,o+=u,h="right",c="middle";break;case"right":a+=r+l,o+=u,c="middle";break;case"top":a+=l/2,o-=r,h="center",c="bottom";break;case"bottom":a+=l/2,o+=s+r,h="center";break;case"inside":a+=l/2,o+=u,h="center",c="middle";break;case"insideLeft":a+=r,o+=u,c="middle";break;case"insideRight":a+=l-r,o+=u,h="right",c="middle";break;case"insideTop":a+=l/2,o+=r,h="center";break;case"insideBottom":a+=l/2,o+=s-r,h="center",c="bottom";break;case"insideTopLeft":a+=r,o+=r;break;case"insideTopRight":a+=l-r,o+=r,h="right";break;case"insideBottomLeft":a+=r,o+=s-r,c="bottom";break;case"insideBottomRight":a+=l-r,o+=s-r,h="right",c="bottom"}return(e=e||{}).x=a,e.y=o,e.textAlign=h,e.textVerticalAlign=c,e}function jn(e,t,i,n,r){if(!t)return"";var a=(e+"").split("\n");r=Xn(t,i,n,r);for(var o=0,s=a.length;o=a;s++)o-=a;var l=Gn(i,t);return l>o&&(i="",l=0),o=e-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=o,n.containerWidth=e,n}function Zn(e,t){var i=t.containerWidth,n=t.font,r=t.contentWidth;if(!i)return"";var a=Gn(e,n);if(a<=i)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?qn(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=Gn(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function qn(e,t,i,n){for(var r=0,a=0,o=e.length;ah)e="",o=[];else if(null!=c)for(var d=Xn(c-(i?i[1]+i[3]:0),t,r.ellipsis,{minChar:r.minChar,placeholder:r.placeholder}),f=0,p=o.length;fr&&$n(i,e.substring(r,a)),$n(i,n[2],n[1]),r=Bn.lastIndex}rf)return{lines:[],width:0,height:0};D.textWidth=Gn(D.text,b);var T=_.textWidth,S=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))D.percentWidth=T,u.push(D),T=0;else{if(S){T=D.textWidth;var M=_.textBackgroundColor,A=M&&M.image;A&&(A=Dn.findExistImage(A),Dn.isImageReady(A)&&(T=Math.max(T,A.width*w/A.height)))}var I=x?x[1]+x[3]:0;T+=I;var C=null!=d?d-v:null;null!=C&&Cu&&(i*=u/(o=i+n),n*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),n+r>h&&(n*=h/(o=n+r),r*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),e.moveTo(s+i,l),e.lineTo(s+u-n,l),0!==n&&e.arc(s+u-n,l+n,n,-Math.PI/2,0),e.lineTo(s+u,l+h-r),0!==r&&e.arc(s+u-r,l+h-r,r,0,Math.PI/2),e.lineTo(s+a,l+h),0!==a&&e.arc(s+a,l+h-a,a,Math.PI/2,Math.PI),e.lineTo(s,l+i),0!==i&&e.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)}},tr=g,ir=tr.retrieve2,nr=tr.retrieve3,rr=tr.each,ar=tr.normalizeCssArray,or=tr.isString,sr=tr.isObject,lr=Tn,ur=er,hr=Sn,cr=Ji,dr=$i,fr=dr.ContextCachedBy,pr=dr.WILL_BE_RESTORED,gr=lr.DEFAULT_FONT,mr={left:1,right:1,center:1},vr={top:1,bottom:1,middle:1},yr=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],_r={},xr={};function br(e){if(e){e.font=lr.makeFont(e);var t=e.textAlign;"middle"===t&&(t="center"),e.textAlign=null==t||mr[t]?t:"left";var i=e.textVerticalAlign||e.textBaseline;"center"===i&&(i="middle"),e.textVerticalAlign=null==i||vr[i]?i:"top",e.textPadding&&(e.textPadding=ar(e.textPadding))}}function wr(e,t,i,n,r){if(i&&t.textRotation){var a=t.textOrigin;"center"===a?(n=i.width/2+i.x,r=i.height/2+i.y):a&&(n=a[0]+i.x,r=a[1]+i.y),e.translate(n,r),e.rotate(-t.textRotation),e.translate(-n,-r)}}function Tr(e,t,i,n,r,a,o,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=a+r/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+r-i.height/2),!i.isLineHolder&&Sr(l)&&Mr(e,t,l,"right"===s?o-i.width:"center"===s?o-i.width/2:o,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(o=Pr(o,s,c),h-=i.height/2-c[2]-i.textHeight/2),Cr(t,"shadowBlur",nr(l.textShadowBlur,n.textShadowBlur,0)),Cr(t,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),Cr(t,"shadowOffsetX",nr(l.textShadowOffsetX,n.textShadowOffsetX,0)),Cr(t,"shadowOffsetY",nr(l.textShadowOffsetY,n.textShadowOffsetY,0)),Cr(t,"textAlign",s),Cr(t,"textBaseline","middle"),Cr(t,"font",i.font||gr);var d=Dr(l.textStroke||n.textStroke,p),f=Er(l.textFill||n.textFill),p=ir(l.textStrokeWidth,n.textStrokeWidth);d&&(Cr(t,"lineWidth",p),Cr(t,"strokeStyle",d),t.strokeText(i.text,o,h)),f&&(Cr(t,"fillStyle",f),t.fillText(i.text,o,h))}function Sr(e){return!!(e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor)}function Mr(e,t,i,n,r,a,o){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=or(s);if(Cr(t,"shadowBlur",i.textBoxShadowBlur||0),Cr(t,"shadowColor",i.textBoxShadowColor||"transparent"),Cr(t,"shadowOffsetX",i.textBoxShadowOffsetX||0),Cr(t,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){t.beginPath();var c=i.textBorderRadius;c?ur.buildPath(t,{x:n,y:r,width:a,height:o,r:c}):t.rect(n,r,a,o),t.closePath()}if(h)if(Cr(t,"fillStyle",s),null!=i.fillOpacity){var d=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,t.fill(),t.globalAlpha=d}else t.fill();else if(sr(s)){var f=s.image;(f=hr.createOrUpdateImage(f,null,e,Ar,s))&&hr.isImageReady(f)&&t.drawImage(f,n,r,a,o)}l&&u&&(Cr(t,"lineWidth",l),Cr(t,"strokeStyle",u),null!=i.strokeOpacity?(d=t.globalAlpha,t.globalAlpha=i.strokeOpacity*i.opacity,t.stroke(),t.globalAlpha=d):t.stroke())}function Ar(e,t){t.image=e}function Ir(e,t,i,n){var r=i.x||0,a=i.y||0,o=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)r=n.x+Lr(l[0],n.width),a=n.y+Lr(l[1],n.height);else{var u=t&&t.calculateTextPosition?t.calculateTextPosition(_r,i,n):lr.calculateTextPosition(_r,i,n);r=u.x,a=u.y,o=o||u.textAlign,s=s||u.textVerticalAlign}var h=i.textOffset;h&&(r+=h[0],a+=h[1])}return(e=e||{}).baseX=r,e.baseY=a,e.textAlign=o,e.textVerticalAlign=s,e}function Cr(e,t,i){return e[t]=cr(e,t,i),e[t]}function Dr(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function Er(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function Lr(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function Pr(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}wn.normalizeTextStyle=function(e){return br(e),rr(e.rich,br),e},wn.renderText=function(e,t,i,n,r,a){n.rich?function(e,t,i,n,r,a){a!==pr&&(t.__attrCachedBy=fr.NONE);var o=e.__textCotentBlock;o&&!e.__dirtyText||(o=e.__textCotentBlock=lr.parseRichText(i,n)),function(e,t,i,n,r){var a=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=Ir(xr,e,n,r),h=u.baseX,c=u.baseY,d=u.textAlign,f=u.textVerticalAlign;wr(t,n,r,h,c);var p=lr.adjustTextX(h,o,d),g=lr.adjustTextY(c,s,f),m=p,v=g;l&&(m+=l[3],v+=l[0]);var y=m+a;Sr(n)&&Mr(e,t,n,p,g,o,s);for(var _=0;_=0&&"right"===(x=w[D]).textAlign;)Tr(e,t,x,n,S,v,C,"right"),M-=x.width,C-=x.width,D--;for(I+=(a-(I-m)-(y-C)-M)/2;A<=D;)Tr(e,t,x=w[A],n,S,v,I+x.width/2,"center"),I+=x.width,A++;v+=S}}(e,t,o,n,r)}(e,t,i,n,r,a):function(e,t,i,n,r,a){var o,s=Sr(n),l=!1,u=t.__attrCachedBy===fr.PLAIN_TEXT;a!==pr?(a&&(o=a.style,l=!s&&u&&o),t.__attrCachedBy=s?fr.NONE:fr.PLAIN_TEXT):u&&(t.__attrCachedBy=fr.NONE);var h=n.font||gr;l&&h===(o.font||gr)||(t.font=h);var c=e.__computedFont;e.__styleFont!==h&&(e.__styleFont=h,c=e.__computedFont=t.font);var d=n.textPadding,f=n.textLineHeight,p=e.__textCotentBlock;p&&!e.__dirtyText||(p=e.__textCotentBlock=lr.parsePlainText(i,c,d,f,n.truncate));var g=p.outerHeight,m=p.lines,v=p.lineHeight,y=Ir(xr,e,n,r),_=y.baseX,x=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;wr(t,n,r,_,x);var T=lr.adjustTextY(x,g,w),S=_,M=T;if(s||d){var A=lr.getWidth(i,c);d&&(A+=d[1]+d[3]);var I=lr.adjustTextX(_,A,b);s&&Mr(e,t,n,I,T,A,g),d&&(S=Pr(_,b,d),M+=d[0])}t.textAlign=b,t.textBaseline="middle",t.globalAlpha=n.opacity||1;for(var C=0;C=0&&i.splice(n,1),e.__hoverMir=null},clearHover:function(e){for(var t=this._hoverElements,i=0;i15)break}s.__drawIndex=g,s.__drawIndex0&&e>n[0]){for(o=0;oe);o++);a=i[n[o]]}if(n.splice(o+1,0,e),i[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(t.dom,l.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom)}else $r("Layer of zlevel "+e+" is not valid")},eachLayer:function(e,t){var i,n,r=this._zlevelList;for(n=0;n0?la:0),this._needsManuallyCompositing),s.__builtin__||$r("ZLevel "+l+" has been used by unkown layer "+s.id),s!==r&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,t(i),r=s),o.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(e){e.clear()},setBackgroundColor:function(e){this._backgroundColor=e},configLayer:function(e,t){if(t){var i=this._layerConfig;i[e]?Jr.merge(i[e],t,!0):i[e]=t;for(var n=0;n=0&&this._clips.splice(t,1)},removeAnimator:function(e){for(var t=e.getClips(),i=0;i=i.length&&i.push({option:e})}})),i},lo.makeIdAndName=function(e){var t=uo.createHashMap();co(e,(function(e,i){var n=e.exist;n&&t.set(n.id,e)})),co(e,(function(e,i){var n=e.option;uo.assert(!n||null==n.id||!t.get(n.id)||t.get(n.id)===e,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})})),co(e,(function(e,i){var n=e.exist,r=e.option,a=e.keyInfo;if(fo(r)){if(a.name=null!=r.name?r.name+"":n?n.name:go+i,n)a.id=n.id;else if(null!=r.id)a.id=r.id+"";else{var o=0;do{a.id="\0"+a.name+"\0"+o++}while(t.get(a.id))}t.set(a.id,e)}}))},lo.isNameSpecified=function(e){var t=e.name;return!(!t||!t.indexOf(go))},lo.isIdInner=vo,lo.compressBatches=function(e,t){var i={},n={};return r(e||[],i),r(t||[],n,i),[a(i),a(n)];function r(e,t,i){for(var n=0,r=e.length;n=0||n&&Io.indexOf(n,o)<0)){var s=t.getShallow(o);null!=s&&(r[e[a][0]]=s)}}return r}},Do=Co([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Eo={getLineStyle:function(e){var t=Do(this,e);return t.lineDash=this.getLineDash(t.lineWidth),t},getLineDash:function(e){null==e&&(e=1);var t=this.get("type"),i=Math.max(e,2),n=4*e;return"solid"!==t&&null!=t&&("dashed"===t?[n,n]:[i,i])}},Lo=Co([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Po={getAreaStyle:function(e,t){return Lo(this,e,t)}},No={},Ro={},Oo={},ko=V,zo=ko.create,Bo=ko.distSquare,Fo=Math.pow,Vo=Math.sqrt,Go=1e-8,Ho=1e-4,Uo=Vo(3),Wo=1/3,jo=zo(),Xo=zo(),Zo=zo();function qo(e){return e>-1e-8&&eGo||e<-1e-8}function Ko(e,t,i,n,r){var a=1-r;return a*a*(a*e+3*r*t)+r*r*(r*n+3*a*i)}function Qo(e,t,i,n){var r=1-n;return r*(r*e+2*n*t)+n*n*i}Oo.cubicAt=Ko,Oo.cubicDerivativeAt=function(e,t,i,n,r){var a=1-r;return 3*(((t-e)*a+2*(i-t)*r)*a+(n-i)*r*r)},Oo.cubicRootAt=function(e,t,i,n,r,a){var o=n+3*(t-i)-e,s=3*(i-2*t+e),l=3*(t-e),u=e-r,h=s*s-3*o*l,c=s*l-9*o*u,d=l*l-3*s*u,f=0;if(qo(h)&&qo(c))qo(s)?a[0]=0:(S=-l/s)>=0&&S<=1&&(a[f++]=S);else{var p=c*c-4*h*d;if(qo(p)){var g=c/h,m=-g/2;(S=-s/o+g)>=0&&S<=1&&(a[f++]=S),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=Vo(p),y=h*s+1.5*o*(-c+v),_=h*s+1.5*o*(-c-v);(S=(-s-((y=y<0?-Fo(-y,Wo):Fo(y,Wo))+(_=_<0?-Fo(-_,Wo):Fo(_,Wo))))/(3*o))>=0&&S<=1&&(a[f++]=S)}else{var x=(2*h*s-3*o*c)/(2*Vo(h*h*h)),b=Math.acos(x)/3,w=Vo(h),T=Math.cos(b),S=(-s-2*w*T)/(3*o),M=(m=(-s+w*(T+Uo*Math.sin(b)))/(3*o),(-s+w*(T-Uo*Math.sin(b)))/(3*o));S>=0&&S<=1&&(a[f++]=S),m>=0&&m<=1&&(a[f++]=m),M>=0&&M<=1&&(a[f++]=M)}}return f},Oo.cubicExtrema=function(e,t,i,n,r){var a=6*i-12*t+6*e,o=9*t+3*n-3*e-9*i,s=3*t-3*e,l=0;if(qo(o))Yo(a)&&(h=-s/a)>=0&&h<=1&&(r[l++]=h);else{var u=a*a-4*o*s;if(qo(u))r[0]=-a/(2*o);else if(u>0){var h,c=Vo(u),d=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l},Oo.cubicSubdivide=function(e,t,i,n,r,a){var o=(t-e)*r+e,s=(i-t)*r+t,l=(n-i)*r+i,u=(s-o)*r+o,h=(l-s)*r+s,c=(h-u)*r+u;a[0]=e,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n},Oo.cubicProjectPoint=function(e,t,i,n,r,a,o,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;jo[0]=l,jo[1]=u;for(var y=0;y<1;y+=.05)Xo[0]=Ko(e,i,r,o,y),Xo[1]=Ko(t,n,a,s,y),(p=Bo(jo,Xo))=0&&p=0&&h<=1&&(r[l++]=h);else{var u=o*o-4*a*s;if(qo(u))(h=-o/(2*a))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=Vo(u),d=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l},Oo.quadraticExtremum=function(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n},Oo.quadraticSubdivide=function(e,t,i,n,r){var a=(t-e)*n+e,o=(i-t)*n+t,s=(o-a)*n+a;r[0]=e,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=i},Oo.quadraticProjectPoint=function(e,t,i,n,r,a,o,s,l){var u,h=.005,c=1/0;jo[0]=o,jo[1]=s;for(var d=0;d<1;d+=.05)Xo[0]=Qo(e,i,r,d),Xo[1]=Qo(t,n,a,d),(m=Bo(jo,Xo))=0&&m1e-4)return s[0]=e-i,s[1]=t-n,l[0]=e+i,void(l[1]=t+n);if(os[0]=rs(r)*i+e,os[1]=ns(r)*n+t,ss[0]=rs(a)*i+e,ss[1]=ns(a)*n+t,u(s,os,ss),h(l,os,ss),(r%=as)<0&&(r+=as),(a%=as)<0&&(a+=as),r>a&&!o?a+=as:rr&&(ls[0]=rs(f)*i+e,ls[1]=ns(f)*n+t,u(s,ls,s),h(l,ls,l))};var cs=Oo,ds=V,fs=Jo,ps=Pi,gs=$t.devicePixelRatio,ms={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},vs=[],ys=[],_s=[],xs=[],bs=Math.min,ws=Math.max,Ts=Math.cos,Ss=Math.sin,Ms=Math.sqrt,As=Math.abs,Is="undefined"!=typeof Float32Array,Cs=function(e){this._saveData=!e,this._saveData&&(this.data=[]),this._ctx=null};Cs.prototype={constructor:Cs,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(e,t,i){i=i||0,this._ux=As(i/gs/e)||0,this._uy=As(i/gs/t)||0},getContext:function(){return this._ctx},beginPath:function(e){return this._ctx=e,e&&e.beginPath(),e&&(this.dpr=e.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(e,t){return this.addData(ms.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},lineTo:function(e,t){var i=As(e-this._xi)>this._ux||As(t-this._yi)>this._uy||this._len<5;return this.addData(ms.L,e,t),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),i&&(this._xi=e,this._yi=t),this},bezierCurveTo:function(e,t,i,n,r,a){return this.addData(ms.C,e,t,i,n,r,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(e,t,i,n,r,a):this._ctx.bezierCurveTo(e,t,i,n,r,a)),this._xi=r,this._yi=a,this},quadraticCurveTo:function(e,t,i,n){return this.addData(ms.Q,e,t,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(e,t,i,n):this._ctx.quadraticCurveTo(e,t,i,n)),this._xi=i,this._yi=n,this},arc:function(e,t,i,n,r,a){return this.addData(ms.A,e,t,i,i,n,r-n,0,a?0:1),this._ctx&&this._ctx.arc(e,t,i,n,r,a),this._xi=Ts(r)*i+e,this._yi=Ss(r)*i+t,this},arcTo:function(e,t,i,n,r){return this._ctx&&this._ctx.arcTo(e,t,i,n,r),this},rect:function(e,t,i,n){return this._ctx&&this._ctx.rect(e,t,i,n),this.addData(ms.R,e,t,i,n),this},closePath:function(){this.addData(ms.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&(this._needsDash()&&this._dashedLineTo(t,i),e.closePath()),this._xi=t,this._yi=i,this},fill:function(e){e&&e.fill(),this.toStatic()},stroke:function(e){e&&e.stroke(),this.toStatic()},setLineDash:function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,i=0;it.length&&(this._expandData(),t=this.data);for(var i=0;i0&&f<=e||h<0&&f>=e||0===h&&(c>0&&p<=t||c<0&&p>=t);)f+=h*(i=o[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&fl||c>0&&pu||s[n%2?"moveTo":"lineTo"](h>=0?bs(f,e):ws(f,e),c>=0?bs(p,t):ws(p,t));h=f-e,c=p-t,this._dashOffset=-Ms(h*h+c*c)},_dashedBezierTo:function(e,t,i,n,r,a){var o,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=cs.cubicAt,y=0,_=this._dashIdx,x=f.length,b=0;for(d<0&&(d=c+d),d%=c,o=0;o<1;o+=.1)s=v(g,e,i,r,o+.1)-v(g,e,i,r,o),l=v(m,t,n,a,o+.1)-v(m,t,n,a,o),y+=Ms(s*s+l*l);for(;_d);_++);for(o=(b-d)/y;o<=1;)u=v(g,e,i,r,o),h=v(m,t,n,a,o),_%2?p.moveTo(u,h):p.lineTo(u,h),o+=f[_]/y,_=(_+1)%x;_%2!=0&&p.lineTo(r,a),s=r-u,l=a-h,this._dashOffset=-Ms(s*s+l*l)},_dashedQuadraticTo:function(e,t,i,n){var r=i,a=n;i=(i+2*e)/3,n=(n+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,i,n,r,a)},toStatic:function(){var e=this.data;e instanceof Array&&(e.length=this._len,Is&&(this.data=new Float32Array(e)))},getBoundingRect:function(){vs[0]=vs[1]=_s[0]=_s[1]=Number.MAX_VALUE,ys[0]=ys[1]=xs[0]=xs[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,i=0,n=0,r=0,a=0;al||As(o-r)>u||c===h-1)&&(e.lineTo(a,o),n=a,r=o);break;case ms.C:e.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],r=s[c-1];break;case ms.Q:e.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],r=s[c-1];break;case ms.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],_=s[c++],x=s[c++],b=g>m?g:m,w=g>m?1:g/m,T=g>m?m/g:1,S=v+y;Math.abs(g-m)>.001?(e.translate(f,p),e.rotate(_),e.scale(w,T),e.arc(0,0,b,v,S,1-x),e.scale(1/w,1/T),e.rotate(-_),e.translate(-f,-p)):e.arc(f,p,b,v,S,1-x),1===c&&(t=Ts(v)*g+f,i=Ss(v)*m+p),n=Ts(S)*g+f,r=Ss(S)*m+p;break;case ms.R:t=n=s[c],i=r=s[c+1],e.rect(s[c++],s[c++],s[c++],s[c++]);break;case ms.Z:e.closePath(),n=t,r=i}}}},Cs.CMD=ms;var Ds=Cs,Es={},Ls={containStroke:function(e,t,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>n+s||oe+s&&a>i+s||at+c&&h>n+c&&h>a+c&&h>s+c||he+c&&u>i+c&&u>r+c&&u>o+c||ut+u&&l>n+u&&l>a+u||le+u&&s>i+u&&s>r+u||si||h+ur&&(r+=Vs);var d=Math.atan2(l,s);return d<0&&(d+=Vs),d>=n&&d<=r||d+Vs>=n&&d+Vs<=r};var Gs=function(e,t,i,n,r,a){if(a>t&&a>n||ar?o:0},Hs=Ds,Us=Ls,Ws=Ps,js=Rs,Xs=ks,Zs=zs.normalizeRadian,qs=Oo,Ys=Gs,Ks=Hs.CMD,Qs=2*Math.PI,Js=[-1,-1,-1],$s=[-1,-1];function el(e,t,i,n,r,a,o,s,l,u){if(u>t&&u>n&&u>a&&u>s||u1&&(h=void 0,h=$s[0],$s[0]=$s[1],$s[1]=h),d=qs.cubicAt(t,n,a,s,$s[0]),g>1&&(f=qs.cubicAt(t,n,a,s,$s[1]))),2===g?v<$s[0]?p+=dt&&s>n&&s>a||s=0&&u<=1){for(var h=0,c=qs.quadraticAt(t,n,a,u),d=0;di||s<-i)return 0;var l=Math.sqrt(i*i-s*s);Js[0]=-l,Js[1]=l;var u=Math.abs(n-r);if(u<1e-4)return 0;if(u%Qs<1e-4){n=0,r=Qs;var h=a?1:-1;return o>=Js[0]+e&&o<=Js[1]+e?h:0}a?(l=n,n=Zs(r),r=Zs(l)):(n=Zs(n),r=Zs(r)),n>r&&(r+=Qs);for(var c=0,d=0;d<2;d++){var f=Js[d];if(f+e>o){var p=Math.atan2(s,f);h=a?1:-1,p<0&&(p=Qs+p),(p>=n&&p<=r||p+Qs>=n&&p+Qs<=r)&&(p>Math.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function nl(e,t,i,n,r){for(var a,o,s=0,l=0,u=0,h=0,c=0,d=0;d1&&(i||(s+=Ys(l,u,h,c,n,r))),1===d&&(h=l=e[d],c=u=e[d+1]),f){case Ks.M:l=h=e[d++],u=c=e[d++];break;case Ks.L:if(i){if(Us.containStroke(l,u,e[d],e[d+1],t,n,r))return!0}else s+=Ys(l,u,e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ks.C:if(i){if(Ws.containStroke(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],t,n,r))return!0}else s+=el(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ks.Q:if(i){if(js.containStroke(l,u,e[d++],e[d++],e[d],e[d+1],t,n,r))return!0}else s+=tl(l,u,e[d++],e[d++],e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ks.A:var p=e[d++],g=e[d++],m=e[d++],v=e[d++],y=e[d++],_=e[d++];d+=1;var x=1-e[d++],b=Math.cos(y)*m+p,w=Math.sin(y)*v+g;d>1?s+=Ys(l,u,b,w,n,r):(h=b,c=w);var T=(n-p)*v/m+p;if(i){if(Xs.containStroke(p,g,v,y,y+_,x,t,T,r))return!0}else s+=il(p,g,v,y,y+_,x,T,r);l=Math.cos(y+_)*m+p,u=Math.sin(y+_)*v+g;break;case Ks.R:if(h=l=e[d++],c=u=e[d++],b=h+e[d++],w=c+e[d++],i){if(Us.containStroke(h,c,b,c,t,n,r)||Us.containStroke(b,c,b,w,t,n,r)||Us.containStroke(b,w,h,w,t,n,r)||Us.containStroke(h,w,h,c,t,n,r))return!0}else s+=Ys(b,c,b,w,n,r),s+=Ys(h,w,h,c,n,r);break;case Ks.Z:if(i){if(Us.containStroke(l,u,h,c,t,n,r))return!0}else s+=Ys(l,u,h,c,n,r);l=h,u=c}}return i||(a=u,o=c,Math.abs(a-o)<1e-4)||(s+=Ys(l,u,h,c,n,r)||0),0!==s}Es.contain=function(e,t,i){return nl(e,0,!1,t,i)},Es.containStroke=function(e,t,i,n){return nl(e,t,!0,i,n)};var rl=Wr,al=g,ol=Ds,sl=Es,ll=dn.prototype.getCanvasPattern,ul=Math.abs,hl=new ol(!0);function cl(e){rl.call(this,e),this.path=null}cl.prototype={constructor:cl,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(e,t){var i,n=this.style,r=this.path||hl,a=n.hasStroke(),o=n.hasFill(),s=n.fill,l=n.stroke,u=o&&!!s.colorStops,h=a&&!!l.colorStops,c=o&&!!s.image,d=a&&!!l.image;n.bind(e,this,t),this.setTransform(e),this.__dirty&&(u&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(e,s,i)),h&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(e,l,i))),u?e.fillStyle=this._fillGradient:c&&(e.fillStyle=ll.call(s,e)),h?e.strokeStyle=this._strokeGradient:d&&(e.strokeStyle=ll.call(l,e));var f=n.lineDash,p=n.lineDashOffset,g=!!e.setLineDash,m=this.getGlobalScale();if(r.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||f&&!g&&a?(r.beginPath(e),f&&!g&&(r.setLineDash(f),r.setLineDashOffset(p)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(e.beginPath(),this.path.rebuildPath(e)),o)if(null!=n.fillOpacity){var v=e.globalAlpha;e.globalAlpha=n.fillOpacity*n.opacity,r.fill(e),e.globalAlpha=v}else r.fill(e);f&&g&&(e.setLineDash(f),e.lineDashOffset=p),a&&(null!=n.strokeOpacity?(v=e.globalAlpha,e.globalAlpha=n.strokeOpacity*n.opacity,r.stroke(e),e.globalAlpha=v):r.stroke(e)),f&&g&&e.setLineDash([]),null!=n.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))},buildPath:function(e,t,i){},createPathProxy:function(){this.path=new ol},getBoundingRect:function(){var e=this._rect,t=this.style,i=!e;if(i){var n=this.path;n||(n=this.path=new ol),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),e=n.getBoundingRect()}if(this._rect=e,t.hasStroke()){var r=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){r.copy(e);var a=t.lineWidth,o=t.strokeNoScale?this.getLineScale():1;t.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),o>1e-10&&(r.width+=a/o,r.height+=a/o,r.x-=a/o/2,r.y-=a/o/2)}return r}return e},contain:function(e,t){var i=this.transformCoordToLocal(e,t),n=this.getBoundingRect(),r=this.style;if(e=i[0],t=i[1],n.contain(e,t)){var a=this.path.data;if(r.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(r.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),sl.containStroke(a,o/s,e,t)))return!0}if(r.hasFill())return sl.contain(a,e,t)}return!1},dirty:function(e){null==e&&(e=!0),e&&(this.__dirtyPath=e,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(e){return this.animate("shape",e)},attrKV:function(e,t){"shape"===e?(this.setShape(t),this.__dirtyPath=!0,this._rect=null):rl.prototype.attrKV.call(this,e,t)},setShape:function(e,t){var i=this.shape;if(i){if(al.isObject(e))for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);else i[e]=t;this.dirty(!0)}return this},getLineScale:function(){var e=this.transform;return e&&ul(e[0]-1)>1e-10&&ul(e[3]-1)>1e-10?Math.sqrt(ul(e[0]*e[3]-e[2]*e[1])):1}},cl.extend=function(e){var t=function(t){cl.call(this,t),e.style&&this.style.extendFrom(e.style,!1);var i=e.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var r in i)!n.hasOwnProperty(r)&&i.hasOwnProperty(r)&&(n[r]=i[r])}e.init&&e.init.call(this,t)};for(var i in al.inherits(t,cl),e)"style"!==i&&"shape"!==i&&(t.prototype[i]=e[i]);return t},al.inherits(cl,rl);var dl=cl,fl=Ds,pl=V.applyTransform,gl=fl.CMD,ml=[[],[],[]],vl=Math.sqrt,yl=Math.atan2,_l=function(e,t){var i,n,r,a,o,s=e.data,l=gl.M,u=gl.C,h=gl.L,c=gl.R,d=gl.A,f=gl.Q;for(r=0,a=0;r1&&(o*=Tl(p),s*=Tl(p));var g=(r===a?-1:1)*Tl((o*o*(s*s)-o*o*(f*f)-s*s*(d*d))/(o*o*(f*f)+s*s*(d*d)))||0,m=g*o*f/s,v=g*-s*d/o,y=(e+i)/2+Ml(c)*m-Sl(c)*v,_=(t+n)/2+Sl(c)*m+Ml(c)*v,x=Dl([1,0],[(d-m)/o,(f-v)/s]),b=[(d-m)/o,(f-v)/s],w=[(-1*d-m)/o,(-1*f-v)/s],T=Dl(b,w);Cl(b,w)<=-1&&(T=Al),Cl(b,w)>=1&&(T=0),0===a&&T>0&&(T-=2*Al),1===a&&T<0&&(T+=2*Al),h.addData(u,y,_,o,s,x,T,c,a)}var Ll=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Pl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Nl(e,t){var i=function(e){if(!e)return new bl;for(var t,i=0,n=0,r=i,a=n,o=new bl,s=bl.CMD,l=e.match(Ll),u=0;u=11?function(){var t,i=this.__clipPaths,n=this.style;if(i)for(var r=0;ri-2?i-1:c+1],u=e[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([Jl(s[0],f[0],l[0],u[0],d,p,g),Jl(s[1],f[1],l[1],u[1],d,p,g)])}return n},eu=V,tu=eu.min,iu=eu.max,nu=eu.scale,ru=eu.distance,au=eu.add,ou=eu.clone,su=eu.sub,lu=function(e,t,i,n){var r,a,o,s,l=[],u=[],h=[],c=[];if(n){o=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=e.length;d=2){if(r&&"spline"!==r){var a=hu(n,r,i,t.smoothConstraint);e.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(i?o:o-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===r&&(n=uu(n,i)),e.moveTo(n[0][0],n[0][1]),s=1;for(var c=n.length;s=0),l=!s&&null!=r;(s||l)&&(t={textFill:e.textFill,textStroke:e.textStroke,textStrokeWidth:e.textStrokeWidth}),s&&(e.textFill="#fff",null==e.textStroke&&(e.textStroke=r,null==e.textStrokeWidth&&(e.textStrokeWidth=2))),l&&(e.textFill=r)}e.insideRollback=t}function uc(e){var t=e.insideRollback;t&&(e.textFill=t.textFill,e.textStroke=t.textStroke,e.textStrokeWidth=t.textStrokeWidth,e.insideRollback=null)}function hc(e,t,i,n,r,a){if("function"==typeof r&&(a=r,r=null),n&&n.isAnimationEnabled()){var o=e?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),u=n.getShallow("animationDelay"+o);"function"==typeof u&&(u=u(r,n.getAnimationDelayParams?n.getAnimationDelayParams(t,r):null)),"function"==typeof s&&(s=s(r)),s>0?t.animateTo(i,s,u||0,l,a,!!a):(t.stopAnimation(),t.attr(i),a&&a())}else t.stopAnimation(),t.attr(i),a&&a()}function cc(e,t,i,n,r){hc(!0,e,t,i,n,r)}function dc(e,t,i){return t&&!ah.isArrayLike(t)&&(t=ch.getLocalTransform(t)),i&&(t=lh.invert([],t)),uh.applyTransform([],e,t)}function fc(e,t,i,n,r,a,o,s){var l,u=i-e,h=n-t,c=o-r,d=s-a,f=pc(c,d,u,h);if((l=f)<=1e-6&&l>=-1e-6)return!1;var p=e-r,g=t-a,m=pc(p,g,u,h)/f;if(m<0||m>1)return!1;var v=pc(p,g,c,d)/f;return!(v<0||v>1)}function pc(e,t,i,n){return e*n-i*t}Bh("circle",gh),Bh("sector",mh),Bh("ring",vh),Bh("polygon",yh),Bh("polyline",_h),Bh("rect",xh),Bh("line",bh),Bh("bezierCurve",wh),Bh("arc",Th),No.Z2_EMPHASIS_LIFT=1,No.CACHED_LABEL_STYLE_PROPERTIES={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},No.extendShape=function(e){return hh.extend(e)},No.extendPath=function(e,t){return oh.extendFromString(e,t)},No.registerShape=Bh,No.getShapeClass=function(e){if(zh.hasOwnProperty(e))return zh[e]},No.makePath=Fh,No.makeImage=function(e,t,i){var n=new dh({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===i){var r={width:e.width,height:e.height};n.setStyle(Vh(t,r))}}});return n},No.mergePath=Gh,No.resizePath=Hh,No.subPixelOptimizeLine=function(e){return Dh.subPixelOptimizeLine(e.shape,e.shape,e.style),e},No.subPixelOptimizeRect=function(e){return Dh.subPixelOptimizeRect(e.shape,e.shape,e.style),e},No.subPixelOptimize=Uh,No.setElementHoverStyle=Qh,No.setHoverStyle=function(e,t){nc(e,!0),Kh(e,Qh,t)},No.setAsHighDownDispatcher=nc,No.isHighDownDispatcher=function(e){return!(!e||!e.__highDownDispatcher)},No.getHighlightDigit=function(e){var t=kh[e];return null==t&&Oh<=32&&(t=kh[e]=Oh++),t},No.setLabelStyle=function(e,t,i,n,r,a,o){var s,l=(r=r||Ph).labelFetcher,u=r.labelDataIndex,h=r.labelDimIndex,c=r.labelProp,d=i.getShallow("show"),f=n.getShallow("show");(d||f)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h,c)),null==s&&(s=ah.isFunction(r.defaultText)?r.defaultText(u,r):r.defaultText));var p=d?s:null,g=f?ah.retrieve2(l?l.getFormattedLabel(u,"emphasis",null,h,c):null,s):null;null==p&&null==g||(rc(e,i,a,r),rc(t,n,o,r,!0)),e.text=p,t.text=g},No.modifyLabelStyle=function(e,t,i){var n=e.style;t&&(uc(n),e.setStyle(t),lc(n)),n=e.__hoverStl,i&&n&&(uc(n),ah.extend(n,i),lc(n))},No.setTextStyle=rc,No.setText=function(e,t,i){var n,r={isRectText:!0};!1===i?n=!0:r.autoColor=i,ac(e,t,r,n)},No.getFont=function(e,t){var i=t&&t.getModel("textStyle");return ah.trim([e.fontStyle||i&&i.getShallow("fontStyle")||"",e.fontWeight||i&&i.getShallow("fontWeight")||"",(e.fontSize||i&&i.getShallow("fontSize")||12)+"px",e.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))},No.updateProps=cc,No.initProps=function(e,t,i,n,r){hc(!1,e,t,i,n,r)},No.getTransform=function(e,t){for(var i=lh.identity([]);e&&e!==t;)lh.mul(i,e.getLocalTransform(),i),e=e.parent;return i},No.applyTransform=dc,No.transformDirection=function(e,t,i){var n=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),r=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),a=["left"===e?-n:"right"===e?n:0,"top"===e?-r:"bottom"===e?r:0];return a=dc(a,t,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},No.groupTransition=function(e,t,i,n){if(e&&t){var r,a=(r={},e.traverse((function(e){!e.isGroup&&e.anid&&(r[e.anid]=e)})),r);t.traverse((function(e){if(!e.isGroup&&e.anid){var t=a[e.anid];if(t){var n=o(e);e.attr(o(t)),cc(e,n,i,e.dataIndex)}}}))}function o(e){var t={position:uh.clone(e.position),rotation:e.rotation};return e.shape&&(t.shape=ah.extend({},e.shape)),t}},No.clipPointsByRect=function(e,t){return ah.map(e,(function(e){var i=e[0];i=Eh(i,t.x),i=Lh(i,t.x+t.width);var n=e[1];return n=Eh(n,t.y),[i,n=Lh(n,t.y+t.height)]}))},No.clipRectByRect=function(e,t){var i=Eh(e.x,t.x),n=Lh(e.x+e.width,t.x+t.width),r=Eh(e.y,t.y),a=Lh(e.y+e.height,t.y+t.height);if(n>=i&&a>=r)return{x:i,y:r,width:n-i,height:a-r}},No.createIcon=function(e,t,i){var n=(t=ah.extend({rectHover:!0},t)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(n.image=e.slice(8),ah.defaults(n,i),new dh(t)):Fh(e.replace("path://",""),t,i,"center")},No.linePolygonIntersect=function(e,t,i,n,r){for(var a=0,o=r[r.length-1];a=0&&i.push(e)})),i}(o.originalDeps=t(a),e);o.entryCount=s.length,0===o.entryCount&&r.push(a),Fc.each(s,(function(e){Fc.indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=i(n,e);Fc.indexOf(t.successor,e)<0&&t.successor.push(a)}))})),{graph:n,noEntryList:r}}(n),s=o.graph,l=o.noEntryList,u={};for(Fc.each(e,(function(e){u[e]=!0}));l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(r.call(a,h,c.originalDeps.slice()),delete u[h]),Fc.each(c.successor,d?p:f)}Fc.each(u,(function(){throw new Error("Circle dependency may exists")}))}function f(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function p(e){u[e]=!0,f(e)}}};var Hc={},Uc={},Wc=g,jc=1e-4,Xc=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Zc(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}Uc.linearMap=function(e,t,i,n){var r=t[1]-t[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/r*a+i[0]},Uc.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?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},Uc.round=function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},Uc.asc=function(e){return e.sort((function(e,t){return e-t})),e},Uc.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},Uc.getPrecisionSafe=function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},Uc.getPixelPrecision=function(e,t){var i=Math.log,n=Math.LN10,r=Math.floor(i(e[1]-e[0])/n),a=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},Uc.getPercentWithPrecision=function(e,t,i){if(!e[t])return 0;var n=Wc.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return 0;for(var r=Math.pow(10,i),a=Wc.map(e,(function(e){return(isNaN(e)?0:e)/n*r*100})),o=100*r,s=Wc.map(a,(function(e){return Math.floor(e)})),l=Wc.reduce(s,(function(e,t){return e+t}),0),u=Wc.map(a,(function(e,t){return e-s[t]}));lh&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[t]/r},Uc.MAX_SAFE_INTEGER=9007199254740991,Uc.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},Uc.isRadianAroundZero=function(e){return e>-1e-4&&e=-20?+e.toFixed(i<0?-i:0):e},Uc.quantile=function(e,t){var i=(e.length-1)*t+1,n=Math.floor(i),r=+e[n-1],a=i-n;return a?r+a*(e[n]-r):r},Uc.reformIntervals=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n=0};var qc={},Yc=g,Kc=Tn,Qc=Uc,Jc=Yc.normalizeCssArray,$c=/([&<>"'])/g,ed={"&":"&","<":"<",">":">",'"':""","'":"'"};function td(e){return null==e?"":(e+"").replace($c,(function(e,t){return ed[t]}))}var id=["a","b","c","d","e","f","g"],nd=function(e,t){return"{"+e+(null==t?"":t)+"}"};function rd(e,t){return"0000".substr(0,t-(e+="").length)+e}var ad=Kc.truncateText;qc.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},qc.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},qc.normalizeCssArray=Jc,qc.encodeHTML=td,qc.formatTpl=function(e,t,i){Yc.isArray(t)||(t=[t]);var n=t.length;if(!n)return"";for(var r=t[0].$vars||[],a=0;a':'':{renderMode:r,content:"{marker"+a+"|} ",style:{color:i}}:""},qc.formatTime=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=Qc.parseDate(t),r=i?"UTC":"",a=n["get"+r+"FullYear"](),o=n["get"+r+"Month"]()+1,s=n["get"+r+"Date"](),l=n["get"+r+"Hours"](),u=n["get"+r+"Minutes"](),h=n["get"+r+"Seconds"](),c=n["get"+r+"Milliseconds"]();return e=e.replace("MM",rd(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100).replace("dd",rd(s,2)).replace("d",s).replace("hh",rd(l,2)).replace("h",l).replace("mm",rd(u,2)).replace("m",u).replace("ss",rd(h,2)).replace("s",h).replace("SSS",rd(c,3))},qc.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},qc.truncateText=ad,qc.getTextBoundingRect=function(e){return Kc.getBoundingRect(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},qc.getTextRect=function(e,t,i,n,r,a,o,s){return Kc.getBoundingRect(e,t,i,n,r,s,a,o)},qc.windowOpen=function(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)};var od=g,sd=Pi,ld=Uc.parsePercent,ud=qc,hd=od.each,cd=["left","right","top","bottom","width","height"],dd=[["width","left","right"],["height","top","bottom"]];function fd(e,t,i,n,r){var a=0,o=0;null==n&&(n=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===e){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=o+v)>r||l.newline?(a+=s+i,o=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===e?a=h+i:o=c+i)}))}var pd=fd,gd=od.curry(fd,"vertical"),md=od.curry(fd,"horizontal");function vd(e,t,i){i=ud.normalizeCssArray(i||0);var n=t.width,r=t.height,a=ld(e.left,n),o=ld(e.top,r),s=ld(e.right,n),l=ld(e.bottom,r),u=ld(e.width,n),h=ld(e.height,r),c=i[2]+i[0],d=i[1]+i[3],f=e.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=r-l-c-o),null!=f&&(isNaN(u)&&isNaN(h)&&(f>n/r?u=.8*n:h=.8*r),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(o)&&(o=r-l-h-c),e.left||e.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(e.top||e.bottom){case"middle":case"center":o=r/2-h/2-i[0];break;case"bottom":o=r-h-c}a=a||0,o=o||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=r-c-o-(l||0));var p=new sd(a+i[3],o+i[0],u,h);return p.margin=i,p}function yd(e,t){return t&&e&&hd(cd,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}Hc.LOCATION_PARAMS=cd,Hc.HV_NAMES=dd,Hc.box=pd,Hc.vbox=gd,Hc.hbox=md,Hc.getAvailableSize=function(e,t,i){var n=t.width,r=t.height,a=ld(e.x,n),o=ld(e.y,r),s=ld(e.x2,n),l=ld(e.y2,r);return(isNaN(a)||isNaN(parseFloat(e.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=n),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.y2)))&&(l=r),i=ud.normalizeCssArray(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}},Hc.getLayoutRect=vd,Hc.positionElement=function(e,t,i,n,r){var a=!r||!r.hv||r.hv[0],o=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(a||o){var l;if("raw"===s)l="group"===e.type?new sd(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}t=vd(od.defaults({width:l.width,height:l.height},t),i,n);var h=e.position,c=a?t.x-l.x:0,d=o?t.y-l.y:0;e.attr("position","raw"===s?[c,d]:[h[0]+c,h[1]+d])}},Hc.sizeCalculable=function(e,t){return null!=e[dd[t][0]]||null!=e[dd[t][1]]&&null!=e[dd[t][2]]},Hc.mergeLayoutParam=function(e,t,i){!od.isObject(i)&&(i={});var n=i.ignoreSize;!od.isArray(n)&&(n=[n,n]);var r=o(dd[0],0),a=o(dd[1],1);function o(i,r){var a={},o=0,u={},h=0;if(hd(i,(function(t){u[t]=e[t]})),hd(i,(function(e){s(t,e)&&(a[e]=u[e]=t[e]),l(a,e)&&o++,l(u,e)&&h++})),n[r])return l(t,i[1])?u[i[2]]=null:l(t,i[2])&&(u[i[1]]=null),u;if(2!==h&&o){if(o>=2)return a;for(var c=0;c=0;a--)r=xd.merge(r,t[a],!0);e.defaultOption=r}return e.defaultOption},getReferringComponents:function(e){return this.ecModel.queryComponents({mainType:e,index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)})}});Sd(Ed,{registerWhenExtend:!0}),wd.enableSubTypeDefaulter(Ed),wd.enableTopologicalTravel(Ed,(function(e){var t=[];return xd.each(Ed.getClassesByMainType(e),(function(e){t=t.concat(e.prototype.dependencies||[])})),t=xd.map(t,(function(e){return Md(e).main})),"dataset"!==e&&xd.indexOf(t,"dataset")<=0&&t.unshift("dataset"),t})),xd.mixin(Ed,Cd);var Ld=Ed,Pd="";"undefined"!=typeof navigator&&(Pd=navigator.platform||"");var Nd={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:Pd.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Rd=lo,Od=Rd.makeInner,kd=Rd.normalizeToArray,zd=Od(),Bd={clearColorPalette:function(){zd(this).colorIdx=0,zd(this).colorNameMap={}},getColorFromPalette:function(e,t,i){var n=zd(t=t||this),r=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(e))return a[e];var o=kd(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?function(e,t){for(var i=e.length,n=0;nt)return e[n];return e[i-1]}(s,i):o;if((l=l||o)&&l.length){var u=l[r];return e&&(a[e]=u),n.colorIdx=(r+1)%l.length,u}}},Fd=Bd,Vd={},Gd={SOURCE_FORMAT_ORIGINAL:"original",SOURCE_FORMAT_ARRAY_ROWS:"arrayRows",SOURCE_FORMAT_OBJECT_ROWS:"objectRows",SOURCE_FORMAT_KEYED_COLUMNS:"keyedColumns",SOURCE_FORMAT_UNKNOWN:"unknown",SOURCE_FORMAT_TYPED_ARRAY:"typedArray",SERIES_LAYOUT_BY_COLUMN:"column",SERIES_LAYOUT_BY_ROW:"row"},Hd=g,Ud=Hd.createHashMap,Wd=Hd.isTypedArray,jd=xo.enableClassCheck,Xd=Gd,Zd=Xd.SOURCE_FORMAT_ORIGINAL,qd=Xd.SERIES_LAYOUT_BY_COLUMN,Yd=Xd.SOURCE_FORMAT_UNKNOWN,Kd=Xd.SOURCE_FORMAT_TYPED_ARRAY,Qd=Xd.SOURCE_FORMAT_KEYED_COLUMNS;function Jd(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===Qd?{}:[]),this.sourceFormat=e.sourceFormat||Yd,this.seriesLayoutBy=e.seriesLayoutBy||qd,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&Ud(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Jd.seriesDataToSource=function(e){return new Jd({data:e,sourceFormat:Wd(e)?Kd:Zd,fromDataset:!1})},jd(Jd);var $d=Jd,ef=lo,tf=ef.makeInner,nf=ef.getDataItemValue,rf=g,af=rf.createHashMap,of=rf.each,sf=rf.map,lf=rf.isArray,uf=rf.isString,hf=rf.isObject,cf=rf.isTypedArray,df=rf.isArrayLike,ff=rf.extend;rf.assert;var pf=$d,gf=Gd,mf=gf.SOURCE_FORMAT_ORIGINAL,vf=gf.SOURCE_FORMAT_ARRAY_ROWS,yf=gf.SOURCE_FORMAT_OBJECT_ROWS,_f=gf.SOURCE_FORMAT_KEYED_COLUMNS,xf=gf.SOURCE_FORMAT_UNKNOWN,bf=gf.SOURCE_FORMAT_TYPED_ARRAY,wf=gf.SERIES_LAYOUT_BY_ROW,Tf={Must:1,Might:2,Not:3},Sf=tf();function Mf(e){if(e){var t=af();return sf(e,(function(e,i){if(null==(e=ff({},hf(e)?e:{name:e})).name)return e;e.name+="",null==e.displayName&&(e.displayName=e.name);var n=t.get(e.name);return n?e.name+="-"+n.count++:t.set(e.name,{count:1}),e}))}}function Af(e,t,i,n){if(null==n&&(n=1/0),t===wf)for(var r=0;r=0;n--)Uf.isIdInner(t[n])&&t.splice(n,1);e[i]=t}})),delete e["\0_ec_inner"],e},getTheme:function(){return this._theme},getComponent:function(e,t){var i=this._componentsMap.get(e);if(i)return i[t||0]},queryComponents:function(e){var t=e.mainType;if(!t)return[];var i,n=e.index,r=e.id,a=e.name,o=this._componentsMap.get(t);if(!o||!o.length)return[];if(null!=n)Nf(n)||(n=[n]),i=Lf(Pf(n,(function(e){return o[e]})),(function(e){return!!e}));else if(null!=r){var s=Nf(r);i=Lf(o,(function(e){return s&&Rf(r,e.id)>=0||!s&&e.id===r}))}else if(null!=a){var l=Nf(a);i=Lf(o,(function(e){return l&&Rf(a,e.name)>=0||!l&&e.name===a}))}else i=o.slice();return $f(i,e)},findComponents:function(e){var t,i,n,r,a,o=e.query,s=e.mainType,l=(i=s+"Index",n=s+"Id",r=s+"Name",!(t=o)||null==t[i]&&null==t[n]&&null==t[r]?null:{mainType:s,index:t[i],id:t[n],name:t[r]}),u=l?this.queryComponents(l):this._componentsMap.get(s);return a=$f(u,e),e.filter?Lf(a,e.filter):a},eachComponent:function(e,t,i){var n=this._componentsMap;if("function"==typeof e)i=t,t=e,n.each((function(e,n){Ef(e,(function(e,r){t.call(i,n,e,r)}))}));else if(kf(e))Ef(n.get(e),t,i);else if(Of(e)){var r=this.findComponents(e);Ef(r,t,i)}},getSeriesByName:function(e){var t=this._componentsMap.get("series");return Lf(t,(function(t){return t.name===e}))},getSeriesByIndex:function(e){return this._componentsMap.get("series")[e]},getSeriesByType:function(e){var t=this._componentsMap.get("series");return Lf(t,(function(t){return t.subType===e}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(e,t){Ef(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];e.call(t,n,i)}),this)},eachRawSeries:function(e,t){Ef(this._componentsMap.get("series"),e,t)},eachSeriesByType:function(e,t,i){Ef(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];r.subType===e&&t.call(i,r,n)}),this)},eachRawSeriesByType:function(e,t,i){return Ef(this.getSeriesByType(e),t,i)},isSeriesFiltered:function(e){return null==this._seriesIndicesMap.get(e.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(e,t){Jf(this,Lf(this._componentsMap.get("series"),e,t))},restoreData:function(e){var t=this._componentsMap;Jf(this,t.get("series"));var i=[];t.each((function(e,t){i.push(t)})),jf.topologicalTravel(i,jf.getAllClassMainTypes(),(function(i,n){Ef(t.get(i),(function(t){("series"!==i||!function(e,t){if(t){var i=t.seiresIndex,n=t.seriesId,r=t.seriesName;return null!=i&&e.componentIndex!==i||null!=n&&e.id!==n||null!=r&&e.name!==r}}(t,e))&&t.restoreData()}))}))}});function Qf(e){e=e,this.option={},this.option["\0_ec_inner"]=1,this._componentsMap=zf({series:[]}),this._seriesIndices,this._seriesIndicesMap,function(e,t){var i=e.color&&!e.colorLayer;Ef(t,(function(t,n){"colorLayer"===n&&i||jf.hasClass(n)||("object"==typeof t?e[n]=e[n]?Vf(e[n],t,!1):Ff(t):null==e[n]&&(e[n]=t))}))}(e,this._theme.option),Vf(e,Xf,!1),this.mergeOption(e)}function Jf(e,t){e._seriesIndicesMap=zf(e._seriesIndices=Pf(t,(function(e){return e.componentIndex}))||[])}function $f(e,t){return t.hasOwnProperty("subType")?Lf(e,(function(e){return e.subType===t.subType})):e}Hf(Kf,Zf);var ep=Kf,tp=g,ip=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],np=function(e){tp.each(ip,(function(t){this[t]=tp.bind(e[t],e)}),this)},rp=g,ap={};function op(){this._coordinateSystems=[]}op.prototype={constructor:op,create:function(e,t){var i=[];rp.each(ap,(function(n,r){var a=n.create(e,t);i=i.concat(a||[])})),this._coordinateSystems=i},update:function(e,t){rp.each(this._coordinateSystems,(function(i){i.update&&i.update(e,t)}))},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},op.register=function(e,t){ap[e]=t},op.get=function(e){return ap[e]};var sp=op,lp=g,up=lo,hp=Ld,cp=lp.each,dp=lp.clone,fp=lp.map,pp=lp.merge,gp=/^(min|max)?(.+)$/;function mp(e){this._api=e,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function vp(e,t,i){var n,r,a=[],o=[],s=e.timeline;if(e.baseOption&&(r=e.baseOption),(s||e.options)&&(r=r||{},a=(e.options||[]).slice()),e.media){r=r||{};var l=e.media;cp(l,(function(e){e&&e.option&&(e.query?o.push(e):n||(n=e))}))}return r||(r=e),r.timeline||(r.timeline=s),cp([r].concat(a).concat(lp.map(o,(function(e){return e.option}))),(function(e){cp(t,(function(t){t(e,i)}))})),{baseOption:r,timelineOptions:a,mediaDefault:n,mediaList:o}}function yp(e,t,i){var n={width:t,height:i,aspectratio:t/i},r=!0;return lp.each(e,(function(e,t){var i=t.match(gp);if(i&&i[1]&&i[2]){var a=i[1],o=i[2].toLowerCase();(function(e,t,i){return"min"===i?e>=t:"max"===i?e<=t:e===t})(n[o],e,a)||(r=!1)}})),r}mp.prototype={constructor:mp,setOption:function(e,t){e&&lp.each(up.normalizeToArray(e.series),(function(e){e&&e.data&&lp.isTypedArray(e.data)&&lp.setAsPrimitive(e.data)})),e=dp(e);var i,n,r=this._optionBackup,a=vp.call(this,e,t,!r);this._newBaseOption=a.baseOption,r?(i=r.baseOption,n=a.baseOption,cp(n=n||{},(function(e,t){if(null!=e){var n=i[t];if(hp.hasClass(t)){e=up.normalizeToArray(e),n=up.normalizeToArray(n);var r=up.mappingToExists(n,e);i[t]=fp(r,(function(e){return e.option&&e.exist?pp(e.exist,e.option,!0):e.exist||e.option}))}else i[t]=pp(n,e,!0)}})),a.timelineOptions.length&&(r.timelineOptions=a.timelineOptions),a.mediaList.length&&(r.mediaList=a.mediaList),a.mediaDefault&&(r.mediaDefault=a.mediaDefault)):this._optionBackup=a},mountOption:function(e){var t=this._optionBackup;return this._timelineOptions=fp(t.timelineOptions,dp),this._mediaList=fp(t.mediaList,dp),this._mediaDefault=dp(t.mediaDefault),this._currentMediaIndices=[],dp(e?t.baseOption:this._newBaseOption)},getTimelineOption:function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=dp(i[n.getCurrentIndex()],!0))}return t},getMediaOption:function(e){var t,i,n=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,o=this._mediaDefault,s=[],l=[];if(!a.length&&!o)return l;for(var u=0,h=a.length;u=0;p--){var g=e[p];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var m=g.data.getByRawIndex(g.stackResultDimension,c);if(d>=0&&m>0||d<=0&&m<0){d+=m,f=m;break}}}return n[0]=d,n[1]=f,n}));o.hostModel.setData(l),t.data=l}))}var Zp=function(e){var t=Wp();e.eachSeries((function(e){var i=e.get("stack");if(i){var n=t.get(i)||t.set(i,[]),r=e.getData(),a={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:e};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&r.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}})),t.each(Xp)},qp={},Yp=g;Yp.isTypedArray;var Kp=Yp.extend;Yp.assert;var Qp=Yp.each,Jp=Yp.isObject,$p=lo,eg=$p.getDataItemValue,tg=$p.isDataItemOption,ig=Uc.parseDate,ng=$d,rg=Gd,ag=rg.SOURCE_FORMAT_TYPED_ARRAY,og=rg.SOURCE_FORMAT_ARRAY_ROWS,sg=rg.SOURCE_FORMAT_ORIGINAL,lg=rg.SOURCE_FORMAT_OBJECT_ROWS;function ug(e,t){ng.isInstance(e)||(e=ng.seriesDataToSource(e)),this._source=e;var i=this._data=e.data,n=e.sourceFormat;n===ag&&(this._offset=0,this._dimSize=t,this._data=i);var r=cg[n===og?n+"_"+e.seriesLayoutBy:n];Kp(this,r)}var hg=ug.prototype;hg.pure=!1,hg.persistent=!0,hg.getSource=function(){return this._source};var cg={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(e){return this._data[e+this._source.startIndex]},appendData:pg},arrayRows_row:{pure:!0,count:function(){var e=this._data[0];return e?Math.max(0,e.length-this._source.startIndex):0},getItem:function(e){e+=this._source.startIndex;for(var t=[],i=this._data,n=0;n=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,a=function(e,t){var i,n;e._dueIndex=e._outputDueEnd=e._dueEnd=0,e._settedOutputEnd=null,!t&&e._reset&&((i=e._reset(e.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),Eg(i)&&!i.length&&(i=null)),e._progress=i,e._modBy=e._modDataCount=null;var r=e._downstream;return r&&r.dirty(),n}(this,n)),this._modBy=l,this._modDataCount=u;var c=e&&e.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(a||d1&&n>0?s:o}};return a;function o(){return t=e?null:a":"\n",o="richText"===n,s={},l=0;function u(e){return{renderMode:n,content:Fg(Vg(e)),style:s}}var h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),d=c.length,f=this.getRawValue(e),p=Og.isArray(f),g=h.getItemVisual(e,"color");Og.isObject(g)&&g.colorStops&&(g=(g.colorStops[0]||{}).color),g=g||"transparent";var m=d>1||p&&!d?function(i){var a=Og.reduce(i,(function(e,t,i){var n=h.getDimensionInfo(i);return e|(n&&!1!==n.tooltip&&null!=n.displayName)}),0),u=[];function d(e,i){var c=h.getDimensionInfo(i);if(c&&!1!==c.otherDims.tooltip){var d=c.type,f="sub"+r.seriesIndex+"at"+l,p=Gg({color:g,type:"subItem",renderMode:n,markerId:f}),m="string"==typeof p?p:p.content,v=(a?m+Fg(c.displayName||"-")+": ":"")+Fg("ordinal"===d?e+"":"time"===d?t?"":Bg("yyyy/MM/dd hh:mm:ss",e):Vg(e));v&&u.push(v),o&&(s[f]=g,++l)}}c.length?Og.each(c,(function(t){d($g(h,e,t),t)})):Og.each(i,d);var f=a?o?"\n":"
":"",p=f+u.join(f||", ");return{renderMode:n,content:p,style:s}}(f):u(d?$g(h,e,c[0]):p?f[0]:f),v=m.content,y=r.seriesIndex+"at"+l,_=Gg({color:g,type:"item",renderMode:n,markerId:y});s[y]=g,++l;var x=h.getName(e),b=this.name;Hg.isNameSpecified(this)||(b=""),b=b?Fg(b)+(t?": ":a):"";var w="string"==typeof _?_:_.content;return{html:t?w+b+v:b+w+(x?Fg(x)+": "+v:v),markers:s}},isAnimationEnabled:function(){if(kg.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),e},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(e,t,i){var n=this.ecModel,r=Wg.getColorFromPalette.call(this,e,t,i);return r||(r=n.getColorFromPalette(e,t,i)),r},coordDimToDataDim:function(e){return this.getRawData().mapDimension(e,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function im(e){var t=e.name;Hg.isNameSpecified(e)||(e.name=function(e){var t=e.getRawData(),i=t.mapDimension("seriesName",!0),n=[];return Og.each(i,(function(e){var i=t.getDimensionInfo(e);i.displayName&&n.push(i.displayName)})),n.join(" ")}(e)||t)}function nm(e){return e.model.getRawData().count()}function rm(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),am}function am(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function om(e,t){Og.each(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,Og.curry(sm,t))}))}function sm(e){var t=lm(e);t&&t.setOutputEnd(this.count())}function lm(e){var t=(e.ecModel||{}).scheduler,i=t&&t.getPipeline(e.uid);if(i){var n=i.currentTask;if(n){var r=n.agentStubMap;r&&(n=r.get(e.uid))}return n}}Og.mixin(tm,jg),Og.mixin(tm,Wg);var um=tm,hm=zi,cm=Bc,dm=xo,fm=function(){this.group=new hm,this.uid=cm.getUID("viewComponent")},pm=fm.prototype={constructor:fm,init:function(e,t){},render:function(e,t,i,n){},dispose:function(){},filterForExposedEvent:null};pm.updateView=pm.updateLayout=pm.updateVisual=function(e,t,i,n){},dm.enableClassExtend(fm),dm.enableClassManagement(fm,{registerWhenExtend:!0});var gm=fm,mm=lo.makeInner,vm=function(){var e=mm();return function(t){var i=e(t),n=t.pipelineContext,r=i.large,a=i.progressiveRender,o=i.large=n&&n.large,s=i.progressiveRender=n&&n.progressiveRender;return!!(r^o||a^s)&&"reset"}},ym=g.each,_m=zi,xm=Bc,bm=xo,wm=lo,Tm=No,Sm=Cg.createTask,Mm=vm,Am=wm.makeInner(),Im=Mm();function Cm(){this.group=new _m,this.uid=xm.getUID("viewChart"),this.renderTask=Sm({plan:Pm,reset:Nm}),this.renderTask.context={view:this}}Cm.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,n){},highlight:function(e,t,i,n){Lm(e.getData(),n,"emphasis")},downplay:function(e,t,i,n){Lm(e.getData(),n,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var Dm=Cm.prototype;function Em(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!Tm.isHighDownDispatcher(e)))for(var n=0,r=e.childCount();n=0?c():h=setTimeout(c,-r),l=n};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(e){s=e},d}km.throttle=Vm,km.createOrUpdate=function(e,t,i,n){var r=e[t];if(r){var a=r[zm]||r,o=r[Fm];if(r[Bm]!==i||o!==n){if(null==i||!n)return e[t]=a;(r=e[t]=Vm(a,i,"debounce"===n))[zm]=a,r[Fm]=n,r[Bm]=i}return r}},km.clear=function(e,t){var i=e[t];i&&i[zm]&&(e[t]=i[zm])};var Gm=Wu,Hm=g.isFunction,Um={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),n=(e.visualColorAccessPath||"itemStyle.color").split("."),r=e.get(n),a=!Hm(r)||r instanceof Gm?null:r;r&&!a||(r=e.getColorFromPalette(e.name,null,t.getSeriesCount())),i.setVisual("color",r);var o=(e.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=e.get(o);if(i.setVisual("borderColor",s),!t.isSeriesFiltered(e))return a&&i.each((function(t){i.setItemVisual(t,"color",a(e.getDataParams(t)))})),{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t),r=i.get(n,!0),a=i.get(o,!0);null!=r&&e.setItemVisual(t,"color",r),null!=a&&e.setItemVisual(t,"borderColor",a)}:null}}},Wm=Um,jm={legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},Xm=g,Zm=jm,qm=qp.retrieveRawValue,Ym=function(e,t){var i=t.getModel("aria");if(i.get("show"))if(i.get("description"))e.setAttribute("aria-label",i.get("description"));else{var n=0;t.eachSeries((function(e,t){++n}),this);var r,a=i.get("data.maxCount")||10,o=i.get("series.maxCount")||10,s=Math.min(n,o);if(!(n<1)){var l=function(){var e=t.getModel("title").option;return e&&e.length&&(e=e[0]),e&&e.text}();r=l?h(c("general.withTitle"),{title:l}):c("general.withoutTitle");var u=[];r+=h(c(n>1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:n}),t.eachSeries((function(e,t){if(t1?"multiple":"single")+".";i=h(i=c(r?o+"withName":o+"withoutName"),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(m=e.subType,Zm.series.typeNames[m]||"自定义图")});var l=e.getData();window.data=l,l.count()>a?i+=h(c("data.partialData"),{displayCnt:a}):i+=c("data.allData");for(var d=[],f=0;fi.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},fv.getPipeline=function(e){return this._pipelineMap.get(e)},fv.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData().count(),r=i.progressiveEnabled&&t.incrementalPrepareRender&&n>=i.threshold,a=e.get("large")&&n>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?n:null;e.pipelineContext=i.context={progressiveRender:r,modDataCount:o,large:a}},fv.restorePipelines=function(e){var t=this,i=t._pipelineMap=av();e.eachSeries((function(e){var n=e.getProgressive(),r=e.uid;i.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:n&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),Mv(t,e,e.dataTask)}))},fv.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.ecInstance.getModel(),i=this.api;iv(this._allHandlers,(function(n){var r=e.get(n.uid)||e.set(n.uid,[]);n.reset&&function(e,t,i,n,r){var a=i.seriesTaskMap||(i.seriesTaskMap=av()),o=t.seriesType,s=t.getTargetSeries;function l(i){var o=i.uid,s=a.get(o)||a.set(o,sv({plan:xv,reset:bv,count:Sv}));s.context={model:i,ecModel:n,api:r,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:e},Mv(e,i,s)}t.createOnAllSeries?n.eachRawSeries(l):o?n.eachRawSeriesByType(o,l):s&&s(n,r).each(l);var u=e._pipelineMap;a.each((function(e,t){u.get(t)||(e.dispose(),a.removeKey(t))}))}(this,n,r,t,i),n.overallReset&&function(e,t,i,n,r){var a=i.overallTask=i.overallTask||sv({reset:mv});a.context={ecModel:n,api:r,overallReset:t.overallReset,scheduler:e};var o=a.agentStubMap=a.agentStubMap||av(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;function c(t){var i=t.uid,n=o.get(i);n||(n=o.set(i,sv({reset:vv,onDirty:_v})),a.dirty()),n.context={model:t,overallProgress:u,modifyOutputEnd:h},n.agent=a,n.__block=u,Mv(e,t,n)}s?n.eachRawSeriesByType(s,c):l?l(n,r).each(c):(u=!1,iv(n.getSeries(),c));var d=e._pipelineMap;o.each((function(e,t){d.get(t)||(e.dispose(),a.dirty(),o.removeKey(t))}))}(this,n,r,t,i)}),this)},fv.prepareView=function(e,t,i,n){var r=e.renderTask,a=r.context;a.model=t,a.ecModel=i,a.api=n,r.__block=!e.incrementalPrepareRender,Mv(this,t,r)},fv.performDataProcessorTasks=function(e,t){pv(this,this._dataProcessorHandlers,e,t,{block:!0})},fv.performVisualTasks=function(e,t,i){pv(this,this._visualHandlers,e,t,i)},fv.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t|=e.dataTask.perform()})),this.unfinished|=t},fv.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))};var gv=fv.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function mv(e){e.overallReset(e.ecModel,e.api,e.payload)}function vv(e,t){return e.overallProgress&&yv}function yv(){this.agent.dirty(),this.getDownstream().dirty()}function _v(){this.agent&&this.agent.dirty()}function xv(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function bv(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=cv(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?nv(t,(function(e,t){return Tv(t)})):wv}var wv=Tv(0);function Tv(e){return function(t,i){var n=i.data,r=i.resetDefines[e];if(r&&r.dataEach)for(var a=t.start;a=4&&(s={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(s&&null!=a&&null!=o&&(l=Sy(s,a,o),!t.ignoreViewBox)){var c=n;(n=new jv).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return t.ignoreRootClip||null==a||null==o||n.setClipPath(new Yv({shape:{x:0,y:0,width:a,height:o}})),{root:n,width:a,height:o,viewBoxRect:s,viewBoxTransform:l}},fy.prototype._parseNode=function(e,t){var i,n,r=e.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(n=gy[r]){var a=n.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=a)}}else(n=py[r])&&(i=n.call(this,e,t),t.add(i));for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},fy.prototype._parseText=function(e,t){if(1===e.nodeType){var i=e.getAttribute("dx")||0,n=e.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var r=new Zv({style:{text:e.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});my(t,r),_y(e,r,this._defs);var a=r.style.fontSize;a&&a<9&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=a/9,r.scale[1]*=a/9);var o=r.getBoundingRect();return this._textX+=o.width,t.add(r),r};var py={g:function(e,t){var i=new jv;return my(t,i),_y(e,i,this._defs),i},rect:function(e,t){var i=new Yv;return my(t,i),_y(e,i,this._defs),i.setShape({x:parseFloat(e.getAttribute("x")||0),y:parseFloat(e.getAttribute("y")||0),width:parseFloat(e.getAttribute("width")||0),height:parseFloat(e.getAttribute("height")||0)}),i},circle:function(e,t){var i=new qv;return my(t,i),_y(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),r:parseFloat(e.getAttribute("r")||0)}),i},line:function(e,t){var i=new Qv;return my(t,i),_y(e,i,this._defs),i.setShape({x1:parseFloat(e.getAttribute("x1")||0),y1:parseFloat(e.getAttribute("y1")||0),x2:parseFloat(e.getAttribute("x2")||0),y2:parseFloat(e.getAttribute("y2")||0)}),i},ellipse:function(e,t){var i=new Kv;return my(t,i),_y(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),rx:parseFloat(e.getAttribute("rx")||0),ry:parseFloat(e.getAttribute("ry")||0)}),i},polygon:function(e,t){var i=e.getAttribute("points");i&&(i=vy(i));var n=new $v({shape:{points:i||[]}});return my(t,n),_y(e,n,this._defs),n},polyline:function(e,t){var i=new Jv;my(t,i),_y(e,i,this._defs);var n=e.getAttribute("points");return n&&(n=vy(n)),new ey({shape:{points:n||[]}})},image:function(e,t){var i=new Xv;return my(t,i),_y(e,i,this._defs),i.setStyle({image:e.getAttribute("xlink:href"),x:e.getAttribute("x"),y:e.getAttribute("y"),width:e.getAttribute("width"),height:e.getAttribute("height")}),i},text:function(e,t){var i=e.getAttribute("x")||0,n=e.getAttribute("y")||0,r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(r),this._textY=parseFloat(n)+parseFloat(a);var o=new jv;return my(t,o),_y(e,o,this._defs),o},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0,o=new jv;return my(t,o),_y(e,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(e,t){var i=e.getAttribute("d")||"",n=ry(i);return my(t,n),_y(e,n,this._defs),n}},gy={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||0,10),i=parseInt(e.getAttribute("y1")||0,10),n=parseInt(e.getAttribute("x2")||10,10),r=parseInt(e.getAttribute("y2")||0,10),a=new ty(t,i,n,r);return function(e,t){for(var i=e.firstChild;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var r=i.getAttribute("stop-color")||"#000000";t.addColorStop(n,r)}i=i.nextSibling}}(e,a),a},radialgradient:function(e){}};function my(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),ly(t.__inheritedStyle,e.__inheritedStyle))}function vy(e){for(var t=uy(e).split(cy),i=[],n=0;n0;a-=2){var o=r[a],s=r[a-1];switch(n=n||ny.create(),s){case"translate":o=uy(o).split(cy),ny.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=uy(o).split(cy),ny.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=uy(o).split(cy),ny.rotate(n,n,parseFloat(o[0]));break;case"skew":o=uy(o).split(cy),console.warn("Skew transform is not supported yet");break;case"matrix":o=uy(o).split(cy),n[0]=parseFloat(o[0]),n[1]=parseFloat(o[1]),n[2]=parseFloat(o[2]),n[3]=parseFloat(o[3]),n[4]=parseFloat(o[4]),n[5]=parseFloat(o[5])}}t.setLocalTransform(n)}}(e,t),sy(r,function(e){var t=e.getAttribute("style"),i={};if(!t)return i;var n,r={};for(Ty.lastIndex=0;null!=(n=Ty.exec(t));)r[n[1]]=n[2];for(var a in yy)yy.hasOwnProperty(a)&&null!=r[a]&&(i[yy[a]]=r[a]);return i}(e)),!n))for(var o in yy)if(yy.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(r[yy[o]]=s)}var l=a?"textFill":"fill",u=a?"textStroke":"stroke";t.style=t.style||new iy;var h=t.style;null!=r.fill&&h.set(l,by(r.fill,i)),null!=r.stroke&&h.set(u,by(r.stroke,i)),hy(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){var t="lineWidth"===e&&a?"textStrokeWidth":e;null!=r[e]&&h.set(t,parseFloat(r[e]))})),r.textBaseline&&"auto"!==r.textBaseline||(r.textBaseline="alphabetic"),"alphabetic"===r.textBaseline&&(r.textBaseline="bottom"),"start"===r.textAlign&&(r.textAlign="left"),"end"===r.textAlign&&(r.textAlign="right"),hy(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=r[e]&&h.set(e,r[e])})),r.lineDash&&(t.style.lineDash=uy(r.lineDash).split(cy)),h[u]&&"none"!==h[u]&&(t[u]=!0),t.__inheritedStyle=r}var xy=/url\(\s*#(.*?)\)/;function by(e,t){var i=t&&e&&e.match(xy);return i?t[uy(i[1])]:e}var wy=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,Ty=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Sy(e,t,i){var n=t/e.width,r=i/e.height,a=Math.min(n,r);return{scale:[a,a],position:[-(e.x+e.width/2)*a+t/2,-(e.y+e.height/2)*a+i/2]}}Uv.parseXML=dy,Uv.makeViewBoxTransform=Sy,Uv.parseSVG=function(e,t){return(new fy).parse(e,t)};var My=g,Ay=My.createHashMap,Iy=My.isString,Cy=My.isArray,Dy=My.each;My.assert;var Ey=Uv.parseXML,Ly=Ay(),Py={registerMap:function(e,t,i){var n;return Cy(t)?n=t:t.svg?n=[{type:"svg",source:t.svg,specialAreas:t.specialAreas}]:(t.geoJson&&!t.features&&(i=t.specialAreas,t=t.geoJson),n=[{type:"geoJSON",source:t,specialAreas:i}]),Dy(n,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON"),(0,Ny[t])(e)})),Ly.set(e,n)},retrieveMap:function(e){return Ly.get(e)}},Ny={geoJSON:function(e){var t=e.source;e.geoJSON=Iy(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=Ey(e.source)}},Ry=Py,Oy={},ky={};function zy(e){return e}function By(e,t,i,n,r){this._old=e,this._new=t,this._oldKeyGetter=i||zy,this._newKeyGetter=n||zy,this.context=r}function Fy(e,t,i,n,r){for(var a=0;a65535?s_:u_}var c_=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],d_=["_extent","_approximateExtent","_rawExtent"];function f_(e,t){Yy.each(c_.concat(t.__wrappedMethods||[]),(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e.__wrappedMethods=t.__wrappedMethods,Yy.each(d_,(function(i){e[i]=Yy.clone(t[i])})),e._calculationInfo=Yy.extend(t._calculationInfo)}var p_=function(e,t){e=e||["x","y"];for(var i={},n=[],r={},a=0;a=0?this._indices[e]:-1}function b_(e,t){var i=e._idList[t];return null==i&&(i=y_(e,e._idDimIdx,t)),null==i&&(i="e\0\0"+t),i}function w_(e){return Yy.isArray(e)||(e=[e]),e}function T_(e,t){var i=e.dimensions,n=new p_(Yy.map(i,e.getDimensionInfo,e),e.hostModel);f_(n,e);for(var r=n._storage={},a=e._storage,o=0;o=0?(r[s]=S_(a[s]),n._rawExtent[s]=[1/0,-1/0],n._extent[s]=null):r[s]=a[s])}return n}function S_(e){for(var t,i,n=new Array(e.length),r=0;r_[1]&&(_[1]=y)}t&&(this._nameList[d]=t[f])}this._rawCount=this._count=l,this._extent={},v_(this)},g_._initDataFromProvider=function(e,t){if(!(e>=t)){for(var i,n=this._chunkSize,r=this._rawData,a=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pS[1]&&(S[1]=T)}if(!r.pure){var M=u[v];if(m&&null==M)if(null!=m.name)u[v]=M=m.name;else if(null!=i){var A=o[i],I=a[A][y];if(I){M=I[_];var C=l[A].ordinalMeta;C&&C.categories.length&&(M=C.categories[M])}}var D=null==m?null:m.id;null==D&&null!=M&&(d[M]=d[M]||0,D=M,d[M]>0&&(D+="__ec__"+d[M]),d[M]++),null!=D&&(h[v]=D)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent={},v_(this)}},g_.count=function(){return this._count},g_.getIndices=function(){var e=this._indices;if(e){var t=e.constructor,i=this._count;if(t===Array){r=new t(i);for(var n=0;n=0&&t=0&&to&&(o=l)}return n=[a,o],this._extent[e]=n,n},g_.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},g_.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},g_.getCalculationInfo=function(e){return this._calculationInfo[e]},g_.setCalculationInfo=function(e,t){r_(e)?Yy.extend(this._calculationInfo,e):this._calculationInfo[e]=t},g_.getSum=function(e){var t=0;if(this._storage[e])for(var i=0,n=this.count();i=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&ie))return a;r=a-1}}return-1},g_.indicesOfNearest=function(e,t,i){var n=[];if(!this._storage[e])return n;null==i&&(i=1/0);for(var r=1/0,a=-1,o=0,s=0,l=this.count();s=0&&a<0)&&(r=h,a=u,o=0),u===a&&(n[o++]=s))}return n.length=o,n},g_.getRawIndex=__,g_.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],i=0;i=l&&b<=u||isNaN(b))&&(a[o++]=c),c++;h=!0}else if(2===n){d=this._storage[s];var v=this._storage[t[1]],y=e[t[1]][0],_=e[t[1]][1];for(f=0;f=l&&b<=u||isNaN(b))&&(w>=y&&w<=_||isNaN(w))&&(a[o++]=c),c++}}h=!0}}if(!h)if(1===n)for(m=0;m=l&&b<=u||isNaN(b))&&(a[o++]=T)}else for(m=0;me[M][1])&&(S=!1)}S&&(a[o++]=this.getRawIndex(m))}return ob[1]&&(b[1]=x)}}}return r},g_.downSample=function(e,t,i,n){for(var r=T_(this,[e]),a=r._storage,o=[],s=Math.floor(1/t),l=a[e],u=this.count(),h=this._chunkSize,c=r._rawExtent[e],d=new(h_(this))(u),f=0,p=0;pu-p&&(s=u-p,o.length=s);for(var g=0;gc[1]&&(c[1]=_),d[f++]=x}return r._count=f,r._indices=d,r.getRawIndex=x_,r},g_.getItemModel=function(e){var t=this.hostModel;return new Ky(this.getRawDataItem(e),t,t&&t.ecModel)},g_.diff=function(e){var t=this;return new Qy(e?e.getIndices():[],this.getIndices(),(function(t){return b_(e,t)}),(function(e){return b_(t,e)}))},g_.getVisual=function(e){var t=this._visual;return t&&t[e]},g_.setVisual=function(e,t){if(r_(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},g_.setLayout=function(e,t){if(r_(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},g_.getLayout=function(e){return this._layout[e]},g_.getItemLayout=function(e){return this._itemLayouts[e]},g_.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?Yy.extend(this._itemLayouts[e]||{},t):t},g_.clearItemLayouts=function(){this._itemLayouts.length=0},g_.getItemVisual=function(e,t,i){var n=this._itemVisuals[e],r=n&&n[t];return null!=r||i?r:this.getVisual(t)},g_.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{},r=this.hasItemVisual;if(this._itemVisuals[e]=n,r_(t))for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a],r[a]=!0);else n[t]=i,r[t]=!0},g_.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var M_=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};g_.setItemGraphicEl=function(e,t){var i=this.hostModel;t&&(t.dataIndex=e,t.dataType=this.dataType,t.seriesIndex=i&&i.seriesIndex,"group"===t.type&&t.traverse(M_,t)),this._graphicEls[e]=t},g_.getItemGraphicEl=function(e){return this._graphicEls[e]},g_.eachItemGraphicEl=function(e,t){Yy.each(this._graphicEls,(function(i,n){i&&e&&e.call(t,i,n)}))},g_.cloneShallow=function(e){if(!e){var t=Yy.map(this.dimensions,this.getDimensionInfo,this);e=new p_(t,this.hostModel)}if(e._storage=this._storage,f_(e,this),this._indices){var i=this._indices.constructor;e._indices=new i(this._indices)}else e._indices=null;return e.getRawIndex=e._indices?x_:__,e},g_.wrapMethod=function(e,t){var i=this[e];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=i.apply(this,arguments);return t.apply(this,[e].concat(Yy.slice(arguments)))})},g_.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],g_.CHANGABLE_METHODS=["filterSelf","selectRange"];var A_=p_,I_=g,C_=I_.createHashMap,D_=I_.each,E_=I_.isString,L_=I_.defaults,P_=I_.extend,N_=I_.isObject,R_=I_.clone,O_=lo.normalizeToArray,k_=Vd,z_=k_.guessOrdinal,B_=k_.BE_ORDINAL,F_=$d,V_=Gy.OTHER_DIMENSIONS,G_=qy;function H_(e,t,i){if(i||null!=t.get(e)){for(var n=0;null!=t.get(e+n);)n++;e+=n}return t.set(e,!0),e}var U_=function(e,t,i){F_.isInstance(t)||(t=F_.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var n=(i.dimsDef||[]).slice(),r=C_(),a=C_(),o=[],s=function(e,t,i,n){var r=Math.max(e.dimensionsDetectCount||1,t.length,i.length,n||0);return D_(t,(function(e){var t=e.dimsDef;t&&(r=Math.max(r,t.length))})),r}(t,e,n,i.dimCount),l=0;l=t[0]&&e<=t[1]},xx.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},xx.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},xx.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1])},xx.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},xx.prototype.getExtent=function(){return this._extent.slice()},xx.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},xx.prototype.isBlank=function(){return this._isBlank},xx.prototype.setBlank=function(e){this._isBlank=e},xx.prototype.getLabel=null,_x.enableClassExtend(xx),_x.enableClassManagement(xx,{registerWhenExtend:!0});var bx=xx,Tx=g,Sx=Tx.createHashMap,Mx=Tx.isObject,Ax=Tx.map;function Ix(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}Ix.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&Ax(i,Ex);return new Ix({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var Cx=Ix.prototype;function Dx(e){return e._map||(e._map=Sx(e.categories))}function Ex(e){return Mx(e)&&null!=e.value?e.value:e+""}Cx.getOrdinal=function(e){return Dx(this).get(e)},Cx.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=Dx(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var Lx=Ix,Px=g,Nx=bx,Rx=Lx,Ox=Nx.prototype,kx=Nx.extend({type:"ordinal",init:function(e,t){e&&!Px.isArray(e)||(e=new Rx({categories:e})),this._ordinalMeta=e,this._extent=t||[0,e.categories.length-1]},parse:function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},contain:function(e){return e=this.parse(e),Ox.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return Ox.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(Ox.scale.call(this,e))},getTicks:function(){for(var e=[],t=this._extent,i=t[0];i<=t[1];)e.push(i),i++;return e},getLabel:function(e){if(!this.isBlank())return this._ordinalMeta.categories[e]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:Px.noop,niceExtent:Px.noop});kx.create=function(){return new kx};var zx=kx,Bx={},Fx=Uc,Vx=Fx.round;function Gx(e){return Fx.getPrecisionSafe(e)+2}function Hx(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function Ux(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),Hx(e,0,t),Hx(e,1,t),e[0]>e[1]&&(e[0]=e[1])}Bx.intervalScaleNiceTicks=function(e,t,i,n){var r={},a=e[1]-e[0],o=r.interval=Fx.nice(a/t,!0);null!=i&&on&&(o=r.interval=n);var s=r.intervalPrecision=Gx(o);return Ux(r.niceTickExtent=[Vx(Math.ceil(e[0]/o)*o,s),Vx(Math.floor(e[1]/o)*o,s)],e),r},Bx.getIntervalPrecision=Gx,Bx.fixExtent=Ux;var Wx=Uc,jx=qc,Xx=bx,Zx=Bx,qx=Wx.round,Yx=Xx.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(e,t){var i=this._extent;isNaN(e)||(i[0]=parseFloat(e)),isNaN(t)||(i[1]=parseFloat(t))},unionExtent:function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),Yx.prototype.setExtent.call(this,t[0],t[1])},getInterval:function(){return this._interval},setInterval:function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=Zx.getIntervalPrecision(e)},getTicks:function(e){var t=this._interval,i=this._extent,n=this._niceExtent,r=this._intervalPrecision,a=[];if(!t)return a;i[0]1e4)return[];var s=a.length?a[a.length-1]:n[1];return i[1]>s&&(e?a.push(qx(s+t,r)):a.push(i[1])),a},getMinorTicks:function(e){for(var t=this.getTicks(!0),i=[],n=this.getExtent(),r=1;rn[0]&&h0&&(a=null===a?s:Math.min(a,s))}i[n]=a}}return i}(e),i=[];return Jx.each(e,(function(e){var n,r=e.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)n=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=t[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);n=s?l/h*s:l}else{var c=e.getData();n=Math.abs(a[1]-a[0])/c.count()}var d=$x(e.get("barWidth"),n),f=$x(e.get("barMaxWidth"),n),p=$x(e.get("barMinWidth")||1,n),g=e.get("barGap"),m=e.get("barCategoryGap");i.push({bandWidth:n,barWidth:d,barMaxWidth:f,barMinWidth:p,barGap:g,barCategoryGap:m,axisKey:rb(r),stackId:nb(e)})})),sb(i)}function sb(e){var t={};Jx.each(e,(function(e,i){var n=e.axisKey,r=e.bandWidth,a=t[n]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=a.stacks;t[n]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var h=e.barMinWidth;h&&(o[s].minWidth=h);var c=e.barGap;null!=c&&(a.gap=c);var d=e.barCategoryGap;null!=d&&(a.categoryGap=d)}));var i={};return Jx.each(t,(function(e,t){i[t]={};var n=e.stacks,r=e.bandWidth,a=$x(e.categoryGap,r),o=$x(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),Jx.each(n,(function(e){var t=e.maxWidth,i=e.minWidth;if(e.width)n=e.width,t&&(n=Math.min(n,t)),i&&(n=Math.max(n,i)),e.width=n,s-=n+o*n,l--;else{var n=u;t&&tn&&(n=i),n!==u&&(e.width=n,s-=n+o*n,l--)}})),u=(s-a)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Jx.each(n,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Jx.each(n,(function(e,n){i[t][n]=i[t][n]||{bandWidth:r,offset:d,width:e.width},d+=e.width*(1+o)}))})),i}function lb(e,t,i){if(e&&t){var n=e[rb(t)];return null!=n&&null!=i&&(n=n[nb(i)]),n}}var ub={seriesType:"bar",plan:vm(),reset:function(e){if(hb(e)&&cb(e)){var t=e.getData(),i=e.coordinateSystem,n=i.grid.getRect(),r=i.getBaseAxis(),a=i.getOtherAxis(r),o=t.mapDimension(a.dim),s=t.mapDimension(r.dim),l=a.isHorizontal(),u=l?0:1,h=lb(ob([e]),r,e).width;return h>.5||(h=.5),{progress:function(e,t){for(var r,c=e.count,d=new ib(2*c),f=new ib(2*c),p=new ib(c),g=[],m=[],v=0,y=0;null!=(r=e.next());)m[u]=t.get(o,r),m[1-u]=t.get(s,r),g=i.dataToPoint(m,null,g),f[v]=l?n.x+n.width:g[0],d[v++]=g[0],f[v]=l?g[1]:n.y+n.height,d[v++]=g[1],p[y++]=r;t.setLayout({largePoints:d,largeDataIndices:p,largeBackgroundPoints:f,barWidth:h,valueAxisStart:db(0,a),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function hb(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function cb(e){return e.pipelineContext&&e.pipelineContext.large}function db(e,t,i){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}Qx.getLayoutOnAxis=function(e){var t=[],i=e.axis,n="axis0";if("category"===i.type){for(var r=i.getBandWidth(),a=0;a=0?"p":"n",C=v;g&&(r[s][A]||(r[s][A]={p:v,n:v}),C=r[s][A][I]),m?(x=C,b=(S=i.dataToPoint([M,A]))[1]+u,w=S[0]-v,T=h,Math.abs(w)i&&(a=i);var o=Ab.length,s=function(e,t,i,n){for(;i>>1;e[r][1]0;)n*=10;var r=[Db.round(kb(t[0]/n)*n),Db.round(Ob(t[1]/n)*n)];this._interval=n,this._niceExtent=r}},niceExtent:function(e){Pb.niceExtent.call(this,e);var t=this._originalScale;t.__fixMin=e.fixMin,t.__fixMax=e.fixMax}});function Vb(e,t){return Rb(e,Nb(t))}Ib.each(["contain","normalize"],(function(e){Fb.prototype[e]=function(t){return t=Bb(t)/Bb(this.base),Lb[e].call(this,t)}})),Fb.create=function(){return new Fb};var Gb=Fb,Hb=g,Ub=zx,Wb=Kx,jb=bx,Xb=Uc,Zb=Qx,qb=Zb.prepareLayoutBarSeries,Yb=Zb.makeColumnLayout,Kb=Zb.retrieveColumnLayout,Qb=Pi;function Jb(e,t){var i,n,r,a=e.type,o=t.getMin(),s=t.getMax(),l=e.getExtent();"ordinal"===a?i=t.getCategories().length:(n=t.get("boundaryGap"),Hb.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Xb.parsePercent(n[0],1),n[1]=Xb.parsePercent(n[1],1),r=l[1]-l[0]||Math.abs(l[0])),"dataMin"===o?o=l[0]:"function"==typeof o&&(o=o({min:l[0],max:l[1]})),"dataMax"===s?s=l[1]:"function"==typeof s&&(s=s({min:l[0],max:l[1]}));var u=null!=o,h=null!=s;null==o&&(o="ordinal"===a?i?0:NaN:l[0]-n[0]*r),null==s&&(s="ordinal"===a?i?i-1:NaN:l[1]+n[1]*r),(null==o||!isFinite(o))&&(o=NaN),(null==s||!isFinite(s))&&(s=NaN),e.setBlank(Hb.eqNaN(o)||Hb.eqNaN(s)||"ordinal"===a&&!e.getOrdinalMeta().categories.length),t.getNeedCrossZero()&&(o>0&&s>0&&!u&&(o=0),o<0&&s<0&&!h&&(s=0));var c=t.ecModel;if(c&&"time"===a){var d,f=qb("bar",c);if(Hb.each(f,(function(e){d|=e.getBaseAxis()===t.axis})),d){var p=Yb(f),g=function(e,t,i,n){var r=i.axis.getExtent(),a=r[1]-r[0],o=Kb(n,i.axis);if(void 0===o)return{min:e,max:t};var s=1/0;Hb.each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;Hb.each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-e,c=h/(1-(s+l)/a)-h;return{min:e-=c*(s/u),max:t+=c*(l/u)}}(o,s,t,p);o=g.min,s=g.max}}return{extent:[o,s],fixMin:u,fixMax:h}}function $b(e){var t,i=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"string"==typeof i?(t=i,i=function(i){return i=e.scale.getLabel(i),t.replace("{value}",null!=i?i:"")}):"function"==typeof i?function(t,r){return null!=n&&(r=t-n),i(ew(e,t),r)}:function(t){return e.scale.getLabel(t)}}function ew(e,t){return"category"===e.type?e.scale.getLabel(t):t}function tw(e,t){var i=t*Math.PI/180,n=e.plain(),r=n.width,a=n.height,o=r*Math.abs(Math.cos(i))+Math.abs(a*Math.sin(i)),s=r*Math.abs(Math.sin(i))+Math.abs(a*Math.cos(i));return new Qb(n.x,n.y,o,s)}function iw(e){var t=e.get("interval");return null==t?"auto":t}yx.getScaleExtent=Jb,yx.niceScaleExtent=function(e,t){var i=Jb(e,t),n=i.extent,r=t.get("splitNumber");"log"===e.type&&(e.base=t.get("logBase"));var a=e.type;e.setExtent(n[0],n[1]),e.niceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:"interval"===a||"time"===a?t.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)},yx.createScaleByModel=function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Ub(e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),[1/0,-1/0]);case"value":return new Wb;default:return(jb.getClass(t)||Wb).create(e)}},yx.ifAxisCrossZero=function(e){var t=e.scale.getExtent(),i=t[0],n=t[1];return!(i>0&&n>0||i<0&&n<0)},yx.makeLabelFormatter=$b,yx.getAxisRawValue=ew,yx.estimateLabelUnionRect=function(e){var t=e.model,i=e.scale;if(t.get("axisLabel.show")&&!i.isBlank()){var n,r,a="category"===e.type,o=i.getExtent();r=a?i.count():(n=i.getTicks()).length;var s,l=e.getLabelModel(),u=$b(e),h=1;r>40&&(h=Math.ceil(r/40));for(var c=0;c>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,n.push([s/i,l/i])}return n}var Xw=function(e,t){return function(e){if(!e.UTF8Encoding)return e;var t=e.UTF8Scale;null==t&&(t=1024);for(var i=e.features,n=0;n0})),(function(e){var i=e.properties,n=e.geometry,r=n.coordinates,a=[];"Polygon"===n.type&&a.push({type:"polygon",exterior:r[0],interiors:r.slice(1)}),"MultiPolygon"===n.type&&Uw.each(r,(function(e){e[0]&&a.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new Ww(i[t||"name"],a,i.cp);return o.properties=i,o}))},Zw={},qw=g,Yw=Tn,Kw=lo.makeInner,Qw=yx,Jw=Qw.makeLabelFormatter,$w=Qw.getOptionCategoryInterval,eT=Qw.shouldShowAllLabels,tT=Kw();function iT(e,t){var i,n,r=nT(e,"labels"),a=$w(t),o=rT(r,a);return o||(qw.isFunction(a)?i=sT(e,a):(n="auto"===a?function(e){var t=tT(e).autoInterval;return null!=t?t:tT(e).autoInterval=e.calculateCategoryInterval()}(e):a,i=oT(e,n)),aT(r,a,{labels:i,labelCategoryInterval:n}))}function nT(e,t){return tT(e)[t]||(tT(e)[t]=[])}function rT(e,t){for(var i=0;i1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=eT(e),d=o.get("showMinLabel")||c,f=o.get("showMaxLabel")||c;d&&u!==a[0]&&g(a[0]);for(var p=u;p<=a[1];p+=l)g(p);function g(e){s.push(i?e:{formattedLabel:n(e),rawLabel:r.getLabel(e),tickValue:e})}return f&&p-l!==a[1]&&g(a[1]),s}function sT(e,t,i){var n=e.scale,r=Jw(e),a=[];return qw.each(n.getTicks(),(function(e){var o=n.getLabel(e);t(e,o)&&a.push(i?e:{formattedLabel:r(e),rawLabel:o,tickValue:e})})),a}Zw.createAxisLabels=function(e){return"category"===e.type?function(e){var t=e.getLabelModel(),i=iT(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(e):function(e){var t=e.scale.getTicks(),i=Jw(e);return{labels:qw.map(t,(function(t,n){return{formattedLabel:i(t,n),rawLabel:e.scale.getLabel(t),tickValue:t}}))}}(e)},Zw.createAxisTicks=function(e,t){return"category"===e.type?function(e,t){var i,n,r=nT(e,"ticks"),a=$w(t),o=rT(r,a);if(o)return o;if(t.get("show")&&!e.scale.isBlank()||(i=[]),qw.isFunction(a))i=sT(e,a,!0);else if("auto"===a){var s=iT(e,e.getLabelModel());n=s.labelCategoryInterval,i=qw.map(s.labels,(function(e){return e.tickValue}))}else i=oT(e,n=a,!0);return aT(r,a,{ticks:i,tickCategoryInterval:n})}(e,t):{ticks:e.scale.getTicks()}},Zw.calculateCategoryInterval=function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),i=Jw(e),n=(t.axisRotate-t.labelRotate)/180*Math.PI,r=e.scale,a=r.getExtent(),o=r.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,f=0;l<=a[1];l+=s){var p,g,m=Yw.getBoundingRect(i(l),t.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,y=f/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(v,y))),x=tT(e.model),b=e.getExtent(),w=x.lastAutoInterval,T=x.lastTickCount;return null!=w&&null!=T&&Math.abs(w-_)<=1&&Math.abs(T-o)<=1&&w>_&&x.axisExtend0===b[0]&&x.axisExtend1===b[1]?_=w:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtend0=b[0],x.axisExtend1=b[1]),_};var lT=g,uT=lT.each,hT=lT.map,cT=Uc,dT=cT.linearMap,fT=cT.getPixelPrecision,pT=cT.round,gT=Zw,mT=gT.createAxisTicks,vT=gT.createAxisLabels,yT=gT.calculateCategoryInterval,_T=[0,1],xT=function(e,t,i){this.dim=e,this.scale=t,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function bT(e,t){var i=(e[1]-e[0])/t/2;e[0]+=i,e[1]-=i}xT.prototype={constructor:xT,contain:function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},containData:function(e){return this.scale.contain(e)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(e){return fT(e||this.scale.getExtent(),this._extent)},setExtent:function(e,t){var i=this._extent;i[0]=e,i[1]=t},dataToCoord:function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&"ordinal"===n.type&&bT(i=i.slice(),n.count()),dT(e,_T,i,t)},coordToData:function(e,t){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&bT(i=i.slice(),n.count());var r=dT(e,i,_T,t);return this.scale.scale(r)},pointToData:function(e,t){},getTicksCoords:function(e){var t=(e=e||{}).tickModel||this.getTickModel(),i=mT(this,t).ticks,n=hT(i,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this);return function(e,t,i,n){var r=t.length;if(e.onBand&&!i&&r){var a,o,s=e.getExtent();if(1===r)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[r-1].tickValue-t[0].tickValue,u=(t[r-1].coord-t[0].coord)/l;uT(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[r-1].tickValue,a={coord:t[r-1].coord+u*o},t.push(a)}var h=s[0]>s[1];c(t[0].coord,s[0])&&(n?t[0].coord=s[0]:t.shift()),n&&c(s[0],t[0].coord)&&t.unshift({coord:s[0]}),c(s[1],a.coord)&&(n?a.coord=s[1]:t.pop()),n&&c(a.coord,s[1])&&t.push({coord:s[1]})}function c(e,t){return e=pT(e),t=pT(t),h?e>t:e0&&e<100||(e=5);var t=this.scale.getMinorTicks(e);return hT(t,(function(e){return hT(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},getViewLabels:function(){return vT(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return yT(this)}};var wT=xT,TT=c;Oy.zrender=TT;var ST=Ue;Oy.matrix=ST;var MT=V;Oy.vector=MT;var AT=g,IT=ut;Oy.color=IT;var CT=No,DT=Uc;Oy.number=DT;var ET=qc;Oy.format=ET;var LT=km;LT.throttle,Oy.throttle=LT.throttle;var PT=ky;Oy.helper=PT;var NT=Xw;Oy.parseGeoJSON=NT;var RT=A_;Oy.List=RT;var OT=zc;Oy.Model=OT;var kT=wT;Oy.Axis=kT;var zT=p;Oy.env=zT;var BT=NT,FT={};AT.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){FT[e]=AT[e]}));var VT={};AT.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],(function(e){VT[e]=CT[e]})),Oy.parseGeoJson=BT,Oy.util=FT,Oy.graphic=VT,function(e){var t=c,i=g,n=ut,r=p,a=Ui,o=ie,s=ep,l=np,u=sp,h=_p,d=Hp,f=Zp,m=Ld,v=um,y=gm,_=Om,x=No,b=lo,w=km.throttle,T=Wm,S=Ym,M=ev,A=Lv,I=Nv,C=Bv,D=Ry,E=i.assert,L=i.each,P=i.isFunction,N=i.isObject,R=m.parseClassType,O={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:3500,COMPONENT:4e3,BRUSH:5e3}},k="__flagInMainProcess",z=/^[a-zA-Z0-9_]+$/;function B(e,t){return function(i,n,r){t||!this._disposed?(i=i&&i.toLowerCase(),o.prototype[e].call(this,i,n,r)):this.id}}function F(){o.call(this)}function V(e,n,r){r=r||{},"string"==typeof n&&(n=ce[n]),this.id,this.group,this._dom=e;var s=this._zr=t.init(e,{renderer:r.renderer||"canvas",devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height});this._throttledZrFlush=w(i.bind(s.flush,s),17),(n=i.clone(n))&&d(n,!0),this._theme=n,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new u;var h,c,f=this._api=(c=(h=this)._coordSysMgr,i.extend(new l(h),{getCoordinateSystems:i.bind(c.getCoordinateSystems,c),getComponentByElement:function(e){for(;e;){var t=e.__ecComponentInfo;if(null!=t)return h._model.getComponent(t.mainType,t.index);e=e.parent}}}));function p(e,t){return e.__prio-t.__prio}a(he,p),a(se,p),this._scheduler=new A(this,f,se,he),o.call(this,this._ecEventProcessor=new re),this._messageCenter=new F,this._initEvents(),this.resize=i.bind(this.resize,this),this._pendingActions=[],s.animation.on("frame",this._onframe,this),function(e,t){e.on("rendered",(function(){t.trigger("rendered"),!e.animation.isFinished()||t.__optionUpdated||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))}(s,this),i.setAsPrimitive(this)}F.prototype.on=B("on",!0),F.prototype.off=B("off",!0),F.prototype.one=B("one",!0),i.mixin(F,o);var G=V.prototype;function H(e,t,i){if(this._disposed)this.id;else{var n,r=this._model,a=this._coordSysMgr.getCoordinateSystems();t=b.parseFinder(r,t);for(var o=0;o0&&e.unfinished);e.unfinished||this._zr.flush()}}},G.getDom=function(){return this._dom},G.getZr=function(){return this._zr},G.setOption=function(e,t,i){if(this._disposed)this.id;else{var n;if(N(t)&&(i=t.lazyUpdate,n=t.silent,t=t.notMerge),this[k]=!0,!this._model||t){var r=new h(this._api),a=this._theme,o=this._model=new s;o.scheduler=this._scheduler,o.init(null,null,a,r)}this._model.setOption(e,le),i?(this.__optionUpdated={silent:n},this[k]=!1):(W(this),U.update.call(this),this._zr.flush(),this.__optionUpdated=!1,this[k]=!1,q.call(this,n),Y.call(this,n))}},G.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},G.getModel=function(){return this._model},G.getOption=function(){return this._model&&this._model.getOption()},G.getWidth=function(){return this._zr.getWidth()},G.getHeight=function(){return this._zr.getHeight()},G.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},G.getRenderedCanvas=function(e){if(r.canvasSupported)return(e=e||{}).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},G.getSvgDataURL=function(){if(r.svgSupported){var e=this._zr,t=e.storage.getDisplayList();return i.each(t,(function(e){e.stopAnimation(!0)})),e.painter.toDataURL()}},G.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,i=this._model,n=[],r=this;L(t,(function(e){i.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(n.push(t),t.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return L(n,(function(e){e.group.ignore=!1})),a}this.id},G.getConnectedDataURL=function(e){if(this._disposed)this.id;else if(r.canvasSupported){var n="svg"===e.type,a=this.group,o=Math.min,s=Math.max,l=1/0;if(pe[a]){var u=l,h=l,c=-1/0,d=-1/0,f=[],p=e&&e.pixelRatio||1;i.each(fe,(function(t,r){if(t.group===a){var l=n?t.getZr().painter.getSvgDom().innerHTML:t.getRenderedCanvas(i.clone(e)),p=t.getDom().getBoundingClientRect();u=o(p.left,u),h=o(p.top,h),c=s(p.right,c),d=s(p.bottom,d),f.push({dom:l,left:p.left,top:p.top})}}));var g=(c*=p)-(u*=p),m=(d*=p)-(h*=p),v=i.createCanvas(),y=t.init(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var _="";return L(f,(function(e){var t=e.left-u,i=e.top-h;_+=''+e.dom+""})),y.painter.getSvgRoot().innerHTML=_,e.connectedBackgroundColor&&y.painter.setBackgroundColor(e.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return e.connectedBackgroundColor&&y.add(new x.Rect({shape:{x:0,y:0,width:g,height:m},style:{fill:e.connectedBackgroundColor}})),L(f,(function(e){var t=new x.Image({style:{x:e.left*p-u,y:e.top*p-h,image:e.dom}});y.add(t)})),y.refreshImmediately(),v.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},G.convertToPixel=i.curry(H,"convertToPixel"),G.convertFromPixel=i.curry(H,"convertFromPixel"),G.containPixel=function(e,t){if(!this._disposed){var n,r=this._model;return e=b.parseFinder(r,e),i.each(e,(function(e,r){r.indexOf("Models")>=0&&i.each(e,(function(e){var i=e.coordinateSystem;if(i&&i.containPoint)n|=!!i.containPoint(t);else if("seriesModels"===r){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(n|=a.containPoint(t,e))}}),this)}),this),!!n}this.id},G.getVisual=function(e,t){var i=this._model,n=(e=b.parseFinder(i,e,{defaultMainType:"series"})).seriesModel.getData(),r=e.hasOwnProperty("dataIndexInside")?e.dataIndexInside:e.hasOwnProperty("dataIndex")?n.indexOfRawIndex(e.dataIndex):null;return null!=r?n.getItemVisual(r,t):n.getVisual(t)},G.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},G.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]};var U={prepareAndUpdate:function(e){W(this),U.update.call(this,e)},update:function(e){var t=this._model,i=this._api,a=this._zr,o=this._coordSysMgr,s=this._scheduler;if(t){s.restoreData(t,e),s.performSeriesTasks(t),o.create(t,i),s.performDataProcessorTasks(t,e),X(this,t),o.update(t,i),Q(t),s.performVisualTasks(t,e),J(this,t,i,e);var l=t.get("backgroundColor")||"transparent";if(r.canvasSupported)a.setBackgroundColor(l);else{var u=n.parse(l);l=n.stringify(u,"rgb"),0===u[3]&&(l="transparent")}ee(t,i)}},updateTransform:function(e){var t=this._model,n=this,r=this._api;if(t){var a=[];t.eachComponent((function(i,o){var s=n.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,t,r,e);l&&l.update&&a.push(s)}else a.push(s)}));var o=i.createHashMap();t.eachSeries((function(i){var a=n._chartsMap[i.__viewId];if(a.updateTransform){var s=a.updateTransform(i,t,r,e);s&&s.update&&o.set(i.uid,1)}else o.set(i.uid,1)})),Q(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0,dirtyMap:o}),$(n,t,0,e,o),ee(t,this._api)}},updateView:function(e){var t=this._model;t&&(_.markUpdateMethod(e,"updateView"),Q(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),J(this,this._model,this._api,e),ee(t,this._api))},updateVisual:function(e){U.update.call(this,e)},updateLayout:function(e){U.update.call(this,e)}};function W(e){var t=e._model,i=e._scheduler;i.restorePipelines(t),i.prepareStageTasks(),K(e,"component",t,i),K(e,"chart",t,i),i.plan()}function j(e,t,n,r,a){var o=e._model;if(r){var s={};s[r+"Id"]=n[r+"Id"],s[r+"Index"]=n[r+"Index"],s[r+"Name"]=n[r+"Name"];var l={mainType:r,query:s};a&&(l.subType=a);var u=n.excludeSeriesId;null!=u&&(u=i.createHashMap(b.normalizeToArray(u))),o&&o.eachComponent(l,(function(t){u&&null!=u.get(t.id)||h(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else L(e._componentsViews.concat(e._chartsViews),h);function h(i){i&&i.__alive&&i[t]&&i[t](i.__model,o,e._api,n)}}function X(e,t){var i=e._chartsMap,n=e._scheduler;t.eachSeries((function(e){n.updateStreamModes(e,i[e.__viewId])}))}function Z(e,t){var n=e.type,r=e.escapeConnect,a=ae[n],o=a.actionInfo,s=(o.update||"update").split(":"),l=s.pop();s=null!=s[0]&&R(s[0]),this[k]=!0;var u=[e],h=!1;e.batch&&(h=!0,u=i.map(e.batch,(function(t){return(t=i.defaults(i.extend({},t),e)).batch=null,t})));var c,d=[],f="highlight"===n||"downplay"===n;L(u,(function(e){(c=(c=a.action(e,this._model,this._api))||i.extend({},e)).type=o.event||c.type,d.push(c),f?j(this,l,e,"series"):s&&j(this,l,e,s.main,s.sub)}),this),"none"===l||f||s||(this.__optionUpdated?(W(this),U.update.call(this,e),this.__optionUpdated=!1):U[l].call(this,e)),c=h?{type:o.event||n,escapeConnect:r,batch:d}:d[0],this[k]=!1,!t&&this._messageCenter.trigger(c.type,c)}function q(e){for(var t=this._pendingActions;t.length;){var i=t.shift();Z.call(this,i,e)}}function Y(e){!e&&this.trigger("updated")}function K(e,t,i,n){for(var r="component"===t,a=r?e._componentsViews:e._chartsViews,o=r?e._componentsMap:e._chartsMap,s=e._zr,l=e._api,u=0;ut.get("hoverLayerThreshold")&&!r.node&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var i=e._chartsMap[t.__viewId];i.__alive&&i.group.traverse((function(e){e.useHoverLayer=!0}))}}))}(e,t),S(e._zr.dom,t)}function ee(e,t){L(ue,(function(i){i(e,t)}))}G.resize=function(e){if(this._disposed)this.id;else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var i=t.resetOption("media"),n=e&&e.silent;this[k]=!0,i&&W(this),U.update.call(this),this[k]=!1,q.call(this,n),Y.call(this,n)}}},G.showLoading=function(e,t){if(this._disposed)this.id;else if(N(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),de[e]){var i=de[e](this._api,t),n=this._zr;this._loadingFX=i,n.add(i)}},G.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},G.makeActionFromEvent=function(e){var t=i.extend({},e);return t.type=oe[e.type],t},G.dispatchAction=function(e,t){this._disposed?this.id:(N(t)||(t={silent:!!t}),ae[e.type]&&this._model&&(this[k]?this._pendingActions.push(e):(Z.call(this,e,t.silent),t.flush?this._zr.flush(!0):!1!==t.flush&&r.browser.weChat&&this._throttledZrFlush(),q.call(this,t.silent),Y.call(this,t.silent))))},G.appendData=function(e){if(this._disposed)this.id;else{var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0}},G.on=B("on",!1),G.off=B("off",!1),G.one=B("one",!1);var te=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function ne(e,t){var i=e.get("z"),n=e.get("zlevel");t.group.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=n&&(e.zlevel=n))}))}function re(){this.eventInfo}G._initEvents=function(){L(te,(function(e){var t=function(t){var n,r=this.getModel(),a=t.target;if("globalout"===e)n={};else if(a&&null!=a.dataIndex){var o=a.dataModel||r.getSeriesByIndex(a.seriesIndex);n=o&&o.getDataParams(a.dataIndex,a.dataType,a)||{}}else a&&a.eventData&&(n=i.extend({},a.eventData));if(n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&this["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];n.event=t,n.type=e,this._ecEventProcessor.eventInfo={targetEl:a,packedEvent:n,model:u,view:h},this.trigger(e,n)}};t.zrEventfulCallAtLast=!0,this._zr.on(e,t,this)}),this),L(oe,(function(e,t){this._messageCenter.on(t,(function(e){this.trigger(t,e)}),this)}),this)},G.isDisposed=function(){return this._disposed},G.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},G.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,b.setAttribute(this.getDom(),ve,"");var e=this._api,t=this._model;L(this._componentsViews,(function(i){i.dispose(t,e)})),L(this._chartsViews,(function(i){i.dispose(t,e)})),this._zr.dispose(),delete fe[this.id]}},i.mixin(V,o),re.prototype={constructor:re,normalizeQuery:function(e){var t={},n={},r={};if(i.isString(e)){var a=R(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};i.each(e,(function(e,i){for(var a=!1,l=0;l0&&h===i.length-u.length){var c=i.slice(0,h);"data"!==c&&(t.mainType=c,t[u.toLowerCase()]=e,a=!0)}}s.hasOwnProperty(i)&&(n[i]=e,a=!0),a||(r[i]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:r}},filter:function(e,t,i){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,r,a));function h(e,t,i,n){return null==e[i]||t[n||i]===e[i]}},afterTrigger:function(){this.eventInfo=null}};var ae={},oe={},se=[],le=[],ue=[],he=[],ce={},de={},fe={},pe={},ge=new Date-0,me=new Date-0,ve="_echarts_instance_";function ye(e){pe[e]=!1}var _e=ye;function xe(e){return fe[b.getAttribute(e,ve)]}function be(e,t){ce[e]=t}function we(e){le.push(e)}function Te(e,t){Ae(se,e,t,1e3)}function Se(e,t,i){"function"==typeof t&&(i=t,t="");var n=N(e)?e.type:[e,e={event:t}][0];e.event=(e.event||n).toLowerCase(),t=e.event,E(z.test(n)&&z.test(t)),ae[n]||(ae[n]={action:i,actionInfo:e}),oe[t]=n}function Me(e,t){Ae(he,e,t,3e3,"visual")}function Ae(e,t,i,n,r){(P(t)||N(t))&&(i=t,t=n);var a=A.wrapStageHandler(i,r);return a.__prio=t,a.__raw=i,e.push(a),a}function Ie(e,t){de[e]=t}Me(2e3,T),we(d),Te(900,f),Ie("default",M),Se({type:"highlight",event:"highlight",update:"highlight"},i.noop),Se({type:"downplay",event:"downplay",update:"downplay"},i.noop),be("light",I),be("dark",C),e.version="4.9.0",e.dependencies={zrender:"4.3.2"},e.PRIORITY=O,e.init=function(e,t,i){var n=xe(e);if(n)return n;var r=new V(e,t,i);return r.id="ec_"+ge++,fe[r.id]=r,b.setAttribute(e,ve,r.id),function(e){var t="__connectUpdateStatus";function i(e,i){for(var n=0;n0?i=n[0]:n[1]<0&&(i=n[1]),i}(a,i),s=r.dim,l=a.dim,u=t.mapDimension(l),h=t.mapDimension(s),c="x"===l||"radius"===l?1:0,d=vS(e.dimensions,(function(e){return t.mapDimension(e)})),f=t.getCalculationInfo("stackResultDimension");return(n|=mS(t,d[0]))&&(d[0]=f),(n|=mS(t,d[1]))&&(d[1]=f),{dataDimsForPoint:d,valueStart:o,valueAxisDim:l,baseAxisDim:s,stacked:!!n,valueDim:u,baseDim:h,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}},gS.getStackedOnPoint=function(e,t,i,n){var r=NaN;e.stacked&&(r=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(r)&&(r=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=i.get(e.baseDim,n),o[1-a]=r,t.dataToPoint(o)};var yS=gS,_S=yS.prepareDataCoordInfo,xS=yS.getStackedOnPoint,bS=function(e,t,i,n,r,a,o,s){for(var l=function(e,t){var i=[];return t.diff(e).add((function(e){i.push({cmd:"+",idx:e})})).update((function(e,t){i.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){i.push({cmd:"-",idx:e})})).execute(),i}(e,t),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=_S(r,t,o),v=_S(a,e,s),y=0;y=r||d<0)break;if(NS(p)){if(h){d+=a;continue}break}if(d===i)e[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=t[c],m="y"===u?1:0,v=(p[m]-g[m])*l;DS(LS,g),LS[m]=g[m]+v,DS(PS,p),PS[m]=p[m]-v,e.bezierCurveTo(LS[0],LS[1],PS[0],PS[1],p[0],p[1])}else e.lineTo(p[0],p[1]);c=d,d+=a}return f}function kS(e,t,i,n,r,a,o,s,l,u,h){for(var c=0,d=i,f=0;f=r||d<0)break;if(NS(p)){if(h){d+=a;continue}break}if(d===i)e[a>0?"moveTo":"lineTo"](p[0],p[1]),DS(LS,p);else if(l>0){var g=d+a,m=t[g];if(h)for(;m&&NS(t[g]);)m=t[g+=a];var v=.5,y=t[c];if(!(m=t[g])||NS(m))DS(PS,p);else{var _,x;if(NS(m)&&!h&&(m=p),SS.sub(ES,m,y),"x"===u||"y"===u){var b="x"===u?0:1;_=Math.abs(p[b]-y[b]),x=Math.abs(p[b]-m[b])}else _=SS.dist(p,y),x=SS.dist(p,m);CS(PS,p,ES,-l*(1-(v=x/(x+_))))}AS(LS,LS,s),IS(LS,LS,o),AS(PS,PS,s),IS(PS,PS,o),e.bezierCurveTo(LS[0],LS[1],PS[0],PS[1],p[0],p[1]),CS(LS,p,ES,l*v)}else e.lineTo(p[0],p[1]);c=d,d+=a}return f}function zS(e,t){var i=[1/0,1/0],n=[-1/0,-1/0];if(t)for(var r=0;rn[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:t?i:n,max:t?n:i}}var BS=TS.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:MS(TS.prototype.brush),buildPath:function(e,t){var i=t.points,n=0,r=i.length,a=zS(i,t.smoothConstraint);if(t.connectNulls){for(;r>0&&NS(i[r-1]);r--);for(;n0&&NS(i[a-1]);a--);for(;rn)return!1;return!0}(a,t))){var o=t.mapDimension(a.dim),s={};return jS.each(a.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function fM(e,t,i){if("cartesian2d"===e.type){var n=e.getBaseAxis().isHorizontal(),r=oM(e,t,i);if(!i.get("clip",!0)){var a=r.shape,o=Math.max(a.width,a.height);n?(a.y-=o,a.height+=2*o):(a.x-=o,a.width+=2*o)}return r}return sM(e,t,i)}tM.extend({type:"line",init:function(){var e=new KS.Group,t=new ZS;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},render:function(e,t,i){var n=e.coordinateSystem,r=this.group,a=e.getData(),o=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=e.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(e,t,i){if(!i.valueDim)return[];for(var n=[],r=0,a=t.count();r=0;a--){var o=i[a].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){r=i[a];break}}if(r){var u=t.getAxis(n),h=jS.map(r.stops,(function(e){return{coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),c=h.length,d=r.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";jS.each(h,(function(e){e.offset=(e.coord-f)/g})),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new KS.LinearGradient(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(a,n)||a.getVisual("color");d.useStyle(jS.defaults(o.getLineStyle(),{fill:"none",stroke:S,lineJoin:"bevel"}));var M=e.get("smooth");if(M=hM(e.get("smooth")),d.setShape({smooth:M,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),f){var A=a.getCalculationInfo("stackedOnSeries"),I=0;f.useStyle(jS.defaults(s.getAreaStyle(),{fill:S,opacity:.7,lineJoin:"bevel"})),A&&(I=hM(A.get("smooth"))),f.setShape({smooth:M,stackedOnSmooth:I,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")})}this._data=a,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=T,this._valueOrigin=v},dispose:function(){},highlight:function(e,t,i,n){var r=e.getData(),a=QS.queryDataIndex(r,n);if(!(a instanceof Array)&&null!=a&&a>=0){var o=r.getItemGraphicEl(a);if(!o){var s=r.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(o=new qS(r,a)).position=s,o.setZ(e.get("zlevel"),e.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,r.setItemGraphicEl(a,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else tM.prototype.highlight.call(this,e,t,i,n)},downplay:function(e,t,i,n){var r=e.getData(),a=QS.queryDataIndex(r,n);if(null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else tM.prototype.downplay.call(this,e,t,i,n)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new $S({shape:{points:e},silent:!0,z2:10}),this._lineGroup.add(t),this._polyline=t,t},_newPolygon:function(e,t){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new eM({shape:{points:e,stackedOnPoints:t},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(e,t,i,n,r,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=YS(this._data,e,this._stackedOnPoints,t,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;if(r&&(h=cM(u.current,i,r),c=cM(u.stackedOnCurrent,i,r),d=cM(u.next,i,r),f=cM(u.stackedOnNext,i,r)),uM(h,d)>3e3||s&&uM(c,f)>3e3)return o.setShape({points:d}),void(s&&s.setShape({points:d,stackedOnPoints:f}));o.shape.__points=u.current,o.shape.points=h,KS.updateProps(o,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),KS.updateProps(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;mt&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;i1&&("string"==typeof r?o=xM[r]:"function"==typeof r&&(o=r),o&&e.setData(n.downSample(n.mapDimension(l.dim),1/c,o,bM)))}}}},TM=g;function SM(e){return this._axes[e]}var MM=function(e){this._axes={},this._dimList=[],this.name=e||""};MM.prototype={constructor:MM,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return TM.map(this._dimList,SM,this)},getAxesByScale:function(e){return e=e.toLowerCase(),TM.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 i=this._dimList,n=e instanceof Array?[]:{},r=0;rt[1]&&t.reverse(),t},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},toLocalCoord:null,toGlobalCoord:null},LM.inherits(NM,PM);var RM=NM,OM=g,kM={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,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)"]}}},zM={};zM.categoryAxis=OM.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},kM),zM.valueAxis=OM.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},kM),zM.timeAxis=OM.defaults({scale:!0,min:"dataMin",max:"dataMax"},zM.valueAxis),zM.logAxis=OM.defaults({scale:!0,logBase:10},zM.valueAxis);var BM=zM,FM=g,VM=BM,GM=Ld,HM=Hc,UM=HM.getLayoutParams,WM=HM.mergeLayoutParam,jM=Lx,XM=["value","category","time","log"],ZM=function(e,t,i,n){FM.each(XM,(function(r){t.extend({type:e+"Axis."+r,mergeDefaultAndTheme:function(t,n){var a=this.layoutMode,o=a?UM(t):{},s=n.getTheme();FM.merge(t,s.get(r+"Axis")),FM.merge(t,this.getDefaultOption()),t.type=i(e,t),a&&WM(t,o,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=jM.createByAxisModel(this))},getCategories:function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:FM.mergeAll([{},VM[r+"Axis"],n],!0)})})),GM.registerSubTypeDefaulter(e+"Axis",FM.curry(i,e))},qM=g,YM=ZM,KM=aw,QM=Ld.extend({type:"cartesian2dAxis",axis:null,init:function(){QM.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){QM.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){QM.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function JM(e,t){return t.type||(t.data?"category":"value")}qM.merge(QM.prototype,KM);var $M={offset:0};YM("x",QM,JM,$M),YM("y",QM,JM,$M),Ld.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var eA=g,tA=eA.isObject,iA=eA.each,nA=eA.map,rA=eA.indexOf;eA.retrieve;var aA=Hc.getLayoutRect,oA=yx,sA=oA.createScaleByModel,lA=oA.ifAxisCrossZero,uA=oA.niceScaleExtent,hA=oA.estimateLabelUnionRect,cA=EM,dA=RM,fA=sp,pA=ex.getStackedDimension;function gA(e,t,i){return e.getCoordSysModel()===t}function mA(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}var vA=mA.prototype;function yA(e,t,i,n){i.getAxesOnZeroOf=function(){return r?[r]:[]};var r,a=e[t],o=i.model,s=o.get("axisLine.onZero"),l=o.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)_A(a[l])&&(r=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&_A(a[u])&&!n[h(a[u])]){r=a[u];break}r&&(n[h(r)]=!0)}function h(e){return e.dim+"_"+e.index}}function _A(e){return e&&"category"!==e.type&&"time"!==e.type&&lA(e)}vA.type="grid",vA.axisPointerEnabled=!0,vA.getRect=function(){return this._rect},vA.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model),iA(i.x,(function(e){uA(e.scale,e.model)})),iA(i.y,(function(e){uA(e.scale,e.model)}));var n={};iA(i.x,(function(e){yA(i,"y",e,n)})),iA(i.y,(function(e){yA(i,"x",e,n)})),this.resize(this.model,t)},vA.resize=function(e,t,i){var n=aA(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});this._rect=n;var r=this._axesList;function a(){iA(r,(function(e){var t=e.isHorizontal(),i=t?[0,n.width]:[0,n.height],r=e.inverse?1:0;e.setExtent(i[r],i[1-r]),function(e,t){var i=e.getExtent(),n=i[0]+i[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return n-e+t}}(e,t?n.x:n.y)}))}a(),!i&&e.get("containLabel")&&(iA(r,(function(e){if(!e.model.get("axisLabel.inside")){var t=hA(e);if(t){var i=e.isHorizontal()?"height":"width",r=e.model.get("axisLabel.margin");n[i]-=t[i]+r,"top"===e.position?n.y+=t.height+r:"left"===e.position&&(n.x+=t.width+r)}}})),a())},vA.getAxis=function(e,t){var i=this._axesMap[e];if(null!=i){if(null==t)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[t]}},vA.getAxes=function(){return this._axesList.slice()},vA.getCartesian=function(e,t){if(null!=e&&null!=t){var i="x"+e+"y"+t;return this._coordsMap[i]}tA(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,r=this._coordsList;nu[1]?-1:1,c=["start"===a?u[0]-h*l:"end"===a?u[1]+h*l:(u[0]+u[1])/2,XA(a)?e.labelOffset+o*l:0],d=t.get("nameRotate");null!=d&&(d=d*BA/180),XA(a)?n=HA(e.rotation,null!=d?d:e.rotation,o):(n=function(e,t,i,n){var r,a,o=NA(i-e.rotation),s=n[0]>n[1],l="start"===t&&!s||"start"!==t&&s;return PA(o-BA/2)?(a=l?"bottom":"top",r="center"):PA(o-1.5*BA)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*BA&&o>BA/2?l?"left":"right":l?"right":"left"),{rotation:o,textAlign:r,textVerticalAlign:a}}(e,a,d||0,u),null!=(r=e.axisNameAvailableWidth)&&(r=Math.abs(r/Math.sin(n.rotation)),!isFinite(r)&&(r=null)));var f=s.getFont(),p=t.get("nameTruncate",!0)||{},g=p.ellipsis,m=SA(e.nameTruncateMaxWidth,p.maxWidth,r),v=null!=g&&null!=m?CA.truncateText(i,m,f,g,{minChar:2,placeholder:p.placeholder}):i,y=t.get("tooltip",!0),_=t.mainType,x={componentType:_,name:i,$vars:["name"]};x[_+"Index"]=t.componentIndex;var b=new DA.Text({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:UA(t),z2:1,tooltip:y&&y.show?AA({content:i,formatter:function(){return i},formatterParams:x},y):null});DA.setTextStyle(b.style,s,{text:v,textFont:f,textFill:s.getTextColor()||t.get("axisLine.lineStyle.color"),textAlign:s.get("align")||n.textAlign,textVerticalAlign:s.get("verticalAlign")||n.textVerticalAlign}),t.get("triggerEvent")&&(b.eventData=GA(t),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},GA=FA.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},HA=FA.innerTextLayout=function(e,t,i){var n,r,a=NA(t-e);return PA(a)?(r=i>0?"top":"bottom",n="center"):PA(a-BA)?(r=i>0?"bottom":"top",n="center"):(r="middle",n=a>0&&a0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:r}},UA=FA.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)};function WA(e){e&&(e.ignore=!0)}function jA(e,t,i){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var a=OA.identity([]);return OA.rotate(a,a,-e.rotation),n.applyTransform(OA.mul([],a,e.getLocalTransform())),r.applyTransform(OA.mul([],a,t.getLocalTransform())),n.intersect(r)}}function XA(e){return"middle"===e||"center"===e}function ZA(e,t,i,n,r){for(var a=[],o=[],s=[],l=0;l=0||e===t}function tI(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[nI(e)]}function iI(e){return!!e.get("handle.show")}function nI(e){return e.type+"||"+e.id}YA.collect=function(e,t){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,i){var n=t.getComponent("tooltip"),r=t.getComponent("axisPointer"),a=r.get("link",!0)||[],o=[];JA(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var s=nI(i.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=i;var u=i.model.getModel("tooltip",n);if(JA(i.getAxes(),$A(f,!1,null)),i.getTooltipAxes&&n&&u.get("show")){var h="axis"===u.get("trigger"),c="cross"===u.get("axisPointer.type"),d=i.getTooltipAxes(u.get("axisPointer.axis"));(h||c)&&JA(d.baseAxes,$A(f,!c||"cross",h)),c&&JA(d.otherAxes,$A(f,"cross",!1))}}function f(n,s,h){var c=h.model.getModel("axisPointer",r),d=c.get("show");if(d&&("auto"!==d||n||iI(c))){null==s&&(s=c.get("triggerTooltip")),c=n?function(e,t,i,n,r,a){var o=t.getModel("axisPointer"),s={};JA(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=KA.clone(o.get(e))})),s.snap="category"!==e.type&&!!a,"cross"===o.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=o.get("label.show");if(l.show=null==u||u,!a){var h=s.lineStyle=o.get("crossStyle");h&&KA.defaults(l,h.textStyle)}}return e.model.getModel("axisPointer",new QA(s,i,n))}(h,u,r,t,n,s):c;var f=c.get("snap"),p=nI(h.model),g=s||f||"category"===h.type,m=e.axesInfo[p]={key:p,axis:h,coordSys:i,axisPointerModel:c,triggerTooltip:s,involveSeries:g,snap:f,useHandle:iI(c),seriesModels:[]};l[p]=m,e.seriesInvolved|=g;var v=function(e,t){for(var i=t.model,n=t.dim,r=0;rl[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),oe&&(e=t),e},defaultOption:{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1}}});var OI={},kI=No,zI=HT.getDefaultLabel;function BI(e,t){"outside"===e.textPosition&&(e.textPosition=t)}OI.setLabel=function(e,t,i,n,r,a,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");kI.setLabelStyle(e,t,s,l,{labelFetcher:r,labelDataIndex:a,defaultText:zI(r.getData(),a),isRectText:!0,autoColor:n}),BI(e),BI(t)};var FI=Co([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),VI={getBarItemStyle:function(e){var t=FI(this,e);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(t.lineDash=i)}return t}},GI=(0,No.extendShape)({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=.5*(a-r),s=r+o,l=t.startAngle,u=t.endAngle,h=t.clockwise,c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(c*r+i,d*r+n),e.arc(c*s+i,d*s+n,o,-Math.PI+l,l,!h)),e.arc(i,n,a,l,u,!h),e.moveTo(f*a+i,p*a+n),e.arc(f*s+i,p*s+n,o,u-2*Math.PI,u-Math.PI,!h),0!==r&&(e.arc(i,n,r,u,l,h),e.moveTo(c*r+i,p*r+n)),e.closePath()}}),HI=h,UI=g,WI=No,jI=OI.setLabel,XI=zc,ZI=VI,qI=dl,YI=zi,KI=km.throttle,QI=VS.createClipPath,JI=GI,$I=["itemStyle","barBorderWidth"],eC=[0,0];UI.extend(XI.prototype,ZI),HI.extendChartView({type:"bar",render:function(e,t,i){this._updateDrawMode(e);var n=e.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(e,t,i):this._renderNormal(e,t,i)),this.group},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._incrementalRenderLarge(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e,t,i){var n,r=this.group,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=e.isAnimationEnabled()?e:null,h=e.get("clip",!0),c=function(e,t){var i=e.getArea&&e.getArea();if("cartesian2d"===e.type){var n=e.getBaseAxis();if("category"!==n.type||!n.onBand){var r=t.getLayout("bandWidth");n.isHorizontal()?(i.x-=r,i.width+=2*r):(i.y-=r,i.height+=2*r)}}return i}(s,a);r.removeClipPath();var d=e.get("roundCap",!0),f=e.get("showBackground",!0),p=e.getModel("backgroundStyle"),g=p.get("barBorderRadius")||0,m=[],v=this._backgroundEls||[],y=function(e){var t=sC[s.type](a,e),i=function(e,t,i){return new("polar"===e.type?WI.Sector:WI.Rect)({shape:fC(t,i,e),silent:!0,z2:0})}(s,n,t);return i.useStyle(p.getBarItemStyle()),"cartesian2d"===s.type&&i.setShape("r",g),m[e]=i,i};a.diff(o).add((function(t){var i=a.getItemModel(t),o=sC[s.type](a,t,i);if(f&&y(t),a.hasValue(t)){if(h&&nC[s.type](c,o))return void r.remove(l);var l=rC[s.type](t,o,n,u,!1,d);a.setItemGraphicEl(t,l),r.add(l),uC(l,a,t,i,o,e,n,"polar"===s.type)}})).update((function(t,i){var l=a.getItemModel(t),_=sC[s.type](a,t,l);if(f){var x;0===v.length?x=y(i):((x=v[i]).useStyle(p.getBarItemStyle()),"cartesian2d"===s.type&&x.setShape("r",g),m[t]=x);var b=sC[s.type](a,t),w=fC(n,b,s);WI.updateProps(x,{shape:w},u,t)}var T=o.getItemGraphicEl(i);if(a.hasValue(t)){if(h&&nC[s.type](c,_))return void r.remove(T);T?WI.updateProps(T,{shape:_},u,t):T=rC[s.type](t,_,n,u,!0,d),a.setItemGraphicEl(t,T),r.add(T),uC(T,a,t,l,_,e,n,"polar"===s.type)}else r.remove(T)})).remove((function(e){var t=o.getItemGraphicEl(e);"cartesian2d"===s.type?t&&aC(e,u,t):t&&oC(e,u,t)})).execute();var _=this._backgroundGroup||(this._backgroundGroup=new YI);_.removeAll();for(var x=0;x0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*r/2,y:n.y+o*r/2,width:n.width-a*r,height:n.height-o*r}},polar:function(e,t,i){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};function lC(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function uC(e,t,i,n,r,a,o,s){var l=t.getItemVisual(i,"color"),u=t.getItemVisual(i,"opacity"),h=t.getVisual("borderColor"),c=n.getModel("itemStyle"),d=n.getModel("emphasis.itemStyle").getBarItemStyle();s||e.setShape("r",c.get("barBorderRadius")||0),e.useStyle(UI.defaults({stroke:lC(r)?"none":h,fill:lC(r)?"none":l,opacity:u},c.getBarItemStyle()));var f=n.getShallow("cursor");f&&e.attr("cursor",f);var p=o?r.height>0?"bottom":"top":r.width>0?"left":"right";s||jI(e.style,d,n,l,a,i,p),lC(r)&&(d.fill=d.stroke="none"),WI.setHoverStyle(e,d)}var hC=qI.extend({type:"largeBar",shape:{points:[]},buildPath:function(e,t){for(var i=t.points,n=this.__startPoint,r=this.__baseDimIdx,a=0;a=c&&m<=d&&(l<=v?h>=l&&h<=v:h>=v&&h<=l))return o[f]}return-1}(this,e.offsetX,e.offsetY);this.dataIndex=t>=0?t:null}),30,!1);function fC(e,t,i){var n,r="polar"===i.type;return n=r?i.getArea():i.grid.getRect(),r?{cx:n.cx,cy:n.cy,r0:e?n.r0:t.r0,r:e?n.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}:{x:e?t.x:n.x,y:e?n.y:t.y,width:e?t.width:n.width,height:e?n.height:t.height}}var pC=h,gC=g,mC=Qx,vC=mC.layout,yC=mC.largeLayout;pC.registerLayout(pC.PRIORITY.VISUAL.LAYOUT,gC.curry(vC,"bar")),pC.registerLayout(pC.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,yC),pC.registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}});var _C=X_,xC=A_,bC=g,wC=bC.extend,TC=bC.isArray,SC=function(e,t,i){t=TC(t)&&{coordDimensions:t}||wC({},t);var n=e.getSource(),r=_C(n,t),a=new xC(r,e);return a.initData(n,i),a},MC=g,AC={updateSelectedMap:function(e){this._targetList=MC.isArray(e)?e.slice():[],this._selectTargetMap=MC.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),MC.createHashMap())},select:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);"single"===this.get("selectedMode")&&this._selectTargetMap.each((function(e){e.selected=!1})),i&&(i.selected=!0)},unSelect:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);i&&(i.selected=!1)},toggleSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);if(null!=i)return this[i.selected?"unSelect":"select"](e,t),i.selected},isSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);return i&&i.selected}},IC=function(e,t){this.getAllNames=function(){var e=t();return e.mapArray(e.getName)},this.containName=function(e){return t().indexOfName(e)>=0},this.indexOfName=function(t){return e().indexOfName(t)},this.getItemVisual=function(t,i){return e().getItemVisual(t,i)}},CC=h,DC=SC,EC=g,LC=lo,PC=Uc.getPercentWithPrecision,NC=AC,RC=qp.retrieveRawAttr,OC=Vd.makeSeriesEncodeForNameBased,kC=IC,zC=CC.extendSeriesModel({type:"series.pie",init:function(e){zC.superApply(this,"init",arguments),this.legendVisualProvider=new kC(EC.bind(this.getData,this),EC.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(e)},mergeOption:function(e){zC.superCall(this,"mergeOption",e),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(e,t){return DC(this,{coordDimensions:["value"],encodeDefaulter:EC.curry(OC,this)})},_createSelectableList:function(){for(var e=this.getRawData(),t=e.mapDimension("value"),i=[],n=0,r=e.count();n0&&(l?"scale"!==u:"transition"!==h)){for(var f=r.getItemLayout(0),p=1;isNaN(f.startAngle)&&p=i.r0}}});var jC=h,XC=g,ZC=function(e,t){XC.each(t,(function(t){t.update="updateView",jC.registerAction(t,(function(i,n){var r={};return n.eachComponent({mainType:"series",subType:e,query:i},(function(e){e[t.method]&&e[t.method](i.name,i.dataIndex);var n=e.getData();n.each((function(t){var i=n.getName(t);r[i]=e.isSelected(i)||!1}))})),{name:i.name,selected:r,seriesId:i.seriesId}}))}))},qC=g.createHashMap,YC=function(e){return{getTargetSeries:function(t){var i={},n=qC();return t.eachSeriesByType(e,(function(e){e.__paletteScope=i,n.set(e.uid,e)})),n},reset:function(e,t){var i=e.getRawData(),n={},r=e.getData();r.each((function(e){var t=r.getRawIndex(e);n[t]=e})),i.each((function(t){var a,o=n[t],s=null!=o&&r.getItemVisual(o,"color",!0),l=null!=o&&r.getItemVisual(o,"borderColor",!0);if(s&&l||(a=i.getItemModel(t)),!s){var u=a.get("itemStyle.color")||e.getColorFromPalette(i.getName(t)||t+"",e.__paletteScope,i.count());null!=o&&r.setItemVisual(o,"color",u)}if(!l){var h=a.get("itemStyle.borderColor");null!=o&&r.setItemVisual(o,"borderColor",h)}}))}}},KC=Tn,QC=Uc.parsePercent,JC=Math.PI/180;function $C(e,t,i,n,r,a,o,s,l,u){function h(t,i,n,r){for(var a=t;al+o);a++)if(e[a].y+=n,a>t&&a+1e[a].y+e[a].height)return void c(a,n/2);c(i-1,n/2)}function c(t,i){for(var n=t;n>=0&&!(e[n].y-i0&&e[n].y>e[n-1].y+e[n-1].height));n--);}function d(e,t,i,n,r,a){for(var o=t?Number.MAX_VALUE:0,s=0,l=e.length;s=o&&(d=o-10),!t&&d<=o&&(d=o+10),e[s].x=i+d*a,o=d}}e.sort((function(e,t){return e.y-t.y}));for(var f,p=0,g=e.length,m=[],v=[],y=0;y=i?v.push(e[y]):m.push(e[y]);d(m,!1,t,i,n,r),d(v,!0,t,i,n,r)}function eD(e){return"center"===e.position}var tD=function(e,t,i,n,r,a){var o,s,l=e.getData(),u=[],h=!1,c=(e.get("minShowLabelAngle")||0)*JC;l.each((function(n){var a=l.getItemLayout(n),d=l.getItemModel(n),f=d.getModel("label"),p=f.get("position")||d.get("emphasis.label.position"),g=f.get("distanceToLabelLine"),m=f.get("alignTo"),v=QC(f.get("margin"),i),y=f.get("bleedMargin"),_=f.getFont(),x=d.getModel("labelLine"),b=x.get("length");b=QC(b,i);var w=x.get("length2");if(w=QC(w,i),!(a.angle0?"right":"left":C>0?"left":"right"}var F=f.get("rotate");E="number"==typeof F?F*(Math.PI/180):F?C<0?-I+Math.PI:-I:0,h=!!E,a.label={x:T,y:S,position:p,height:P.height,len:b,len2:w,linePoints:M,textAlign:A,verticalAlign:"middle",rotation:E,inside:N,labelDistance:g,labelAlignTo:m,labelMargin:v,bleedMargin:y,textRect:P,text:L,font:_},N||u.push(a.label)}})),!h&&e.get("avoidLabelOverlap")&&function(e,t,i,n,r,a,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-o/2;if(e>=u&&t>=h&&e<=u+a&&t<=h+o)return s}return-1}});function wD(){this.group=new yD.Group}var TD=wD.prototype;TD.isPersistent=function(){return!this._incremental},TD.updateData=function(e,t){this.group.removeAll();var i=new bD({rectHover:!0,cursor:"default"});i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!1,t),this.group.add(i),this._incremental=null},TD.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("symbolPoints");this.group.eachChild((function(e){if(null!=e.startIndex){var i=2*(e.endIndex-e.startIndex),n=4*e.startIndex*2;t=new Float32Array(t.buffer,n,i)}e.setShape("points",t)}))}},TD.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new xD({silent:!0})),this.group.add(this._incremental)):this._incremental=null},TD.incrementalUpdate=function(e,t,i){var n;this._incremental?(n=new bD,this._incremental.addDisplayable(n,!0)):((n=new bD({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(n)),n.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(n,t,!!this._incremental,i)},TD._setCommon=function(e,t,i,n){var r=t.hostModel;n=n||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=n.clipShape||null,e.symbolProxy=_D(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("color");s&&e.setColor(s),i||(e.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>=0&&(e.dataIndex=i+(e.startIndex||0))})))},TD.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},TD._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var SD=pS,MD=wD,AD=_M;h.extendChartView({type:"scatter",render:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).updateData(n,{clipShape:this._getClipShape(e)}),this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(e,t,i){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=AD().reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_getClipShape:function(e){var t=e.coordinateSystem,i=t&&t.getArea&&t.getArea();return e.get("clip",!0)?i:null},_updateSymbolDraw:function(e,t){var i=this._symbolDraw,n=t.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new MD:new SD,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}});var ID=h,CD=gM,DD=_M;ID.registerVisual(CD("scatter","circle")),ID.registerLayout(DD("scatter"));var ED=wT;function LD(e,t,i){ED.call(this,e,t,i),this.type="value",this.angle=0,this.name="",this.model}g.inherits(LD,ED);var PD=g,ND=LD,RD=Kx,OD=Uc,kD=yx,zD=kD.getScaleExtent,BD=kD.niceScaleExtent,FD=sp,VD=Gb;function GD(e,t,i){this._model=e,this.dimensions=[],this._indicatorAxes=PD.map(e.getIndicatorModels(),(function(e,t){var i="indicator_"+t,n=new ND(i,"log"===e.get("axisType")?new VD:new RD);return n.name=e.get("name"),n.model=e,e.axis=n,this.dimensions.push(i),n}),this),this.resize(e,i),this.cx,this.cy,this.r,this.r0,this.startAngle}GD.prototype.getIndicatorAxes=function(){return this._indicatorAxes},GD.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},GD.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(i),this.cy-e*Math.sin(i)]},GD.prototype.pointToData=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=Math.sqrt(t*t+i*i);t/=n,i/=n;for(var r,a=Math.atan2(-i,t),o=1/0,s=-1,l=0;li[0]&&isFinite(c)&&isFinite(i[0]));else{o.getTicks().length-1>r&&(u=a(u));var h=Math.ceil(i[1]/u)*u,c=OD.round(h-u*r);o.setExtent(c,h),o.setInterval(u)}}))},GD.dimensions=[],GD.create=function(e,t){var i=[];return e.eachComponent("radar",(function(n){var r=new GD(n,e,t);i.push(r),n.coordinateSystem=r})),e.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},FD.register("radar",GD);var HD=h,UD=g,WD=zc,jD=aw,XD=BM.valueAxis;function ZD(e,t){return UD.defaults({show:t},e)}HD.extendComponentModel({type:"radar",optionUpdated:function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),r=this.get("axisTick"),a=this.get("axisType"),o=this.get("axisLabel"),s=this.get("name"),l=this.get("name.show"),u=this.get("name.formatter"),h=this.get("nameGap"),c=this.get("triggerEvent"),d=UD.map(this.get("indicator")||[],(function(d){null!=d.max&&d.max>0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var f=s;if(null!=d.color&&(f=UD.defaults({color:d.color},s)),d=UD.merge(UD.clone(d),{boundaryGap:e,splitNumber:t,scale:i,axisLine:n,axisTick:r,axisType:a,axisLabel:o,name:d.text,nameLocation:"end",nameGap:h,nameTextStyle:f,triggerEvent:c},!1),l||(d.name=""),"string"==typeof u){var p=d.name;d.name=u.replace("{value}",null!=p?p:"")}else"function"==typeof u&&(d.name=u(d.name,d));var g=UD.extend(new WD(d,null,this.ecModel),jD);return g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this.getIndicatorModels=function(){return d}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:UD.merge({lineStyle:{color:"#bbb"}},XD.axisLine),axisLabel:ZD(XD.axisLabel,!1),axisTick:ZD(XD.axisTick,!1),axisType:"interval",splitLine:ZD(XD.splitLine,!0),splitArea:ZD(XD.splitArea,!0),indicator:[]}});var qD=g,YD=qA,KD=No,QD=["axisLine","axisTickLabel","axisName"];h.extendComponentView({type:"radar",render:function(e,t,i){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},_buildAxes:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes(),n=qD.map(i,(function(e){return new YD(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));qD.each(n,(function(e){qD.each(QD,e.add,e),this.group.add(e.getGroup())}),this)},_buildSplitLineAndArea:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes();if(i.length){var n=e.get("shape"),r=e.getModel("splitLine"),a=e.getModel("splitArea"),o=r.getModel("lineStyle"),s=a.getModel("areaStyle"),l=r.get("show"),u=a.get("show"),h=o.get("color"),c=s.get("color");h=qD.isArray(h)?h:[h],c=qD.isArray(c)?c:[c];var d=[],f=[];if("circle"===n)for(var p=i[0].getTicksCoords(),g=t.cx,m=t.cy,v=0;v":"\n";return tE(""===o?this.name:o)+s+eE.map(a,(function(t,i){var n=r.get(r.mapDimension(t.dim),e);return tE(t.name+" : "+n)})).join(s)},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,n=t.getValues(eE.map(i.dimensions,(function(e){return t.mapDimension(e)})),e,!0),r=0,a=n.length;r":"\n";return l.join(", ")+d+fL(o+" : "+a)},getTooltipPosition:function(e){if(null!=e){var t=this.getData().getName(e),i=this.coordinateSystem,n=i.getRegion(t);return n&&i.dataToPoint(n.center)}},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},nameProperty:"name"}});uL.mixin(_L,gL);var xL={},bL="\0_ec_interaction_mutex";function wL(e){return e[bL]||(e[bL]={})}h.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){})),xL.take=function(e,t,i){wL(e)[t]=i},xL.release=function(e,t,i){var n=wL(e);n[t]===i&&(n[t]=null)},xL.isTaken=function(e,t){return!!wL(e)[t]};var TL=g,SL=ie,ML=ne,AL=xL;function IL(e){this.pointerChecker,this._zr=e,this._opt={};var t=TL.bind,i=t(CL,this),n=t(DL,this),r=t(EL,this),a=t(LL,this),o=t(PL,this);SL.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(t,s){this.disable(),this._opt=TL.defaults(TL.clone(s)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",n),e.on("mouseup",r)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",o))},this.disable=function(){e.off("mousedown",i),e.off("mousemove",n),e.off("mouseup",r),e.off("mousewheel",a),e.off("pinch",o)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function CL(e){if(!(ML.isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable)){var t=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,i)&&(this._x=t,this._y=i,this._dragging=!0)}}function DL(e){if(this._dragging&&OL("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!AL.isTaken(this._zr,"globalPan")){var t=e.offsetX,i=e.offsetY,n=this._x,r=this._y,a=t-n,o=i-r;this._x=t,this._y=i,this._opt.preventDefaultMouseMove&&ML.stop(e.event),RL(this,"pan","moveOnMouseMove",e,{dx:a,dy:o,oldX:n,oldY:r,newX:t,newY:i})}}function EL(e){ML.isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)}function LL(e){var t=OL("zoomOnMouseWheel",e,this._opt),i=OL("moveOnMouseWheel",e,this._opt),n=e.wheelDelta,r=Math.abs(n),a=e.offsetX,o=e.offsetY;if(0!==n&&(t||i)){if(t){var s=r>3?1.4:r>1?1.2:1.1;NL(this,"zoom","zoomOnMouseWheel",e,{scale:n>0?s:1/s,originX:a,originY:o})}if(i){var l=Math.abs(n);NL(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:o})}}}function PL(e){AL.isTaken(this._zr,"globalPan")||NL(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY})}function NL(e,t,i,n,r){e.pointerChecker&&e.pointerChecker(n,r.originX,r.originY)&&(ML.stop(n.event),RL(e,t,i,n,r))}function RL(e,t,i,n,r){r.isAvailableBehavior=TL.bind(OL,null,i,n),e.trigger(t,r)}function OL(e,t,i){var n=i[e];return!e||n&&(!TL.isString(n)||t.event[n+"Key"])}TL.mixin(IL,SL);var kL=IL,zL={updateViewOnPan:function(e,t,i){var n=e.target,r=n.position;r[0]+=t,r[1]+=i,n.dirty()},updateViewOnZoom:function(e,t,i,n){var r=e.target,a=e.zoomLimit,o=r.position,s=r.scale,l=e.zoom=e.zoom||1;if(l*=t,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/e.zoom;e.zoom=l,o[0]-=(i-o[0])*(c-1),o[1]-=(n-o[1])*(c-1),s[0]*=c,s[1]*=c,r.dirty()}},BL={},FL={axisPointer:1,tooltip:1,brush:1};BL.onIrrelevantElement=function(e,t,i){var n=t.getComponentByElement(e.topTarget),r=n&&n.coordinateSystem;return n&&n!==i&&!FL[n.mainType]&&r&&r.model!==i};var VL=g,GL=kL,HL=zL,UL=BL.onIrrelevantElement,WL=No,jL=lL,XL=Bc.getUID,ZL=rt;function qL(e){var t=e.getItemStyle(),i=e.get("areaColor");return null!=i&&(t.fill=i),t}function YL(e,t){t.eachChild((function(t){VL.each(t.__regions,(function(i){t.trigger(e.isSelected(i.name)?"emphasis":"normal")}))}))}function KL(e,t){var i=new WL.Group;this.uid=XL("ec_map_draw"),this._controller=new GL(e.getZr()),this._controllerHost={target:t?i:null},this.group=i,this._updateGroup=t,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new WL.Group),i.add(this._backgroundGroup=new WL.Group)}KL.prototype={constructor:KL,draw:function(e,t,i,n,r){var a="geo"===e.mainType,o=e.getData&&e.getData();a&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u=this._regionsGroup,h=this.group,c=s.getTransformInfo(),d=!u.childAt(0)||r;if(d)h.transform=c.roamTransform,h.decomposeTransform(),h.dirty();else{var f=new ZL;f.transform=c.roamTransform,f.decomposeTransform();var p={scale:f.scale,position:f.position};l=f.scale,WL.updateProps(h,p,e)}var g=c.rawScale,m=c.rawPosition;u.removeAll();var v=["itemStyle"],y=["emphasis","itemStyle"],_=["label"],x=["emphasis","label"],b=VL.createHashMap();VL.each(s.regions,(function(t){var i=b.get(t.name)||b.set(t.name,new WL.Group),n=new WL.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(n);var r,s=(R=e.getRegionModel(t.name)||e).getModel(v),c=R.getModel(y),f=qL(s),p=qL(c),w=R.getModel(_),T=R.getModel(x);if(o){r=o.indexOfName(t.name);var S=o.getItemVisual(r,"color",!0);S&&(f.fill=S)}var M=function(e){return[e[0]*g[0]+m[0],e[1]*g[1]+m[1]]};VL.each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],i=0;i=0)&&(E=e);var P=new WL.Text({position:M(t.center.slice()),scale:[1/h.scale[0],1/h.scale[1]],z2:10,silent:!0});if(WL.setLabelStyle(P.style,P.hoverStyle={},w,T,{labelFetcher:E,labelDataIndex:L,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),!d){var N=[1/l[0],1/l[1]];WL.updateProps(P,{scale:N},e)}i.add(P)}if(o)o.setItemGraphicEl(r,i);else{var R=e.getRegionModel(t.name);n.eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:R&&R.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),WL.setHoverStyle(i,p),u.add(i)})),this._updateController(e,t,i),function(e,t,i,n,r){i.off("click"),i.off("mousedown"),t.get("selectedMode")&&(i.on("mousedown",(function(){e._mouseDownFlag=!0})),i.on("click",(function(a){if(e._mouseDownFlag){e._mouseDownFlag=!1;for(var o=a.target;!o.__regions;)o=o.parent;if(o){var s={type:("geo"===t.mainType?"geo":"map")+"ToggleSelect",batch:VL.map(o.__regions,(function(e){return{name:e.name,from:r.uid}}))};s[t.mainType+"Id"]=t.id,n.dispatchAction(s),YL(t,i)}}})))}(this,e,u,i,n),YL(e,u)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&jL.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(e){var t=e.map;this._mapName!==t&&VL.each(jL.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},_updateController:function(e,t,i){var n=e.coordinateSystem,r=this._controller,a=this._controllerHost;a.zoomLimit=e.get("scaleLimit"),a.zoom=n.getZoom(),r.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}r.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,HL.updateViewOnPan(a,e.dx,e.dy),i.dispatchAction(VL.extend(s(),{dx:e.dx,dy:e.dy}))}),this),r.off("zoom").on("zoom",(function(e){if(this._mouseDownFlag=!1,HL.updateViewOnZoom(a,e.scale,e.originX,e.originY),i.dispatchAction(VL.extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY})),this._updateGroup){var t=this.group.scale;this._regionsGroup.traverse((function(e){"text"===e.type&&e.attr("scale",[1/t[0],1/t[1]])}))}}),this),r.setPointerChecker((function(t,r,a){return n.getViewRectAfterRoam().contain(r,a)&&!UL(t,i,e)}))}};var QL=KL,JL=g,$L=No,eP=QL,tP="__seriesMapHighDown";function iP(e){var t=this[tP];t&&t.recordVersion===this.__seriesMapCallKey&&nP(t,e)}function nP(e,t){var i=e.circle,n=e.labelModel,r=e.hoverLabelModel,a=e.emphasisText,o=e.normalText;t?(i.style.extendFrom($L.setTextStyle({},r,{text:r.get("show")?a:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=$L.Z2_EMPHASIS_LIFT):($L.setTextStyle(i.style,n,{text:n.get("show")?o:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}h.extendChartView({type:"map",render:function(e,t,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var r=this.group;if(r.removeAll(),!e.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===e.id)(a=this._mapDraw)&&r.add(a.group);else if(e.needsDrawMap){var a=this._mapDraw||new eP(i,!0);r.add(a.group),a.draw(e,t,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(e,t,i){var n=e.originalData,r=this.group;n.each(n.mapDimension("value"),(function(t,i){if(!isNaN(t)){var a=n.getItemLayout(i);if(a&&a.point){var o=a.point,s=a.offset,l=new $L.Circle({style:{fill:e.getData().getVisual("color")},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:$L.Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),f=d.getModel("label"),p=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=JL.retrieve2(e.getFormattedLabel(c,"normal"),h),v=JL.retrieve2(e.getFormattedLabel(c,"emphasis"),m),y=g[tP],_=Math.random();if(!y){y=g[tP]={};var x=JL.curry(iP,!0),b=JL.curry(iP,!1);g.on("mouseover",x).on("mouseout",b).on("emphasis",x).on("normal",b)}g.__seriesMapCallKey=_,JL.extend(y,{recordVersion:_,circle:l,labelModel:f,hoverLabelModel:p,emphasisText:v,normalText:m}),nP(y,!1)}r.add(l)}}}))}});var rP={updateCenterAndZoom:function(e,t,i){var n=e.getZoom(),r=e.getCenter(),a=t.zoom,o=e.dataToPoint(r);if(null!=t.dx&&null!=t.dy&&(o[0]-=t.dx,o[1]-=t.dy,r=e.pointToData(o),e.setCenter(r)),null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}e.scale[0]*=a,e.scale[1]*=a;var u=e.position,h=(t.originX-u[0])*(a-1),c=(t.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,e.updateTransform(),r=e.pointToData(o),e.setCenter(r),e.setZoom(a*n)}return{center:e.getCenter(),zoom:e.getZoom()}}},aP=h,oP=g,sP=rP.updateCenterAndZoom;aP.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},(function(t){var n=t.coordinateSystem;if("geo"===n.type){var r=sP(n,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom),"series"===i&&oP.each(t.seriesGroup,(function(e){e.setCenter(r.center),e.setZoom(r.zoom)}))}}))}));var lP=g,uP=V,hP=Ue,cP=Pi,dP=rt,fP=uP.applyTransform;function pP(){dP.call(this)}function gP(e){this.name=e,this.zoomLimit,dP.call(this),this._roamTransformable=new pP,this._rawTransformable=new pP,this._center,this._zoom}function mP(e,t,i,n){var r=i.seriesModel,a=r?r.coordinateSystem:null;return a===this?a[e](n):null}lP.mixin(pP,dP),gP.prototype={constructor:gP,type:"view",dimensions:["x","y"],setBoundingRect:function(e,t,i,n){return this._rect=new cP(e,t,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(e,t,i,n){this.transformTo(e,t,i,n),this._viewRect=new cP(e,t,i,n)},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=this._rawTransformable;a.transform=r.calculateTransform(new cP(e,t,i,n)),a.decomposeTransform(),this._updateTransform()},setCenter:function(e){e&&(this._center=e,this._updateCenterAndZoom())},setZoom:function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},getDefaultCenter:function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),r=this.getZoom();n=uP.applyTransform([],n,e),i=uP.applyTransform([],i,e),t.origin=n,t.position=[i[0]-n[0],i[1]-n[1]],t.scale=[r,r],this._updateTransform()},_updateTransform:function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),hP.copy(this.transform||(this.transform=[]),t.transform||hP.create()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],hP.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?lP.slice(e):hP.create(),rawScale:lP.slice(t.scale),rawPosition:lP.slice(t.position)}},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},dataToPoint:function(e,t,i){var n=t?this._rawTransform:this.transform;return i=i||[],n?fP(i,e,n):uP.copy(i,e)},pointToData:function(e){var t=this.invTransform;return t?fP([],e,t):[e[0],e[1]]},convertToPixel:lP.curry(mP,"dataToPoint"),convertFromPixel:lP.curry(mP,"pointToData"),containPoint:function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])}},lP.mixin(gP,dP);var vP=gP,yP=g,_P=Pi,xP=vP,bP=lL;function wP(e,t,i,n){xP.call(this,e),this.map=t;var r=bP.load(t,i);this._nameCoordMap=r.nameCoordMap,this._regionsMap=r.regionsMap,this._invertLongitute=null==n||n,this.regions=r.regions,this._rect=r.boundingRect}function TP(e,t,i,n){var r=i.geoModel,a=i.seriesModel,o=r?r.coordinateSystem:a?a.coordinateSystem||(a.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return o===this?o[e](n):null}wP.prototype={constructor:wP,type:"geo",dimensions:["lng","lat"],containCoord:function(e){for(var t=this.regions,i=0;i1?(f.width=l,f.height=l/c):(f.height=l,f.width=l*c),f.y=s[1]-f.height/2,f.x=s[0]-f.width/2}else(a=e.getBoxLayoutParams()).aspect=c,f=IP.getLayoutRect(a,{width:u,height:h});this.setViewRect(f.x,f.y,f.width,f.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function PP(e,t){MP.each(t.get("geoCoord"),(function(t,i){e.addGeoCoord(i,t)}))}var NP={dimensions:AP.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("geo",(function(e,n){var r=e.get("map"),a=e.get("aspectScale"),o=!0,s=EP.retrieveMap(r);s&&s[0]&&"svg"===s[0].type?(null==a&&(a=1),o=!1):null==a&&(a=.75);var l=new AP(r+n,r,e.get("nameMap"),o);l.aspectScale=a,l.zoomLimit=e.get("scaleLimit"),i.push(l),PP(l,e),e.coordinateSystem=l,l.model=e,l.resize=LP,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=i[t]}}));var n={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();n[t]=n[t]||[],n[t].push(e)}})),MP.each(n,(function(e,n){var r=MP.map(e,(function(e){return e.get("nameMap")})),a=new AP(n,n,MP.mergeAll(r));a.zoomLimit=MP.retrieve.apply(null,MP.map(e,(function(e){return e.get("scaleLimit")}))),i.push(a),a.resize=LP,a.aspectScale=e[0].get("aspectScale"),a.resize(e[0],t),MP.each(e,(function(e){e.coordinateSystem=a,PP(a,e)}))})),i},getFilledRegions:function(e,t,i){for(var n=(e||[]).slice(),r=MP.createHashMap(),a=0;at&&(t=n.height)}this.height=t+1},getNodeById:function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},setVisual:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},getVisual:function(e,t){return this.hostTree.data.getItemVisual(this.dataIndex,e,t)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},isDescendantOf:function(e){return e!==this&&e.isAncestorOf(this)}},uN.prototype={constructor:uN,type:"tree",eachNode:function(e,t,i){this.root.eachNode(e,t,i)},getNodeByDataIndex:function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},getNodeByName:function(e){return this.root.getNodeByName(e)},update:function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;ia&&(a=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),r.data},getOrient:function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},formatTooltip:function(e){for(var t=this.getData().tree,i=t.root.children[0],n=t.getNodeByDataIndex(e),r=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return fN(a+(isNaN(r)||null==r?"":" : "+r))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var gN={},mN=Hc;function vN(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function yN(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function _N(e,t,i){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:i}function xN(e,t,i){var n=i/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=i,t.hierNode.modifier+=i,t.hierNode.prelim+=i,e.hierNode.change+=n}function bN(e,t){return e.parentNode===t.parentNode?1:2}gN.init=function(e){e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t,i,n=[e];t=n.pop();)if(i=t.children,t.isExpand&&i.length)for(var r=i.length-1;r>=0;r--){var a=i[r];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:r,thread:null},n.push(a)}},gN.firstWalk=function(e,t){var i=e.isExpand?e.children:[],n=e.parentNode.children,r=e.hierNode.i?n[e.hierNode.i-1]:null;if(i.length){!function(e){for(var t=e.children,i=t.length,n=0,r=0;--i>=0;){var a=t[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,r+=a.hierNode.change,n+=a.hierNode.shift+r}}(e);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;r?(e.hierNode.prelim=r.hierNode.prelim+t(e,r),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else r&&(e.hierNode.prelim=r.hierNode.prelim+t(e,r));e.parentNode.hierNode.defaultAncestor=function(e,t,i,n){if(t){for(var r=e,a=e,o=a.parentNode.children[0],s=t,l=r.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=vN(s),a=yN(a),s&&a;){r=vN(r),o=yN(o),r.hierNode.ancestor=e;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(xN(_N(s,e,i),e,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=r.hierNode.modifier,h+=o.hierNode.modifier}s&&!vN(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),a&&!yN(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,i=e)}return i}(e,r,e.parentNode.hierNode.defaultAncestor||n[0],t)},gN.secondWalk=function(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier},gN.separation=function(e){return arguments.length?e:bN},gN.radialCoordinate=function(e,t){var i={};return e-=Math.PI/2,i.x=t*Math.cos(e),i.y=t*Math.sin(e),i},gN.getViewRect=function(e,t){return mN.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})};var wN=g,TN=No,SN=aS,MN=gN.radialCoordinate,AN=h,IN=Jo,CN=vP,DN=zL,EN=kL,LN=BL.onIrrelevantElement,PN=Uc.parsePercent,NN=TN.extendShape({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.childPoints,n=i.length,r=t.parentPoint,a=i[0],o=i[n-1];if(1===n)return e.moveTo(r[0],r[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=PN(t.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(o[u]-r[u])*h,e.moveTo(r[0],r[1]),e.lineTo(c[0],c[1]),e.moveTo(a[0],a[1]),c[l]=a[l],e.lineTo(c[0],c[1]),c[l]=o[l],e.lineTo(c[0],c[1]),e.lineTo(o[0],o[1]);for(var d=1;d_.x)||(m-=Math.PI);var w=v?"left":"right",T=a.labelModel.get("rotate"),S=T*(Math.PI/180);g.setStyle({textPosition:a.labelModel.get("position")||w,textRotation:null==T?-m:S,textOrigin:"center",verticalAlign:"middle"})}!function(e,t,i,n,r,a,o,s,l){var u=l.edgeShape,h=n.__edge;if("curve"===u)t.parentNode&&t.parentNode!==i&&(h||(h=n.__edge=new TN.BezierCurve({shape:BN(l,r,r),style:wN.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),TN.updateProps(h,{shape:BN(l,a,o),style:wN.defaults({opacity:1},l.lineStyle)},e));else if("polyline"===u&&"orthogonal"===l.layout&&t!==i&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var c=t.children,d=[],f=0;f=0;a--)n.push(r[a])}}},HN=GN,UN=HN.eachAfter,WN=HN.eachBefore,jN=gN,XN=jN.init,ZN=jN.firstWalk,qN=jN.secondWalk,YN=jN.separation,KN=jN.radialCoordinate,QN=jN.getViewRect,JN=function(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var i=QN(e,t);e.layoutInfo=i;var n=e.get("layout"),r=0,a=0,o=null;"radial"===n?(r=2*Math.PI,a=Math.min(i.height,i.width)/2,o=YN((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(r=i.width,a=i.height,o=YN());var s=e.getData().tree.root,l=s.children[0];if(l){XN(s),UN(l,ZN,o),s.hierNode.modifier=-l.hierNode.prelim,WN(l,qN);var u=l,h=l,c=l;WN(l,(function(e){var t=e.getLayout().x;th.getLayout().x&&(h=e),e.depth>c.depth&&(c=e)}));var d=u===h?1:o(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=r/(h.getLayout().x+d+f),g=a/(c.depth-1||1),WN(l,(function(e){m=(e.getLayout().x+f)*p,v=(e.depth-1)*g;var t=KN(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=a/(h.getLayout().x+d+f),p=r/(c.depth-1||1),WN(l,(function(e){v=(e.getLayout().x+f)*g,m="LR"===y?(e.depth-1)*p:r-(e.depth-1)*p,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(p=r/(h.getLayout().x+d+f),g=a/(c.depth-1||1),WN(l,(function(e){m=(e.getLayout().x+f)*p,v="TB"===y?(e.depth-1)*g:a-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))},$N=h,eR=gM,tR=JN;$N.registerVisual(eR("tree","circle")),$N.registerLayout(tR);var iR={},nR=g;function rR(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}iR.retrieveTargetInfo=function(e,t,i){if(e&&nR.indexOf(t,e.type)>=0){var n=i.getData().tree.root,r=e.targetNode;if("string"==typeof r&&(r=n.getNodeById(r)),r&&n.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=n.getNodeById(a)))return{node:r}}},iR.getPathToRoot=rR,iR.aboveViewRoot=function(e,t){var i=rR(e);return nR.indexOf(i,t)>=0},iR.wrapTreePathInfo=function(e,t){for(var i=[];e;){var n=e.dataIndex;i.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return i.reverse(),i};var aR=g,oR=um,sR=hN,lR=zc,uR=qc,hR=uR.encodeHTML,cR=uR.addCommas,dR=iR.wrapTreePathInfo;function fR(e){var t=0;aR.each(e.children,(function(e){fR(e);var i=e.value;aR.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;aR.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),aR.isArray(e.value)?e.value[0]=i:e.value=i}oR.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(e,t){var i={name:e.name,children:e.data};fR(i);var n=e.levels||[],r=this.designatedVisualItemStyle={},a=new lR({itemStyle:r},this,t);n=e.levels=function(e,t){var i,n=t.get("color");if(n)return e=e||[],aR.each(e,(function(e){var t=new lR(e),n=t.get("color");(t.get("itemStyle.color")||n&&"none"!==n)&&(i=!0)})),i||((e[0]||(e[0]={})).color=n.slice()),e}(n,t);var o=aR.map(n||[],(function(e){return new lR(e,a,t)}),this),s=sR.createTree(i,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=s.getNodeByDataIndex(t),n=o[i.depth];return e.parentModel=n||a,e}))}));return s.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=aR.isArray(i)?cR(i[0]):cR(i),r=t.getName(e);return hR(r+": "+n)},getDataParams:function(e){var t=oR.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=dR(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},aR.extend(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=aR.createHashMap(),this._idIndexMapCount=0);var i=t.get(e);return null==i&&t.set(e,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)}});var pR=No,gR=Hc,mR=g,vR=iR.wrapTreePathInfo;function yR(e){this.group=new pR.Group,e.add(this.group)}function _R(e,t,i,n,r,a){var o=[[r?e:e-5,t],[e+i,t],[e+i,t+n],[r?e:e-5,t+n]];return!a&&o.splice(2,0,[e+i+5,t+n/2]),!r&&o.push([e,t+n/2]),o}function xR(e,t,i){e.eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&vR(i,t)}}yR.prototype={constructor:yR,render:function(e,t,i,n){var r=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),r.get("show")&&i){var o=r.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(e,l,o,s,n),gR.positionElement(a,l.pos,l.box)}},_prepare:function(e,t,i){for(var n=e;n;n=n.parentNode){var r=n.getModel().get("name"),a=i.getTextRect(r),o=Math.max(a.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:n,text:r,width:o})}},_renderContent:function(e,t,i,n,r){for(var a=0,o=t.emptyItemWidth,s=e.get("breadcrumb.height"),l=gR.getAvailableSize(t.pos,t.box),u=t.totalWidth,h=t.renderList,c=h.length-1;c>=0;c--){var d=h[c],f=d.node,p=d.width,g=d.text;u>l.width&&(u-=p-o,p=o,g=null);var m=new pR.Polygon({shape:{points:_R(a,0,p,s,c===h.length-1,0===c)},style:mR.defaults(i.getItemStyle(),{lineJoin:"bevel",text:g,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:mR.curry(r,f)});this.group.add(m),xR(m,e,f),a+=p+8}},remove:function(){this.group.removeAll()}};var bR=yR,wR={},TR=g;wR.createWrap=function(){var e,t=[],i={};return{add:function(e,n,r,a,o){return TR.isString(a)&&(o=a,a=0),!i[e.id]&&(i[e.id]=1,t.push({el:e,target:n,time:r,delay:a,easing:o}),!0)},done:function(t){return e=t,this},start:function(){for(var n=t.length,r=0,a=t.length;r3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var i=t.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+e.dx,y:i.y+e.dy,width:i.width,height:i.height}})}},_onZoom:function(e){var t=e.originX,i=e.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var r=n.getLayout();if(!r)return;var a=new LR(r.x,r.y,r.width,r.height),o=this.seriesModel.layoutInfo;t-=o.x,i-=o.y;var s=PR.create();PR.translate(s,s,[-t,-i]),PR.scale(s,s,[e.scale,e.scale]),PR.translate(s,s,[t,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(e){e.on("click",(function(e){if("ready"===this._state){var t=this.seriesModel.get("nodeClick",!0);if(t){var i=this.findTarget(e.offsetX,e.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===t)this._zoomToNode(i);else if("link"===t){var r=n.hostTree.data.getItemModel(n.dataIndex),a=r.get("link",!0),o=r.get("target",!0)||"blank";a&&OR(a,o)}}}}}),this)},_renderBreadcrumb:function(e,t,i){i||(i=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(i={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new DR(this.group))).render(e,t,i.node,kR((function(t){"animating"!==this._state&&(CR.aboveViewRoot(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))}),this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},_rootToNode:function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},findTarget:function(e,t){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(n){var r=this._storage.background[n.getRawIndex()];if(r){var a=r.transformCoordToLocal(e,t),o=r.shape;if(!(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}}),this),i}});for(var qR=h,YR=iR,KR=function(){},QR=["treemapZoomToNode","treemapRender","treemapMove"],JR=0;JR=0;a--)null==i[a]&&(delete n[t[a]],t.pop())}(n):sO(n,!0):($R.assert("linear"!==t||n.dataExtent),sO(n))};aO.prototype={constructor:aO,mapValueToVisual:function(e){var t=this._normalizeData(e);return this._doMap(t,e)},getNormalizer:function(){return $R.bind(this._normalizeData,this)}};var oO=aO.visualHandlers={color:{applyVisual:hO("color"),getColorMapper:function(){var e=this.option;return $R.bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),cO.call(this,e)}:function(t,i,n){var r=!!n;return!i&&(t=this._normalizeData(t)),n=eO.fastLerp(t,e.parsedVisual,n),r?n:eO.stringify(n,"rgba")},this)},_doMap:{linear:function(e){return eO.stringify(eO.fastLerp(e,this.option.parsedVisual),"rgba")},category:cO,piecewise:function(e,t){var i=pO.call(this,t);return null==i&&(i=eO.stringify(eO.fastLerp(e,this.option.parsedVisual),"rgba")),i},fixed:dO}},colorHue:lO((function(e,t){return eO.modifyHSL(e,t)})),colorSaturation:lO((function(e,t){return eO.modifyHSL(e,null,t)})),colorLightness:lO((function(e,t){return eO.modifyHSL(e,null,null,t)})),colorAlpha:lO((function(e,t){return eO.modifyAlpha(e,t)})),opacity:{applyVisual:hO("opacity"),_doMap:fO([0,1])},liftZ:{applyVisual:hO("liftZ"),_doMap:{linear:dO,category:dO,piecewise:dO,fixed:dO}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);if($R.isString(n))i("symbol",n);else if(nO(n))for(var r in n)n.hasOwnProperty(r)&&i(r,n[r])},_doMap:{linear:uO,category:cO,piecewise:function(e,t){var i=pO.call(this,t);return null==i&&(i=uO.call(this,e)),i},fixed:dO}},symbolSize:{applyVisual:hO("symbolSize"),_doMap:fO([0,1])}};function sO(e,t){var i=e.visual,n=[];$R.isObject(i)?iO(i,(function(e){n.push(e)})):null!=i&&n.push(i),t||1!==n.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(n[1]=n[0]),gO(e,n)}function lO(e){return{applyVisual:function(t,i,n){t=this.mapValueToVisual(t),n("color",e(i("color"),t))},_doMap:fO([0,1])}}function uO(e){var t=this.option.visual;return t[Math.round(tO(e,[0,1],[0,t.length-1],!0))]||{}}function hO(e){return function(t,i,n){n(e,this.mapValueToVisual(t))}}function cO(e){var t=this.option.visual;return t[this.option.loop&&e!==rO?e%t.length:e]}function dO(){return this.option.visual[0]}function fO(e){return{linear:function(t){return tO(t,e,this.option.visual,!0)},category:cO,piecewise:function(t,i){var n=pO.call(this,i);return null==n&&(n=tO(t,e,this.option.visual,!0)),n},fixed:dO}}function pO(e){var t=this.option,i=t.pieceList;if(t.hasSpecialVisual){var n=i[aO.findPieceIndex(e,i)];if(n&&n.visual)return n.visual[this.type]}}function gO(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=$R.map(t,(function(e){return eO.parse(e)}))),t}var mO={linear:function(e){return tO(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,i=aO.findPieceIndex(e,t,!0);if(null!=i)return tO(i,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?rO:t},fixed:$R.noop};function vO(e,t,i){return e?t<=i:tu[1]&&(u[1]=l);var h=t.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new _O(c);return d.__drColorMappingBy=h,d}}}(0,r,a,0,l,c);bO.each(c,(function(e,t){if(e.depth>=i.length||e===i[e.depth]){var a=function(e,t,i,n,r,a){var o=bO.extend({},t);if(r){var s=r.type,l="color"===s&&r.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(e.get("visualDimension"));o[s]=r.mapValueToVisual(u)}return o}(r,l,e,t,d,n);TO(e,a,i,n)}}))}else o=SO(l),e.setVisual("color",o)}}function SO(e){var t=MO(e,"color");if(t){var i=MO(e,"colorAlpha"),n=MO(e,"colorSaturation");return n&&(t=xO.modifyHSL(t,null,null,n)),i&&(t=xO.modifyAlpha(t,i)),t}}function MO(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function AO(e,t){var i=e.get(t);return wO(i)&&i.length?{name:t,range:i}:null}var IO={seriesType:"treemap",reset:function(e,t,i,n){var r=e.getData().tree.root;r.isRemoved()||TO(r,{},e.getViewRoot().getAncestors(),e)}},CO=g,DO=Pi,EO=Uc,LO=EO.parsePercent,PO=EO.MAX_SAFE_INTEGER,NO=Hc,RO=iR,OO=Math.max,kO=Math.min,zO=CO.retrieve,BO=CO.each,FO=["itemStyle","borderWidth"],VO=["itemStyle","gapWidth"],GO=["upperLabel","show"],HO=["upperLabel","height"],UO={seriesType:"treemap",reset:function(e,t,i,n){var r=i.getWidth(),a=i.getHeight(),o=e.option,s=NO.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=LO(zO(s.width,l[0]),r),h=LO(zO(s.height,l[1]),a),c=n&&n.type,d=RO.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=e.getViewRoot(),g=RO.getPathToRoot(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(e,t,i,n,r){var a,o=(t||{}).node,s=[n,r];if(!o||o===i)return s;for(var l=n*r,u=l*e.option.zoomToNodeRatio;a=o.parentNode;){for(var h=0,c=a.children,d=0,f=c.length;dPO&&(u=PO),o=a}us[1]&&(s[1]=t)}))}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,i,n,r){if(!n)return i;for(var a=e.get("visibleMin"),o=r.length,s=o,l=o-1;l>=0;l--){var u=r["asc"===n?o-l-1:l].getValue();u/i*tr&&(r=n));var l=e.area*e.area,u=t*t*i;return l?OO(u*r/l,l/(u*a)):1/0}function XO(e,t,i,n,r){var a=t===i.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=t?e.area/t:0;(r||h>i[l[o]])&&(h=i[l[o]]);for(var c=0,d=e.length;c=0&&e.call(t,i[r],r)},ik.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&e.call(t,i[r],r)},ik.breadthFirstTraverse=function(e,t,i,n){if(nk.isInstance(t)||(t=this._nodesMap[ek(t)]),t){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a=0&&i.node2.dataIndex>=0})),r=0,a=n.length;r=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},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)}}};JO.mixin(nk,ak("hostGraph","data")),JO.mixin(rk,ak("hostGraph","edgeData")),tk.Node=nk,tk.Edge=rk,$O(nk),$O(rk);var ok=g,sk=A_,lk=tk,uk=nN,hk=X_,ck=sp,dk=vx,fk=function(e,t,i,n,r){for(var a=new lk(n),o=0;o "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=dk(e,i);else{var g=ck.get(p),m=g&&"view"!==g.type&&g.dimensions||[];ok.indexOf(m,"value")<0&&m.concat(["value"]);var v=hk(e,{coordDimensions:m});(f=new sk(v,i)).initData(e)}var y=new sk(["value"],i);return y.initData(l,s),r&&r(f,y),uk({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},pk={},gk=g,mk="--\x3e",vk=function(e){return e.get("autoCurveness")||null},yk=function(e,t){var i=vk(e),n=20,r=[];if("number"==typeof i)n=i;else if(gk.isArray(i))return void(e.__curvenessList=i);t>n&&(n=t);var a=n%2?n+2:n+3;r=[];for(var o=0;o ")),r.value&&(l+=" : "+Ik(r.value)),l}return Nk.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=Sk.map(this.option.categories||[],(function(e){return null!=e.value?e:Sk.extend({value:0},e)})),t=new Tk(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},isAnimationEnabled:function(){return Nk.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}}}}),Rk=No,Ok=V,kk=Rk.Line.prototype,zk=Rk.BezierCurve.prototype;function Bk(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var Fk=Rk.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(e,t){this[Bk(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:kk.buildPath,_buildPathCurve:zk.buildPath,pointAt:function(e){return this[Bk(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:kk.pointAt,_pointAtCurve:zk.pointAt,tangentAt:function(e){var t=this.shape,i=Bk(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return Ok.normalize(i,i)},_tangentAtCurve:zk.tangentAt}),Vk=g,Gk=V,Hk=ow,Uk=Fk,Wk=No,jk=Uc.round,Xk=["fromSymbol","toSymbol"];function Zk(e){return"_"+e+"Type"}function qk(e,t,i){var n=t.getItemVisual(i,e);if(n&&"none"!==n){var r=t.getItemVisual(i,"color"),a=t.getItemVisual(i,e+"Size"),o=t.getItemVisual(i,e+"Rotate");Vk.isArray(a)||(a=[a,a]);var s=Hk.createSymbol(n,-a[0]/2,-a[1]/2,a[0],a[1],r);return s.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,s.name=e,s}}function Yk(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var i=t[2];i?(e.cpx1=i[0],e.cpy1=i[1]):(e.cpx1=NaN,e.cpy1=NaN)}function Kk(e,t,i){Wk.Group.call(this),this._createLine(e,t,i)}var Qk=Kk.prototype;Qk.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),i=e.childOfName("toSymbol"),n=e.childOfName("label");if(t||i||!n.ignore){for(var r=1,a=this.parent;a;)a.scale&&(r/=a.scale[0]),a=a.parent;var o=e.childOfName("line");if(this.__dirty||o.__dirty){var s,l=o.shape.percent,u=o.pointAt(0),h=o.pointAt(l),c=Gk.sub([],h,u);if(Gk.normalize(c,c),t){if(t.attr("position",u),null==(s=t.__specifiedRotation)){var d=o.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(d[1],d[0]))}else t.attr("rotation",s);t.attr("scale",[r*l,r*l])}if(i)i.attr("position",h),null==(s=i.__specifiedRotation)?(d=o.tangentAt(1),i.attr("rotation",-Math.PI/2-Math.atan2(d[1],d[0]))):i.attr("rotation",s),i.attr("scale",[r*l,r*l]);if(!n.ignore){var f,p,g,m;n.attr("position",h);var v=n.__labelDistance,y=v[0]*r,_=v[1]*r,x=l/2,b=[(d=o.tangentAt(x))[1],-d[0]],w=o.pointAt(x);b[1]>0&&(b[0]=-b[0],b[1]=-b[1]);var T,S=d[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var M=-Math.atan2(d[1],d[0]);h[0].8?"left":c[0]<-.8?"right":"center",g=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":f=[-c[0]*y+u[0],-c[1]*_+u[1]],p=c[0]>.8?"right":c[0]<-.8?"left":"center",g=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":f=[y*S+u[0],u[1]+T],p=d[0]<0?"right":"left",m=[-y*S,-T];break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":f=[w[0],w[1]+T],p="center",m=[0,-T];break;case"insideEndTop":case"insideEnd":case"insideEndBottom":f=[-y*S+h[0],h[1]+T],p=d[0]>=0?"right":"left",m=[y*S,-T]}n.attr({style:{textVerticalAlign:n.__verticalAlign||g,textAlign:n.__textAlign||p},position:f,scale:[r,r],origin:m})}}}},Qk._createLine=function(e,t,i){var n=e.hostModel,r=function(e){var t=new Uk({name:"line",subPixelOptimize:!0});return Yk(t.shape,e),t}(e.getItemLayout(t));r.shape.percent=0,Wk.initProps(r,{shape:{percent:1}},n,t),this.add(r);var a=new Wk.Text({name:"label",lineLabelOriginalOpacity:1});this.add(a),Vk.each(Xk,(function(i){var n=qk(i,e,t);this.add(n),this[Zk(i)]=e.getItemVisual(t,i)}),this),this._updateCommonStl(e,t,i)},Qk.updateData=function(e,t,i){var n=e.hostModel,r=this.childOfName("line"),a=e.getItemLayout(t),o={shape:{}};Yk(o.shape,a),Wk.updateProps(r,o,n,t),Vk.each(Xk,(function(i){var n=e.getItemVisual(t,i),r=Zk(i);if(this[r]!==n){this.remove(this.childOfName(i));var a=qk(i,e,t);this.add(a)}this[r]=n}),this),this._updateCommonStl(e,t,i)},Qk._updateCommonStl=function(e,t,i){var n=e.hostModel,r=this.childOfName("line"),a=i&&i.lineStyle,o=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||e.hasItemOption){var u=e.getItemModel(t);a=u.getModel("lineStyle").getLineStyle(),o=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var h=e.getItemVisual(t,"color"),c=Vk.retrieve3(e.getItemVisual(t,"opacity"),a.opacity,1);r.useStyle(Vk.defaults({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},a)),r.hoverStyle=o,Vk.each(Xk,(function(e){var t=this.childOfName(e);t&&(t.setColor(h),t.setStyle({opacity:c}))}),this);var d,f,p=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((p||g)&&(d=h||"#000",null==(f=n.getFormattedLabel(t,"normal",e.dataType)))){var v=n.getRawValue(t);f=null==v?e.getName(t):isFinite(v)?jk(v):v}var y=p?f:null,_=g?Vk.retrieve2(n.getFormattedLabel(t,"emphasis",e.dataType),f):null,x=m.style;if(null!=y||null!=_){Wk.setTextStyle(m.style,s,{text:y},{autoColor:d}),m.__textAlign=x.textAlign,m.__verticalAlign=x.textVerticalAlign,m.__position=s.get("position")||"middle";var b=s.get("distance");Vk.isArray(b)||(b=[b,b]),m.__labelDistance=b}m.hoverStyle=null!=_?{text:_,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!p&&!g,Wk.setHoverStyle(this)},Qk.highlight=function(){this.trigger("emphasis")},Qk.downplay=function(){this.trigger("normal")},Qk.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},Qk.setLinePoints=function(e){var t=this.childOfName("line");Yk(t.shape,e),t.dirty()},Vk.inherits(Kk,Wk.Group);var Jk=Kk,$k=No,ez=Jk;function tz(e){this._ctor=e||ez,this.group=new $k.Group}var iz=tz.prototype;function nz(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),hoverLineStyle:t.getModel("emphasis.lineStyle").getLineStyle(),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label")}}function rz(e){return isNaN(e[0])||isNaN(e[1])}function az(e){return!rz(e[0])&&!rz(e[1])}iz.isPersistent=function(){return!0},iz.updateData=function(e){var t=this,i=t.group,n=t._lineData;t._lineData=e,n||i.removeAll();var r=nz(e);e.diff(n).add((function(i){!function(e,t,i,n){if(az(t.getItemLayout(i))){var r=new e._ctor(t,i,n);t.setItemGraphicEl(i,r),e.group.add(r)}}(t,e,i,r)})).update((function(i,a){!function(e,t,i,n,r,a){var o=t.getItemGraphicEl(n);az(i.getItemLayout(r))?(o?o.updateData(i,r,a):o=new e._ctor(i,r,a),i.setItemGraphicEl(r,o),e.group.add(o)):e.group.remove(o)}(t,n,e,a,i,r)})).remove((function(e){i.remove(n.getItemGraphicEl(e))})).execute()},iz.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,i){t.updateLayout(e,i)}),this)},iz.incrementalPrepareUpdate=function(e){this._seriesScope=nz(e),this._lineData=null,this.group.removeAll()},iz.incrementalUpdate=function(e,t){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=e.useHoverLayer=!0)}for(var n=e.start;n=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}var yz=function(e,t){var i=[],n=lz.quadraticSubdivide,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),h=e.getVisual("toSymbol");l.__original||(l.__original=[uz.clone(l[0]),uz.clone(l[1])],l[2]&&l.__original.push(uz.clone(l[2])));var c=l.__original;if(null!=l[2]){if(uz.copy(r[0],c[0]),uz.copy(r[1],c[2]),uz.copy(r[2],c[1]),u&&"none"!==u){var d=hz(e.node1),f=vz(r,c[0],d*t);n(r[0][0],r[1][0],r[2][0],f,i),r[0][0]=i[3],r[1][0]=i[4],n(r[0][1],r[1][1],r[2][1],f,i),r[0][1]=i[3],r[1][1]=i[4]}h&&"none"!==h&&(d=hz(e.node2),f=vz(r,c[1],d*t),n(r[0][0],r[1][0],r[2][0],f,i),r[1][0]=i[1],r[2][0]=i[2],n(r[0][1],r[1][1],r[2][1],f,i),r[1][1]=i[1],r[2][1]=i[2]),uz.copy(l[0],r[0]),uz.copy(l[1],r[2]),uz.copy(l[2],r[1])}else uz.copy(a[0],c[0]),uz.copy(a[1],c[1]),uz.sub(o,a[1],a[0]),uz.normalize(o,o),u&&"none"!==u&&(d=hz(e.node1),uz.scaleAndAdd(a[0],a[0],o,d*t)),h&&"none"!==h&&(d=hz(e.node2),uz.scaleAndAdd(a[1],a[1],o,-d*t)),uz.copy(l[0],a[0]),uz.copy(l[1],a[1])}))},_z=h,xz=g,bz=pS,wz=oz,Tz=kL,Sz=zL,Mz=BL.onIrrelevantElement,Az=No,Iz=yz,Cz=sz.getNodeGlobalScale,Dz="__focusNodeAdjacency",Ez="__unfocusNodeAdjacency",Lz=["itemStyle","opacity"],Pz=["lineStyle","opacity"];function Nz(e,t){var i=e.getVisual("opacity");return null!=i?i:e.getModel().get(t)}function Rz(e,t,i){var n=e.getGraphicEl(),r=Nz(e,t);null!=i&&(null==r&&(r=1),r*=i),n.downplay&&n.downplay(),n.traverse((function(e){if(!e.isGroup){var t=e.lineLabelOriginalOpacity;null!=t&&null==i||(t=r),e.setStyle("opacity",t)}}))}function Oz(e,t){var i=Nz(e,t),n=e.getGraphicEl();n.traverse((function(e){!e.isGroup&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}_z.extendChartView({type:"graph",init:function(e,t){var i=new bz,n=new wz,r=this.group;this._controller=new Tz(t.getZr()),this._controllerHost={target:r},r.add(i.group),r.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(e,t,i){var n=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if("view"===r.type){var l={position:r.position,scale:r.scale};this._firstRender?s.attr(l):Az.updateProps(s,l,e)}Iz(e.getGraph(),Cz(e));var u=e.getData();a.updateData(u);var h=e.getEdgeData();o.updateData(h),this._updateNodeAndLinkScale(),this._updateController(e,t,i),clearTimeout(this._layoutTimeout);var c=e.forceLayout,d=e.get("force.layoutAnimation");c&&this._startForceLayoutIteration(c,d),u.eachItemGraphicEl((function(t,r){var a=u.getItemModel(r);t.off("drag").off("dragend");var o=a.get("draggable");o&&t.on("drag",(function(){c&&(c.warmUp(),!this._layouting&&this._startForceLayoutIteration(c,d),c.setFixed(r),u.setItemLayout(r,t.position))}),this).on("dragend",(function(){c&&c.setUnfixed(r)}),this),t.setDraggable(o&&c),t[Dz]&&t.off("mouseover",t[Dz]),t[Ez]&&t.off("mouseout",t[Ez]),a.get("focusNodeAdjacency")&&(t.on("mouseover",t[Dz]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex})}),t.on("mouseout",t[Ez]=function(){n._dispatchUnfocus(i)}))}),this),u.graph.eachEdge((function(t){var r=t.getGraphicEl();r[Dz]&&r.off("mouseover",r[Dz]),r[Ez]&&r.off("mouseout",r[Ez]),t.getModel().get("focusNodeAdjacency")&&(r.on("mouseover",r[Dz]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex})}),r.on("mouseout",r[Ez]=function(){n._dispatchUnfocus(i)}))}));var f="circular"===e.get("layout")&&e.get("circular.rotateLabel"),p=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var i=u.getItemModel(t).get("label.rotate")||0,n=e.getSymbolPath();if(f){var r=u.getItemLayout(t),a=Math.atan2(r[1]-g,r[0]-p);a<0&&(a=2*Math.PI+a);var o=r[0]=r/3?1:2),l=t.y-n(o)*a*(a>=r/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+i(o)*a,t.y+n(o)*a),e.lineTo(t.x+i(t.angle)*r,t.y+n(t.angle)*r),e.lineTo(t.x-i(o)*a,t.y-n(o)*a),e.lineTo(s,l)}}),zB=kB,BB=No,FB=Om,VB=Uc,GB=VB.parsePercent,HB=VB.round,UB=VB.linearMap;function WB(e,t){return t&&("string"==typeof t?e=t.replace("{value}",null!=e?e:""):"function"==typeof t&&(e=t(e))),e}var jB=2*Math.PI;FB.extend({type:"gauge",render:function(e,t,i){this.group.removeAll();var n=e.get("axisLine.lineStyle.color"),r=function(e,t){var i=e.get("center"),n=t.getWidth(),r=t.getHeight(),a=Math.min(n,r);return{cx:GB(i[0],t.getWidth()),cy:GB(i[1],t.getHeight()),r:GB(e.get("radius"),a/2)}}(e,i);this._renderMain(e,t,i,n,r)},dispose:function(){},_renderMain:function(e,t,i,n,r){for(var a=this.group,o=e.getModel("axisLine"),s=o.getModel("lineStyle"),l=e.get("clockwise"),u=-e.get("startAngle")/180*Math.PI,h=((g=-e.get("endAngle")/180*Math.PI)-u)%jB,c=u,d=s.get("width"),f=o.get("show"),p=0;f&&p=e&&(0===t?0:n[t-1][0]).4?"bottom":"middle",textAlign:I<-.4?"left":I>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&A!==v){for(var N=0;N<=y;N++){I=Math.cos(b),C=Math.sin(b);var R=new BB.Line({shape:{x1:I*c+u,y1:C*c+h,x2:I*(c-x)+u,y2:C*(c-x)+h},silent:!0,style:M});"auto"===M.stroke&&R.setStyle({stroke:n((A+N/y)/v)}),l.add(R),b+=T}b-=T}else b+=w}},_renderPointer:function(e,t,i,n,r,a,o,s){var l=this.group,u=this._data;if(e.get("pointer.show")){var h=[+e.get("min"),+e.get("max")],c=[a,o],d=e.getData(),f=d.mapDimension("value");d.diff(u).add((function(t){var i=new zB({shape:{angle:a}});BB.initProps(i,{shape:{angle:UB(d.get(f,t),h,c,!0)}},e),l.add(i),d.setItemGraphicEl(t,i)})).update((function(t,i){var n=u.getItemGraphicEl(i);BB.updateProps(n,{shape:{angle:UB(d.get(f,t),h,c,!0)}},e),l.add(n),d.setItemGraphicEl(t,n)})).remove((function(e){var t=u.getItemGraphicEl(e);l.remove(t)})).execute(),d.eachItemGraphicEl((function(e,t){var i=d.getItemModel(t),a=i.getModel("pointer");e.setShape({x:r.cx,y:r.cy,width:GB(a.get("width"),r.r),r:GB(a.get("length"),r.r)}),e.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===e.style.fill&&e.setStyle("fill",n(UB(d.get(f,t),h,[0,1],!0))),BB.setHoverStyle(e,i.getModel("emphasis.itemStyle").getItemStyle())})),this._data=d}else u&&u.eachItemGraphicEl((function(e){l.remove(e)}))},_renderTitle:function(e,t,i,n,r){var a=e.getData(),o=a.mapDimension("value"),s=e.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=r.cx+GB(l[0],r.r),h=r.cy+GB(l[1],r.r),c=+e.get("min"),d=+e.get("max"),f=e.getData().get(o,0),p=n(UB(f,[c,d],[0,1],!0));this.group.add(new BB.Text({silent:!0,style:BB.setTextStyle({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:p,forceRich:!0})}))}},_renderDetail:function(e,t,i,n,r){var a=e.getModel("detail"),o=+e.get("min"),s=+e.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=r.cx+GB(l[0],r.r),h=r.cy+GB(l[1],r.r),c=GB(a.get("width"),r.r),d=GB(a.get("height"),r.r),f=e.getData(),p=f.get(f.mapDimension("value"),0),g=n(UB(p,[o,s],[0,1],!0));this.group.add(new BB.Text({silent:!0,style:BB.setTextStyle({},a,{x:u,y:h,text:WB(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}});var XB=h,ZB=g,qB=SC,YB=lo.defaultEmphasis,KB=Vd.makeSeriesEncodeForNameBased,QB=IC,JB=XB.extendSeriesModel({type:"series.funnel",init:function(e){JB.superApply(this,"init",arguments),this.legendVisualProvider=new QB(ZB.bind(this.getData,this),ZB.bind(this.getRawData,this)),this._defaultLabelLine(e)},getInitialData:function(e,t){return qB(this,{coordDimensions:["value"],encodeDefaulter:ZB.curry(KB,this)})},_defaultLabelLine:function(e){YB(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},getDataParams:function(e){var t=this.getData(),i=JB.superCall(this,"getDataParams",e),n=t.mapDimension("value"),r=t.getSum(n);return i.percent=r?+(t.get(n,e)/r*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}}),$B=No,eF=g,tF=Om;function iF(e,t){$B.Group.call(this);var i=new $B.Polygon,n=new $B.Polyline,r=new $B.Text;this.add(i),this.add(n),this.add(r),this.highDownOnUpdate=function(e,t){"emphasis"===t?(n.ignore=n.hoverIgnore,r.ignore=r.hoverIgnore):(n.ignore=n.normalIgnore,r.ignore=r.normalIgnore)},this.updateData(e,t,!0)}var nF=iF.prototype,rF=["itemStyle","opacity"];nF.updateData=function(e,t,i){var n=this.childAt(0),r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=e.getItemModel(t).get(rF);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:o.points}),n.setStyle({opacity:0}),$B.initProps(n,{style:{opacity:s}},r,t)):$B.updateProps(n,{style:{opacity:s},shape:{points:o.points}},r,t);var l=a.getModel("itemStyle"),u=e.getItemVisual(t,"color");n.setStyle(eF.defaults({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(e,t),$B.setHoverStyle(this)},nF._updateLabel=function(e,t){var i=this.childAt(1),n=this.childAt(2),r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t).label,s=e.getItemVisual(t,"color");$B.updateProps(i,{shape:{points:o.linePoints||o.linePoints}},r,t),$B.updateProps(n,{style:{x:o.x,y:o.y}},r,t),n.attr({rotation:o.rotation,origin:[o.x,o.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine");s=e.getItemVisual(t,"color"),$B.setLabelStyle(n.style,n.hoverStyle={},l,u,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:e.getName(t),autoColor:s,useInsideStyle:!!o.inside},{textAlign:o.textAlign,textVerticalAlign:o.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},eF.inherits(iF,$B.Group),tF.extend({type:"funnel",render:function(e,t,i){var n=e.getData(),r=this._data,a=this.group;n.diff(r).add((function(e){var t=new iF(n,e);n.setItemGraphicEl(e,t),a.add(t)})).update((function(e,t){var i=r.getItemGraphicEl(t);i.updateData(n,e),a.add(i),n.setItemGraphicEl(e,i)})).remove((function(e){var t=r.getItemGraphicEl(e);a.remove(t)})).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var aF=Hc,oF=Uc,sF=oF.parsePercent,lF=oF.linearMap,uF=function(e,t,i){e.eachSeriesByType("funnel",(function(e){var i=e.getData(),n=i.mapDimension("value"),r=e.get("sort"),a=function(e,t){return aF.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),o=function(e,t){for(var i=e.mapDimension("value"),n=e.mapArray(i,(function(e){return e})),r=[],a="ascending"===t,o=0,s=e.count();o0?-1:i<0?1:t?-1:1}}function bF(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}_F.prototype={constructor:_F,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},vF.inherits(_F,yF);var wF=function(e,t,i,n,r,a){e=e||0;var o=i[1]-i[0];if(null!=r&&(r=bF(r,[0,o])),null!=a&&(a=Math.max(a,null!=r?r:0)),"all"===n){var s=Math.abs(t[1]-t[0]);s=bF(s,[0,o]),r=a=bF(s,[r,a]),n=0}t[0]=bF(t[0],i),t[1]=bF(t[1],i);var l=xF(t,n);t[n]+=e;var u=r||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,t[n]=bF(t[n],h);var c=xF(t,n);return null!=r&&(c.sign!==l.sign||c.spana&&(t[1-n]=t[n]+c.sign*a),t},TF=g,SF=Ue,MF=Hc,AF=yx,IF=_F,CF=No,DF=Uc,EF=wF,LF=TF.each,PF=Math.min,NF=Math.max,RF=Math.floor,OF=Math.ceil,kF=DF.round,zF=Math.PI;function BF(e,t,i){this._axesMap=TF.createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._rect,this._model=e,this._init(e,t,i)}function FF(e,t){return PF(NF(e,t[0]),t[1])}function VF(e,t){var i=t.layoutLength/(t.axisCount-1);return{position:i*e,axisNameAvailableWidth:i,axisLabelShow:!0}}function GF(e,t){var i,n,r=t.layoutLength,a=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,h=!1;return e=i&&a<=i+t.axisLength&&o>=n&&o<=n+t.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,t){t.eachSeries((function(i){if(e.contains(i,t)){var n=i.getData();LF(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(n,n.mapDimension(e)),AF.niceScaleExtent(t.scale,t.model)}),this)}}),this)},resize:function(e,t){this._rect=MF.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var e,t=this._model,i=this._rect,n=["x","y"],r=["width","height"],a=t.get("layout"),o="horizontal"===a?0:1,s=i[r[o]],l=[0,s],u=this.dimensions.length,h=FF(t.get("axisExpandWidth"),l),c=FF(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=t.get("axisExpandWindow");f?(e=FF(f[1]-f[0],l),f[1]=f[0]+e):(e=FF(h*(c-1),l),(f=[h*(t.get("axisExpandCenter")||RF(u/2))-e/2])[1]=f[0]+e);var p=(s-e)/(u-c);p<3&&(p=0);var g=[RF(kF(f[0]/h,1))+1,OF(kF(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:o,layoutBase:i[n[o]],layoutLength:s,axisBase:i[n[1-o]],axisLength:i[r[1-o]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),r=n.layout;t.each((function(e){var t=[0,n.axisLength],i=e.inverse?1:0;e.setExtent(t[i],t[1-i])})),LF(i,(function(t,i){var a=(n.axisExpandable?GF:VF)(i,n),o={horizontal:{x:a.position,y:n.axisLength},vertical:{x:0,y:a.position}},s={horizontal:zF/2,vertical:0},l=[o[r].x+e.x,o[r].y+e.y],u=s[r],h=SF.create();SF.rotate(h,h,u),SF.translate(h,h,l),this._axesLayout[t]={position:l,rotation:u,transform:h,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},getAxis:function(e){return this._axesMap.get(e)},dataToPoint:function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},eachActiveState:function(e,t,i,n){null==i&&(i=0),null==n&&(n=e.count());var r=this._axesMap,a=this.dimensions,o=[],s=[];TF.each(a,(function(t){o.push(e.mapDimension(t)),s.push(r.get(t).model)}));for(var l=this.hasAxisBrushed(),u=i;ur*(1-h[0])?(l="jump",o=s-r*(1-h[2])):(o=s-r*h[1])>=0&&(o=s-r*(1-h[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?EF(o,n,a,"all"):l="none"):(r=n[1]-n[0],(n=[NF(0,a[1]*s/r-r/2)])[1]=PF(a[1],n[0]+r),n[0]=n[1]-r),{axisExpandWindow:n,behavior:l}}};var HF=BF;sp.register("parallel",{create:function(e,t){var i=[];return e.eachComponent("parallel",(function(n,r){var a=new HF(n,e,t);a.name="parallel_"+r,a.resize(n,t),n.coordinateSystem=a,a.model=n,i.push(a)})),e.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}});var UF=g,WF=Co,jF=ZM,XF=Uc,ZF=aw,qF=Ld.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return WF([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=UF.clone(e);if(t)for(var i=t.length-1;i>=0;i--)XF.asc(t[i])},getActiveState:function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(e))return"inactive";if(1===t.length){var i=t[0];if(i[0]<=e&&e<=i[1])return"active"}else for(var n=0,r=t.length;n1)return("e"===(i=[PV(e,(t=t.split(""))[0]),PV(e,t[1])])[0]||"w"===i[0])&&i.reverse(),i.join("");var i=eV.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return eV.getTransform(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function NV(e,t,i,n,r,a,o,s){var l=n.__brushOption,u=e(l.range),h=OV(i,a,o);rV(r.split(""),(function(e){var t=hV[e];u[t[0]][t[1]]+=h[t[0]]})),l.range=t(LV(u[0][0],u[1][0],u[0][1],u[1][1])),_V(i,n),SV(i,{isEnd:!1})}function RV(e,t,i,n,r){var a=t.__brushOption.range,o=OV(e,i,n);rV(a,(function(e){e[0]+=o[0],e[1]+=o[1]})),_V(e,t),SV(e,{isEnd:!1})}function OV(e,t,i){var n=e.group,r=n.transformCoordToLocal(t,i),a=n.transformCoordToLocal(0,0);return[r[0]-a[0],r[1]-a[1]]}function kV(e,t,i){var n=wV(e,t);return n&&!0!==n?n.clipPath(i,e._transform):JF.clone(i)}function zV(e){var t=e.event;t.preventDefault&&t.preventDefault()}function BV(e,t,i){return e.childOfName("main").contain(t,i)}function FV(e,t,i,n){var r,a=e._creatingCover,o=e._creatingPanel,s=e._brushOption;if(e._track.push(i.slice()),function(e){var t=e._track;if(!t.length)return!1;var i=t[t.length-1],n=t[0],r=i[0]-n[0],a=i[1]-n[1];return lV(r*r+a*a,.5)>6}(e)||a){if(o&&!a){"single"===s.brushMode&&TV(e);var l=JF.clone(s);l.brushType=VV(l.brushType,o),l.panelId=!0===o?null:o.panelId,a=e._creatingCover=gV(e,l),e._covers.push(a)}if(a){var u=UV[VV(e._brushType,o)];a.__brushOption.range=u.getCreatingRange(kV(e,a,e._track)),n&&(mV(e,a),u.updateCommon(e,a)),vV(e,a),r={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&bV(e,t,i)&&TV(e)&&(r={isEnd:n,removeOnClick:!0});return r}function VV(e,t){return"auto"===e?t.defaultBrushType:e}pV.prototype={constructor:pV,enableBrush:function(e){var t,i;return this._brushType&&(i=(t=this)._zr,tV.release(i,uV,t._uid),function(e,t){rV(t,(function(t,i){e.off(i,t)}))}(i,t._handlers),t._brushType=t._brushOption=null),e.brushType&&function(e,t){var i=e._zr;e._enableGlobalPan||tV.take(i,uV,e._uid),function(e,t){rV(t,(function(t,i){e.on(i,t)}))}(i,e._handlers),e._brushType=t.brushType,e._brushOption=JF.merge(JF.clone(dV),t,!0)}(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};JF.each(e,(function(e){t[e.panelId]=JF.clone(e)}))}else this._panels=null;return this},mount:function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({position:e.position||[0,0],rotation:e.rotation||0,scale:e.scale||[1,1]}),this._transform=t.getLocalTransform(),this},eachCover:function(e,t){rV(this._covers,e,t)},updateCovers:function(e){e=JF.map(e,(function(e){return JF.merge(JF.clone(dV),e,!0)}));var t=this._covers,i=this._covers=[],n=this,r=this._creatingCover;return new iV(t,e,(function(e,t){return a(e.__brushOption,t)}),a).add(o).update(o).remove((function(e){t[e]!==r&&n.group.remove(t[e])})).execute(),this;function a(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function o(a,o){var s=e[a];if(null!=o&&t[o]===r)i[a]=t[o];else{var l=i[a]=null!=o?(t[o].__brushOption=s,t[o]):mV(n,gV(n,s));_V(n,l)}}},unmount:function(){return this.enableBrush(!1),TV(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},JF.mixin(pV,$F);var GV={mousedown:function(e){if(this._dragging)HV(this,e);else if(!e.target||!e.target.draggable){zV(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=bV(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,i=e.offsetY,n=this.group.transformCoordToLocal(t,i);if(function(e,t,i){if(e._brushType&&!function(e,t,i){var n=e._zr;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}(e,t)){var n=e._zr,r=e._covers,a=bV(e,t,i);if(!e._dragging)for(var o=0;o5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&uG(this,"mousemove")){var t=this._model,i=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};function uG(e,t){var i=e._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===t}rG.registerPreprocessor(sG);var hG=g,cG=hG.each,dG=hG.createHashMap,fG=vx;um.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=this.getSource();return function(e,t){if(!e.encodeDefine){var i=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(i){var n=e.encodeDefine=dG();cG(i.dimensions,(function(e){var t=+e.replace("dim","");n.set(e,t)}))}}}(i,this),fG(i,this)},getRawIndicesByActiveState:function(e){var t=this.coordinateSystem,i=this.getData(),n=[];return t.eachActiveState(i,(function(t,r){e===t&&n.push(i.getRawIndex(r))})),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});var pG=No;function gG(e,t,i,n){for(var r,a=[],o=0;o=0&&(a[r[o].depth]=new SG(r[o],this,t));if(n&&i){var s=wG(n,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getData().getItemLayout(t).depth;return i.levelModels[n]||this.parentModel})),e})),t.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;return i.levelModels[n]||this.parentModel})),e}))}));return s.data}},setNodePosition:function(e,t){var i=this.option.data[e];i.localX=t[0],i.localY=t[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getDataParams(e,i),r=n.data,a=r.source+" -- "+r.target;return n.value&&(a+=" : "+n.value),TG(a)}if("node"===i){var o=this.getGraph().getNodeByIndex(e).getLayout().value,s=this.getDataParams(e,i).data.name;return o&&(a=s+" : "+o),TG(a)}return MG.superCall(this,"formatTooltip",e,t)},optionUpdated:function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},getDataParams:function(e,t){var i=MG.superCall(this,"getDataParams",e,t);if(null==i.value&&"node"===t){var n=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=n}return i},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},animationEasing:"linear",animationDuration:1e3}}),AG=No,IG=h,CG=g,DG=["itemStyle","opacity"],EG=["emphasis","itemStyle","opacity"],LG=["lineStyle","opacity"],PG=["emphasis","lineStyle","opacity"];function NG(e,t){return e.getVisual("opacity")||e.getModel().get(t)}function RG(e,t,i){var n=e.getGraphicEl(),r=NG(e,t);null!=i&&(null==r&&(r=1),r*=i),n.downplay&&n.downplay(),n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",r)}))}function OG(e,t){var i=NG(e,t),n=e.getGraphicEl();n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}var kG=AG.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(e,t){var i=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+i,t.y2),e.bezierCurveTo(t.cpx2+i,t.cpy2,t.cpx1+i,t.cpy1,t.x1+i,t.y1)):(e.lineTo(t.x2,t.y2+i),e.bezierCurveTo(t.cpx2,t.cpy2+i,t.cpx1,t.cpy1+i,t.x1,t.y1+i)),e.closePath()},highlight:function(){this.trigger("emphasis")},downplay:function(){this.trigger("normal")}});IG.extendChartView({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(e,t,i){var n=this,r=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),h=e.getData("edge"),c=e.get("orient");this._model=e,a.removeAll(),a.attr("position",[o.x,o.y]),r.eachEdge((function(t){var i=new kG;i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var n,r,o,u,d,f,p,g,m=t.getModel("lineStyle"),v=m.get("curveness"),y=t.node1.getLayout(),_=t.node1.getModel(),x=_.get("localX"),b=_.get("localY"),w=t.node2.getLayout(),T=t.node2.getModel(),S=T.get("localX"),M=T.get("localY"),A=t.getLayout();switch(i.shape.extent=Math.max(1,A.dy),i.shape.orient=c,"vertical"===c?(n=(null!=x?x*s:y.x)+A.sy,r=(null!=b?b*l:y.y)+y.dy,o=(null!=S?S*s:w.x)+A.ty,d=n,f=r*(1-v)+(u=null!=M?M*l:w.y)*v,p=o,g=r*v+u*(1-v)):(n=(null!=x?x*s:y.x)+y.dx,r=(null!=b?b*l:y.y)+A.sy,d=n*(1-v)+(o=null!=S?S*s:w.x)*v,f=r,p=n*v+o*(1-v),g=u=(null!=M?M*l:w.y)+A.ty),i.setShape({x1:n,y1:r,x2:o,y2:u,cpx1:d,cpy1:f,cpx2:p,cpy2:g}),i.setStyle(m.getItemStyle()),i.style.fill){case"source":i.style.fill=t.node1.getVisual("color");break;case"target":i.style.fill=t.node2.getVisual("color")}AG.setHoverStyle(i,t.getModel("emphasis.lineStyle").getItemStyle()),a.add(i),h.setItemGraphicEl(t.dataIndex,i)})),r.eachNode((function(t){var i=t.getLayout(),n=t.getModel(),r=n.get("localX"),o=n.get("localY"),h=n.getModel("label"),c=n.getModel("emphasis.label"),d=new AG.Rect({shape:{x:null!=r?r*s:i.x,y:null!=o?o*l:i.y,width:i.dx,height:i.dy},style:n.getModel("itemStyle").getItemStyle()}),f=t.getModel("emphasis.itemStyle").getItemStyle();AG.setLabelStyle(d.style,f,h,c,{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),d.setStyle("fill",t.getVisual("color")),AG.setHoverStyle(d,f),a.add(d),u.setItemGraphicEl(t.dataIndex,d),d.dataType="node"})),u.eachItemGraphicEl((function(t,r){var a=u.getItemModel(r);a.get("draggable")&&(t.drift=function(t,a){n._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){n._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move"),t.highlight=function(){this.trigger("emphasis")},t.downplay=function(){this.trigger("normal")},t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),a.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),h.eachItemGraphicEl((function(t,r){var a=h.getItemModel(r);t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),a.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),!this._data&&e.get("animation")&&a.setClipPath(function(e,t,i){var n=new AG.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return AG.initProps(n,{shape:{width:e.width+20}},t,i),n}(a.getBoundingRect(),e,(function(){a.removeClipPath()}))),this._data=e.getData()},dispose:function(){this._clearTimer()},_dispatchUnfocus:function(e){var t=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){t._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:t._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var r=e.getData(),a=r.graph,o=n.dataIndex,s=r.getItemModel(o),l=n.edgeDataIndex;if(null!=o||null!=l){var u=a.getNodeByIndex(o),h=a.getEdgeByIndex(l);if(a.eachNode((function(e){RG(e,DG,.1)})),a.eachEdge((function(e){RG(e,LG,.1)})),u){OG(u,EG);var c=s.get("focusNodeAdjacency");"outEdges"===c?CG.each(u.outEdges,(function(e){e.dataIndex<0||(OG(e,PG),OG(e.node2,EG))})):"inEdges"===c?CG.each(u.inEdges,(function(e){e.dataIndex<0||(OG(e,PG),OG(e.node1,EG))})):"allEdges"===c&&CG.each(u.edges,(function(e){e.dataIndex<0||(OG(e,PG),e.node1!==u&&OG(e.node1,EG),e.node2!==u&&OG(e.node2,EG))}))}h&&(OG(h,PG),OG(h.node1,EG),OG(h.node2,EG))}},unfocusNodeAdjacency:function(e,t,i,n){var r=e.getGraph();r.eachNode((function(e){RG(e,DG)})),r.eachEdge((function(e){RG(e,LG)}))}}),h.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}));var zG=Hc,BG=g,FG=lo.groupData;function VG(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function GG(e,t,i,n,r){var a="vertical"===r?"x":"y";BG.each(e,(function(e){var o,s,l;e.sort((function(e,t){return e.getLayout()[a]-t.getLayout()[a]}));for(var u=0,h=e.length,c="vertical"===r?"dx":"dy",d=0;d0&&(o=s.getLayout()[a]+l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]+s.getLayout()[c]+t;if((l=u-t-("vertical"===r?n:i))>0)for(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o,d=h-2;d>=0;--d)(l=(s=e[d]).getLayout()[a]+s.getLayout()[c]+t-u)>0&&(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]}))}function HG(e,t,i){BG.each(e.slice().reverse(),(function(e){BG.each(e,(function(e){if(e.outEdges.length){var n=YG(e.outEdges,UG,i)/YG(e.outEdges,qG,i);if(isNaN(n)){var r=e.outEdges.length;n=r?YG(e.outEdges,WG,i)/r:0}if("vertical"===i){var a=e.getLayout().x+(n-ZG(e,i))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(n-ZG(e,i))*t;e.setLayout({y:o},!0)}}}))}))}function UG(e,t){return ZG(e.node2,t)*e.getValue()}function WG(e,t){return ZG(e.node2,t)}function jG(e,t){return ZG(e.node1,t)*e.getValue()}function XG(e,t){return ZG(e.node1,t)}function ZG(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function qG(e){return e.getValue()}function YG(e,t,i){for(var n=0,r=e.length,a=-1;++a=0;v&&m.depth>f&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===a?g.setLayout({dy:i},!0):g.setLayout({dx:i},!0);for(var y=0;yc-1?f:c-1;o&&"left"!==o&&function(e,t,i,n){if("right"===t){for(var r=[],a=e,o=0;a.length;){for(var s=0;s0;a--)HG(s,l*=.99,o),GG(s,r,i,n,o),KG(s,l,o),GG(s,r,i,n,o)}(e,t,a,r,n,o,s),function(e,t){var i="vertical"===t?"x":"y";BG.each(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[i]-t.node2.getLayout()[i]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[i]-t.node1.getLayout()[i]}))})),BG.each(e,(function(e){var t=0,i=0;BG.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),BG.each(e.inEdges,(function(e){e.setLayout({ty:i},!0),i+=e.getLayout().dy}))}))}(e,s)}(l,u,i,n,a,o,0!==BG.filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))},JG=yO,$G=g,eH=h,tH=QG,iH=function(e,t){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var i=1/0,n=-1/0;$G.each(t,(function(e){var t=e.getLayout().value;tn&&(n=t)})),$G.each(t,(function(t){var r=new JG({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),a=t.getModel().get("itemStyle.color");null!=a?t.setVisual("color",a):t.setVisual("color",r)}))}}))};eH.registerLayout(tH),eH.registerVisual(iH);var nH={},rH=SC,aH=g,oH=Gy.getDimensionTypeByAxis,sH=Vd.makeSeriesEncodeForAxisCoordSys,lH={_baseAxisDim:null,getInitialData:function(e,t){var i,n,r=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=r.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",i=r.getOrdinalMeta(),n=!0):"category"===s?(e.layout="vertical",i=a.getOrdinalMeta(),n=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[r,a],f=d[u].get("type"),p=d[1-u].get("type"),g=e.data;if(g&&n){var m=[];aH.each(g,(function(e,t){var i;e.value&&aH.isArray(e.value)?(i=e.value.slice(),e.value.unshift(t)):aH.isArray(e)?(i=e.slice(),e.unshift(t)):i=e,m.push(i)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:h,type:oH(f),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:oH(p),dimsDef:v.slice()}];return rH(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:aH.curry(sH,y,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}};nH.seriesModelMixin=lH;var uH=g,hH=um,cH=nH.seriesModelMixin,dH=hH.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});uH.mixin(dH,cH,!0);var fH=g,pH=No,gH=dl,mH=["itemStyle"],vH=["emphasis","itemStyle"];Om.extend({type:"boxplot",render:function(e,t,i){var n=e.getData(),r=this.group,a=this._data;this._data||r.removeAll();var o="horizontal"===e.get("layout")?1:0;n.diff(a).add((function(e){if(n.hasValue(e)){var t=_H(n.getItemLayout(e),n,e,o,!0);n.setItemGraphicEl(e,t),r.add(t)}})).update((function(e,t){var i=a.getItemGraphicEl(t);if(n.hasValue(e)){var s=n.getItemLayout(e);i?xH(s,i,n,e):i=_H(s,n,e,o),r.add(i),n.setItemGraphicEl(e,i)}else r.remove(i)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=n},remove:function(e){var t=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl((function(e){e&&t.remove(e)}))},dispose:fH.noop});var yH=gH.extend({type:"boxplotBoxPath",shape:{},buildPath:function(e,t){var i=t.points,n=0;for(e.moveTo(i[n][0],i[n][1]),n++;n<4;n++)e.lineTo(i[n][0],i[n][1]);for(e.closePath();n0?"P":"N",a=n.getVisual("borderColor"+r)||n.getVisual("color"+r),o=i.getModel(VH).getItemStyle(HH);t.useStyle(o),t.style.fill=null,t.style.stroke=a}var QH=g,JH=function(e){e&&QH.isArray(e.series)&&QH.each(e.series,(function(e){QH.isObject(e)&&"k"===e.type&&(e.type="candlestick")}))},$H=["itemStyle","borderColor"],eU=["itemStyle","borderColor0"],tU=["itemStyle","color"],iU=["itemStyle","color0"],nU={seriesType:"candlestick",plan:vm(),performRawSeries:!0,reset:function(e,t){if(e.getData().setVisual({legendSymbol:"roundRect",colorP:i(1,e),colorN:i(-1,e),borderColorP:n(1,e),borderColorN:n(-1,e)}),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var r;null!=(r=e.next());){var a=t.getItemModel(r),o=t.getItemLayout(r).sign;t.setItemVisual(r,{color:i(o,a),borderColor:n(o,a)})}}};function i(e,t){return t.get(e>0?tU:iU)}function n(e,t){return t.get(e>0?$H:eU)}}},rU=nU,aU=No.subPixelOptimize,oU=vm,sU=Uc.parsePercent,lU=g.retrieve2,uU="undefined"!=typeof Float32Array?Float32Array:Array,hU={seriesType:"candlestick",plan:oU(),reset:function(e){var t=e.coordinateSystem,i=e.getData(),n=function(e,t){var i,n=e.getBaseAxis(),r="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/t.count()),a=sU(lU(e.get("barMaxWidth"),r),r),o=sU(lU(e.get("barMinWidth"),1),r),s=e.get("barWidth");return null!=s?sU(s,r):Math.max(Math.min(r/2,a),o)}(e,i),r=["x","y"],a=i.mapDimension(r[0]),o=i.mapDimension(r[1],!0),s=o[0],l=o[1],u=o[2],h=o[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==a||o.length<4))return{progress:e.pipelineContext.large?function(e,i){for(var n,r,o=new uU(4*e.count),c=0,d=[],f=[];null!=(r=e.next());){var p=i.get(a,r),g=i.get(s,r),m=i.get(l,r),v=i.get(u,r),y=i.get(h,r);isNaN(p)||isNaN(v)||isNaN(y)?(o[c++]=NaN,c+=3):(o[c++]=cU(i,r,g,m,l),d[0]=p,d[1]=v,n=t.dataToPoint(d,null,f),o[c++]=n?n[0]:NaN,o[c++]=n?n[1]:NaN,d[1]=y,n=t.dataToPoint(d,null,f),o[c++]=n?n[1]:NaN)}i.setLayout("largePoints",o)}:function(e,i){for(var r;null!=(r=e.next());){var o=i.get(a,r),c=i.get(s,r),d=i.get(l,r),f=i.get(u,r),p=i.get(h,r),g=Math.min(c,d),m=Math.max(c,d),v=w(g,o),y=w(m,o),_=w(f,o),x=w(p,o),b=[];T(b,y,0),T(b,v,1),b.push(M(x),M(y),M(_),M(v)),i.setItemLayout(r,{sign:cU(i,r,c,d,l),initBaseline:c>d?y[1]:v[1],ends:b,brushRect:S(f,p,o)})}function w(e,i){var n=[];return n[0]=i,n[1]=e,isNaN(i)||isNaN(e)?[NaN,NaN]:t.dataToPoint(n)}function T(e,t,i){var r=t.slice(),a=t.slice();r[0]=aU(r[0]+n/2,1,!1),a[0]=aU(a[0]-n/2,1,!0),i?e.push(r,a):e.push(a,r)}function S(e,t,i){var r=w(e,i),a=w(t,i);return r[0]-=n/2,a[0]-=n/2,{x:r[0],y:r[1],width:n,height:a[1]-r[1]}}function M(e){return e[0]=aU(e[0],1),e}}}}};function cU(e,t,i,n,r){return i>n?-1:i0?e.get(r,t-1)<=n?1:-1:1}var dU=h,fU=JH,pU=rU,gU=hU;dU.registerPreprocessor(fU),dU.registerVisual(pU),dU.registerLayout(gU);var mU=vx;um.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(e,t){return mU(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var vU=g,yU=ow.createSymbol,_U=No.Group,xU=Uc.parsePercent,bU=aS;function wU(e,t){var i=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?i:null,fill:"fill"===t.brushType?i:null}})}))}function TU(e,t){_U.call(this);var i=new bU(e,t),n=new _U;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(e,t)}var SU=TU.prototype;SU.stopEffectAnimation=function(){this.childAt(1).removeAll()},SU.startEffectAnimation=function(e){for(var t=e.symbolType,i=e.color,n=this.childAt(1),r=0;r<3;r++){var a=yU(t,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var o=-r/3*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scale:[e.rippleScale/2,e.rippleScale/2]}).delay(o).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(o).start(),n.add(a)}wU(n,e)},SU.updateEffectAnimation=function(e){for(var t=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],r=0;r "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),UU=No,WU=Jk,jU=g,XU=ow.createSymbol,ZU=V,qU=Oo;function YU(e,t,i){UU.Group.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var KU=YU.prototype;KU.createLine=function(e,t,i){return new WU(e,t,i)},KU._updateEffectSymbol=function(e,t){var i=e.getItemModel(t).getModel("effect"),n=i.get("symbolSize"),r=i.get("symbol");jU.isArray(n)||(n=[n,n]);var a=i.get("color")||e.getItemVisual(t,"color"),o=this.childAt(1);this._symbolType!==r&&(this.remove(o),(o=XU(r,-.5,-.5,1,1,a)).z2=100,o.culling=!0,this.add(o)),o&&(o.setStyle("shadowColor",a),o.setStyle(i.getItemStyle(["color"])),o.attr("scale",n),o.setColor(a),o.attr("scale",n),this._symbolType=r,this._symbolScale=n,this._updateEffectAnimation(e,i,t))},KU._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var r=this,a=e.getItemLayout(i),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=jU.retrieve(t.get("delay"),(function(t){return t/e.count()*o/3})),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(o=this.getLineLength(n)/l*1e3),o!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-o*n.__t),n.__t=0;var d=n.animate("",s).when(o,{__t:1}).delay(c).during((function(){r.updateSymbolPosition(n)}));s||d.done((function(){r.remove(n)})),d.start()}this._period=o,this._loop=s}},KU.getLineLength=function(e){return ZU.dist(e.__p1,e.__cp1)+ZU.dist(e.__cp1,e.__p2)},KU.updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},KU.updateData=function(e,t,i){this.childAt(0).updateData(e,t,i),this._updateEffectSymbol(e,t)},KU.updateSymbolPosition=function(e){var t=e.__p1,i=e.__p2,n=e.__cp1,r=e.__t,a=e.position,o=[a[0],a[1]],s=qU.quadraticAt,l=qU.quadraticDerivativeAt;a[0]=s(t[0],n[0],i[0],r),a[1]=s(t[1],n[1],i[1],r);var u=l(t[0],n[0],i[0],r),h=l(t[1],n[1],i[1],r);if(e.rotation=-Math.atan2(h,u)-Math.PI/2,"line"===this._symbolType||"rect"===this._symbolType||"roundRect"===this._symbolType)if(void 0!==e.__lastT&&e.__lastT=0&&!(n[o]<=t);o--);o=Math.min(o,r-2)}else{for(var o=a;ot);o++);o=Math.min(o-1,r-2)}oW.lerp(e.position,i[o],i[o+1],(t-n[o])/(n[o+1]-n[o]));var s=i[o+1][0]-i[o][0],l=i[o+1][1]-i[o][1];e.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},rW.inherits(sW,aW);var uW=sW,hW=No,cW=rh,dW=Ls,fW=Rs,pW=hW.extendShape({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(e,t){var i=t.segs,n=t.curveness;if(t.polyline)for(var r=0;r0){e.moveTo(i[r++],i[r++]);for(var o=1;o0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;e.quadraticCurveTo(c,d,u,h)}else e.lineTo(u,h)}},findDataIndex:function(e,t){var i=this.shape,n=i.segs,r=i.curveness;if(i.polyline)for(var a=0,o=0;o0)for(var l=n[o++],u=n[o++],h=1;h0){var f=(l+c)/2-(u-d)*r,p=(u+d)/2-(c-l)*r;if(fW.containStroke(l,u,f,p,c,d))return a}else if(dW.containStroke(l,u,c,d))return a;a++}return-1}});function gW(){this.group=new hW.Group}var mW=gW.prototype;mW.isPersistent=function(){return!this._incremental},mW.updateData=function(e){this.group.removeAll();var t=new pW({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},mW.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new cW({silent:!0})),this.group.add(this._incremental)):this._incremental=null},mW.incrementalUpdate=function(e,t){var i=new pW;i.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(i,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=e.start,this.group.add(i))},mW.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},mW._setCommon=function(e,t,i){var n=t.hostModel;e.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),e.useStyle(n.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var r=t.getVisual("color");r&&e.setStyle("stroke",r),e.setStyle("fill"),i||(e.seriesIndex=n.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>0&&(e.dataIndex=i+e.__startIndex)})))},mW._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var vW=gW,yW={seriesType:"lines",plan:vm(),reset:function(e){var t=e.coordinateSystem,i=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(r,a){var o=[];if(n){var s,l=r.end-r.start;if(i){for(var u=0,h=r.start;h0){var M=a(v)?s:l;v>0&&(v=v*T+w),_[x++]=M[S],_[x++]=M[S+1],_[x++]=M[S+2],_[x++]=M[S+3]*v*256}else x+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var e=this._brushCanvas||(this._brushCanvas=kW.createCanvas()),t=this.pointSize+this.blurSize,i=2*t;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),e},_getGradient:function(e,t,i){for(var n=this._gradientPixels,r=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[i](s/255,!0,a),r[o++]=a[0],r[o++]=a[1],r[o++]=a[2],r[o++]=a[3];return r}};var BW=No,FW=zW,VW=g;h.extendChartView({type:"heatmap",render:function(e,t,i){var n;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(i){i===e&&(n=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,i,0,e.getData().count()):function(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(r)&&this._renderOnGeo(r,e,n,i)},incrementalPrepareRender:function(e,t,i){this.group.removeAll()},incrementalRender:function(e,t,i,n){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,n,e.start,e.end,!0)},_renderOnCartesianAndCalendar:function(e,t,i,n,r){var a,o,s=e.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");a=l.getBandWidth(),o=u.getBandWidth()}for(var h=this.group,c=e.getData(),d="itemStyle",f="emphasis.itemStyle",p="label",g="emphasis.label",m=e.getModel(d).getItemStyle(["color"]),v=e.getModel(f).getItemStyle(),y=e.getModel(p),_=e.getModel(g),x=s.type,b="cartesian2d"===x?[c.mapDimension("x"),c.mapDimension("y"),c.mapDimension("value")]:[c.mapDimension("time"),c.mapDimension("value")],w=i;w=t[0]&&e<=t[1]}}(y,i.option.range):function(e,t,i){var n=e[1]-e[0],r=(t=VW.map(t,(function(t){return{interval:[(t.interval[0]-e[0])/n,(t.interval[1]-e[0])/n]}}))).length,a=0;return function(e){for(var n=a;n=0;n--){var o;if((o=t[n].interval)[0]<=e&&e<=o[1]){a=n;break}}return n>=0&&n0?1:a<0?-1:0}(i,a,r,n,c),function(e,t,i,n,r,a,o,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=e.getItemVisual(t,"symbolSize");UW.isArray(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[c.index]=ZW(f[c.index],d),f[h.index]=ZW(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*o}(e,t,r,a,0,c.boundingLength,c.pxSign,u,n,c),function(e,t,i,n,r){var a=e.get(KW)||0;a&&(JW.attr({scale:t.slice(),rotation:i}),JW.updateTransform(),a/=JW.getLineScale(),a*=t[n.valueDim.index]),r.valueLineWidth=a}(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return UW.isArray(f)&&(f=[ZW(f[0],d[0]),ZW(f[1],d[1])]),function(e,t,i,n,r,a,o,s,l,u,h,c){var d=h.categoryDim,f=h.valueDim,p=c.pxSign,g=Math.max(t[f.index]+s,0),m=g;if(n){var v=Math.abs(l),y=UW.retrieve(e.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1)),y=ZW(y,t[f.index]);var x=Math.max(g+2*y,0),b=_?0:2*y,w=qW(n),T=w?n:mj((v+b)/x);x=g+2*(y=(v-T*g)/2/(_?T:T-1)),b=_?0:2*y,w||"fixed"===n||(T=u?mj((Math.abs(u)+b)/x):0),m=T*x-b,c.repeatTimes=T,c.symbolMargin=y}var S=p*(m/2),M=c.pathPosition=[];M[d.index]=i[d.wh]/2,M[f.index]="start"===o?S:"end"===o?l-S:l/2,a&&(M[0]+=a[0],M[1]+=a[1]);var A=c.bundlePosition=[];A[d.index]=i[d.xy],A[f.index]=i[f.xy];var I=c.barRectShape=UW.extend({},i);I[f.wh]=p*Math.max(Math.abs(i[f.wh]),Math.abs(M[f.index]+S)),I[d.wh]=i[d.wh];var C=c.clipShape={};C[d.xy]=-i[d.xy],C[d.wh]=h.ecSize[d.wh],C[f.xy]=0,C[f.wh]=i[f.wh]}(i,d,r,a,0,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function ej(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function tj(e){var t=e.symbolPatternSize,i=jW(e.symbolType,-t/2,-t/2,t,t,e.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function ij(e,t,i,n){var r=e.__pictorialBundle,a=i.symbolSize,o=i.valueLineWidth,s=i.pathPosition,l=t.valueDim,u=i.repeatTimes||0,h=0,c=a[t.valueDim.index]+o+2*i.symbolMargin;for(fj(e,(function(e){e.__pictorialAnimationIndex=h,e.__pictorialRepeatTimes=u,h0:n<0)&&(r=u-1-e),t[l.index]=c*(r-u/2+.5)+s[l.index],{position:t,scale:i.symbolScale.slice(),rotation:i.rotation}}function g(){fj(e,(function(e){e.trigger("emphasis")}))}function m(){fj(e,(function(e){e.trigger("normal")}))}}function nj(e,t,i,n){var r=e.__pictorialBundle,a=e.__pictorialMainPath;a?pj(a,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(a=e.__pictorialMainPath=tj(i),r.add(a),pj(a,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),a.on("mouseover",(function(){this.trigger("emphasis")})).on("mouseout",(function(){this.trigger("normal")}))),uj(a,i)}function rj(e,t,i){var n=UW.extend({},t.barRectShape),r=e.__pictorialBarRect;r?pj(r,null,{shape:n},t,i):(r=e.__pictorialBarRect=new WW.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(r))}function aj(e,t,i,n){if(i.symbolClip){var r=e.__pictorialClipPath,a=UW.extend({},i.clipShape),o=t.valueDim,s=i.animationModel,l=i.dataIndex;if(r)WW.updateProps(r,{shape:a},s,l);else{a[o.wh]=0,r=new WW.Rect({shape:a}),e.__pictorialBundle.setClipPath(r),e.__pictorialClipPath=r;var u={};u[o.wh]=i.clipShape[o.wh],WW[n?"updateProps":"initProps"](r,{shape:u},s,l)}}}function oj(e,t){var i=e.getItemModel(t);return i.getAnimationDelayParams=sj,i.isAnimationEnabled=lj,i}function sj(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function lj(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function uj(e,t){e.off("emphasis").off("normal");var i=t.symbolScale.slice();t.hoverAnimation&&e.on("emphasis",(function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")})).on("normal",(function(){this.animateTo({scale:i.slice()},400,"elasticOut")}))}function hj(e,t,i,n){var r=new WW.Group,a=new WW.Group;return r.add(a),r.__pictorialBundle=a,a.attr("position",i.bundlePosition.slice()),i.symbolRepeat?ij(r,t,i):nj(r,0,i),rj(r,i,n),aj(r,t,i,n),r.__pictorialShapeStr=dj(e,i),r.__pictorialSymbolMeta=i,r}function cj(e,t,i,n){var r=n.__pictorialBarRect;r&&(r.style.text=null);var a=[];fj(n,(function(e){a.push(e)})),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),UW.each(a,(function(e){WW.updateProps(e,{scale:[0,0]},i,t,(function(){n.parent&&n.parent.remove(n)}))})),e.setItemGraphicEl(t,null)}function dj(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function fj(e,t,i){UW.each(e.__pictorialBundle.children(),(function(n){n!==e.__pictorialBarRect&&t.call(i,n)}))}function pj(e,t,i,n,r,a){t&&e.attr(t),n.symbolClip&&!r?i&&e.attr(i):i&&WW[r?"updateProps":"initProps"](e,i,n.animationModel,n.dataIndex,a)}function gj(e,t,i){var n=i.color,r=i.dataIndex,a=i.itemModel,o=a.getModel("itemStyle").getItemStyle(["color"]),s=a.getModel("emphasis.itemStyle").getItemStyle(),l=a.getShallow("cursor");fj(e,(function(e){e.setColor(n),e.setStyle(UW.defaults({fill:n,opacity:i.opacity},o)),WW.setHoverStyle(e,s),l&&(e.cursor=l),e.z2=i.z2}));var u={},h=t.valueDim.posDesc[+(i.boundingLength>0)],c=e.__pictorialBarRect;YW(c.style,u,a,n,t.seriesModel,r,h),WW.setHoverStyle(c,u)}function mj(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}HW.extendChartView({type:"pictorialBar",render:function(e,t,i){var n=this.group,r=e.getData(),a=this._data,o=e.coordinateSystem,s=!!o.getBaseAxis().isHorizontal(),l=o.grid.getRect(),u={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:QW[+s],categoryDim:QW[1-s]};return r.diff(a).add((function(e){if(r.hasValue(e)){var t=oj(r,e),i=$W(r,e,t,u),a=hj(r,u,i);r.setItemGraphicEl(e,a),n.add(a),gj(a,u,i)}})).update((function(e,t){var i=a.getItemGraphicEl(t);if(r.hasValue(e)){var o=oj(r,e),s=$W(r,e,o,u),l=dj(r,s);i&&l!==i.__pictorialShapeStr&&(n.remove(i),r.setItemGraphicEl(e,null),i=null),i?function(e,t,i){var n=i.animationModel,r=i.dataIndex,a=e.__pictorialBundle;WW.updateProps(a,{position:i.bundlePosition.slice()},n,r),i.symbolRepeat?ij(e,t,i,!0):nj(e,0,i,!0),rj(e,i,!0),aj(e,t,i,!0)}(i,u,s):i=hj(r,u,s,!0),r.setItemGraphicEl(e,i),i.__pictorialSymbolMeta=s,n.add(i),gj(i,u,s)}else n.remove(i)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&cj(a,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=r,this.group},dispose:UW.noop,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl((function(t){cj(n,t.dataIndex,e,t)})):i.removeAll()}});var vj=h,yj=g,_j=Qx.layout,xj=gM;vj.registerLayout(yj.curry(_j,"pictorialBar")),vj.registerVisual(xj("pictorialBar","roundRect"));var bj=g,wj=wT,Tj=function(e,t,i,n,r){wj.call(this,e,t,i),this.type=n||"value",this.position=r||"bottom",this.orient=null};Tj.prototype={constructor:Tj,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},pointToData:function(e,t){return this.coordinateSystem.pointToData(e,t)[0]},toGlobalCoord:null,toLocalCoord:null},bj.inherits(Tj,wj);var Sj=Tj,Mj=yx,Aj=Hc.getLayoutRect,Ij=g.each;function Cj(e,t,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(e,t,i),this.model=e}Cj.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:Cj,_init:function(e,t,i){var n=this.dimension,r=new Sj(n,Mj.createScaleByModel(e),[0,0],e.get("type"),e.get("position")),a="category"===r.type;r.onBand=a&&e.get("boundaryGap"),r.inverse=e.get("inverse"),r.orient=e.get("orient"),e.axis=r,r.model=e,r.coordinateSystem=this,this._axis=r},update:function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();Ij(t.mapDimension(this.dimension,!0),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),Mj.niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},resize:function(e,t){this._rect=Aj({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var e=this._rect,t=this._axis,i=t.isHorizontal(),n=i?[0,e.width]:[0,e.height],r=t.reverse?1:0;t.setExtent(n[r],n[1-r]),this._updateAxisTransform(t,i?e.x:e.y)},_updateAxisTransform:function(e,t){var i=e.getExtent(),n=i[0]+i[1],r=e.isHorizontal();e.toGlobalCoord=r?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord=r?function(e){return e-t}:function(e){return n-e+t}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(e){var t=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},pointToData:function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},dataToPoint:function(e){var t=this.getAxis(),i=this.getRect(),n=[],r="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),n[r]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-r]=0===r?i.y+i.height/2:i.x+i.width/2,n}};var Dj=Cj;sp.register("single",{create:function(e,t){var i=[];return e.eachComponent("singleAxis",(function(n,r){var a=new Dj(n,e,t);a.name="single_"+r,a.resize(n,t),n.coordinateSystem=a,i.push(a)})),e.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=i&&i.coordinateSystem}})),i},dimensions:Dj.prototype.dimensions});var Ej={},Lj=g;Ej.layout=function(e,t){t=t||{};var i=e.coordinateSystem,n=e.axis,r={},a=n.position,o=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===o?u.vertical[a]:l[0],"horizontal"===o?u.horizontal[a]:l[3]],r.rotation=Math.PI/2*{horizontal:0,vertical:1}[o],r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get("axisTick.inside")&&(r.tickDirection=-r.tickDirection),Lj.retrieve(t.labelInside,e.get("axisLabel.inside"))&&(r.labelDirection=-r.labelDirection);var h=t.rotate;return null==h&&(h=e.get("axisLabel.rotate")),r.labelRotation="top"===a?-h:h,r.z2=1,r};var Pj=g,Nj=qA,Rj=No,Oj=Ej,kj=uI,zj=dI,Bj=zj.rectCoordAxisBuildSplitArea,Fj=zj.rectCoordAxisHandleRemove,Vj=["axisLine","axisTickLabel","axisName"],Gj=["splitArea","splitLine"],Hj=kj.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var r=this.group;r.removeAll();var a=this._axisGroup;this._axisGroup=new Rj.Group;var o=Oj.layout(e),s=new Nj(e,o);Pj.each(Vj,s.add,s),r.add(this._axisGroup),r.add(s.getGroup()),Pj.each(Gj,(function(t){e.get(t+".show")&&this["_"+t](e)}),this),Rj.groupTransition(a,this._axisGroup,e),Hj.superCall(this,"render",e,t,i,n)},remove:function(){Fj(this)},_splitLine:function(e){var t=e.axis;if(!t.scale.isBlank()){var i=e.getModel("splitLine"),n=i.getModel("lineStyle"),r=n.get("width"),a=n.get("color");a=a instanceof Array?a:[a];for(var o=e.coordinateSystem.getRect(),s=t.isHorizontal(),l=[],u=0,h=t.getTicksCoords({tickModel:i}),c=[],d=[],f=0;f=0&&s<0)&&(o=p,s=f,r=u,a.length=0),eX(h,(function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:a,snapToValue:r}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==r.seriesIndex&&Kj.extend(r,s[0]),!n&&e.snap&&a.containData(l)&&null!=l&&(t=l),i.showPointer(e,t,s,r),i.showTooltip(e,o,l)}else i.showPointer(e,t)}function rX(e,t,i,n){e[t.key]={value:i,payloadBatch:n}}function aX(e,t,i,n){var r=i.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=Jj.makeKey(l),h=e.map[u];h||(h=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:r.slice()})}}function oX(e){var t=e.axis.model,i={},n=i.axisDim=e.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=t.componentIndex,i.axisName=i[n+"AxisName"]=t.name,i.axisId=i[n+"AxisId"]=t.id,i}function sX(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var lX=function(e,t,i){var n=e.currTrigger,r=[e.x,e.y],a=e,o=e.dispatchAction||Kj.bind(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){sX(r)&&(r=$j({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=sX(r),u=a.axesInfo,h=s.axesInfo,c="leave"===n||sX(r),d={},f={},p={list:[],map:{}},g={showPointer:tX(rX,f),showTooltip:tX(aX,p)};eX(s.coordSysMap,(function(e,t){var i=l||e.containPoint(r);eX(s.coordSysAxesInfo[t],(function(e,t){var n=e.axis,a=function(e,t){for(var i=0;i<(e||[]).length;i++){var n=e[i];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}(u,e);if(!c&&i&&(!u||a)){var o=a&&a.value;null!=o||l||(o=n.pointToData(r)),null!=o&&nX(e,o,g,!1,d)}}))}));var m={};return eX(h,(function(e,t){var i=e.linkGroup;i&&!f[t]&&eX(i.axesInfo,(function(t,n){var r=f[n];if(t!==e&&r){var a=r.value;i.mapper&&(a=e.axis.scale.parse(i.mapper(a,oX(t),oX(e)))),m[e.key]=a}}))})),eX(m,(function(e,t){nX(h[t],e,g,!0,d)})),function(e,t,i){var n=i.axesInfo=[];eX(t,(function(t,i){var r=t.axisPointerModel.option,a=e[i];a?(!t.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(r.status="hide"),"show"===r.status&&n.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:r.value})}))}(f,h,d),function(e,t,i,n){if(!sX(t)&&e.list.length){var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}else n({type:"hideTip"})}(p,r,e,o),function(e,t,i){var n=i.getZr(),r="axisPointerLastHighlights",a=iX(n)[r]||{},o=iX(n)[r]={};eX(e,(function(e,t){var i=e.axisPointerModel.option;"show"===i.status&&eX(i.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];Kj.each(a,(function(e,t){!o[t]&&l.push(e)})),Kj.each(o,(function(e,t){!a[t]&&s.push(e)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}};h.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}});var uX={},hX=g,cX=p,dX=(0,lo.makeInner)(),fX=hX.each;function pX(e,t,i){e.handler("leave",null,i)}function gX(e,t,i,n){t.handler(e,i,n)}uX.register=function(e,t,i){if(!cX.node){var n=t.getZr();dX(n).records||(dX(n).records={}),function(e,t){function i(i,n){e.on(i,(function(i){var r=function(e){var t={showTip:[],hideTip:[]},i=function(n){var r=t[n.type];r?r.push(n):(n.dispatchAction=i,e.dispatchAction(n))};return{dispatchAction:i,pendings:t}}(t);fX(dX(e).records,(function(e){e&&n(e,i,r.dispatchAction)})),function(e,t){var i,n=e.showTip.length,r=e.hideTip.length;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}(r.pendings,t)}))}dX(e).initialized||(dX(e).initialized=!0,i("click",hX.curry(gX,"click")),i("mousemove",hX.curry(gX,"mousemove")),i("globalout",pX))}(n,t),(dX(n).records[e]||(dX(n).records[e]={})).handler=i}},uX.unregister=function(e,t){if(!cX.node){var i=t.getZr();(dX(i).records||{})[e]&&(dX(i).records[e]=null)}};var mX=uX,vX=h.extendComponentView({type:"axisPointer",render:function(e,t,i){var n=t.getComponent("tooltip"),r=e.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";mX.register("axisPointer",i,(function(e,t,i){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&i({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},remove:function(e,t){mX.unregister(t.getZr(),"axisPointer"),vX.superApply(this._model,"remove",arguments)},dispose:function(e,t){mX.unregister("axisPointer",t),vX.superApply(this._model,"dispose",arguments)}}),yX=g,_X=xo,xX=No,bX=YA,wX=ne,TX=km,SX=(0,lo.makeInner)(),MX=yX.clone,AX=yX.bind;function IX(){}function CX(e,t,i,n){DX(SX(i).lastProp,n)||(SX(i).lastProp=n,t?xX.updateProps(i,n,e):(i.stopAnimation(),i.attr(n)))}function DX(e,t){if(yX.isObject(e)&&yX.isObject(t)){var i=!0;return yX.each(t,(function(t,n){i=i&&DX(e[n],t)})),!!i}return e===t}function EX(e,t){e[t.get("label.show")?"show":"hide"]()}function LX(e){return{position:e.position.slice(),rotation:e.rotation||0}}function PX(e,t,i){var n=t.get("z"),r=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=n&&(e.z=n),null!=r&&(e.zlevel=r),e.silent=i)}))}IX.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(e,t,i,n){var r=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,n||this._lastValue!==r||this._lastStatus!==a){this._lastValue=r,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||"hide"===a)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(e,t);if(o){var c=yX.curry(CX,t,h);this.updatePointerEl(o,l,c,t),this.updateLabelEl(o,l,c,t)}else o=this._group=new xX.Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),i.getZr().add(o);PX(o,t,!0),this._renderHandle(r)}},remove:function(e){this.clear(e)},dispose:function(e){this.clear(e)},determineAnimation:function(e,t){var i=t.get("animation"),n=e.axis,r="category"===n.type,a=t.get("snap");if(!a&&!r)return!1;if("auto"===i||null==i){var o=this.animationThreshold;if(r&&n.getBandWidth()>o)return!0;if(a){var s=bX.getAxisInfo(e).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===i},makeElOption:function(e,t,i,n,r){},createPointerEl:function(e,t,i,n){var r=t.pointer;if(r){var a=SX(e).pointerEl=new xX[r.type](MX(t.pointer));e.add(a)}},createLabelEl:function(e,t,i,n){if(t.label){var r=SX(e).labelEl=new xX.Rect(MX(t.label));e.add(r),EX(r,n)}},updatePointerEl:function(e,t,i){var n=SX(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,n){var r=SX(e).labelEl;r&&(r.setStyle(t.label.style),i(r,{shape:t.label.shape,position:t.label.position}),EX(r,n))},_renderHandle:function(e){if(!this._dragging&&this.updateHandleTransform){var t,i=this._axisPointerModel,n=this._api.getZr(),r=this._handle,a=i.getModel("handle"),o=i.get("status");if(!a.get("show")||!o||"hide"===o)return r&&n.remove(r),void(this._handle=null);this._handle||(t=!0,r=this._handle=xX.createIcon(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){wX.stop(e.event)},onmousedown:AX(this._onHandleDragMove,this,0,0),drift:AX(this._onHandleDragMove,this),ondragend:AX(this._onHandleDragEnd,this)}),n.add(r)),PX(r,i,!1),r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");yX.isArray(s)||(s=[s,s]),r.attr("scale",[s[0]/2,s[1]/2]),TX.createOrUpdate(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){CX(this._axisPointerModel,!t&&this._moveAnimation,this._handle,LX(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(LX(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(LX(n)),SX(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},_onHandleDragEnd:function(e){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}}},IX.prototype.constructor=IX,_X.enableClassExtend(IX);var NX=IX,RX={},OX=g,kX=No,zX=Tn,BX=qc,FX=Ue,VX=yx,GX=qA;function HX(e,t,i,n,r){var a=UX(i.get("value"),t.axis,t.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),o=i.getModel("label"),s=BX.normalizeCssArray(o.get("padding")||0),l=o.getFont(),u=zX.getBoundingRect(a,l),h=r.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=r.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=r.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),function(e,t,i,n){var r=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,r)-t,e[1]=Math.min(e[1]+i,a)-i,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(h,c,d,n);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get("axisLine.lineStyle.color")),e.label={shape:{x:0,y:0,width:c,height:d,r:o.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:o.getTextColor(),textPosition:"inside",textPadding:s,fill:g,stroke:o.get("borderColor")||"transparent",lineWidth:o.get("borderWidth")||0,shadowBlur:o.get("shadowBlur"),shadowColor:o.get("shadowColor"),shadowOffsetX:o.get("shadowOffsetX"),shadowOffsetY:o.get("shadowOffsetY")},z2:10}}function UX(e,t,i,n,r){e=t.scale.parse(e);var a=t.scale.getLabel(e,{precision:r.precision}),o=r.formatter;if(o){var s={value:VX.getAxisRawValue(t,e),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};OX.each(n,(function(e){var t=i.getSeriesByIndex(e.seriesIndex),n=e.dataIndexInside,r=t&&t.getDataParams(n);r&&s.seriesData.push(r)})),OX.isString(o)?a=o.replace("{value}",a):OX.isFunction(o)&&(a=o(s))}return a}function WX(e,t,i){var n=FX.create();return FX.rotate(n,n,i.rotation),FX.translate(n,n,i.position),kX.applyTransform([e.dataToCoord(t),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}RX.buildElStyle=function(e){var t,i=e.get("type"),n=e.getModel(i+"Style");return"line"===i?(t=n.getLineStyle()).fill=null:"shadow"===i&&((t=n.getAreaStyle()).stroke=null),t},RX.buildLabelElOption=HX,RX.getValueLabel=UX,RX.getTransformedPosition=WX,RX.buildCartesianSingleLabelElOption=function(e,t,i,n,r,a){var o=GX.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=r.get("label.margin"),HX(t,n,r,a,{position:WX(n.axis,e,i),align:o.textAlign,verticalAlign:o.textVerticalAlign})},RX.makeLineShape=function(e,t,i){return{x1:e[i=i||0],y1:e[1-i],x2:t[i],y2:t[1-i]}},RX.makeRectShape=function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}},RX.makeSectorShape=function(e,t,i,n,r,a){return{cx:e,cy:t,r0:i,r:n,startAngle:r,endAngle:a,clockwise:!0}};var jX=RX,XX=hI,ZX=uI,qX=NX.extend({makeElOption:function(e,t,i,n,r){var a=i.axis,o=a.grid,s=n.get("type"),l=YX(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var h=jX.buildElStyle(n),c=KX[s](a,u,l);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=XX.layout(o.model,i);jX.buildCartesianSingleLabelElOption(t,e,d,i,n,r)},getHandleTransform:function(e,t,i){var n=XX.layout(t.axis.grid.model,t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:jX.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var r=i.axis,a=r.grid,o=r.getGlobalExtent(!0),s=YX(a,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=e.position;u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];return c[l]=u[l],{position:u,rotation:e.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function YX(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var KX={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:jX.makeLineShape([t,i[0]],[t,i[1]],QX(e))}},shadow:function(e,t,i){var n=Math.max(1,e.getBandWidth()),r=i[1]-i[0];return{type:"Rect",shape:jX.makeRectShape([t-n/2,i[0]],[n,r],QX(e))}}};function QX(e){return"x"===e.dim?0:1}ZX.registerAxisPointerClass("CartesianAxisPointer",qX);var JX=h,$X=g,eZ=YA,tZ=lX;JX.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!$X.isArray(t)&&(e.axisPointer.link=[t])}})),JX.registerProcessor(JX.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=eZ.collect(e,t)})),JX.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},tZ);var iZ=RX,nZ=Ej,rZ=uI,aZ=["x","y"],oZ=["width","height"],sZ=NX.extend({makeElOption:function(e,t,i,n,r){var a=i.axis,o=a.coordinateSystem,s=hZ(o,1-uZ(a)),l=o.dataToPoint(t)[0],u=n.get("type");if(u&&"none"!==u){var h=iZ.buildElStyle(n),c=lZ[u](a,l,s);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=nZ.layout(i);iZ.buildCartesianSingleLabelElOption(t,e,d,i,n,r)},getHandleTransform:function(e,t,i){var n=nZ.layout(t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:iZ.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var r=i.axis,a=r.coordinateSystem,o=uZ(r),s=hZ(a,o),l=e.position;l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=hZ(a,1-o),h=(u[1]+u[0])/2,c=[h,h];return c[o]=l[o],{position:l,rotation:e.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),lZ={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:iZ.makeLineShape([t,i[0]],[t,i[1]],uZ(e))}},shadow:function(e,t,i){var n=e.getBandWidth(),r=i[1]-i[0];return{type:"Rect",shape:iZ.makeRectShape([t-n/2,i[0]],[n,r],uZ(e))}}};function uZ(e){return e.isHorizontal()?0:1}function hZ(e,t){var i=e.getRect();return[i[aZ[t]],i[aZ[t]]+i[oZ[t]]]}rZ.registerAxisPointerClass("SingleAxisPointer",sZ),h.extendComponentView({type:"single"});var cZ=um,dZ=X_,fZ=Gy.getDimensionTypeByAxis,pZ=A_,gZ=g,mZ=lo.groupData,vZ=qc.encodeHTML,yZ=IC,_Z=cZ.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){_Z.superApply(this,"init",arguments),this.legendVisualProvider=new yZ(gZ.bind(this.getData,this),gZ.bind(this.getRawData,this))},fixData:function(e){var t=e.length,i={},n=mZ(e,(function(e){return i.hasOwnProperty(e[0])||(i[e[0]]=-1),e[2]})),r=[];n.buckets.each((function(e,t){r.push({name:t,dataList:e})}));for(var a=r.length,o=0;oa&&(a=u),n.push(u)}for(var h=0;ha&&(a=d)}return o.y0=r,o.max=a,o}(l),h=u.y0,c=i/u.max,d=a.length,f=a[0].indices.length,p=0;p1;)t=t.parentNode;var i=e.getAncestors()[0];return UZ.indexOf(i.children,t)}(e)%o],a}(t,0,r);!function(e,t,i){t.getData().setItemVisual(e.dataIndex,"color",i)}(t,n,u);var h,c=o.getModel("itemStyle").getItemStyle();if("normal"===i)h=c;else{var d=o.getModel(i+".itemStyle").getItemStyle();h=UZ.merge(d,c)}h=UZ.defaults({lineJoin:"bevel",fill:h.fill||u},h),e?(a.setShape(l),a.shape.r=s.r0,WZ.updateProps(a,{shape:{r:s.r}},n,t.dataIndex),a.useStyle(h)):"object"==typeof h.fill&&h.fill.type||"object"==typeof a.style.fill&&a.style.fill.type?(WZ.updateProps(a,{shape:l},n),a.useStyle(h)):WZ.updateProps(a,{shape:l,style:h},n),this._updateLabel(n,u,i);var f=o.getShallow("cursor");if(f&&a.attr("cursor",f),e){var p=n.getShallow("highlightPolicy");this._initEvents(a,t,n,p)}this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel,WZ.setHoverStyle(this)},YZ.onEmphasis=function(e){var t=this;this.node.hostTree.root.eachNode((function(i){var n,r,a;i.piece&&(t.node===i?i.piece.updateData(!1,i,"emphasis"):(n=i,r=t.node,(a=e)!==jZ&&(a===ZZ?n===r:a===XZ?n===r||n.isAncestorOf(r):n===r||n.isDescendantOf(r))?i.piece.childAt(0).trigger("highlight"):e!==jZ&&i.piece.childAt(0).trigger("downplay")))}))},YZ.onNormal=function(){this.node.hostTree.root.eachNode((function(e){e.piece&&e.piece.updateData(!1,e,"normal")}))},YZ.onHighlight=function(){this.updateData(!1,this.node,"highlight")},YZ.onDownplay=function(){this.updateData(!1,this.node,"downplay")},YZ._updateLabel=function(e,t,i){var n=this.node.getModel(),r=n.getModel("label"),a="normal"===i||"emphasis"===i?r:n.getModel(i+".label"),o=n.getModel("emphasis.label"),s=a.get("formatter")?i:"normal",l=UZ.retrieve(e.getFormattedLabel(this.node.dataIndex,s,null,null,"label"),this.node.name);!1===S("show")&&(l="");var u=this.node.getLayout(),h=a.get("minAngle");null==h&&(h=r.get("minAngle")),h=h/180*Math.PI;var c=u.endAngle-u.startAngle;null!=h&&Math.abs(c)Math.PI/2?"right":"left"):_&&"center"!==_?"left"===_?(f=u.r0+y,p>Math.PI/2&&(_="right")):"right"===_&&(f=u.r-y,p>Math.PI/2&&(_="left")):(f=(u.r+u.r0)/2,_="center"),d.attr("style",{text:l,textAlign:_,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=f*g+u.cx,b=f*m+u.cy;d.attr("position",[x,b]);var w=S("rotate"),T=0;function S(e){var t=a.get(e);return null==t?r.get(e):t}"radial"===w?(T=-p)<-Math.PI/2&&(T+=Math.PI):"tangential"===w?(T=Math.PI/2-p)>Math.PI/2?T-=Math.PI:T<-Math.PI/2&&(T+=Math.PI):"number"==typeof w&&(T=w*Math.PI/180),d.attr("rotation",T)},YZ._initEvents=function(e,t,i,n){e.off("mouseover").off("mouseout").off("emphasis").off("normal");var r=this,a=function(){r.onEmphasis(n)},o=function(){r.onNormal()};i.isAnimationEnabled()&&e.on("mouseover",a).on("mouseout",o).on("emphasis",a).on("normal",o).on("downplay",(function(){r.onDownplay()})).on("highlight",(function(){r.onHighlight()}))},UZ.inherits(qZ,WZ.Group);var KZ=g,QZ=Om,JZ=qZ,$Z=Vy,eq=qc.windowOpen;QZ.extend({type:"sunburst",init:function(){},render:function(e,t,i,n){var r=this;this.seriesModel=e,this.api=i,this.ecModel=t;var a=e.getData(),o=a.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),h=[];s.eachNode((function(e){h.push(e)}));var c=this._oldChildren||[];if(function(i,n){function r(e){return e.getId()}function s(r,s){!function(i,n){if(u||!i||i.getValue()||(i=null),i!==o&&n!==o)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",e,t),a.setItemGraphicEl(i.dataIndex,n.piece)):(s=n)&&s.piece&&(l.remove(s.piece),s.piece=null);else if(i){var r=new JZ(i,e,t);l.add(r),a.setItemGraphicEl(i.dataIndex,r)}var s}(null==r?null:i[r],null==s?null:n[s])}0===i.length&&0===n.length||new $Z(n,i,r,r).add(s).update(s).remove(KZ.curry(s,null)).execute()}(h,c),function(i,n){if(n.depth>0){r.virtualPiece?r.virtualPiece.updateData(!1,i,"normal",e,t):(r.virtualPiece=new JZ(i,e,t),l.add(r.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var a=function(e){r._rootToNode(n.parentNode)};n.piece._onclickEvent=a,r.virtualPiece.on("click",a)}else r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(o,s),n&&n.highlight&&n.highlight.piece){var d=e.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(d)}else if(n&&n.unhighlight){var f=this.virtualPiece;!f&&o.children.length&&(f=o.children[0].piece),f&&f.onNormal()}this._initEvents(),this._oldChildren=h},dispose:function(){},_initEvents:function(){var e=this,t=function(t){var i=!1;e.seriesModel.getViewRoot().eachNode((function(n){if(!i&&n.piece&&n.piece.childAt(0)===t.target){var r=n.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(n);else if("link"===r){var a=n.getModel(),o=a.get("link");if(o){var s=a.get("target",!0)||"_blank";eq(o,s)}}i=!0}}))};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,r=e[1]-i.cy,a=Math.sqrt(n*n+r*r);return a<=i.r&&a>=i.r0}}});var tq=h,iq=iR,nq="sunburstRootToNode";tq.registerAction({type:nq,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=iq.retrieveTargetInfo(e,[nq],t);if(n){var r=t.getViewRoot();r&&(e.direction=iq.aboveViewRoot(r,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var rq="sunburstHighlight";tq.registerAction({type:rq,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=iq.retrieveTargetInfo(e,[rq],t);n&&(e.highlight=n.node)}))})),tq.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){e.unhighlight=!0}))}));var aq=Uc.parsePercent,oq=g,sq=Math.PI/180;function lq(e,t){var i=e.children||[];e.children=function(e,t){if("function"==typeof t)return e.sort(t);var i="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(i?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(i?-1:1):n}))}(i,t),i.length&&oq.each(e.children,(function(e){lq(e,t)}))}var uq=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),n=e.get("radius");oq.isArray(n)||(n=[0,n]),oq.isArray(t)||(t=[t,t]);var r=i.getWidth(),a=i.getHeight(),o=Math.min(r,a),s=aq(t[0],r),l=aq(t[1],a),u=aq(n[0],o/2),h=aq(n[1],o/2),c=-e.get("startAngle")*sq,d=e.get("minAngle")*sq,f=e.getData().tree.root,p=e.getViewRoot(),g=p.depth,m=e.get("sort");null!=m&&lq(p,m);var v=0;oq.each(p.children,(function(e){!isNaN(e.getValue())&&v++}));var y=p.getValue(),_=Math.PI/(y||v)*2,x=p.depth>0,b=p.height-(x?-1:1),w=(h-u)/(b||1),T=e.get("clockwise"),S=e.get("stillShowZeroSum"),M=T?1:-1,A=function(e,t){if(e){var i=t;if(e!==f){var n=e.getValue(),r=0===y&&S?_:n*_;rn[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:Sq.bind((function(n){var r=t.dataToRadius(n[0]),a=i.dataToAngle(n[1]),o=e.coordToPoint([r,a]);return o.push(r,a*Math.PI/180),o})),size:Sq.bind(Mq,e)}}},Iq=function(e){var t=e.getRect(),i=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(t,i){return e.dataToPoint(t,i)}}}},Cq=g,Dq=No,Eq=HT.getDefaultLabel,Lq=vx,Pq=Qx.getLayoutOnAxis,Nq=Vy,Rq=um,Oq=zc,kq=Om,zq=VS.createClipPath,Bq=vq,Fq=xq,Vq=Tq,Gq=Aq,Hq=Iq,Uq=Dq.CACHED_LABEL_STYLE_PROPERTIES,Wq=["itemStyle"],jq=["emphasis","itemStyle"],Xq=["label"],Zq=["emphasis","label"],qq={cartesian2d:Bq,geo:Fq,singleAxis:Vq,polar:Gq,calendar:Hq};function Yq(e,t,i,n,r){null==i[e]||r||(t[e]=i[e],i[e]=n[e])}function Kq(e,t,i,n){var r=e.get("renderItem"),a=e.coordinateSystem,o={};a&&(o=a.prepareCustoms?a.prepareCustoms():qq[a.type](a));var s,l,u,h,c,d=Cq.defaults({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(e,i){return null==i&&(i=s),t.get(t.getDimension(e||0),i)},style:function(i,n){null==n&&(n=s),g(n);var r=l.getModel(Wq).getItemStyle();null!=c&&(r.fill=c);var a=t.getItemVisual(n,"opacity");null!=a&&(r.opacity=a);var o=i?iY(i,u):u;return Dq.setTextStyle(r,o,null,{autoColor:c,isRectText:!0}),r.text=o.getShallow("show")?Cq.retrieve2(e.getFormattedLabel(n,"normal"),Eq(t,n)):null,i&&nY(r,i),r},styleEmphasis:function(i,n){null==n&&(n=s),g(n);var r=l.getModel(jq).getItemStyle(),a=i?iY(i,h):h;return Dq.setTextStyle(r,a,null,{isRectText:!0},!0),r.text=a.getShallow("show")?Cq.retrieve3(e.getFormattedLabel(n,"emphasis"),e.getFormattedLabel(n,"normal"),Eq(t,n)):null,i&&nY(r,i),r},visual:function(e,i){return null==i&&(i=s),t.getItemVisual(i,e)},barLayout:function(e){if(a.getBaseAxis){var t=a.getBaseAxis();return Pq(Cq.defaults({axis:t},e),n)}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(e){return Dq.getFont(e,i)}},o.api||{}),f={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:Qq(e.getData())},p=!0;return function(e,i){return s=e,p=!0,r&&r(Cq.defaults({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:i?i.type:null},f),d)};function g(e){null==e&&(e=s),p&&(l=t.getItemModel(e),u=l.getModel(Xq),h=l.getModel(Zq),c=t.getItemVisual(e,"color"),p=!1)}}function Qq(e){var t={};return Cq.each(e.dimensions,(function(i,n){var r=e.getDimensionInfo(i);if(!r.isExtraCoord){var a=r.coordDim;(t[a]=t[a]||[])[r.coordDimIndex]=n}})),t}function Jq(e,t,i,n,r,a){return(e=$q(e,t,i,n,r,a,!0))&&a.setItemGraphicEl(t,e),e}function $q(e,t,i,n,r,a,o){var s,l=!i,u=(i=i||{}).type,h=i.shape,c=i.style;if(e&&(l||null!=u&&u!==e.__customGraphicType||"path"===u&&(s=h)&&(s.hasOwnProperty("pathData")||s.hasOwnProperty("d"))&&aY(h)!==e.__customPathData||"image"===u&&oY(c,"image")&&c.image!==e.__customImagePath||"text"===u&&oY(h,"text")&&c.text!==e.__customText)&&(r.remove(e),e=null),!l){var d=!e;return!e&&(e=function(e){var t,i=e.type;if("path"===i){var n=e.shape,r=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,a=aY(n);(t=Dq.makePath(a,null,r,n.layout||"center")).__customPathData=a}else if("image"===i)(t=new Dq.Image({})).__customImagePath=e.style.image;else if("text"===i)(t=new Dq.Text({})).__customText=e.style.text;else if("group"===i)t=new Dq.Group;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');t=new(Dq.getShapeClass(i))}return t.__customGraphicType=i,t.name=e.name,t}(i)),function(e,t,i,n,r,a,o){var s={},l=i.style||{};if(i.shape&&(s.shape=Cq.clone(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===e.type&&i.style){var u=s.style={};Cq.each(["x","y","width","height"],(function(t){Yq(t,u,l,e.style,a)}))}if("text"===e.type&&i.style&&(u=s.style={},Cq.each(["x","y"],(function(t){Yq(t,u,l,e.style,a)})),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)),"group"!==e.type&&(e.useStyle(l),a)){e.style.opacity=0;var h=l.opacity;null==h&&(h=1),Dq.initProps(e,{style:{opacity:h}},n,t)}a?e.attr(s):Dq.updateProps(e,s,n,t),i.hasOwnProperty("z2")&&e.attr("z2",i.z2||0),i.hasOwnProperty("silent")&&e.attr("silent",i.silent),i.hasOwnProperty("invisible")&&e.attr("invisible",i.invisible),i.hasOwnProperty("ignore")&&e.attr("ignore",i.ignore),i.hasOwnProperty("info")&&e.attr("info",i.info);var c=i.styleEmphasis;Dq.setElementHoverStyle(e,c),o&&Dq.setAsHighDownDispatcher(e,!1!==c)}(e,t,i,n,0,d,o),"group"===u&&function(e,t,i,n,r){var a=i.children,o=a?a.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(o||l||u){if(l)return h={oldChildren:e.children()||[],newChildren:a||[],dataIndex:t,animatableModel:n,group:e,data:r},void new Nq(h.oldChildren,h.newChildren,eY,eY,h).add(tY).update(tY).remove(rY).execute();var h;u&&e.removeAll();for(var c=0;c=0?"p":"n",E=x;if(y&&(n[s][C]||(n[s][C]={p:x,n:x}),E=n[s][C][D]),"radius"===c.dim){var L=c.dataToRadius(I)-x,P=a.dataToAngle(C);Math.abs(L)h?h=d:(c.lastTickCount=r,c.lastAutoInterval=h),h}},yY.inherits(wY,xY);var TY=vY,SY=wY,MY=function(e){this.name=e||"",this.cx=0,this.cy=0,this._radiusAxis=new TY,this._angleAxis=new SY,this._radiusAxis.polar=this._angleAxis.polar=this};MY.prototype={type:"polar",axisPointerEnabled:!0,constructor:MY,dimensions:["radius","angle"],model:null,containPoint:function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},containData:function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},getAxis:function(e){return this["_"+e+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},dataToPoint:function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},pointToData:function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},pointToCoord:function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),r=n.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);n.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+i*i);t/=s,i/=s;for(var l=Math.atan2(-i,t)/Math.PI*180,u=lo;)l+=360*u;return[s,l]},coordToPoint:function(e){var t=e[0],i=e[1]/180*Math.PI;return[Math.cos(i)*t+this.cx,-Math.sin(i)*t+this.cy]},getArea:function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var i=e.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:e.inverse,contain:function(e,t){var i=e-this.cx,n=t-this.cy,r=i*i+n*n,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}}};var AY=MY,IY=g,CY=ZM,DY=aw,EY=Ld.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});IY.merge(EY.prototype,DY);var LY={splitNumber:5};function PY(e,t){return t.type||(t.data?"category":"value")}CY("angle",EY,PY,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),CY("radius",EY,PY,LY),h.extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var NY=g,RY=AY,OY=Uc.parsePercent,kY=yx,zY=kY.createScaleByModel,BY=kY.niceScaleExtent,FY=sp,VY=ex.getStackedDimension;function GY(e,t){var i=this,n=i.getAngleAxis(),r=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===i){var t=e.getData();NY.each(t.mapDimension("radius",!0),(function(e){r.scale.unionExtentFromData(t,VY(t,e))})),NY.each(t.mapDimension("angle",!0),(function(e){n.scale.unionExtentFromData(t,VY(t,e))}))}})),BY(n.scale,n.model),BY(r.scale,r.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function HY(e,t){if(e.type=t.get("type"),e.scale=zY(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),"angleAxis"===t.mainType){e.inverse^=t.get("clockwise");var i=t.get("startAngle");e.setExtent(i,i+(e.inverse?-360:360))}t.axis=e,e.model=t}var UY={dimensions:RY.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("polar",(function(e,n){var r=new RY(n);r.update=GY;var a=r.getRadiusAxis(),o=r.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");HY(a,s),HY(o,l),function(e,t,i){var n=t.get("center"),r=i.getWidth(),a=i.getHeight();e.cx=OY(n[0],r),e.cy=OY(n[1],a);var o=e.getRadiusAxis(),s=Math.min(r,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:NY.isArray(l)||(l=[0,l]),l=[OY(l[0],s),OY(l[1],s)],o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(r,e,t),i.push(r),e.coordinateSystem=r,r.model=e})),e.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}};FY.register("polar",UY);var WY=g,jY=No,XY=zc,ZY=qA,qY=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function YY(e,t,i){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],i]),r=e.coordToPoint([t[1],i]);return{x1:n[0],y1:n[1],x2:r[0],y2:r[1]}}function KY(e){return e.getRadiusAxis().inverse?0:1}function QY(e){var t=e[0],i=e[e.length-1];t&&i&&Math.abs(Math.abs(t.coord-i.coord)-360)<1e-4&&e.pop()}uI.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,r=n.getRadiusAxis().getExtent(),a=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=WY.map(i.getViewLabels(),(function(e){return(e=WY.clone(e)).coord=i.dataToCoord(e.tickValue),e}));QY(s),QY(a),WY.each(qY,(function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,a,o,r,s)}),this)}},_axisLine:function(e,t,i,n,r){var a,o=e.getModel("axisLine.lineStyle"),s=KY(t),l=s?0:1;(a=0===r[l]?new jY.Circle({shape:{cx:t.cx,cy:t.cy,r:r[s]},style:o.getLineStyle(),z2:1,silent:!0}):new jY.Ring({shape:{cx:t.cx,cy:t.cy,r:r[s],r0:r[l]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(e,t,i,n,r){var a=e.getModel("axisTick"),o=(a.get("inside")?-1:1)*a.get("length"),s=r[KY(t)],l=WY.map(i,(function(e){return new jY.Line({shape:YY(t,[s,s+o],e.coord)})}));this.group.add(jY.mergePath(l,{style:WY.defaults(a.getModel("lineStyle").getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")})}))},_minorTick:function(e,t,i,n,r){if(n.length){for(var a=e.getModel("axisTick"),o=e.getModel("minorTick"),s=(a.get("inside")?-1:1)*o.get("length"),l=r[KY(t)],u=[],h=0;hf?"left":"right",m=Math.abs(d[1]-p)/c<.3?"middle":d[1]>p?"top":"bottom";o&&o[h]&&o[h].textStyle&&(a=new XY(o[h].textStyle,s,s.ecModel));var v=new jY.Text({silent:ZY.isLabelSilent(e)});this.group.add(v),jY.setTextStyle(v.style,a,{x:d[0],y:d[1],textFill:a.getTextColor()||e.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:g,textVerticalAlign:m}),u&&(v.eventData=ZY.makeAxisEventDataBase(e),v.eventData.targetType="axisLabel",v.eventData.value=i.rawLabel)}),this)},_splitLine:function(e,t,i,n,r){var a=e.getModel("splitLine").getModel("lineStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;um?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(t,i,0,s,n.get("label.margin"));aK.buildLabelElOption(e,i,n,r,d)}}),hK={line:function(e,t,i,n,r){return"angle"===e.dim?{type:"Line",shape:aK.makeLineShape(t.coordToPoint([n[0],i]),t.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:i}}},shadow:function(e,t,i,n,r){var a=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:aK.makeSectorShape(t.cx,t.cy,n[0],n[1],(-i-a/2)*o,(a/2-i)*o)}:{type:"Sector",shape:aK.makeSectorShape(t.cx,t.cy,i-a/2,i+a/2,0,2*Math.PI)}}};lK.registerAxisPointerClass("PolarAxisPointer",uK);var cK=h,dK=g,fK=fY;cK.registerLayout(dK.curry(fK,"bar")),cK.extendComponentView({type:"polar"});var pK=g,gK=lo,mK=Ld,vK=zc,yK=AC,_K=RP,xK=mK.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(e){mK.prototype.init.apply(this,arguments),gK.defaultEmphasis(e,"label",["show"])},optionUpdated:function(){var e=this.option,t=this;e.regions=_K.getFilledRegions(e.regions,e.map,e.nameMap),this._optionModelMap=pK.reduce(e.regions||[],(function(e,i){return i.name&&e.set(i.name,new vK(i,t)),e}),pK.createHashMap()),this.updateSelectedMap(e.regions)},defaultOption:{zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(e){return this._optionModelMap.get(e)||new vK(null,this,this.ecModel)},getFormattedLabel:function(e,t){t=t||"normal";var i=this.getRegionModel(e).get(("normal"===t?"":t+".")+"label.formatter"),n={name:e};return"function"==typeof i?(n.status=t,i(n)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e}});pK.mixin(xK,yK);var bK=QL;h.extendComponentView({type:"geo",init:function(e,t){var i=new bK(t,!0);this._mapDraw=i,this.group.add(i.group)},render:function(e,t,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var r=this._mapDraw;e.get("show")?r.draw(e,t,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=e.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}});var wK=h,TK=g;function SK(e,t){t.update="updateView",wK.registerAction(t,(function(t,i){var n={};return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name);var r=i.coordinateSystem;TK.each(r.regions,(function(e){n[e.name]=i.isSelected(e.name)||!1}))})),{selected:n,name:t.name}}))}SK("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),SK("select",{type:"geoSelect",event:"geoselected"}),SK("unSelect",{type:"geoUnSelect",event:"geounselected"});var MK=g,AK=Hc,IK=Uc,CK=sp,DK=864e5;function EK(e,t,i){this._model=e}function LK(e,t,i,n){var r=i.calendarModel,a=i.seriesModel,o=r?r.coordinateSystem:a?a.coordinateSystem:null;return o===this?o[e](n):null}EK.prototype={constructor:EK,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(e){var t=(e=IK.parseDate(e)).getFullYear(),i=e.getMonth()+1;i=i<10?"0"+i:i;var n=e.getDate();n=n<10?"0"+n:n;var r=e.getDay();return{y:t,m:i,d:n,day:r=Math.abs((r+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+n,date:e}},getNextNDay:function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},update:function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var i=this._rangeInfo.weeks||1,n=["width","height"],r=this._model.get("cellSize").slice(),a=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[i,7]:[7,i];MK.each([0,1],(function(e){u(r,e)&&(a[n[e]]=r[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=AK.getLayoutRect(a,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}MK.each([0,1],(function(e){u(r,e)||(r[e]=l[n[e]]/o[e])})),this._sw=r[0],this._sh=r[1]},dataToPoint:function(e,t){MK.isArray(e)&&(e=e[0]),null==t&&(t=!0);var i=this.getDateInfo(e),n=this._rangeInfo,r=i.formatedDate;if(t&&!(i.time>=n.start.time&&i.timea.end.time&&e.reverse(),e},_getRangeInfo:function(e){var t;(e=[this.getDateInfo(e[0]),this.getDateInfo(e[1])])[0].time>e[1].time&&(t=!0,e.reverse());var i=Math.floor(e[1].time/DK)-Math.floor(e[0].time/DK)+1,n=new Date(e[0].time),r=n.getDate(),a=e[1].date.getDate();n.setDate(r+i-1);var o=n.getDate();if(o!==a)for(var s=n.getTime()-e[1].time>0?1:-1;(o=n.getDate())!==a&&(n.getTime()-e[1].time)*s>0;)i-=s,n.setDate(o-s);var l=Math.floor((i+e[0].day+6)/7),u=t?1-l:l-1;return t&&e.reverse(),{range:[e[0].formatedDate,e[1].formatedDate],start:e[0],end:e[1],allDay:i,weeks:l,nthWeek:u,fweek:e[0].day,lweek:e[1].day}},_getDateByWeeksAndDay:function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||0===e&&tn.lweek)return!1;var r=7*(e-1)-n.fweek+t,a=new Date(n.start.time);return a.setDate(n.start.d+r),this.getDateInfo(a)}},EK.dimensions=EK.prototype.dimensions,EK.getDimensionsInfo=EK.prototype.getDimensionsInfo,EK.create=function(e,t){var i=[];return e.eachComponent("calendar",(function(n){var r=new EK(n,e,t);i.push(r),n.coordinateSystem=r})),e.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},CK.register("calendar",EK);var PK=g,NK=Ld,RK=Hc,OK=RK.getLayoutParams,kK=RK.sizeCalculable,zK=RK.mergeLayoutParam,BK=NK.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(e,t,i,n){var r=OK(e);BK.superApply(this,"init",arguments),FK(e,r)},mergeOption:function(e,t){BK.superApply(this,"mergeOption",arguments),FK(this.option,e)}});function FK(e,t){var i=e.cellSize;PK.isArray(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var n=PK.map([0,1],(function(e){return kK(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]}));zK(e,t,{type:"box",ignoreSize:n})}var VK=g,GK=No,HK=qc,UK=Uc,WK={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},jK={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};h.extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(e,t,i){var n=this.group;n.removeAll();var r=e.coordinateSystem,a=r.getRangeInfo(),o=r.getOrient();this._renderDayRect(e,a,n),this._renderLines(e,a,o,n),this._renderYearText(e,a,o,n),this._renderMonthText(e,o,n),this._renderWeekText(e,a,o,n)},_renderDayRect:function(e,t,i){for(var n=e.coordinateSystem,r=e.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),o=n.getCellHeight(),s=t.start.time;s<=t.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new GK.Rect({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:r});i.add(u)}},_renderLines:function(e,t,i,n){var r=this,a=e.coordinateSystem,o=e.getModel("splitLine.lineStyle").getLineStyle(),s=e.get("splitLine.show"),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=a.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=a.getDateInfo(c)}function d(t){r._firstDayOfMonth.push(a.getDateInfo(t)),r._firstDayPoints.push(a.dataToRect([t],!1).tl);var l=r._getLinePointsOfOneWeek(e,t,i);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,o,n)}d(a.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,i),o,n),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,i),o,n)},_getEdgesPoints:function(e,t,i){var n=[e[0].slice(),e[e.length-1].slice()],r="horizontal"===i?0:1;return n[0][r]=n[0][r]-t/2,n[1][r]=n[1][r]+t/2,n},_drawSplitline:function(e,t,i){var n=new GK.Polyline({z2:20,shape:{points:e},style:t});i.add(n)},_getLinePointsOfOneWeek:function(e,t,i){var n=e.coordinateSystem;t=n.getDateInfo(t);for(var r=[],a=0;a<7;a++){var o=n.getNextNDay(t.time,a),s=n.dataToRect([o.time],!1);r[2*o.day]=s.tl,r[2*o.day+1]=s["horizontal"===i?"bl":"tr"]}return r},_formatterLabel:function(e,t){return"string"==typeof e&&e?HK.formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},_yearTextPositionControl:function(e,t,i,n,r){t=t.slice();var a=["center","bottom"];"bottom"===n?(t[1]+=r,a=["center","top"]):"left"===n?t[0]-=r:"right"===n?(t[0]+=r,a=["center","top"]):t[1]-=r;var o=0;return"left"!==n&&"right"!==n||(o=Math.PI/2),{rotation:o,position:t,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(e,t,i,n){var r=e.getModel("yearLabel");if(r.get("show")){var a=r.get("margin"),o=r.get("position");o||(o="horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var f=r.get("formatter"),p={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new GK.Text({z2:30});GK.setTextStyle(m.style,r,{text:g}),m.attr(this._yearTextPositionControl(m,c[o],i,o,a)),n.add(m)}},_monthTextPositionControl:function(e,t,i,n,r){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===i?(l+=r,t&&(a="center"),"start"===n&&(o="bottom")):(s+=r,t&&(o="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:o}},_renderMonthText:function(e,t,i){var n=e.getModel("monthLabel");if(n.get("show")){var r=n.get("nameMap"),a=n.get("margin"),o=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];VK.isString(r)&&(r=WK[r.toUpperCase()]||[]);var u="start"===o?0:1,h="horizontal"===t?0:1;a="start"===o?-a:a;for(var c="center"===s,d=0;d=0;l--)null==r[l]?r.splice(l,1):delete r[l].$action},_flatten:function(e,t,i){ZK.each(e,(function(e){if(e){i&&(e.parentOption=i),t.push(e);var n=e.children;"group"===e.type&&n&&this._flatten(n,t,e),delete e.children}}),this)},useElOptionsToUpdate:function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e}});function eQ(e,t,i,n){var r=i.type,a=new(JK.hasOwnProperty(r)?JK[r]:YK.getShapeClass(r))(i);t.add(a),n.set(e,a),a.__ecGraphicId=e}function tQ(e,t){var i=e&&e.parent;i&&("group"===e.type&&e.traverse((function(e){tQ(e,t)})),t.removeKey(e.__ecGraphicId),i.remove(e))}function iQ(e,t){var i;return ZK.each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)})),i}XK.extendComponentView({type:"graphic",init:function(e,t){this._elMap=ZK.createHashMap(),this._lastGraphicModel},render:function(e,t,i){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,i)},_updateElements:function(e){var t=e.useElOptionsToUpdate();if(t){var i=this._elMap,n=this.group;ZK.each(t,(function(t){var r=t.$action,a=t.id,o=i.get(a),s=t.parentId,l=null!=s?i.get(s):n,u=t.style;"text"===t.type&&u&&(t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=function(e){return e=ZK.extend({},e),ZK.each(["id","parentId","$action","hv","bounding"].concat(KK.LOCATION_PARAMS),(function(t){delete e[t]})),e}(t);r&&"merge"!==r?"replace"===r?(tQ(o,i),eQ(a,l,h,i)):"remove"===r&&tQ(o,i):o?o.attr(h):eQ(a,l,h,i);var c=i.get(a);c&&(c.__ecGraphicWidthOption=t.width,c.__ecGraphicHeightOption=t.height,function(e,t,i){var n=e.eventData;e.silent||e.ignore||n||(n=e.eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=e.info)}(c,e))}))}},_relocate:function(e,t){for(var i=e.option.elements,n=this.group,r=this._elMap,a=t.getWidth(),o=t.getHeight(),s=0;s=0;s--){var h;if(l=i[s],h=r.get(l.id)){var c,d=(c=h.parent)===n?{width:a,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight};KK.positionElement(h,l,d,null,{hv:l.hv,boundingMode:l.bounding})}}},_clear:function(){var e=this._elMap;e.each((function(t){tQ(t,e)})),this._elMap=ZK.createHashMap()},dispose:function(){this._clear()}});var nQ={},rQ={};nQ.register=function(e,t){rQ[e]=t},nQ.get=function(e){return rQ[e]};var aQ=g,oQ=nQ,sQ=h.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){sQ.superApply(this,"optionUpdated",arguments),aQ.each(this.option.feature,(function(e,t){var i=oQ.get(t);i&&aQ.merge(e,i.defaultOption)}))},defaultOption:{show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1}}}),lQ={},uQ=Hc,hQ=uQ.getLayoutRect,cQ=uQ.box,dQ=uQ.positionElement,fQ=qc,pQ=No;lQ.layout=function(e,t,i){var n=t.getBoxLayoutParams(),r=t.get("padding"),a={width:i.getWidth(),height:i.getHeight()},o=hQ(n,a,r);cQ(t.get("orient"),e,t.get("itemGap"),o.width,o.height),dQ(e,n,a,r)},lQ.makeBackground=function(e,t){var i=fQ.normalizeCssArray(t.get("padding")),n=t.getItemStyle(["color","opacity"]);return n.fill=t.get("backgroundColor"),e=new pQ.Rect({shape:{x:e.x-i[3],y:e.y-i[0],width:e.width+i[1]+i[3],height:e.height+i[0]+i[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1})};var gQ=g,mQ=Tn,vQ=nQ,yQ=No,_Q=zc,xQ=Vy,bQ=lQ;h.extendComponentView({type:"toolbox",render:function(e,t,i,n){var r=this.group;if(r.removeAll(),e.get("show")){var a=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];gQ.each(o,(function(e,t){l.push(t)})),new xQ(this._featureNames||[],l).add(u).update(u).remove(gQ.curry(u,null)).execute(),this._featureNames=l,bQ.layout(r,e,i),r.add(bQ.makeBackground(r.getBoundingRect(),e)),r.eachChild((function(e){var t=e.__title,n=e.hoverStyle;if(n&&t){var o=mQ.getBoundingRect(t,mQ.makeFont(n)),s=e.position[0]+r.position[0],l=!1;e.position[1]+r.position[1]+a+o.height>i.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:a+8;s+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):s-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}}))}function u(u,h){var c,d=l[u],f=l[h],p=o[d],g=new _Q(p,e,e.ecModel);if(n&&null!=n.newTitle&&n.featureName===d&&(p.title=n.newTitle),d&&!f){if(function(e){return 0===e.indexOf("my")}(d))c={model:g,onclick:g.option.onclick,featureName:d};else{var m=vQ.get(d);if(!m)return;c=new m(g,t,i)}s[d]=c}else{if(!(c=s[f]))return;c.model=g,c.ecModel=t,c.api=i}d||!f?g.get("show")&&!c.unusable?(function(n,o,s){var l=n.getModel("iconStyle"),u=n.getModel("emphasis.iconStyle"),h=o.getIcons?o.getIcons():n.get("icon"),c=n.get("title")||{};if("string"==typeof h){var d=h,f=c;c={},(h={})[s]=d,c[s]=f}var p=n.iconPaths={};gQ.each(h,(function(s,h){var d=yQ.createIcon(s,{},{x:-a/2,y:-a/2,width:a,height:a});d.setStyle(l.getItemStyle()),d.hoverStyle=u.getItemStyle(),d.setStyle({text:c[h],textAlign:u.get("textAlign"),textBorderRadius:u.get("textBorderRadius"),textPadding:u.get("textPadding"),textFill:null});var f=e.getModel("tooltip");f&&f.get("show")&&d.attr("tooltip",gQ.extend({content:c[h],formatter:f.get("formatter",!0)||function(){return c[h]},formatterParams:{componentType:"toolbox",name:h,title:c[h],$vars:["name","title"]},position:f.get("position",!0)||"bottom"},f.option)),yQ.setHoverStyle(d),e.get("showTitle")&&(d.__title=c[h],d.on("mouseover",(function(){var t=u.getItemStyle(),i="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({textFill:u.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:u.get("textBackgroundColor"),textPosition:u.get("textPosition")||i})})).on("mouseout",(function(){d.setStyle({textFill:null,textBackgroundColor:null})}))),d.trigger(n.get("iconStatus."+h)||"normal"),r.add(d),d.on("click",gQ.bind(o.onclick,o,t,i,h)),p[h]=d}))}(g,c,d),g.setIconStatus=function(e,t){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[e]=t,n[e]&&n[e].trigger(t)},c.render&&c.render(g,t,i,n)):c.remove&&c.remove(t,i):c.dispose&&c.dispose(t,i)}},updateView:function(e,t,i,n){gQ.each(this._features,(function(e){e.updateView&&e.updateView(e.model,t,i,n)}))},remove:function(e,t){gQ.each(this._features,(function(i){i.remove&&i.remove(e,t)})),this.group.removeAll()},dispose:function(e,t){gQ.each(this._features,(function(i){i.dispose&&i.dispose(e,t)}))}});var wQ=p,TQ=nQ,SQ=jm.toolbox.saveAsImage;function MQ(e){this.model=e}MQ.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:SQ.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:SQ.lang.slice()},MQ.prototype.unusable=!wQ.canvasSupported,MQ.prototype.onclick=function(e,t){var i=this.model,n=i.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType()?"svg":i.get("type",!0)||"png",a=t.getConnectedDataURL({type:r,backgroundColor:i.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||wQ.browser.ie||wQ.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(a.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+r)}else{var h=i.get("lang"),c='';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+r,d.target="_blank",d.href=a;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},TQ.register("saveAsImage",MQ);var AQ=h,IQ=g,CQ=nQ,DQ=jm.toolbox.magicType,EQ="__ec_magicType_stack__";function LQ(e){this.model=e}LQ.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:IQ.clone(DQ.title),option:{},seriesIndex:{}};var PQ=LQ.prototype;PQ.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return IQ.each(e.get("type"),(function(e){t[e]&&(i[e]=t[e])})),i};var NQ={line:function(e,t,i,n){if("bar"===e)return IQ.merge({id:t,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(e,t,i,n){if("line"===e)return IQ.merge({id:t,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(e,t,i,n){var r=i.get("stack")===EQ;if("line"===e||"bar"===e)return n.setIconStatus("stack",r?"normal":"emphasis"),IQ.merge({id:t,stack:r?"":EQ},n.get("option.stack")||{},!0)}},RQ=[["line","bar"],["stack"]];PQ.onclick=function(e,t,i){var n=this.model,r=n.get("seriesIndex."+i);if(NQ[i]){var a,o={series:[]};IQ.each(RQ,(function(e){IQ.indexOf(e,i)>=0&&IQ.each(e,(function(e){n.setIconStatus(e,"normal")}))})),n.setIconStatus(i,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var r=t.subType,a=t.id,s=NQ[i](r,a,t,n);s&&(IQ.defaults(s,t.option),o.series.push(s));var l=t.coordinateSystem;if(l&&"cartesian2d"===l.type&&("line"===i||"bar"===i)){var u=l.getAxesByScale("ordinal")[0];if(u){var h=u.dim+"Axis",c=e.queryComponents({mainType:h,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;o[h]=o[h]||[];for(var d=0;d<=c;d++)o[h][c]=o[h][c]||{};o[h][c].boundaryGap="bar"===i}}})),"stack"===i&&(a=o.series&&o.series[0]&&o.series[0].stack===EQ?IQ.merge({stack:DQ.title.tiled},DQ.title):IQ.clone(DQ.title)),t.dispatchAction({type:"changeMagicType",currentType:i,newOption:o,newTitle:a,featureName:"magicType"})}},AQ.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),CQ.register("magicType",LQ);var OQ=h,kQ=g,zQ=ne,BQ=nQ,FQ=jm.toolbox.dataView,VQ=new Array(60).join("-"),GQ="\t";function HQ(e){return kQ.map(e,(function(e){var t=e.getRawData(),i=[e.name],n=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,r=arguments[e-1],a=t.getName(r),o=0;o=0)return!0}(e)){var r=function(e){for(var t=e.split(/\n+/g),i=UQ(t.shift()).split(WQ),n=[],r=kQ.map(i,(function(e){return{name:e,data:[]}})),a=0;a=0)&&e(a,n,r)}))}var rJ=nJ.prototype;function aJ(e){return e[0]>e[1]&&e.reverse(),e}function oJ(e,t){return KQ.parseFinder(e,t,{includeMainTypes:iJ})}rJ.setOutputRanges=function(e,t){this.matchOutputRanges(e,t,(function(e,t,i){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var n=hJ[e.brushType](0,i,t);e.__rangeOffset={offset:dJ[e.brushType](n.values,e.range,[1,1]),xyMinMax:n.xyMinMax}}}))},rJ.matchOutputRanges=function(e,t,i){JQ(e,(function(e){var n=this.findTargetInfo(e,t);n&&!0!==n&&qQ.each(n.coordSyses,(function(n){var r=hJ[e.brushType](1,n,e.range);i(e,r.values,n,t)}))}),this)},rJ.setInputRanges=function(e,t){JQ(e,(function(e){var i,n,r,a,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=hJ[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?dJ[e.brushType](l.values,u.offset,(i=l.xyMinMax,n=u.xyMinMax,r=pJ(i),a=pJ(n),o=[r[0]/a[0],r[1]/a[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},rJ.makePanelOpts=function(e,t){return qQ.map(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t&&t(i),clipPath:QQ.makeRectPanelClipPath(n),isTargetByCursor:QQ.makeRectIsTargetByCursor(n,e,i.coordSysModel),getLinearBrushOtherExtent:QQ.makeLinearBrushOtherExtent(n)}}))},rJ.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return!0===n||n&&$Q(n.coordSyses,t.coordinateSystem)>=0},rJ.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=oJ(t,e),r=0;r=0||$Q(n,e.getAxis("y").model)>=0)&&a.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:uJ.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){JQ(e.geoModels,(function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:uJ.geo})}))}},lJ=[function(e,t){var i=e.xAxisModel,n=e.yAxisModel,r=e.gridModel;return!r&&i&&(r=i.axis.grid.model),!r&&n&&(r=n.axis.grid.model),r&&r===t.gridModel},function(e,t){var i=e.geoModel;return i&&i===t.geoModel}],uJ={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(YQ.getTransform(e)),t}},hJ={lineX:eJ(cJ,0),lineY:eJ(cJ,1),rect:function(e,t,i){var n=t[tJ[e]]([i[0][0],i[1][0]]),r=t[tJ[e]]([i[0][1],i[1][1]]),a=[aJ([n[0],r[0]]),aJ([n[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:qQ.map(i,(function(i){var r=t[tJ[e]](i);return n[0][0]=Math.min(n[0][0],r[0]),n[1][0]=Math.min(n[1][0],r[1]),n[0][1]=Math.max(n[0][1],r[0]),n[1][1]=Math.max(n[1][1],r[1]),r})),xyMinMax:n}}};function cJ(e,t,i,n){var r=i.getAxis(["x","y"][e]),a=aJ(qQ.map([0,1],(function(e){return t?r.coordToData(r.toLocalCoord(n[e])):r.toGlobalCoord(r.dataToCoord(n[e]))}))),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var dJ={lineX:eJ(fJ,0),lineY:eJ(fJ,1),rect:function(e,t,i){return[[e[0][0]-i[0]*t[0][0],e[0][1]-i[0]*t[0][1]],[e[1][0]-i[1]*t[1][0],e[1][1]-i[1]*t[1][1]]]},polygon:function(e,t,i){return qQ.map(e,(function(e,n){return[e[0]-i[0]*t[n][0],e[1]-i[1]*t[n][1]]}))}};function fJ(e,t,i,n){return[t[0]-n[e]*i[0],t[1]-n[e]*i[1]]}function pJ(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var gJ=nJ,mJ={},vJ=g.each,yJ="\0_ec_hist_store";function _J(e){var t=e[yJ];return t||(t=e[yJ]=[{}]),t}mJ.push=function(e,t){var i=_J(e);vJ(t,(function(t,n){for(var r=i.length-1;r>=0&&!i[r][n];r--);if(r<0){var a=e.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var o=a.getPercentRange();i[0][n]={dataZoomId:n,start:o[0],end:o[1]}}}})),i.push(t)},mJ.pop=function(e){var t=_J(e),i=t[t.length-1];t.length>1&&t.pop();var n={};return vJ(i,(function(e,i){for(var r=t.length-1;r>=0;r--)if(e=t[r][i]){n[i]=e;break}})),n},mJ.clear=function(e){e[yJ]=null},mJ.count=function(e){return _J(e).length},Ld.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var xJ={},bJ=g,wJ=qc,TJ=["cartesian2d","polar","singleAxis"];function SJ(e,t){e=e.slice();var i=bJ.map(e,wJ.capitalFirst);t=(t||[]).slice();var n=bJ.map(t,wJ.capitalFirst);return function(r,a){bJ.each(e,(function(e,o){for(var s={name:e,capital:i[o]},l=0;l=0},xJ.createNameEach=SJ,xJ.eachAxisDim=MJ,xJ.createLinkedNodesFinder=function(e,t,i){return function(r){var a,o={nodes:[],records:{}};if(t((function(e){o.records[e.name]={}})),!r)return o;n(r,o);do{a=!1,e(s)}while(a);function s(e){!function(e,t){return bJ.indexOf(t.nodes,e)>=0}(e,o)&&function(e,n){var r=!1;return t((function(t){bJ.each(i(e,t)||[],(function(e){n.records[t.name][e]&&(r=!0)}))})),r}(e,o)&&(n(e,o),a=!0)}return o};function n(e,n){n.nodes.push(e),t((function(t){bJ.each(i(e,t)||[],(function(e){n.records[t.name][e]=!0}))}))}};var AJ=g,IJ=Uc,CJ=xJ,DJ=wF,EJ=AJ.each,LJ=IJ.asc,PJ=function(e,t,i,n){this._dimName=e,this._axisIndex=t,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i};function NJ(e,t){var i=e.getAxisModel(),n=e._percentWindow,r=e._valueWindow;if(n){var a=IJ.getPixelPrecision(r,[0,500]);a=Math.min(a,20);var o=t||0===n[0]&&100===n[1];i.setRange(o?null:+r[0].toFixed(a),o?null:+r[1].toFixed(a))}}PJ.prototype={constructor:PJ,hostedBy:function(e){return this._dataZoomModel===e},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var e=[],t=this.ecModel;return t.eachSeries((function(i){if(CJ.isCoordSupported(i.get("coordinateSystem"))){var n=this._dimName,r=t.queryComponents({mainType:n+"Axis",index:i.get(n+"AxisIndex"),id:i.get(n+"AxisId")})[0];this._axisIndex===(r&&r.componentIndex)&&e.push(i)}}),this),e},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var e,t,i,n=this._dimName,r=this.ecModel,a=this.getAxisModel();return"x"===n||"y"===n?(t="gridIndex",e="x"===n?"y":"x"):(t="polarIndex",e="angle"===n?"radius":"angle"),r.eachComponent(e+"Axis",(function(e){(e.get(t)||0)===(a.get(t)||0)&&(i=e)})),i},getMinMaxSpan:function(){return AJ.clone(this._minMaxSpan)},calculateDataWindow:function(e){var t,i=this._dataExtent,n=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],o=[],s=[];EJ(["start","end"],(function(l,u){var h=e[l],c=e[l+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=n.parse(IJ.linearMap(h,a,i))):(t=!0,c=null==c?i[u]:n.parse(c),h=IJ.linearMap(c,i,a)),s[u]=c,o[u]=h})),LJ(s),LJ(o);var l=this._minMaxSpan;function u(e,t,i,r,a){var o=a?"Span":"ValueSpan";DJ(0,e,i,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=IJ.linearMap(e[s],i,r,!0),a&&(t[s]=n.parse(t[s]))}return t?u(s,o,i,a,!1):u(o,s,a,i,!0),{valueWindow:s,percentWindow:o}},reset:function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=(n=this,r=this._dimName,a=[1/0,-1/0],EJ(t,(function(e){var t=e.getData();t&&EJ(t.mapDimension(r,!0),(function(e){var i=t.getApproximateExtent(e);i[0]a[1]&&(a[1]=i[1])}))})),a[1]0?0:NaN);var o=i.getMax(!0);null!=o&&"dataMax"!==o&&"function"!=typeof o?t[1]=o:r&&(t[1]=a>0?a-1:NaN),i.get("scale",!0)||(t[0]>0&&(t[0]=0),t[1]<0&&(t[1]=0))}(n,a),a),function(e){var t=e._minMaxSpan={},i=e._dataZoomModel,n=e._dataExtent;EJ(["min","max"],(function(r){var a=i.get(r+"Span"),o=i.get(r+"ValueSpan");null!=o&&(o=e.getAxisModel().axis.scale.parse(o)),null!=o?a=IJ.linearMap(n[0]+o,n,[0,100],!0):null!=a&&(o=IJ.linearMap(a,[0,100],n,!0)-n[0]),t[r+"Span"]=a,t[r+"ValueSpan"]=o}))}(this);var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,NJ(this)}var n,r,a},restore:function(e){e===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,NJ(this,!0))},filterData:function(e,t){if(e===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),r=e.get("filterMode"),a=this._valueWindow;"none"!==r&&EJ(n,(function(e){var t=e.getData(),n=t.mapDimension(i,!0);n.length&&("weakFilter"===r?t.filterSelf((function(e){for(var i,r,o,s=0;sa[1];if(u&&!h&&!c)return!0;u&&(o=!0),h&&(i=!0),c&&(r=!0)}return o&&i&&r})):EJ(n,(function(i){if("empty"===r)e.setData(t=t.map(i,(function(e){return function(e){return e>=a[0]&&e<=a[1]}(e)?e:NaN})));else{var n={};n[i]=a,t.selectRange(n)}})),EJ(n,(function(e){t.setApproximateExtent(a,e)})))}))}}};var RJ=h,OJ=g,kJ=p,zJ=lo,BJ=xJ,FJ=PJ,VJ=OJ.each,GJ=BJ.eachAxisDim,HJ=RJ.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(e,t,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=UJ(e);this.settledOption=n,this.mergeDefaultAndTheme(e,i),this.doInit(n)},mergeOption:function(e){var t=UJ(e);OJ.merge(this.option,e,!0),OJ.merge(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var t=this.option;kJ.canvasSupported||(t.realtime=!1),this._setDefaultThrottle(e),WJ(this,e);var i=this.settledOption;VJ([["start","startValue"],["end","endValue"]],(function(e,n){"value"===this._rangePropMode[n]&&(t[e[0]]=i[e[0]]=null)}),this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var e=this._axisProxies;this.eachTargetAxis((function(t,i,n,r){var a=this.dependentModels[t.axis][i],o=a.__dzAxisProxy||(a.__dzAxisProxy=new FJ(t.name,i,this,r));e[t.name+"_"+i]=o}),this)},_resetTarget:function(){var e=this.option,t=this._judgeAutoMode();GJ((function(t){var i=t.axisIndex;e[i]=zJ.normalizeToArray(e[i])}),this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,t=!1;GJ((function(i){null!=e[i.axisIndex]&&(t=!0)}),this);var i=e.orient;return null==i&&t?"orient":t?void 0:(null==i&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var e=!0,t=this.get("orient",!0),i=this.option,n=this.dependentModels;if(e){var r="vertical"===t?"y":"x";n[r+"Axis"].length?(i[r+"AxisIndex"]=[0],e=!1):VJ(n.singleAxis,(function(n){e&&n.get("orient",!0)===t&&(i.singleAxisIndex=[n.componentIndex],e=!1)}))}e&&GJ((function(t){if(e){var n=[],r=this.dependentModels[t.axis];if(r.length&&!n.length)for(var a=0,o=r.length;a0?100:20}},getFirstTargetAxisModel:function(){var e;return GJ((function(t){if(null==e){var i=this.get(t.axisIndex);i.length&&(e=this.dependentModels[t.axis][i[0]])}}),this),e},eachTargetAxis:function(e,t){var i=this.ecModel;GJ((function(n){VJ(this.get(n.axisIndex),(function(r){e.call(t,n,r,this,i)}),this)}),this)},getAxisProxy:function(e,t){return this._axisProxies[e+"_"+t]},getAxisModel:function(e,t){var i=this.getAxisProxy(e,t);return i&&i.getAxisModel()},setRawRange:function(e){var t=this.option,i=this.settledOption;VJ([["start","startValue"],["end","endValue"]],(function(n){null==e[n[0]]&&null==e[n[1]]||(t[n[0]]=i[n[0]]=e[n[0]],t[n[1]]=i[n[1]]=e[n[1]])}),this),WJ(this,e)},setCalculatedRange:function(e){var t=this.option;VJ(["start","startValue","end","endValue"],(function(i){t[i]=e[i]}))},getPercentRange:function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},getValueRange:function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(e){if(e)return e.__dzAxisProxy;var t=this._axisProxies;for(var i in t)if(t.hasOwnProperty(i)&&t[i].hostedBy(this))return t[i];for(var i in t)if(t.hasOwnProperty(i)&&!t[i].hostedBy(this))return t[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});function UJ(e){var t={};return VJ(["start","end","startValue","endValue","throttle"],(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}function WJ(e,t){var i=e._rangePropMode,n=e.get("rangeMode");VJ([["start","startValue"],["end","endValue"]],(function(e,r){var a=null!=t[e[0]],o=null!=t[e[1]];a&&!o?i[r]="percent":!a&&o?i[r]="value":n?i[r]=n[r]:a&&(i[r]="percent")}))}var jJ=HJ,XJ=gm.extend({type:"dataZoom",render:function(e,t,i,n){this.dataZoomModel=e,this.ecModel=t,this.api=i},getTargetCoordInfo:function(){var e=this.dataZoomModel,t=this.ecModel,i={};return e.eachTargetAxis((function(e,n){var r=t.getComponent(e.axis,n);if(r){var a=r.getCoordSysModel();a&&function(e,t,i,n){for(var r,a=0;a1?"emphasis":"normal")}(e,t)},h$.onclick=function(e,t,i){c$[i].call(this)},h$.remove=function(e,t){this._brushController.unmount()},h$.dispose=function(e,t){this._brushController.dispose()};var c$={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(r$.pop(this.ecModel))}};function d$(e){var t={};return t$.each(["xAxisIndex","yAxisIndex"],(function(i){t[i]=e[i],null==t[i]&&(t[i]="all"),(!1===t[i]||"none"===t[i])&&(t[i]=[])})),t}h$._onBrush=function(e,t){if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new n$(d$(this.model.option),n,{include:["grid"]}).matchOutputRanges(e,n,(function(e,t,i){if("cartesian2d"===i.type){var n=e.brushType;"rect"===n?(r("x",i,t[0]),r("y",i,t[1])):r({lineX:"x",lineY:"y"}[n],i,t)}})),r$.push(n,i),this._dispatchZoomAction(i)}function r(e,t,r){var a=t.getAxis(e),o=a.model,s=function(e,t,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},(function(i){i.getAxisModel(e,t.componentIndex)&&(n=i)})),n}(e,o,n),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=a$(0,r.slice(),a.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},h$._dispatchZoomAction=function(e){var t=[];l$(e,(function(e,i){t.push(t$.clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},o$.register("dataZoom",u$),e$.registerPreprocessor((function(e){if(e){var t=e.dataZoom||(e.dataZoom=[]);t$.isArray(t)||(e.dataZoom=t=[t]);var i=e.toolbox;if(i&&(t$.isArray(i)&&(i=i[0]),i&&i.feature)){var n=i.feature.dataZoom;r("xAxis",n),r("yAxis",n)}}function r(i,n){if(n){var r=i+"Index",a=n[r];null==a||"all"===a||t$.isArray(a)||(a=!1===a||"none"===a?[]:[a]),o=function(e,o){if(null==a||"all"===a||-1!==t$.indexOf(a,o)){var s={type:"select",$fromToolbox:!0,filterMode:n.filterMode||"filter",id:"\0_ec_\0toolbox-dataZoom_"+i+o};s[r]=o,t.push(s)}},s=e[i],t$.isArray(s)||(s=s?[s]:[]),l$(s,o)}var o,s}}));var f$=h,p$=mJ,g$=nQ,m$=jm.toolbox.restore;function v$(e){this.model=e}v$.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:m$.title},v$.prototype.onclick=function(e,t,i){p$.clear(e),t.dispatchAction({type:"restore",from:this.uid})},g$.register("restore",v$),f$.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")})),h.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var y$=g,_$=ut,x$=ne,b$=re,w$=p,T$=qc,S$=y$.each,M$=T$.toCamelCase,A$=["","-webkit-","-moz-","-o-"];function I$(e){var t,i,n,r=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.getModel("textStyle"),l=e.get("padding");return a&&r.push((n="left "+(t=a)+"s "+(i="cubic-bezier(0.23, 1, 0.32, 1)")+",top "+t+"s "+i,y$.map(A$,(function(e){return e+"transition:"+n})).join(";"))),o&&(w$.canvasSupported?r.push("background-Color:"+o):(r.push("background-Color:#"+_$.toHex(o)),r.push("filter:alpha(opacity=70)"))),S$(["width","color","radius"],(function(t){var i="border-"+t,n=M$(i),a=e.get(n);null!=a&&r.push(i+":"+a+("color"===t?"":"px"))})),r.push(function(e){var t=[],i=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var r=e.get("lineHeight");null==r&&(r=Math.round(3*i/2)),i&&t.push("line-height:"+r+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),S$(["decoration","align"],(function(i){var n=e.get(i);n&&t.push("text-"+i+":"+n)})),t.join(";")}(s)),null!=l&&r.push("padding:"+T$.normalizeCssArray(l).join("px ")+"px"),r.join(";")+";"}function C$(e,t,i,n,r){var a=t&&t.painter;if(i){var o=a&&a.getViewportRoot();o&&b$.transformLocalCoord(e,o,document.body,n,r)}else{e[0]=n,e[1]=r;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function D$(e,t,i){if(w$.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=t.getZr(),a=this._appendToBody=i&&i.appendToBody;this._styleCoord=[0,0,0,0],C$(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),a?document.body.appendChild(n):e.appendChild(n),this._container=e,this._show=!1,this._hideTimeout;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=r.handler,i=r.painter.getViewportRoot();x$.normalizeEvent(i,e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}D$.prototype={constructor:D$,_enterable:!0,update:function(e){var t=this._container,i=t.currentStyle||document.defaultView.getComputedStyle(t),n=t.style;"absolute"!==n.position&&"absolute"!==i.position&&(n.position="relative"),e.get("alwaysShowContent")&&this._moveTooltipIfResized()},_moveTooltipIfResized:function(){var e=this._styleCoord[2],t=this._styleCoord[3],i=e*this._zr.getWidth(),n=t*this._zr.getHeight();this.moveTo(i,n)},show:function(e){clearTimeout(this._hideTimeout);var t=this.el,i=this._styleCoord;t.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+I$(e)+";left:"+i[0]+"px;top:"+i[1]+"px;"+(e.get("extraCssText")||""),t.style.display=t.innerHTML?"block":"none",t.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(e){this.el.innerHTML=null==e?"":e},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el;return[e.clientWidth,e.clientHeight]},moveTo:function(e,t){var i=this._styleCoord;C$(i,this._zr,this._appendToBody,e,t);var n=this.el.style;n.left=i[0]+"px",n.top=i[1]+"px"},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(y$.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){this.el.parentNode.removeChild(this.el)},getOuterSize:function(){var e=this.el.clientWidth,t=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(this.el);i&&(e+=parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),t+=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:e,height:t}}};var E$=D$,L$=g,P$=Vl,N$=No;function R$(e,t,i,n){e[0]=i,e[1]=n,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function O$(e){var t=this._zr=e.getZr();this._styleCoord=[0,0,0,0],R$(this._styleCoord,t,e.getWidth()/2,e.getHeight()/2),this._show=!1,this._hideTimeout}O$.prototype={constructor:O$,_enterable:!0,update:function(e){e.get("alwaysShowContent")&&this._moveTooltipIfResized()},_moveTooltipIfResized:function(){var e=this._styleCoord[2],t=this._styleCoord[3],i=e*this._zr.getWidth(),n=t*this._zr.getHeight();this.moveTo(i,n)},show:function(e){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(e,t,i){this.el&&this._zr.remove(this.el);for(var n={},r=e,a="{marker",o=r.indexOf(a);o>=0;){var s=r.indexOf("|}"),l=r.substr(o+a.length,s-o-a.length);l.indexOf("sub")>-1?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:t[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:t[l]},o=(r=r.substr(s+1)).indexOf("{marker")}var u=i.getModel("textStyle"),h=u.get("fontSize"),c=i.get("textLineHeight");null==c&&(c=Math.round(3*h/2)),this.el=new P$({style:N$.setTextStyle({},u,{rich:n,text:e,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding"),textLineHeight:c}),z:i.get("z")}),this._zr.add(this.el);var d=this;this.el.on("mouseover",(function(){d._enterable&&(clearTimeout(d._hideTimeout),d._show=!0),d._inContent=!0})),this.el.on("mouseout",(function(){d._enterable&&d._show&&d.hideLater(d._hideDelay),d._inContent=!1}))},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el.getBoundingRect();return[e.width,e.height]},moveTo:function(e,t){if(this.el){var i=this._styleCoord;R$(i,this._zr,e,t),this.el.attr("position",[i[0],i[1]])}},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(L$.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){clearTimeout(this._hideTimeout),this.el&&this._zr.remove(this.el)},getOuterSize:function(){var e=this.getSize();return{width:e[0],height:e[1]}}};var k$=h,z$=g,B$=p,F$=E$,V$=O$,G$=qc,H$=Uc,U$=No,W$=Yj,j$=Hc,X$=zc,Z$=uX,q$=yx,Y$=RX,K$=lo.getTooltipRenderMode,Q$=z$.bind,J$=z$.each,$$=H$.parsePercent,e0=new U$.Rect({shape:{x:-1,y:-1,width:2,height:2}});function t0(e){for(var t=e.pop();e.length;){var i=e.pop();i&&(X$.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),t=new X$(i,t,t.ecModel))}return t}function i0(e,t){return e.dispatchAction||z$.bind(t.dispatchAction,t)}function n0(e){return"center"===e||"middle"===e}k$.extendComponentView({type:"tooltip",init:function(e,t){if(!B$.node){var i,n=e.getComponent("tooltip"),r=n.get("renderMode");this._renderMode=K$(r),"html"===this._renderMode?(i=new F$(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)}),this._newLine="
"):(i=new V$(t),this._newLine="\n"),this._tooltipContent=i}},render:function(e,t,i){if(!B$.node){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=e.get("alwaysShowContent");var n=this._tooltipContent;n.update(e),n.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var e=this._tooltipModel.get("triggerOn");Z$.register("itemTooltip",this._api,Q$((function(t,i,n){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(i,n):"leave"===t&&this._hide(n))}),this))},_keepShow:function(){var e=this._tooltipModel,t=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&n.manuallyShowTip(e,t,i,{x:n._lastX,y:n._lastY})}))}},manuallyShowTip:function(e,t,i,n){if(n.from!==this.uid&&!B$.node){var r=i0(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var o=e0;o.position=[n.x,n.y],o.update(),o.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:o},r)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},r);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(e,t,i,n))return;var s=W$(n,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el},r)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},r))}},manuallyHideTip:function(e,t,i,n){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(i0(n,i))},_manuallyAxisShowTip:function(e,t,i,n){var r=n.seriesIndex,a=n.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=t.getSeriesByIndex(r);if(s&&"axis"===(e=t0([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,e])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:n.position}),!0}},_tryShow:function(e,t){var i=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var n=e.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,e):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,i,t)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,i,t)):(this._lastDataByCoordSys=null,this._hide(t))}},_showOrMove:function(e,t){var i=e.get("showDelay");t=z$.bind(t,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(t,i):t()},_showAxisTooltip:function(e,t){var i=this._ecModel,n=this._tooltipModel,r=[t.offsetX,t.offsetY],a=[],o=[],s=t0([t.tooltipOption,n]),l=this._renderMode,u=this._newLine,h={};J$(e,(function(e){J$(e.dataByAxis,(function(e){var t=i.getComponent(e.axisDim+"Axis",e.axisIndex),n=e.value,r=[];if(t&&null!=n){var s=Y$.getValueLabel(n,t.axis,i,e.seriesDataIndices,e.valueLabelOpt);z$.each(e.seriesDataIndices,(function(a){var u=i.getSeriesByIndex(a.seriesIndex),c=a.dataIndexInside,d=u&&u.getDataParams(c);if(d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=q$.getAxisRawValue(t.axis,n),d.axisValueLabel=s,d){o.push(d);var f,p=u.formatTooltip(c,!0,null,l);if(z$.isObject(p)){f=p.html;var g=p.markers;z$.merge(h,g)}else f=p;r.push(f)}}));var c=s;"html"!==l?a.push(r.join(u)):a.push((c?G$.encodeHTML(c)+u:"")+r.join(u))}}))}),this),a.reverse(),a=a.join(this._newLine+this._newLine);var c=t.position;this._showOrMove(s,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(s,c,r[0],r[1],this._tooltipContent,o):this._showTooltipContent(s,a,o,Math.random(),r[0],r[1],c,void 0,h)}))},_showSeriesItemTooltip:function(e,t,i){var n=this._ecModel,r=t.seriesIndex,a=n.getSeriesByIndex(r),o=t.dataModel||a,s=t.dataIndex,l=t.dataType,u=o.getData(l),h=t0([u.getItemModel(s),o,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=o.getDataParams(s,l),g=o.formatTooltip(s,!1,l,this._renderMode);z$.isObject(g)?(d=g.html,f=g.markers):(d=g,f=null);var m="item_"+o.name+"_"+s;this._showOrMove(h,(function(){this._showTooltipContent(h,d,p,m,e.offsetX,e.offsetY,e.position,e.target,f)})),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:r,from:this.uid})}},_showComponentItemTooltip:function(e,t,i){var n=t.tooltip;"string"==typeof n&&(n={content:n,formatter:n});var r=new X$(n,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random();this._showOrMove(r,(function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t)})),i({type:"showTip",from:this.uid})},_showTooltipContent:function(e,t,i,n,r,a,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,h=e.get("formatter");o=o||e.get("position");var c=t;if(h&&"string"==typeof h)c=G$.formatTpl(h,i,!0);else if("function"==typeof h){var d=Q$((function(t,n){t===this._ticket&&(u.setContent(n,l,e),this._updatePosition(e,o,r,a,u,i,s))}),this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,e),u.show(e),this._updatePosition(e,o,r,a,u,i,s)}},_updatePosition:function(e,t,i,n,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),h=e.get("align"),c=e.get("verticalAlign"),d=o&&o.getBoundingRect().clone();if(o&&d.applyTransform(o.transform),"function"==typeof t&&(t=t([i,n],a,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),z$.isArray(t))i=$$(t[0],s),n=$$(t[1],l);else if(z$.isObject(t)){t.width=u[0],t.height=u[1];var f=j$.getLayoutRect(t,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else if("string"==typeof t&&o){var p=function(e,t,i){var n=i[0],r=i[1],a=5,o=0,s=0,l=t.width,u=t.height;switch(e){case"inside":o=t.x+l/2-n/2,s=t.y+u/2-r/2;break;case"top":o=t.x+l/2-n/2,s=t.y-r-a;break;case"bottom":o=t.x+l/2-n/2,s=t.y+u+a;break;case"left":o=t.x-n-a,s=t.y+u/2-r/2;break;case"right":o=t.x+l+a,s=t.y+u/2-r/2}return[o,s]}(t,d,u);i=p[0],n=p[1]}else p=function(e,t,i,n,r,a,o){var s=i.getOuterSize(),l=s.width,u=s.height;return null!=a&&(e+l+a>n?e-=l+a:e+=a),null!=o&&(t+u+o>r?t-=u+o:t+=o),[e,t]}(i,n,r,s,l,h?null:20,c?null:20),i=p[0],n=p[1];h&&(i-=n0(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=n0(c)?u[1]/2:"bottom"===c?u[1]:0),e.get("confine")&&(p=function(e,t,i,n,r){var a=i.getOuterSize(),o=a.width,s=a.height;return e=Math.min(e+o,n)-o,t=Math.min(t+s,r)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(i,n,r,s,l),i=p[0],n=p[1]),r.moveTo(i,n)},_updateContentNotChangedOnAxis:function(e){var t=this._lastDataByCoordSys,i=!!t&&t.length===e.length;return i&&J$(t,(function(t,n){var r=t.dataByAxis||{},a=(e[n]||{}).dataByAxis||[];(i&=r.length===a.length)&&J$(r,(function(e,t){var n=a[t]||{},r=e.seriesDataIndices||[],o=n.seriesDataIndices||[];(i&=e.value===n.value&&e.axisType===n.axisType&&e.axisId===n.axisId&&r.length===o.length)&&J$(r,(function(e,t){var n=o[t];i&=e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}))}))})),this._lastDataByCoordSys=e,!!i},_hide:function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},dispose:function(e,t){B$.node||(this._tooltipContent.dispose(),Z$.unregister("itemTooltip",t))}});var r0=h;r0.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),r0.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var a0=g,o0=["rect","polygon","keep","clear"],s0=function(e,t){var i=e&&e.brush;if(a0.isArray(i)||(i=i?[i]:[]),i.length){var n=[];a0.each(i,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(n=n.concat(t))}));var r=e&&e.toolbox;a0.isArray(r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var a=r.feature||(r.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),function(e){var t={};a0.each(e,(function(e){t[e]=1})),e.length=0,a0.each(t,(function(t,i){e.push(i)}))}(s),t&&!s.length&&s.push.apply(s,o0)}},l0={},u0={},h0=g,c0=yO,d0=h0.each;function f0(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}u0.createVisualMappings=function(e,t,i){var n={};return d0(t,(function(t){var r,a=n[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);d0(e[t],(function(e,n){if(c0.isValidType(n)){var r={type:n,visual:e};i&&i(r,t),a[n]=new c0(r),"opacity"===n&&((r=h0.clone(r)).type="colorAlpha",a.__hidden.__alphaForOpacity=new c0(r))}}))})),n},u0.replaceVisualOption=function(e,t,i){var n;h0.each(i,(function(e){t.hasOwnProperty(e)&&f0(t[e])&&(n=!0)})),n&&h0.each(i,(function(i){t.hasOwnProperty(i)&&f0(t[i])?e[i]=h0.clone(t[i]):delete e[i]}))},u0.applyVisual=function(e,t,i,n,r,a){var o,s={};function l(e){return i.getItemVisual(o,e)}function u(e,t){i.setItemVisual(o,e,t)}function h(e,h){o=null==a?e:h;var c=i.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var d=n.call(r,e),f=t[d],p=s[d],g=0,m=p.length;gt[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&k0(t)}};function k0(e){return new w0(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}l0.layoutCovers=L0;var z0=g,B0=u0,F0=zc,V0=["#ddd"];function G0(e,t){return z0.merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new F0(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}h.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(e,t){var i=this.option;!t&&B0.replaceVisualOption(i,e,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:V0},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(e){e&&(this.areas=z0.map(e,(function(e){return G0(this.option,e)}),this))},setBrushOption:function(e){this.brushOption=G0(this.option,e),this.brushType=this.brushOption.brushType}});var H0=h,U0=g,W0=jV,j0=l0.layoutCovers;function X0(e,t,i,n){(!n||n.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}H0.extendComponentView({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new W0(t.getZr())).on("brush",U0.bind(this._onBrush,this)).mount()},render:function(e){return this.model=e,X0.apply(this,arguments)},updateTransform:function(e,t){return j0(t),X0.apply(this,arguments)},updateView:X0,dispose:function(){this._brushController.dispose()},_onBrush:function(e,t){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(e,this.ecModel),(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:U0.clone(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:U0.clone(e),$from:i})}});var Z0=h;Z0.registerAction({type:"brush",event:"brush"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),Z0.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),Z0.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var q0=g,Y0=nQ,K0=jm.toolbox.brush;function Q0(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}Q0.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:q0.clone(K0.title)};var J0=Q0.prototype;J0.render=J0.updateView=function(e,t,i){var n,r,a;t.eachComponent({mainType:"brush"},(function(e){n=e.brushType,r=e.brushOption.brushMode||"single",a|=e.areas.length})),this._brushType=n,this._brushMode=r,q0.each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===r:"clear"===t?a:t===n)?"emphasis":"normal")}))},J0.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return q0.each(e.get("type",!0),(function(e){t[e]&&(i[e]=t[e])})),i},J0.onclick=function(e,t,i){var n=this._brushType,r=this._brushMode;"clear"===i?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===r?"single":"multiple":r}})},Y0.register("brush",Q0),h.registerPreprocessor(s0);var $0=g,e1=h,t1=No,i1=Hc.getLayoutRect,n1=qc.windowOpen;e1.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),e1.extendComponentView({type:"title",render:function(e,t,i){if(this.group.removeAll(),e.get("show")){var n=this.group,r=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=$0.retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new t1.Text({style:t1.setTextStyle({},r,{text:e.get("text"),textFill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=e.get("subtext"),c=new t1.Text({style:t1.setTextStyle({},a,{text:h,textFill:a.getTextColor(),y:u.height+e.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),f=e.get("sublink"),p=e.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",(function(){n1(d,"_"+e.get("target"))})),f&&c.on("click",(function(){n1(f,"_"+e.get("subtarget"))})),l.eventData=c.eventData=p?{componentType:"title",componentIndex:e.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=i1(m,{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?v.x+=v.width:"center"===o&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:o,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var _=v.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var b=new t1.Rect({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});n.add(b)}}});var r1=g;function a1(e){var t=e.itemStyle||(e.itemStyle={}),i=t.emphasis||(t.emphasis={}),n=e.label||e.label||{},r=n.normal||(n.normal={}),a={normal:1,emphasis:1};r1.each(n,(function(e,t){a[t]||o1(r,t)||(r[t]=e)})),i.label&&!o1(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function o1(e,t){return e.hasOwnProperty(t)}var s1=function(e){var t=e&&e.timeline;r1.isArray(t)||(t=t?[t]:[]),r1.each(t,(function(e){e&&function(e){var t=e.type,i={number:"value",time:"time"};if(i[t]&&(e.axisType=i[t],delete e.type),a1(e),o1(e,"controlPosition")){var n=e.controlStyle||(e.controlStyle={});o1(n,"position")||(n.position=e.controlPosition),"none"!==n.position||o1(n,"show")||(n.show=!1,delete n.position),delete e.controlPosition}r1.each(e.data||[],(function(e){r1.isObject(e)&&!r1.isArray(e)&&(!o1(e,"value")&&o1(e,"name")&&(e.value=e.name),a1(e))}))}(e)}))};Ld.registerSubTypeDefaulter("timeline",(function(){return"slider"}));var l1=h,u1=g;l1.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var i=t.getComponent("timeline");return i&&null!=e.currentIndex&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),t.resetOption("timeline"),u1.defaults({currentIndex:i.option.currentIndex},e)})),l1.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)}));var h1=g,c1=A_,d1=lo,f1=Ld.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(e,t,i){this._data,this._names,this.mergeDefaultAndTheme(e,i),this._initData()},mergeOption:function(e){f1.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(e){this.option.autoPlay=!!e},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var e=this.option,t=e.data||[],i=e.axisType,n=this._names=[];if("category"===i){var r=[];h1.each(t,(function(e,t){var i,a=d1.getDataItemValue(e);h1.isObject(e)?(i=h1.clone(e)).value=t:i=t,r.push(i),h1.isString(a)||null!=a&&!isNaN(a)||(a=""),n.push(a+"")})),t=r}var a={category:"ordinal",time:"time"}[i]||"number";(this._data=new c1([{name:"value",type:a}],this)).initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}}),p1=g,g1=Ig,m1=f1.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});p1.mixin(m1,g1);var v1=gm.extend({type:"timeline"}),y1=g,_1=wT,x1=function(e,t,i,n){_1.call(this,e,t,i),this.type=n||"value",this.model=null};x1.prototype={constructor:x1,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},y1.inherits(x1,_1);var b1=g,w1=Pi,T1=Ue,S1=No,M1=Hc,A1=v1,I1=x1,C1=ow.createSymbol,D1=yx,E1=Uc,L1=qc.encodeHTML,P1=b1.bind,N1=b1.each,R1=Math.PI;function O1(e,t,i,n,r,a){var o=t.get("color");if(r)r.setColor(o),i.add(r),a&&a.onUpdate(r);else{var s=e.get("symbol");(r=C1(s,-1,-1,2,2,o)).setStyle("strokeNoScale",!0),i.add(r),a&&a.onCreate(r)}var l=t.getItemStyle(["color","symbol","symbolSize"]);r.setStyle(l),n=b1.merge({rectHover:!0,z2:100},n,!0);var u=e.get("symbolSize");(u=u instanceof Array?u.slice():[+u,+u])[0]/=2,u[1]/=2,n.scale=u;var h=e.get("symbolOffset");if(h){var c=n.position=n.position||[0,0];c[0]+=E1.parsePercent(h[0],u[0]),c[1]+=E1.parsePercent(h[1],u[1])}var d=e.get("symbolRotate");return n.rotation=(d||0)*Math.PI/180||0,r.attr(n),r.updateTransform(),r}function k1(e,t,i,n,r){if(!e.dragging){var a=n.getModel("checkpointStyle"),o=i.dataToCoord(n.getData().get(["value"],t));r||!a.get("animation",!0)?e.attr({position:[o,0]}):(e.stopAnimation(!0),e.animateTo({position:[o,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}A1.extend({type:"timeline.slider",init:function(e,t){this.api=t,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var r=this._layout(e,i),a=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),s=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return L1(s.scale.getLabel(e))},N1(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](r,a,s,e)}),this),this._renderAxisLabel(r,o,s,e),this._position(r,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(e,t){var i=e.get("label.position"),n=e.get("orient"),r=function(e,t){return M1.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t);null==i||"auto"===i?i="horizontal"===n?r.y+r.height/2=0||"+"===i?"left":"right"},h={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:R1/2},d="vertical"===n?r.height:r.width,f=e.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=e.get("label.rotate")||0;y=y*R1/180;var _=f.get("position",!0),x=p&&f.get("showPlayBtn",!0),b=p&&f.get("showPrevBtn",!0),w=p&&f.get("showNextBtn",!0),T=0,S=d;return"left"===_||"bottom"===_?(x&&(a=[0,0],T+=v),b&&(o=[T,0],T+=v),w&&(s=[S-g,0],S-=v)):(x&&(a=[S-g,0],S-=v),b&&(o=[0,0],T+=v),w&&(s=[S-g,0],S-=v)),l=[T,S],e.get("inverse")&&l.reverse(),{viewRect:r,mainLength:d,orient:n,rotation:c[n],labelRotation:y,labelPosOpt:i,labelAlign:e.get("label.align")||u[n],labelBaseline:e.get("label.verticalAlign")||e.get("label.baseline")||h[n],playPosition:a,prevBtnPosition:o,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(e,t){var i=this._mainGroup,n=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){var a=T1.create(),o=r.x,s=r.y+r.height;T1.translate(a,a,[-o,-s]),T1.rotate(a,a,-R1/2),T1.translate(a,a,[o,s]),(r=r.clone()).applyTransform(a)}var l=m(r),u=m(i.getBoundingRect()),h=m(n.getBoundingRect()),c=i.position,d=n.position;d[0]=c[0]=l[0][0];var f,p=e.labelPosOpt;function g(e){var t=e.position;e.origin=[l[0][0]-t[0],l[1][0]-t[1]]}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,i,n,r){e[n]+=i[n][r]-t[n][r]}isNaN(p)?(v(c,u,l,1,f="+"===p?0:1),v(d,h,l,1,1-f)):(v(c,u,l,1,f=p>=0?0:1),d[1]=c[1]+p),i.attr("position",c),n.attr("position",d),i.rotation=n.rotation=e.rotation,g(i),g(n)},_createAxis:function(e,t){var i=t.getData(),n=t.get("axisType"),r=D1.createScaleByModel(t,n);r.getTicks=function(){return i.mapArray(["value"],(function(e){return e}))};var a=i.getDataExtent("value");r.setExtent(a[0],a[1]),r.niceTicks();var o=new I1("value",r,e.axisExtent,n);return o.model=t,o},_createGroup:function(e){var t=this["_"+e]=new S1.Group;return this.group.add(t),t},_renderAxisLine:function(e,t,i,n){var r=i.getExtent();n.get("lineStyle.show")&&t.add(new S1.Line({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:b1.extend({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(e,t,i,n){var r=n.getData(),a=i.scale.getTicks();N1(a,(function(e){var a=i.dataToCoord(e),o=r.getItemModel(e),s=o.getModel("itemStyle"),l=o.getModel("emphasis.itemStyle"),u={position:[a,0],onclick:P1(this._changeTimeline,this,e)},h=O1(o,s,t,u);S1.setHoverStyle(h,l.getItemStyle()),o.get("tooltip")?(h.dataIndex=e,h.dataModel=n):h.dataIndex=h.dataModel=null}),this)},_renderAxisLabel:function(e,t,i,n){if(i.getLabelModel().get("show")){var r=n.getData(),a=i.getViewLabels();N1(a,(function(n){var a=n.tickValue,o=r.getItemModel(a),s=o.getModel("label"),l=o.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new S1.Text({position:[u,0],rotation:e.labelRotation-e.rotation,onclick:P1(this._changeTimeline,this,a),silent:!1});S1.setTextStyle(h.style,s,{text:n.formattedLabel,textAlign:e.labelAlign,textVerticalAlign:e.labelBaseline}),t.add(h),S1.setHoverStyle(h,S1.setTextStyle({},l))}),this)}},_renderControl:function(e,t,i,n){var r=e.controlSize,a=e.rotation,o=n.getModel("controlStyle").getItemStyle(),s=n.getModel("emphasis.controlStyle").getItemStyle(),l=[0,-r/2,r,r],u=n.getPlayState(),h=n.get("inverse",!0);function c(e,i,u,h){if(e){var c=function(e,t,i,n){var r=n.style,a=S1.createIcon(e.get(t),n||{},new w1(i[0],i[1],i[2],i[3]));return r&&a.setStyle(r),a}(n,i,l,{position:e,origin:[r/2,0],rotation:h?-a:0,rectHover:!0,style:o,onclick:u});t.add(c),S1.setHoverStyle(c,s)}}c(e.nextBtnPosition,"controlStyle.nextIcon",P1(this._changeTimeline,this,h?"-":"+")),c(e.prevBtnPosition,"controlStyle.prevIcon",P1(this._changeTimeline,this,h?"+":"-")),c(e.playPosition,"controlStyle."+(u?"stopIcon":"playIcon"),P1(this._handlePlayClick,this,!u),!0)},_renderCurrentPointer:function(e,t,i,n){var r=n.getData(),a=n.getCurrentIndex(),o=r.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=P1(s._handlePointerDrag,s),e.ondragend=P1(s._handlePointerDragend,s),k1(e,a,i,n,!0)},onUpdate:function(e){k1(e,a,i,n)}};this._currentPointer=O1(o,o,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},_handlePointerDrag:function(e,t,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},_pointerChangeTimeline:function(e,t){var i=this._toAxisCoord(e)[0],n=this._axis,r=E1.asc(n.getExtent().slice());i>r[1]&&(i=r[1]),i":"\n"),s&&(l+=W1(s),null!=a&&(l+=" : ")),null!=a&&(l+=W1(o)),l},getData:function(){return this._data},setData:function(e){this._data=e}});B1.mixin(X1,H1);var Z1=X1;Z1.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var q1={},Y1=g,K1=Uc,Q1=ex.isDimensionStacked,J1=Y1.indexOf;function $1(e,t,i,n,r,a){var o=[],s=Q1(t,n)?t.getCalculationInfo("stackResultDimension"):n,l=n2(t,s,e),u=t.indicesOfNearest(s,l)[0];o[r]=t.get(i,u),o[a]=t.get(s,u);var h=t.get(n,u),c=K1.getPrecision(t.get(n,u));return(c=Math.min(c,20))>=0&&(o[a]=+o[a].toFixed(c)),[o,h]}var e2=Y1.curry,t2={min:e2($1,"min"),max:e2($1,"max"),average:e2($1,"average")};function i2(e,t,i,n){var r={};return null!=e.valueIndex||null!=e.valueDim?(r.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,r.valueAxis=i.getAxis(function(e,t){var i=e.getData(),n=i.dimensions;t=i.getDimension(t);for(var r=0;r=0&&"number"==typeof s&&(s=+s.toFixed(Math.min(p,20))),d.coord[h]=f.coord[h]=s,n=[d,f,{type:a,valueIndex:n.valueIndex,value:s}]}return(n=[g2.dataTransform(e,n[0]),g2.dataTransform(e,n[1]),d2.extend({},n[2])])[2].type=n[2].type||"",d2.merge(n[2],n[0]),d2.merge(n[2],n[1]),n};function x2(e){return!isNaN(e)&&!isFinite(e)}function b2(e,t,i,n){var r=1-e,a=n.dimensions[e];return x2(t[r])&&x2(i[r])&&t[e]===i[e]&&n.getAxis(a).containData(t[e])}function w2(e,t){if("cartesian2d"===e.type){var i=t[0].coord,n=t[1].coord;if(i&&n&&(b2(1,i,n,e)||b2(0,i,n,e)))return!0}return g2.dataFilter(e,t[0])&&g2.dataFilter(e,t[1])}function T2(e,t,i,n,r){var a,o=n.coordinateSystem,s=e.getItemModel(t),l=p2.parsePercent(s.get("x"),r.getWidth()),u=p2.parsePercent(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)a=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var h=o.dimensions,c=e.get(h[0],t),d=e.get(h[1],t);a=o.dataToPoint([c,d])}if("cartesian2d"===o.type){var f=o.getAxis("x"),p=o.getAxis("y");h=o.dimensions,x2(e.get(h[0],t))?a[0]=f.toGlobalCoord(f.getExtent()[i?0:1]):x2(e.get(h[1],t))&&(a[1]=p.toGlobalCoord(p.getExtent()[i?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];e.setItemLayout(t,a)}v2.extend({type:"markLine",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markLineModel;if(t){var n=t.getData(),r=t.__from,a=t.__to;r.each((function(t){T2(r,t,!0,e,i),T2(a,t,!1,e,i)})),n.each((function(e){n.setItemLayout(e,[r.getItemLayout(e),a.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new m2);this.group.add(l.group);var u=function(e,t,i){var n;n=e?d2.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return d2.defaults({name:e},i)})):[{name:"value",type:"float"}];var r=new f2(n,i),a=new f2(n,i),o=new f2([],i),s=d2.map(i.get("data"),d2.curry(_2,t,e,i));e&&(s=d2.filter(s,d2.curry(w2,e)));var l=e?g2.dimValueGetter:function(e){return e.value};return r.initData(d2.map(s,(function(e){return e[0]})),null,l),a.initData(d2.map(s,(function(e){return e[1]})),null,l),o.initData(d2.map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:r,to:a,line:o}}(r,e,t),h=u.from,c=u.to,d=u.line;t.__from=h,t.__to=c,t.setData(d);var f=t.get("symbol"),p=t.get("symbolSize");function g(t,i,r){var a=t.getItemModel(i);T2(t,i,r,e,n),t.setItemVisual(i,{symbolRotate:a.get("symbolRotate"),symbolSize:a.get("symbolSize")||p[r?0:1],symbol:a.get("symbol",!0)||f[r?0:1],color:a.get("itemStyle.color")||o.getVisual("color")})}d2.isArray(f)||(f=[f,f]),"number"==typeof p&&(p=[p,p]),u.from.each((function(e){g(h,e,!0),g(c,e,!1)})),d.each((function(e){var t=d.getItemModel(e).get("lineStyle.color");d.setItemVisual(e,{color:t||h.getItemVisual(e,"color")}),d.setItemLayout(e,[h.getItemLayout(e),c.getItemLayout(e)]),d.setItemVisual(e,{fromSymbolRotate:h.getItemVisual(e,"symbolRotate"),fromSymbolSize:h.getItemVisual(e,"symbolSize"),fromSymbol:h.getItemVisual(e,"symbol"),toSymbolRotate:c.getItemVisual(e,"symbolRotate"),toSymbolSize:c.getItemVisual(e,"symbolSize"),toSymbol:c.getItemVisual(e,"symbol")})})),l.updateData(d),u.line.eachItemGraphicEl((function(e,i){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),h.registerPreprocessor((function(e){e.markLine=e.markLine||{}})),Z1.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var S2=g,M2=ut,A2=A_,I2=Uc,C2=No,D2=q1,E2=function(e,t,i,n){var r=D2.dataTransform(e,n[0]),a=D2.dataTransform(e,n[1]),o=S2.retrieve,s=r.coord,l=a.coord;s[0]=o(s[0],-1/0),s[1]=o(s[1],-1/0),l[0]=o(l[0],1/0),l[1]=o(l[1],1/0);var u=S2.mergeAll([{},r,a]);return u.coord=[r.coord,a.coord],u.x0=r.x,u.y0=r.y,u.x1=a.x,u.y1=a.y,u};function L2(e){return!isNaN(e)&&!isFinite(e)}function P2(e,t,i,n){var r=1-e;return L2(t[r])&&L2(i[r])}function N2(e,t){var i=t.coord[0],n=t.coord[1];return!("cartesian2d"!==e.type||!i||!n||!P2(1,i,n)&&!P2(0,i,n))||D2.dataFilter(e,{coord:i,x:t.x0,y:t.y0})||D2.dataFilter(e,{coord:n,x:t.x1,y:t.y1})}function R2(e,t,i,n,r){var a,o=n.coordinateSystem,s=e.getItemModel(t),l=I2.parsePercent(s.get(i[0]),r.getWidth()),u=I2.parsePercent(s.get(i[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)a=n.getMarkerPosition(e.getValues(i,t));else{var h=[f=e.get(i[0],t),p=e.get(i[1],t)];o.clampData&&o.clampData(h,h),a=o.dataToPoint(h,!0)}if("cartesian2d"===o.type){var c=o.getAxis("x"),d=o.getAxis("y"),f=e.get(i[0],t),p=e.get(i[1],t);L2(f)?a[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):L2(p)&&(a[1]=d.toGlobalCoord(d.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];return a}var O2=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];a2.extend({type:"markArea",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markAreaModel;if(t){var n=t.getData();n.each((function(t){var r=S2.map(O2,(function(r){return R2(n,t,r,e,i)}));n.setItemLayout(t,r),n.getItemGraphicEl(t).setShape("points",r)}))}}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new C2.Group});this.group.add(l.group),l.__keep=!0;var u=function(e,t,i){var n,r,a=["x0","y0","x1","y1"];e?(n=S2.map(e&&e.dimensions,(function(e){var i=t.getData(),n=i.getDimensionInfo(i.mapDimension(e))||{};return S2.defaults({name:e},n)})),r=new A2(S2.map(a,(function(e,t){return{name:e,type:n[t%2].type}})),i)):r=new A2(n=[{name:"value",type:"float"}],i);var o=S2.map(i.get("data"),S2.curry(E2,t,e,i));e&&(o=S2.filter(o,S2.curry(N2,e)));var s=e?function(e,t,i,n){return e.coord[Math.floor(n/2)][n%2]}:function(e){return e.value};return r.initData(o,null,s),r.hasItemOption=!0,r}(r,e,t);t.setData(u),u.each((function(t){var i=S2.map(O2,(function(i){return R2(u,t,i,e,n)})),a=!0;S2.each(O2,(function(e){if(a){var i=u.get(e[0],t),n=u.get(e[1],t);(L2(i)||r.getAxis("x").containData(i))&&(L2(n)||r.getAxis("y").containData(n))&&(a=!1)}})),u.setItemLayout(t,{points:i,allClipped:a}),u.setItemVisual(t,{color:o.getVisual("color")})})),u.diff(l.__data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var i=new C2.Polygon({shape:{points:t.points}});u.setItemGraphicEl(e,i),l.group.add(i)}})).update((function(e,i){var n=l.__data.getItemGraphicEl(i),r=u.getItemLayout(e);r.allClipped?n&&l.group.remove(n):(n?C2.updateProps(n,{shape:{points:r.points}},t,e):n=new C2.Polygon({shape:{points:r.points}}),u.setItemGraphicEl(e,n),l.group.add(n))})).remove((function(e){var t=l.__data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,i){var n=u.getItemModel(i),r=n.getModel("label"),a=n.getModel("emphasis.label"),o=u.getItemVisual(i,"color");e.useStyle(S2.defaults(n.getModel("itemStyle").getItemStyle(),{fill:M2.modifyAlpha(o,.4),stroke:o})),e.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),C2.setLabelStyle(e.style,e.hoverStyle,r,a,{labelFetcher:t,labelDataIndex:i,defaultText:u.getName(i)||"",isRectText:!0,autoColor:o}),C2.setHoverStyle(e,{}),e.dataModel=t})),l.__data=u,l.group.silent=t.get("silent")||e.get("silent")}}),h.registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var k2=h,z2=g,B2=zc,F2=lo.isNameSpecified,V2=jm.legend.selector,G2={all:{type:"all",title:z2.clone(V2.all)},inverse:{type:"inverse",title:z2.clone(V2.inverse)}},H2=k2.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(e,t,i){this.mergeDefaultAndTheme(e,i),e.selected=e.selected||{},this._updateSelector(e)},mergeOption:function(e){H2.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),z2.isArray(t)&&z2.each(t,(function(e,i){z2.isString(e)&&(e={type:e}),t[i]=z2.merge(e,G2[e.type])}))},optionUpdated:function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,i=0;i=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}}}),U2=H2,W2=h,j2=g;function X2(e,t,i){var n,r={},a="toggleSelected"===e;return i.eachComponent("legend",(function(i){a&&null!=n?i[n?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?i[e]():(i[e](t.name),n=i.isSelected(t.name));var o=i.getData();j2.each(o,(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var n=i.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&n:r[t]=n}}))})),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}W2.registerAction("legendToggleSelect","legendselectchanged",j2.curry(X2,"toggleSelected")),W2.registerAction("legendAllSelect","legendselectall",j2.curry(X2,"allSelect")),W2.registerAction("legendInverseSelect","legendinverseselect",j2.curry(X2,"inverseSelect")),W2.registerAction("legendSelect","legendselected",j2.curry(X2,"select")),W2.registerAction("legendUnSelect","legendunselected",j2.curry(X2,"unSelect"));var Z2=h,q2=g,Y2=ow.createSymbol,K2=No,Q2=lQ.makeBackground,J2=Hc,$2=q2.curry,e3=q2.each,t3=K2.Group,i3=Z2.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new t3),this._backgroundEl,this.group.add(this._selectorGroup=new t3),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(e,t,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,i,o,a,s);var l=e.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},h=e.get("padding"),c=J2.getLayoutRect(l,u,h),d=this.layoutInner(e,r,c,n,o,s),f=J2.getLayoutRect(q2.defaults({width:d.width,height:d.height},l),u,h);this.group.attr("position",[f.x-d.x,f.y-d.y]),this.group.add(this._backgroundEl=Q2(d,e))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(e,t,i,n,r,a,o){var s=this.getContentGroup(),l=q2.createHashMap(),u=t.get("selectedMode"),h=[];i.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),e3(t.getData(),(function(r,a){var o=r.get("name");if(this.newlineDisabled||""!==o&&"\n"!==o){var c=i.getSeriesByName(o)[0];if(!l.get(o))if(c){var d=c.getData(),f=d.getVisual("color"),p=d.getVisual("borderColor");"function"==typeof f&&(f=f(c.getDataParams(0))),"function"==typeof p&&(p=p(c.getDataParams(0)));var g=d.getVisual("legendSymbol")||"roundRect",m=d.getVisual("symbol");this._createItem(o,a,r,t,g,m,e,f,p,u).on("click",$2(r3,o,null,n,h)).on("mouseover",$2(a3,c.name,null,n,h)).on("mouseout",$2(o3,c.name,null,n,h)),l.set(o,!0)}else i.eachRawSeries((function(i){if(!l.get(o)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(o))return;var c=s.indexOfName(o),d=s.getItemVisual(c,"color"),f=s.getItemVisual(c,"borderColor");this._createItem(o,a,r,t,"roundRect",null,e,d,f,u).on("click",$2(r3,null,o,n,h)).on("mouseover",$2(a3,null,o,n,h)).on("mouseout",$2(o3,null,o,n,h)),l.set(o,!0)}}),this)}else s.add(new t3({newline:!0}))}),this),r&&this._createSelector(r,t,n,a,o)},_createSelector:function(e,t,i,n,r){var a=this.getSelectorGroup();e3(e,(function(e){!function(e){var n=e.type,r=new K2.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});a.add(r);var o=t.getModel("selectorLabel"),s=t.getModel("emphasis.selectorLabel");K2.setLabelStyle(r.style,r.hoverStyle={},o,s,{defaultText:e.title,isRectText:!1}),K2.setHoverStyle(r)}(e)}))},_createItem:function(e,t,i,n,r,a,o,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.get("inactiveBorderColor"),p=n.get("symbolKeepAspect"),g=n.getModel("itemStyle"),m=n.isSelected(e),v=new t3,y=i.getModel("textStyle"),_=i.get("icon"),x=i.getModel("tooltip"),b=x.parentModel,w=Y2(r=_||r,0,0,h,c,m?s:d,null==p||p);if(v.add(n3(w,r,g,l,f,m)),!_&&a&&(a!==r||"none"===a)){var T=.8*c;"none"===a&&(a="circle");var S=Y2(a,(h-T)/2,(c-T)/2,T,T,m?s:d,null==p||p);v.add(n3(S,a,g,l,f,m))}var M="left"===o?h+5:-5,A=o,I=n.get("formatter"),C=e;"string"==typeof I&&I?C=I.replace("{name}",null!=e?e:""):"function"==typeof I&&(C=I(e)),v.add(new K2.Text({style:K2.setTextStyle({},y,{text:C,x:M,y:c/2,textFill:m?y.getTextColor():d,textAlign:A,textVerticalAlign:"middle"})}));var D=new K2.Rect({shape:v.getBoundingRect(),invisible:!0,tooltip:x.get("show")?q2.extend({content:e,formatter:b.get("formatter",!0)||function(){return e},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:e,$vars:["name"]}},x.option):null});return v.add(D),v.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(v),K2.setHoverStyle(v),v.__legendDataIndex=t,v},layoutInner:function(e,t,i,n,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();J2.box(e.get("orient"),o,e.get("itemGap"),i.width,i.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(r){J2.box("horizontal",s,e.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=e.get("selectorButtonGap",!0),f=e.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===a?c[f]+=l[p]+d:u[f]+=h[p]+d,c[1-f]+=l[g]/2-h[g]/2,s.attr("position",c),o.attr("position",u);var v={x:0,y:0};return v[p]=l[p]+d+h[p],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-f]),v}return o.attr("position",u),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function n3(e,t,i,n,r,a){var o;return"line"!==t&&t.indexOf("empty")<0?(o=i.getItemStyle(),e.style.stroke=n,a||(o.stroke=r)):o=i.getItemStyle(["borderWidth","borderColor"]),e.setStyle(o)}function r3(e,t,i,n){o3(e,t,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),a3(e,t,i,n)}function a3(e,t,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:n})}function o3(e,t,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:n})}var s3=i3,l3=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var i=0;ii[r],f=[-h.x,-h.y];t||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=y3.retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?g[n]+=i[r]-c[r]:p[n]+=c[r]+m),g[1-n]+=h[a]/2-c[a]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[r]=d?i[r]:h[r],v[a]=Math.max(h[a],c[a]),v[o]=Math.min(0,c[o]+g[1-n]),l.__rectSize=i[r],d){var y={x:0,y:0};y[r]=Math.max(i[r]-c[r]-m,0),y[a]=v[a],l.setClipPath(new _3.Rect({shape:y})),l.__rectSize=y[r]}else u.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var _=this._getPageInfo(e);return null!=_.pageIndex&&_3.updateProps(s,{position:_.contentPosition},!!d&&e),this._updatePageInfoView(e,_),v},_pageGo:function(e,t,i){var n=this._getPageInfo(t)[e];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:t.id})},_updatePageInfoView:function(e,t){var i=this._controllerGroup;y3.each(["pagePrev","pageNext"],(function(n){var r=null!=t[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")}));var n=i.childOfName("pageText"),r=e.get("pageFormatter"),a=t.pageIndex,o=null!=a?a+1:0,s=t.pageCount;n&&r&&n.setStyle("text",y3.isString(r)?r.replace("{current}",o).replace("{total}",s):r({current:o,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,r=e.getOrient().index,a=T3[r],o=S3[r],s=this._findTargetItemIndex(t),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[r]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;p>=-1;--p)(v=y(l[p]))&&_(m,v.s)||!(g.i=t&&e.s<=t+n}},_findTargetItemIndex:function(e){return this._showController?(this.getContentGroup().eachChild((function(n,r){var a=n.__legendDataIndex;null==i&&null!=a&&(i=r),a===e&&(t=r)})),null!=t?t:i):0;var t,i}});h.registerAction("legendScroll","legendscroll",(function(e,t){var i=e.scrollDataIndex;null!=i&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(i)}))})),jJ.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var A3=g,I3=ne,C3=No,D3=km,E3=ZJ,L3=Uc,P3=Hc,N3=wF,R3=C3.Rect,O3=L3.linearMap,k3=L3.asc,z3=A3.bind,B3=A3.each,F3="horizontal",V3="vertical",G3=["line","bar","candlestick","scatter"],H3=E3.extend({type:"dataZoom.slider",init:function(e,t){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=t},render:function(e,t,i,n){H3.superApply(this,"render",arguments),D3.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=e.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){H3.superApply(this,"remove",arguments),D3.clear(this,"_dispatchZoomAction")},dispose:function(){H3.superApply(this,"dispose",arguments),D3.clear(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new C3.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},_resetLocation:function(){var e=this.dataZoomModel,t=this.api,i=this._findCoordRect(),n={width:t.getWidth(),height:t.getHeight()},r=this._orient===F3?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=P3.getLayoutParams(e.option);A3.each(["right","top","width","height"],(function(e){"ph"===a[e]&&(a[e]=r[e])}));var o=P3.getLayoutRect(a,n,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],this._orient===V3&&this._size.reverse()},_positionGroup:function(){var e=this.group,t=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),r=n&&n.get("inverse"),a=this._displayables.barGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==F3||r?i===F3&&r?{scale:o?[-1,1]:[-1,-1]}:i!==V3||r?{scale:o?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:o?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:o?[1,1]:[1,-1]});var s=e.getBoundingRect([a]);e.attr("position",[t.x-s.x,t.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var e=this.dataZoomModel,t=this._size,i=this._displayables.barGroup;i.add(new R3({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new R3({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:A3.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(e){var t=this._size,i=e.series,n=i.getRawData(),r=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=r){var a=n.getDataExtent(r),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],h=[[t[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/t[0]);n.each([r],(function(e,t){if(p>0&&t%p)f+=d;else{var i=null==e||isNaN(e)||""===e,n=i?0:O3(e,a,l,!0);i&&!s&&t?(h.push([h[h.length-1][0],0]),c.push([c[c.length-1][0],0])):!i&&s&&(h.push([f,0]),c.push([f,0])),h.push([f,n]),c.push([f,n]),f+=d,s=i}}));var g=this.dataZoomModel;this._displayables.barGroup.add(new C3.Polygon({shape:{points:h},style:A3.defaults({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new C3.Polyline({shape:{points:c},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var i,n=this.ecModel;return e.eachTargetAxis((function(r,a){var o=e.getAxisProxy(r.name,a).getTargetSeriesModels();A3.each(o,(function(e){if(!(i||!0!==t&&A3.indexOf(G3,e.get("type"))<0)){var o,s=n.getComponent(r.axis,a).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r.name],u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),i={thisAxis:s,series:e,thisDim:r.name,otherDim:l,otherAxisInverse:o}}}),this)}),this),i}},_renderHandle:function(){var e=this._displayables,t=e.handles=[],i=e.handleLabels=[],n=this._displayables.barGroup,r=this._size,a=this.dataZoomModel;n.add(e.filler=new R3({draggable:!0,cursor:U3(this._orient),drift:z3(this._onDragMove,this,"all"),ondragstart:z3(this._showDataInfo,this,!0),ondragend:z3(this._onDragEnd,this),onmouseover:z3(this._showDataInfo,this,!0),onmouseout:z3(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new R3({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),B3([0,1],(function(e){var r=C3.createIcon(a.get("handleIcon"),{cursor:U3(this._orient),draggable:!0,drift:z3(this._onDragMove,this,e),ondragend:z3(this._onDragEnd,this),onmouseover:z3(this._showDataInfo,this,!0),onmouseout:z3(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),o=r.getBoundingRect();this._handleHeight=L3.parsePercent(a.get("handleSize"),this._size[1]),this._handleWidth=o.width/o.height*this._handleHeight,r.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(r.style.fill=s),n.add(t[e]=r);var l=a.textStyleModel;this.group.add(i[e]=new C3.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))}),this)},_resetInterval:function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[O3(e[0],[0,100],t,!0),O3(e[1],[0,100],t,!0)]},_updateInterval:function(e,t){var i=this.dataZoomModel,n=this._handleEnds,r=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];N3(t,n,r,i.get("zoomLock")?"all":e,null!=a.minSpan?O3(a.minSpan,o,r,!0):null,null!=a.maxSpan?O3(a.maxSpan,o,r,!0):null);var s=this._range,l=this._range=k3([O3(n[0],r,o,!0),O3(n[1],r,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(e){var t=this._displayables,i=this._handleEnds,n=k3(i.slice()),r=this._size;B3([0,1],(function(e){var n=t.handles[e],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[e],r[1]/2-a/2]})}),this),t.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:r[1]}),this._updateDataInfo(e)},_updateDataInfo:function(e){var t=this.dataZoomModel,i=this._displayables,n=i.handleLabels,r=this._orient,a=["",""];if(t.get("showDetail")){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,l=this._range,u=e?o.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var h=k3(this._handleEnds.slice());function c(e){var t=C3.getTransform(i.handles[e].parent,this.group),o=C3.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=C3.applyTransform([h[e]+(0===e?-s:s),this._size[1]/2],t);n[e].setStyle({x:l[0],y:l[1],textVerticalAlign:r===F3?"middle":o,textAlign:r===F3?o:"center",text:a[e]})}c.call(this,0),c.call(this,1)},_formatLabel:function(e,t){var i=this.dataZoomModel,n=i.get("labelFormatter"),r=i.get("labelPrecision");null!=r&&"auto"!==r||(r=t.getPixelPrecision());var a=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel(Math.round(e)):e.toFixed(Math.min(r,20));return A3.isFunction(n)?n(e,a):A3.isString(n)?n.replace("{value}",a):a},_showDataInfo:function(e){e=this._dragging||e;var t=this._displayables.handleLabels;t[0].attr("invisible",!e),t[1].attr("invisible",!e)},_onDragMove:function(e,t,i,n){this._dragging=!0,I3.stop(n.event);var r=this._displayables.barGroup.getLocalTransform(),a=C3.applyTransform([t,i],r,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),o&&s&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(e){var t=this._size,i=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(i[0]<0||i[0]>t[0]||i[1]<0||i[1]>t[1])){var n=this._handleEnds,r=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-r);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:e[0],end:e[1]})},_findCoordRect:function(){var e;if(B3(this.getTargetCoordInfo(),(function(t){if(!e&&t.length){var i=t[0].model.coordinateSystem;e=i.getRect&&i.getRect()}})),!e){var t=this.api.getWidth(),i=this.api.getHeight();e={x:.2*t,y:.2*i,width:.6*t,height:.6*i}}return e}});function U3(e){return"vertical"===e?"ns-resize":"ew-resize"}jJ.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var W3={},j3=g,X3=kL,Z3=km,q3="\0_ec_dataZoom_roams";function Y3(e){var t=e.getZr();return t[q3]||(t[q3]={})}function K3(e){j3.each(e,(function(t,i){t.count||(t.controller.dispose(),delete e[i])}))}function Q3(e,t){e.dispatchAction({type:"dataZoom",batch:t})}W3.register=function(e,t){var i=Y3(e),n=t.dataZoomId,r=t.coordId;j3.each(i,(function(e,i){var a=e.dataZoomInfos;a[n]&&j3.indexOf(t.allCoordIds,r)<0&&(delete a[n],e.count--)})),K3(i);var a=i[r];a||((a=i[r]={coordId:r,dataZoomInfos:{},count:0}).controller=function(e,t){var i=new X3(e.getZr());return j3.each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(i){var n=[];j3.each(t.dataZoomInfos,(function(r){if(i.isAvailableBehavior(r.dataZoomModel.option)){var a=(r.getRange||{})[e],o=a&&a(t.controller,i);!r.dataZoomModel.get("disabled",!0)&&o&&n.push({dataZoomId:r.dataZoomId,start:o[0],end:o[1]})}})),n.length&&t.dispatchAction(n)}))})),i}(e,a),a.dispatchAction=j3.curry(Q3,e)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=t;var o,s,l,u,h,c=(o=a.dataZoomInfos,l="type_",u={type_true:2,type_move:1,type_false:0,type_undefined:-1},h=!0,j3.each(o,(function(e){var t=e.dataZoomModel,i=!t.get("disabled",!0)&&(!t.get("zoomLock",!0)||"move");u[l+i]>u[l+s]&&(s=i),h&=t.get("preventDefaultMouseMove",!0)})),{controlType:s,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!h}});a.controller.enable(c.controlType,c.opt),a.controller.setPointerChecker(t.containsPoint),Z3.createOrUpdate(a,"dispatchAction",t.dataZoomModel.get("throttle",!0),"fixRate")},W3.unregister=function(e,t){var i=Y3(e);j3.each(i,(function(e){e.controller.dispose();var i=e.dataZoomInfos;i[t]&&(delete i[t],e.count--)})),K3(i)},W3.generateCoordId=function(e){return e.type+"\0_"+e.id};var J3=g,$3=ZJ,e5=wF,t5=W3,i5=J3.bind,n5=$3.extend({type:"dataZoom.inside",init:function(e,t){this._range},render:function(e,t,i,n){n5.superApply(this,"render",arguments),this._range=e.getPercentRange(),J3.each(this.getTargetCoordInfo(),(function(t,n){var r=J3.map(t,(function(e){return t5.generateCoordId(e.model)}));J3.each(t,(function(t){var a=t.model,o={};J3.each(["pan","zoom","scrollMove"],(function(e){o[e]=i5(r5[e],this,t,n)}),this),t5.register(i,{coordId:t5.generateCoordId(a),allCoordIds:r,containsPoint:function(e,t,i){return a.coordinateSystem.containPoint([t,i])},dataZoomId:e.id,dataZoomModel:e,getRange:o})}),this)}),this)},dispose:function(){t5.unregister(this.api,this.dataZoomModel.id),n5.superApply(this,"dispose",arguments),this._range=null}}),r5={zoom:function(e,t,i,n){var r=this._range,a=r.slice(),o=e.axisModels[0];if(o){var s=o5[t](null,[n.originX,n.originY],o,i,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return e5(0,a,[0,100],0,h.minSpan,h.maxSpan),this._range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:a5((function(e,t,i,n,r,a){var o=o5[n]([a.oldX,a.oldY],[a.newX,a.newY],t,r,i);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:a5((function(e,t,i,n,r,a){return o5[n]([0,0],[a.scrollDelta,a.scrollDelta],t,r,i).signal*(e[1]-e[0])*a.scrollDelta}))};function a5(e){return function(t,i,n,r){var a=this._range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,i,n,r);return e5(l,o,[0,100],"all"),this._range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}}var o5={grid:function(e,t,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===a.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===i.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,i,n,r){var a=i.axis,o=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===a.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},s5=g,l5=s5.each;function u5(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var h5=function(e){var t=e&&e.visualMap;s5.isArray(t)||(t=t?[t]:[]),l5(t,(function(e){if(e){u5(e,"splitList")&&!u5(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&s5.isArray(t)&&l5(t,(function(e){s5.isObject(e)&&(u5(e,"start")&&!u5(e,"min")&&(e.min=e.start),u5(e,"end")&&!u5(e,"max")&&(e.max=e.end))}))}}))};Ld.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var c5=h,d5=g,f5=u0,p5=yO,g5=c5.PRIORITY.VISUAL.COMPONENT;function m5(e,t,i,n){for(var r=t.targetVisuals[n],a=p5.prepareVisualTypes(r),o={color:e.getData().getVisual("color")},s=0,l=a.length;s"],w5.isArray(e)&&(e=e.slice(),n=!0),r=t?e:n?[u(e[0]),u(e[1])]:u(e),w5.isString(l)?l.replace("{value}",n?r[0]:r).replace("{value2}",n?r[1]:r):w5.isFunction(l)?n?l(e[0],e[1]):l(e):n?e[0]===s[0]?i[0]+" "+r[1]:e[1]===s[1]?i[1]+" "+r[0]:r[0]+" - "+r[1]:r;function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},resetExtent:function(){var e=this.option,t=N5([e.min,e.max]);this._dataExtent=t},getDataDimension:function(e){var t=this.option.dimension,i=e.dimensions;if(null!=t||i.length){if(null!=t)return e.getDimension(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var a=n[r];if(!e.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var e=this.ecModel,t=this.option,i={inRange:t.inRange,outOfRange:t.outOfRange},n=t.target||(t.target={}),r=t.controller||(t.controller={});w5.merge(n,i),w5.merge(r,i);var a=this.isCategory();function o(i){L5(t.color)&&!i.inRange&&(i.inRange={color:t.color.slice().reverse()}),i.inRange=i.inRange||{color:e.get("gradientColor")},P5(this.stateList,(function(e){var t=i[e];if(w5.isString(t)){var n=S5.get(t,"active",a);n?(i[e]={},i[e][t]=n):delete i[e]}}),this)}o.call(this,n),o.call(this,r),function(e,t,i){var n=e[t],r=e[i];n&&!r&&(r=e[i]={},P5(n,(function(e,t){if(M5.isValidType(t)){var i=S5.get(t,"inactive",a);null!=i&&(r[t]=i,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,n,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,i=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,n=this.get("inactiveColor");P5(this.stateList,(function(r){var o=this.itemSize,s=e[r];s||(s=e[r]={color:a?n:[n]}),null==s.symbol&&(s.symbol=t&&w5.clone(t)||(a?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&w5.clone(i)||(a?o[0]:[o[0],o[0]])),s.symbol=D5(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;E5(l,(function(e){e>u&&(u=e)})),s.symbolSize=D5(l,(function(e){return R5(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,r)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:O5,getValueState:O5,getVisualMeta:O5}),z5=k5,B5=g,F5=z5,V5=Uc,G5=[20,140],H5=F5.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(e,t){H5.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},resetItemSize:function(){H5.superApply(this,"resetItemSize",arguments);var e=this.itemSize;"horizontal"===this._orient&&e.reverse(),(null==e[0]||isNaN(e[0]))&&(e[0]=G5[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=G5[1])},_resetRange:function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):B5.isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},completeVisualOption:function(){F5.prototype.completeVisualOption.apply(this,arguments),B5.each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=0)}),this)},setSelected:function(e){this.option.range=e.slice(),this._resetRange()},getSelected:function(){var e=this.getExtent(),t=V5.asc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=i[1]||e<=t[1])?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimension(r),(function(t,i){e[0]<=t&&t<=e[1]&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getVisualMeta:function(e){var t=U5(0,0,this.getExtent()),i=U5(0,0,this.option.range.slice()),n=[];function r(t,i){n.push({value:t,color:e(t,i)})}for(var a=0,o=0,s=i.length,l=t.length;oe[1])break;i.push({color:this.getControllerVisual(a,"color",t),offset:r/100})}return i.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),i},_createBarPoints:function(e,t){var i=this.visualMapModel.itemSize;return[[i[0]-t[0],e[0]],[i[0],e[0]],[i[0],e[1]],[i[0]-t[1],e[1]]]},_createBarGroup:function(e){var t=this._orient,i=this.visualMapModel.get("inverse");return new r4.Group("horizontal"!==t||i?"horizontal"===t&&i?{scale:"bottom"===e?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==t||i?{scale:"left"===e?[1,1]:[-1,1]}:{scale:"left"===e?[1,-1]:[-1,-1]}:{scale:"bottom"===e?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(e,t){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,r=i.handleThumbs,a=i.handleLabels;u4([0,1],(function(o){var s=r[o];s.setStyle("fill",t.handlesColor[o]),s.position[1]=e[o];var l=r4.applyTransform(i.handleLabelPoints[o],r4.getTransform(s,this.group));a[o].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[o]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===o?"bottom":"top":"left",i.barGroup)})}),this)}},_showIndicator:function(e,t,i,n){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,s=[0,o[1]],l=l4(e,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(e,t,i,n){return e?[[0,-h4(t,c4(i,0))],[6,0],[0,h4(t,c4(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,o[1]));var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=r4.applyTransform(u.indicatorLabelPoint,r4.getTransform(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+r.formatValueText(t),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var e=this;this._shapes.barGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var i=e.visualMapModel.itemSize,n=e._applyTransform([t.offsetX,t.offsetY],e._shapes.barGroup,!0,!0);n[1]=h4(c4(0,n[1]),i[1]),e._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},_enableHoverLinkFromSeries:function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(e,t){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var r=[0,n[1]],a=i.getExtent();e=h4(c4(r[0],e),r[1]);var o=function(e,t,i){var n=6,r=e.get("hoverLinkDataSize");return r&&(n=l4(r,t,i,!0)/2),n}(i,a,r),s=[e-o,e+o],l=l4(e,r,a,!0),u=[l4(s[0],r,a,!0),l4(s[1],r,a,!0)];s[0]r[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var h=this._hoverLinkDataIndices,c=[];(t||p4(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=s4.compressBatches(h,c);this._dispatchHighDown("downplay",o4.makeHighDownBatch(d[0],i)),this._dispatchHighDown("highlight",o4.makeHighDownBatch(d[1],i))}},_hoverLinkFromSeriesMouseOver:function(e){var t=e.target,i=this.visualMapModel;if(t&&null!=t.dataIndex){var n=this.ecModel.getSeriesByIndex(t.seriesIndex);if(i.isTargetSeries(n)){var r=n.getData(t.dataType),a=r.get(i.getDataDimension(r),t.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",o4.makeHighDownBatch(e,this.visualMapModel)),e.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},_applyTransform:function(e,t,i,n){var r=r4.getTransform(t,n?null:this.group);return r4[e4.isArray(e)?"applyTransform":"transformDirection"](e,r,i)},_dispatchHighDown:function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function f4(e,t,i,n){return new r4.Polygon({shape:{points:e},draggable:!!i,cursor:t,drift:i,onmousemove:function(e){i4.stop(e.event)},ondragend:n})}function p4(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function g4(e){return"vertical"===e?"ns-resize":"ew-resize"}h.registerAction({type:"selectDataRange",event:"dataRangeSelected",update:"update"},(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),h.registerPreprocessor(h5);var m4=g,v4=z5,y4=yO,_4=x5,x4=Uc.reformIntervals,b4=v4.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(e,t){b4.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();w4[this._mode].call(this),this._resetSelected(e,t);var n=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=m4.clone(n)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=m4.map(this._pieceList,(function(e){return e=m4.clone(e),"inRange"!==t&&(e.visual=null),e})))}))},completeVisualOption:function(){var e=this.option,t={},i=y4.listVisualTypes(),n=this.isCategory();function r(e,t,i){return e&&e[t]&&(m4.isObject(e[t])?e[t].hasOwnProperty(i):e[t]===i)}m4.each(e.pieces,(function(e){m4.each(i,(function(i){e.hasOwnProperty(i)&&(t[i]=1)}))})),m4.each(t,(function(t,i){var a=0;m4.each(this.stateList,(function(t){a|=r(e,t,i)||r(e.target,t,i)}),this),!a&&m4.each(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=_4.get(i,"inRange"===t?"active":"inactive",n)}))}),this),v4.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(e,t){var i=this.option,n=this._pieceList,r=(t?i:e).selected||{};if(i.selected=r,m4.each(n,(function(e,t){var i=this.getSelectedMapKey(e);r.hasOwnProperty(i)||(r[i]=!0)}),this),"single"===i.selectedMode){var a=!1;m4.each(n,(function(e,t){var i=this.getSelectedMapKey(e);r[i]&&(a?r[i]=!1:a=!0)}),this)}},getSelectedMapKey:function(e){return"categories"===this._mode?e.value+"":e.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(e){this.option.selected=m4.clone(e)},getValueState:function(e){var t=y4.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimension(r),(function(t,i){y4.findPieceIndex(t,this._pieceList)===e&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getRepresentValue:function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var i=e.interval||[];t=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return t},getVisualMeta:function(e){if(!this.isCategory()){var t=[],i=[],n=this,r=this._pieceList.slice();if(r.length){var a=r[0].interval[0];a!==-1/0&&r.unshift({interval:[-1/0,a]}),(a=r[r.length-1].interval[1])!==1/0&&r.push({interval:[a,1/0]})}else r.push({interval:[-1/0,1/0]});var o=-1/0;return m4.each(r,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:i}}function s(r,a){var o=n.getRepresentValue({interval:r});a||(a=n.getValueState(o));var s=e(o,a);r[0]===-1/0?i[0]=s:r[1]===1/0?i[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}}}),w4={splitNumber:function(){var e=this.option,t=this._pieceList,i=Math.min(e.precision,20),n=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;for(var a=(n[1]-n[0])/r;+a.toFixed(i)!==a&&i<5;)i++;e.precision=i,a=+a.toFixed(i),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,i)}),this)}};function T4(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}var S4=g,M4=K5,A4=No,I4=ow.createSymbol,C4=Hc,D4=Q5;M4.extend({type:"visualMap.piecewise",doRender:function(){var e=this.group;e.removeAll();var t=this.visualMapModel,i=t.get("textGap"),n=t.textStyleModel,r=n.getFont(),a=n.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,h=S4.retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,h,o),S4.each(l.viewPieceList,(function(n){var l=n.piece,u=new A4.Group;u.onclick=S4.bind(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=t.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new A4.Text({style:{x:"right"===o?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:o,textFont:r,textFill:a,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,h,o),C4.box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},_enableHoverLink:function(e,t){function i(e){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:e,batch:D4.makeHighDownBatch(i.findTargetDataIndices(t),i)})}e.on("mouseover",S4.bind(i,this,"highlight")).on("mouseout",S4.bind(i,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return D4.getItemAlign(e,this.api,e.itemSize);var i=t.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(e,t,i,n,r){if(t){var a=new A4.Group,o=this.visualMapModel.textStyleModel;a.add(new A4.Text({style:{x:n?"right"===r?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?r:"center",text:t,textFont:o.getFont(),textFill:o.getTextColor()}})),e.add(a)}},_getViewData:function(){var e=this.visualMapModel,t=S4.map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),i=e.get("text"),n=e.get("orient"),r=e.get("inverse");return("horizontal"===n?r:!r)?t.reverse():i&&(i=i.slice().reverse()),{viewPieceList:t,endsText:i}},_createItemSymbol:function(e,t,i){e.add(I4(this.getControllerVisual(t,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(t,"color")))},_onItemClick:function(e){var t=this.visualMapModel,i=t.option,n=S4.clone(i.selected),r=t.getSelectedMapKey(e);"single"===i.selectedMode?(n[r]=!0,S4.each(n,(function(e,t){n[t]=t===r}))):n[r]=!n[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}}),h.registerPreprocessor(h5);var E4,L4={},P4=p,N4="urn:schemas-microsoft-com:vml",R4="undefined"==typeof window?null:window,O4=!1,k4=R4&&R4.document;if(k4&&!P4.canvasSupported)try{!k4.namespaces.zrvml&&k4.namespaces.add("zrvml",N4),E4=function(e){return k4.createElement("')}}catch(m9){E4=function(e){return k4.createElement("<"+e+' xmlns="'+N4+'" class="zrvml">')}}L4.doc=k4,L4.createNode=function(e){return E4(e)},L4.initVML=function(){if(!O4&&k4){O4=!0;var e=k4.styleSheets;e.length<31?k4.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}};var z4=p,B4=V.applyTransform,F4=Pi,V4=ut,G4=Tn,H4=wn,U4=Br,W4=Wr,j4=Kr,X4=Vl,Z4=dl,q4=Ds,Y4=Wu,K4=L4,Q4=q4.CMD,J4=Math.round,$4=Math.sqrt,e6=Math.abs,t6=Math.cos,i6=Math.sin,n6=Math.max;if(!z4.canvasSupported){var r6=",",a6="progid:DXImageTransform.Microsoft",o6=21600,s6=o6/2,l6=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=o6+","+o6,e.coordorigin="0,0"},u6=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},h6=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},c6=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},d6=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},f6=H4.parsePercent,p6=function(e,t,i){var n=V4.parse(t);i=+i,isNaN(i)&&(i=1),n&&(e.color=u6(n[0],n[1],n[2]),e.opacity=i*n[3])},g6=function(e){var t=V4.parse(e);return[u6(t[0],t[1],t[2]),t[3]]},m6=function(e,t,i,n){var r="fill"===t,a=e.getElementsByTagName(t)[0];null!=i[t]&&"none"!==i[t]&&(r||!r&&i.lineWidth)?(e[r?"filled":"stroked"]="true",i[t]instanceof Y4&&c6(e,a),a||(a=K4.createNode(t)),r?function(e,t,i){var n=t.fill;if(null!=n)if(n instanceof Y4){var r,a=0,o=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){r="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(B4(f,f,d),B4(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{r="gradientradial",f=[n.x*h,n.y*c],d=i.transform;var v=i.scale,y=h,_=c;o=[(f[0]-u.x)/y,(f[1]-u.y)/_],d&&B4(f,f,d),y/=v[0]*o6,_/=v[1]*o6;var x=n6(y,_);s=0/x,l=2*n.r/x-s}var b=n.colorStops.slice();b.sort((function(e,t){return e.offset-t.offset}));for(var w=b.length,T=[],S=[],M=0;M=2){var C=T[0][0],D=T[1][0],E=T[0][1]*t.opacity,L=T[1][1]*t.opacity;e.type=r,e.method="none",e.focus="100%",e.angle=a,e.color=C,e.color2=D,e.colors=S.join(","),e.opacity=L,e.opacity2=E}"radial"===r&&(e.focusposition=o.join(","))}else p6(e,n,t.opacity)}(a,i,n):function(e,t){t.lineDash&&(e.dashstyle=t.lineDash.join(" ")),null==t.stroke||t.stroke instanceof Y4||p6(e,t.stroke,t.opacity)}(a,i),h6(e,a)):(e[r?"filled":"stroked"]="false",c6(e,a))},v6=[[],[],[]];Z4.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=K4.createNode("shape"),l6(i),this._vmlEl=i),m6(i,"fill",t,this),m6(i,"stroke",t,this);var n=this.transform,r=null!=n,a=i.getElementsByTagName("stroke")[0];if(a){var o=t.lineWidth;if(r&&!t.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];o*=$4(e6(s))}a.weight=o+"px"}var l=this.path||(this.path=new q4);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(e,t){var i,n,r,a,o,s,l=Q4.M,u=Q4.C,h=Q4.L,c=Q4.A,d=Q4.Q,f=[],p=e.data,g=e.len();for(a=0;a.01?N&&(R+=270/o6):Math.abs(O-C)<1e-4?N&&RI?_-=270/o6:_+=270/o6:N&&OC?y+=270/o6:y-=270/o6),f.push(k,J4(((I-D)*S+w)*o6-s6),r6,J4(((C-E)*M+T)*o6-s6),r6,J4(((I+D)*S+w)*o6-s6),r6,J4(((C+E)*M+T)*o6-s6),r6,J4((R*S+w)*o6-s6),r6,J4((O*M+T)*o6-s6),r6,J4((y*S+w)*o6-s6),r6,J4((_*M+T)*o6-s6)),o=y,s=_;break;case Q4.R:var z=v6[0],B=v6[1];z[0]=p[a++],z[1]=p[a++],B[0]=z[0]+p[a++],B[1]=z[1]+p[a++],t&&(B4(z,z,t),B4(B,B,t)),z[0]=J4(z[0]*o6-s6),B[0]=J4(B[0]*o6-s6),z[1]=J4(z[1]*o6-s6),B[1]=J4(B[1]*o6-s6),f.push(" m ",z[0],r6,z[1]," l ",B[0],r6,z[1]," l ",B[0],r6,B[1]," l ",z[0],r6,B[1]);break;case Q4.Z:f.push(" x ")}if(i>0){f.push(n);for(var F=0;F100&&(b6=0,x6={});var i,n=w6.style;try{n.font=e,i=n.fontFamily.split(",")[0]}catch(m9){}t={style:n.fontStyle||_6,variant:n.fontVariant||_6,weight:n.fontWeight||_6,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},x6[e]=t,b6++}return t}(r.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||G4.getBoundingRect(a,m,f,p,r.textPadding,r.textLineHeight);var v=this.transform;if(v&&!n&&(T6.copy(t),T6.applyTransform(v),t=T6),n)c=t.x,d=t.y;else{var y=r.textPosition;if(y instanceof Array)c=t.x+f6(y[0],t.width),d=t.y+f6(y[1],t.height),f=f||"left";else{var _=this.calculateTextPosition?this.calculateTextPosition({},r,t):G4.calculateTextPosition({},r,t);c=_.x,d=_.y,f=f||_.textAlign,p=p||_.textVerticalAlign}}c=G4.adjustTextX(c,i.width,f),d=G4.adjustTextY(d,i.height,p),d+=i.height/2;var x,b,w,T=K4.createNode,S=this._textVmlEl;S?b=(x=(w=S.firstChild).nextSibling).nextSibling:(S=T("line"),x=T("path"),b=T("textpath"),w=T("skew"),b.style["v-text-align"]="left",l6(S),x.textpathok=!0,b.on=!0,S.from="0 0",S.to="1000 0.05",h6(S,w),h6(S,x),h6(S,b),this._textVmlEl=S);var M=[c,d],A=S.style;v&&n?(B4(M,M,v),w.on=!0,w.matrix=v[0].toFixed(3)+r6+v[2].toFixed(3)+r6+v[1].toFixed(3)+r6+v[3].toFixed(3)+",0,0",w.offset=(J4(M[0])||0)+","+(J4(M[1])||0),w.origin="0 0",A.left="0px",A.top="0px"):(w.on=!1,A.left=J4(c)+"px",A.top=J4(d)+"px"),b.string=String(a).replace(/&/g,"&").replace(/"/g,""");try{b.style.font=m}catch(m9){}m6(S,"fill",{fill:r.textFill,opacity:r.opacity},this),m6(S,"stroke",{stroke:r.textStroke,opacity:r.opacity,lineDash:r.lineDash||null},this),S.style.zIndex=d6(this.zlevel,this.z,this.z2),h6(e,S)}},M6=function(e){c6(e,this._textVmlEl),this._textVmlEl=null},A6=function(e){h6(e,this._textVmlEl)},I6=[U4,W4,j4,Z4,X4],C6=0;C6-1e-4}function i8(e,t){t&&n8(e,"transform","matrix("+j6.call(t,",")+")")}function n8(e,t,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&e.setAttribute(t,i)}function r8(e,t,i,n){if(function(e,t){var i=t?e.textFill:e.fill;return null!=i&&i!==X6}(t,i)){var r=i?t.textFill:t.fill;n8(e,"fill",r="transparent"===r?X6:r),n8(e,"fill-opacity",null!=t.fillOpacity?t.fillOpacity*t.opacity:t.opacity)}else n8(e,"fill",X6);if(function(e,t){var i=t?e.textStroke:e.stroke;return null!=i&&i!==X6}(t,i)){var a=i?t.textStroke:t.stroke;n8(e,"stroke",a="transparent"===a?X6:a),n8(e,"stroke-width",(i?t.textStrokeWidth:t.lineWidth)/(!i&&t.strokeNoScale?n.getLineScale():1)),n8(e,"paint-order",i?"stroke":"fill"),n8(e,"stroke-opacity",null!=t.strokeOpacity?t.strokeOpacity:t.opacity),t.lineDash?(n8(e,"stroke-dasharray",t.lineDash.join(",")),n8(e,"stroke-dashoffset",Z6(t.lineDashOffset||0))):n8(e,"stroke-dasharray",""),t.lineCap&&n8(e,"stroke-linecap",t.lineCap),t.lineJoin&&n8(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&n8(e,"stroke-miterlimit",t.miterLimit)}else n8(e,"stroke",X6)}var a8={brush:function(e){var t=e.style,i=e.__svgEl;i||(i=B6("path"),e.__svgEl=i),e.path||e.createPathProxy();var n=e.path;if(e.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,e.buildPath(n,e.shape),e.__dirtyPath=!1;var r=function(e){for(var t=[],i=e.data,n=e.len(),r=0;r=Q6:-d>=Q6),v=d>0?d%Q6:d%Q6+Q6,y=!1;y=!!m||!t8(g)&&v>=K6==!!p;var _=e8(s+u*Y6(c)),x=e8(l+h*q6(c));m&&(d=p?Q6-1e-4:1e-4-Q6,y=!0,9===r&&t.push("M",_,x));var b=e8(s+u*Y6(c+d)),w=e8(l+h*q6(c+d));t.push("A",e8(u),e8(h),Z6(f*J6),+y,+p,b,w);break;case W6.Z:a="Z";break;case W6.R:b=e8(i[r++]),w=e8(i[r++]);var T=e8(i[r++]),S=e8(i[r++]);t.push("M",b,w,"L",b+T,w,"L",b+T,w+S,"L",b,w+S,"L",b,w)}a&&t.push(a);for(var M=0;MA){for(;S=r&&u+1>=a){for(var h=[],c=0;c=r&&c+1>=a)return m8(0,s.components);l[i]=s}else l[i]=void 0}o++}for(;o<=s;){var f=d();if(f)return f}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var r=t.length,a=i.length,o=e.newPos,s=o-n,l=0;o+1=0;--n)if(t[n]===e)return!0;return!1}),i):null:i[0]},D8.prototype.update=function(e,t){if(e){var i=this.getDefs(!1);if(e[this._domName]&&i.contains(e[this._domName]))"function"==typeof t&&t(e);else{var n=this.add(e);n&&(e[this._domName]=n)}}},D8.prototype.addDom=function(e){this.getDefs(!0).appendChild(e)},D8.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},D8.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return b8.each(this._tagNames,(function(i){var n=e.getElementsByTagName(i);t=t.concat([].slice.call(n))})),t},D8.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;b8.each(e,(function(e){e[t._markLabel]="0"}))},D8.prototype.markUsed=function(e){e&&(e[this._markLabel]="1")},D8.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;b8.each(t,(function(t){"1"!==t[i._markLabel]&&e.removeChild(t)}))}},D8.prototype.getSvgProxy=function(e){return e instanceof w8?A8:e instanceof T8?I8:e instanceof S8?C8:A8},D8.prototype.getTextSvgElement=function(e){return e.__textSvgEl},D8.prototype.getSvgElement=function(e){return e.__svgEl};var E8=D8,L8=E8,P8=g,N8=ni,R8=ut;function O8(e,t){L8.call(this,e,t,["linearGradient","radialGradient"],"__gradient_in_use__")}P8.inherits(O8,L8),O8.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var i=this;P8.each(["fill","stroke"],(function(n){if(t.style[n]&&("linear"===t.style[n].type||"radial"===t.style[n].type)){var r,a=t.style[n],o=i.getDefs(!0);a._dom?(r=a._dom,o.contains(a._dom)||i.addDom(r)):r=i.add(a),i.markUsed(t);var s=r.getAttribute("id");e.setAttribute(n,"url(#"+s+")")}}))}},O8.prototype.add=function(e){var t;if("linear"===e.type)t=this.createElement("linearGradient");else{if("radial"!==e.type)return N8("Illegal gradient type."),null;t=this.createElement("radialGradient")}return e.id=e.id||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-gradient-"+e.id),this.updateDom(e,t),this.addDom(t),t},O8.prototype.update=function(e){var t=this;L8.prototype.update.call(this,e,(function(){var i=e.type,n=e._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?t.updateDom(e,e._dom):(t.removeDom(e),t.add(e))}))},O8.prototype.updateDom=function(e,t){if("linear"===e.type)t.setAttribute("x1",e.x),t.setAttribute("y1",e.y),t.setAttribute("x2",e.x2),t.setAttribute("y2",e.y2);else{if("radial"!==e.type)return void N8("Illegal gradient type.");t.setAttribute("cx",e.x),t.setAttribute("cy",e.y),t.setAttribute("r",e.r)}e.global?t.setAttribute("gradientUnits","userSpaceOnUse"):t.setAttribute("gradientUnits","objectBoundingBox"),t.innerHTML="";for(var i=e.colorStops,n=0,r=i.length;n-1){var s=R8.parse(o)[3],l=R8.toHex(o);a.setAttribute("stop-color","#"+l),a.setAttribute("stop-opacity",s)}else a.setAttribute("stop-color",i[n].color);t.appendChild(a)}e._dom=t},O8.prototype.markUsed=function(e){if(e.style){var t=e.style.fill;t&&t._dom&&L8.prototype.markUsed.call(this,t._dom),(t=e.style.stroke)&&t._dom&&L8.prototype.markUsed.call(this,t._dom)}};var k8=O8,z8=E8,B8=g,F8=Ue;function V8(e,t){z8.call(this,e,t,"clipPath","__clippath_in_use__")}B8.inherits(V8,z8),V8.prototype.update=function(e){var t=this.getSvgElement(e);t&&this.updateDom(t,e.__clipPaths,!1);var i=this.getTextSvgElement(e);i&&this.updateDom(i,e.__clipPaths,!0),this.markUsed(e)},V8.prototype.updateDom=function(e,t,i){if(t&&t.length>0){var n,r,a=this.getDefs(!0),o=t[0],s=i?"_textDom":"_dom";o[s]?(r=o[s].getAttribute("id"),n=o[s],a.contains(n)||a.appendChild(n)):(r="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",r),a.appendChild(n),o[s]=n);var l=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var u=Array.prototype.slice.call(o.transform);F8.mul(o.transform,o.parent.invTransform,o.transform),l.brush(o),o.transform=u}else l.brush(o);var h=this.getSvgElement(o);n.innerHTML="",n.appendChild(h.cloneNode()),e.setAttribute("clip-path","url(#"+r+")"),t.length>1&&this.updateDom(n,t.slice(1),i)}else e&&e.setAttribute("clip-path","none")},V8.prototype.markUsed=function(e){var t=this;e.__clipPaths&&B8.each(e.__clipPaths,(function(e){e._dom&&z8.prototype.markUsed.call(t,e._dom),e._textDom&&z8.prototype.markUsed.call(t,e._textDom)}))};var G8=V8,H8=E8;function U8(e,t){H8.call(this,e,t,["filter"],"__filter_in_use__","_shadowDom")}function W8(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY||e.textShadowBlur||e.textShadowOffsetX||e.textShadowOffsetY)}g.inherits(U8,H8),U8.prototype.addWithoutUpdate=function(e,t){if(t&&W8(t.style)){var i;t._shadowDom?(i=t._shadowDom,this.getDefs(!0).contains(t._shadowDom)||this.addDom(i)):i=this.add(t),this.markUsed(t);var n=i.getAttribute("id");e.style.filter="url(#"+n+")"}},U8.prototype.add=function(e){var t=this.createElement("filter");return e._shadowDomId=e._shadowDomId||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-shadow-"+e._shadowDomId),this.updateDom(e,t),this.addDom(t),t},U8.prototype.update=function(e,t){if(W8(t.style)){var i=this;H8.prototype.update.call(this,t,(function(){i.updateDom(t,t._shadowDom)}))}else this.remove(e,t)},U8.prototype.remove=function(e,t){null!=t._shadowDomId&&(this.removeDom(e),e.style.filter="")},U8.prototype.updateDom=function(e,t){var i=t.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,r,a,o,s=e.style,l=e.scale&&e.scale[0]||1,u=e.scale&&e.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,r=s.shadowOffsetY||0,a=s.shadowBlur,o=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(t,s);n=s.textShadowOffsetX||0,r=s.textShadowOffsetY||0,a=s.textShadowBlur,o=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",r/u),i.setAttribute("flood-color",o);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width",Math.ceil(a/2*200)+"%"),t.setAttribute("height",Math.ceil(a/2*200)+"%"),t.appendChild(i),e._shadowDom=t},U8.prototype.markUsed=function(e){e._shadowDom&&H8.prototype.markUsed.call(this,e._shadowDom)};var j8=U8,X8=z6.createElement,Z8=g,q8=ni,Y8=dl,K8=Kr,Q8=Vl,J8=_8,$8=k8,e9=G8,t9=j8,i9=k6,n9=i9.path,r9=i9.image,a9=i9.text;function o9(e){return parseInt(e,10)}function s9(e,t){return t&&e&&t.parentNode!==e}function l9(e,t,i){if(s9(e,t)&&i){var n=i.nextSibling;n?e.insertBefore(t,n):e.appendChild(t)}}function u9(e,t){if(s9(e,t)){var i=e.firstChild;i?e.insertBefore(t,i):e.appendChild(t)}}function h9(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function c9(e){return e.__textSvgEl}function d9(e){return e.__svgEl}var f9=function(e,t,i,n){this.root=e,this.storage=t,this._opts=i=Z8.extend({},i||{});var r=X8("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;";var a=X8("g");r.appendChild(a);var o=X8("g");r.appendChild(o),this.gradientManager=new $8(n,o),this.clipPathManager=new e9(n,o),this.shadowManager=new t9(n,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=r,this._svgRoot=o,this._backgroundRoot=a,this._viewport=s,e.appendChild(s),s.appendChild(r),this.resize(i.width,i.height),this._visibleList=[]};f9.prototype={constructor:f9,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},setBackgroundColor:function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=X8("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},_paintList:function(e){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var t,i,n=this._svgRoot,r=this._visibleList,a=e.length,o=[];for(t=0;t=0;--n)if(i[n]===e)return!0;return!1}),t):null:t[0]},resize:function(e,t){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var r=i.style;r.width=e+"px",r.height=t+"px";var a=this._svgDom;a.setAttribute("width",e),a.setAttribute("height",t)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||o9(s[i])||o9(o.style[i]))-(o9(s[r])||0)-(o9(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/>\n\r<"))}},Z8.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(e){var t;f9.prototype[e]=(t=e,function(){q8('In SVG mode painter not support method "'+t+'"')})}));var p9,g9=f9;(0,c.registerPainter)("svg",g9),function(e){var t=h;!function(){for(var i in t){if(null==t||!t.hasOwnProperty(i)||"default"===i||"__esModule"===i)return;e[i]=t[i]}}();var i=Oy;!function(){for(var t in i){if(null==i||!i.hasOwnProperty(t)||"default"===t||"__esModule"===t)return;e[t]=i[t]}}()}(u),e("e",t(u)),p9=function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=106)}([function(t,i){t.exports=e},function(e,t,i){var n=i(40),r=i(52),a=i(5),o=i(4),s=i(8),l=i(19),u=i(35),h=i(15),c=i(0),d=i.n(c),f=i(36),p=i(60),g=i.n(p),m=i(61),v=i(124),y=i(125),_=i(129),x=i(130),b=i(2),w=i(132),T=i(43),S=i(76),M=i(133),A=i(134),I=i(135),C=i(136),D=i(41),E=i(37),L=i(26),P=i(3),N=i(137),R=i(56),O=i(138),k=i(139),z=i(140),B=i(9),F=i(74),V=i(54),G=i(18),H=i(59),U=i(141),W=i(146),j=i(71),X=i(147),Z=i(148),q=i(149),Y=i(150),K=i(151),Q=i(152);function J(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}d.a.util.extend(u.a.prototype,U.a),s.a.import(W.a),s.a.import(j.a),s.a.import(X.a),s.a.import(Z.a),s.a.import(q.a),s.a.import(Y.a),s.a.import(K.a),s.a.import(Q.a);var $=f.a.prototype.addToScene,ee=f.a.prototype.removeFromScene;f.a.prototype.addToScene=function(e){if($.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,i,n){if(this.shader){var r,a,o=i.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(e),(a=t)&&"none"!==a&&(r=te.loadTexture(t,i,n,(function(t){s.enableTexture(e),o&&o.refresh()})),s.set(e,r)),r}};var te={};te.Renderer=r.a,te.Node=u.a,te.Mesh=n.a,te.Shader=s.a,te.Material=l.a,te.Texture=o.a,te.Texture2D=a.a,te.Geometry=h.a,te.SphereGeometry=w.a,te.PlaneGeometry=T.a,te.CubeGeometry=S.a,te.AmbientLight=M.a,te.DirectionalLight=A.a,te.PointLight=I.a,te.SpotLight=C.a,te.PerspectiveCamera=D.a,te.OrthographicCamera=E.a,te.Vector2=L.a,te.Vector3=P.a,te.Vector4=N.a,te.Quaternion=R.a,te.Matrix2=O.a,te.Matrix2d=k.a,te.Matrix3=z.a,te.Matrix4=B.a,te.Plane=F.a,te.Ray=V.a,te.BoundingBox=G.a,te.Frustum=H.a;var ie=m.a.createBlank("rgba(255,255,255,0)").image;function ne(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function re(e){if((e.wrapS===o.a.REPEAT||e.wrapT===o.a.REPEAT)&&e.image){var t=ne(e.width),i=ne(e.height);if(t!==e.width||i!==e.height){var n=document.createElement("canvas");n.width=t,n.height=i,n.getContext("2d").drawImage(e.image,0,0,t,i),e.image=n}}}te.loadTexture=function(e,t,i,n){"function"==typeof i&&(n=i,i={}),i=i||{};for(var r=Object.keys(i).sort(),a="",o=0;o3?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 i=e/180*Math.PI+Math.PI/2,n=-t/180*Math.PI+Math.PI/2,r=[],a=Math.sin(i);return r[0]=a*Math.cos(n),r[1]=-Math.cos(i),r[2]=a*Math.sin(n),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=s.a.source(e+".vertex"),i=s.a.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),i||console.error("Fragment shader of '%s' not exits",e);var n=new s.a(t,i);return n.name=e,n},te.createMaterial=function(e,t){t instanceof Array||(t=[t]);var i=te.createShader(e),n=new l.a({shader:i});return t.forEach((function(e){"string"==typeof e&&n.define(e)})),n},te.setMaterialFromModel=function(e,t,i,n){t.autoUpdateTextureStatus=!1;var r=i.getModel(e+"Material"),a=r.get("detailTexture"),o=b.a.firstNotNull(r.get("textureTiling"),1),s=b.a.firstNotNull(r.get("textureOffset"),0);"number"==typeof o&&(o=[o,o]),"number"==typeof s&&(s=[s,s]);var l=o[0]>1||o[1]>1?te.Texture.REPEAT:te.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var h=r.get("roughness"),c=r.get("metalness");null!=c?isNaN(c)&&(t.setTextureImage("metalnessMap",c,n,u),c=b.a.firstNotNull(r.get("metalnessAdjust"),.5)):c=0,null!=h?isNaN(h)&&(t.setTextureImage("roughnessMap",h,n,u),h=b.a.firstNotNull(r.get("roughnessAdjust"),.5)):h=.5;var d=r.get("normalTexture");t.setTextureImage("detailMap",a,n,u),t.setTextureImage("normalMap",d,n,u),t.set({roughness:h,metalness:c,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",a,n,u),t.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",a,n,u),t.set({detailUvRepeat:o,detailUvOffset:s});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],n,{anisotropic:8,wrapS:te.Texture.REPEAT,wrapT:te.Texture.REPEAT});t.set({detailUvRepeat:o,detailUvOffset:s})}},te.updateVertexAnimation=function(e,t,i,n){var r=n.get("animation"),a=n.get("animationDurationUpdate"),o=n.get("animationEasingUpdate"),s=i.shadowDepthMaterial;if(r&&t&&a>0&&t.geometry.vertexCount===i.geometry.vertexCount){i.material.define("vertex","VERTEX_ANIMATION"),i.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;li?i:e}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i,r){n.a.set(e.array,t,i,r),e._dirty=!0},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.cross=function(e,t,i){return n.a.cross(e.array,t.array,i.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat3=function(e,t,i){return n.a.transformMat3(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},r.transformQuat=function(e,t,i){return n.a.transformQuat(e.array,t.array,i.array),e._dirty=!0,e};var l=Math.atan2,u=Math.asin,h=Math.abs;r.eulerFromQuat=function(e,t,i){e._dirty=!0,t=t.array;var n=e.array,r=t[0],a=t[1],o=t[2],h=t[3],c=r*r,d=a*a,f=o*o,p=h*h;switch(i=(i||"XYZ").toUpperCase()){case"XYZ":n[0]=l(2*(r*h-a*o),p-c-d+f),n[1]=u(s(2*(r*o+a*h),-1,1)),n[2]=l(2*(o*h-r*a),p+c-d-f);break;case"YXZ":n[0]=u(s(2*(r*h-a*o),-1,1)),n[1]=l(2*(r*o+a*h),p-c-d+f),n[2]=l(2*(r*a+o*h),p-c+d-f);break;case"ZXY":n[0]=u(s(2*(r*h+a*o),-1,1)),n[1]=l(2*(a*h-o*r),p-c-d+f),n[2]=l(2*(o*h-r*a),p-c+d-f);break;case"ZYX":n[0]=l(2*(r*h+o*a),p-c-d+f),n[1]=u(s(2*(a*h-r*o),-1,1)),n[2]=l(2*(r*a+o*h),p+c-d-f);break;case"YZX":n[0]=l(2*(r*h-o*a),p-c+d-f),n[1]=l(2*(a*h-r*o),p+c-d-f),n[2]=u(s(2*(r*a+o*h),-1,1));break;case"XZY":n[0]=l(2*(r*h+a*o),p-c+d-f),n[1]=l(2*(r*o+a*h),p+c-d-f),n[2]=u(s(2*(o*h-r*a),-1,1));break;default:console.warn("Unkown order: "+i)}return e},r.eulerFromMat3=function(e,t,i){var n=t.array,r=n[0],a=n[3],o=n[6],c=n[1],d=n[4],f=n[7],p=n[2],g=n[5],m=n[8],v=e.array;switch(i=(i||"XYZ").toUpperCase()){case"XYZ":v[1]=u(s(o,-1,1)),h(o)<.99999?(v[0]=l(-f,m),v[2]=l(-a,r)):(v[0]=l(g,d),v[2]=0);break;case"YXZ":v[0]=u(-s(f,-1,1)),h(f)<.99999?(v[1]=l(o,m),v[2]=l(c,d)):(v[1]=l(-p,r),v[2]=0);break;case"ZXY":v[0]=u(s(g,-1,1)),h(g)<.99999?(v[1]=l(-p,m),v[2]=l(-a,d)):(v[1]=0,v[2]=l(c,r));break;case"ZYX":v[1]=u(-s(p,-1,1)),h(p)<.99999?(v[0]=l(g,m),v[2]=l(c,r)):(v[0]=0,v[2]=l(-a,d));break;case"YZX":v[2]=u(s(c,-1,1)),h(c)<.99999?(v[0]=l(-f,d),v[1]=l(-p,r)):(v[0]=0,v[1]=l(o,m));break;case"XZY":v[2]=u(-s(a,-1,1)),h(a)<.99999?(v[0]=l(g,d),v[1]=l(o,r)):(v[0]=l(-f,m),v[1]=0);break;default:console.warn("Unkown order: "+i)}return e._dirty=!0,e},Object.defineProperties(r,{POSITIVE_X:{get:function(){return new r(1,0,0)}},NEGATIVE_X:{get:function(){return new r(-1,0,0)}},POSITIVE_Y:{get:function(){return new r(0,1,0)}},NEGATIVE_Y:{get:function(){return new r(0,-1,0)}},POSITIVE_Z:{get:function(){return new r(0,0,1)}},NEGATIVE_Z:{get:function(){return new r(0,0,-1)}},UP:{get:function(){return new r(0,1,0)}},ZERO:{get:function(){return new r}}}),t.a=r},function(e,t,i){var n=i(7),r=i(11),a=i(57),o=n.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,__used:0},(function(){this._cache=new a.a}),{getWebGLTexture:function(e){var t=e.gl,i=this._cache;return i.use(e.__uid__),i.miss("webgl_texture")&&i.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):i.isDirty()&&(this.update(e),i.fresh()),i.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 i=e.getGLExtension("EXT_sRGB");this.format!==o.SRGB||i||(this.format=o.RGB),this.format!==o.SRGB_ALPHA||i||(this.format=o.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 i=t.get("webgl_texture");i&&e.gl.deleteTexture(i),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),o.BYTE=r.a.BYTE,o.UNSIGNED_BYTE=r.a.UNSIGNED_BYTE,o.SHORT=r.a.SHORT,o.UNSIGNED_SHORT=r.a.UNSIGNED_SHORT,o.INT=r.a.INT,o.UNSIGNED_INT=r.a.UNSIGNED_INT,o.FLOAT=r.a.FLOAT,o.HALF_FLOAT=36193,o.UNSIGNED_INT_24_8_WEBGL=34042,o.DEPTH_COMPONENT=r.a.DEPTH_COMPONENT,o.DEPTH_STENCIL=r.a.DEPTH_STENCIL,o.ALPHA=r.a.ALPHA,o.RGB=r.a.RGB,o.RGBA=r.a.RGBA,o.LUMINANCE=r.a.LUMINANCE,o.LUMINANCE_ALPHA=r.a.LUMINANCE_ALPHA,o.SRGB=35904,o.SRGB_ALPHA=35906,o.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,o.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,o.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,o.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,o.NEAREST=r.a.NEAREST,o.LINEAR=r.a.LINEAR,o.NEAREST_MIPMAP_NEAREST=r.a.NEAREST_MIPMAP_NEAREST,o.LINEAR_MIPMAP_NEAREST=r.a.LINEAR_MIPMAP_NEAREST,o.NEAREST_MIPMAP_LINEAR=r.a.NEAREST_MIPMAP_LINEAR,o.LINEAR_MIPMAP_LINEAR=r.a.LINEAR_MIPMAP_LINEAR,o.REPEAT=r.a.REPEAT,o.CLAMP_TO_EDGE=r.a.CLAMP_TO_EDGE,o.MIRRORED_REPEAT=r.a.MIRRORED_REPEAT,t.a=o},function(e,t,i){var n=i(4),r=i(11),a=i(14),o=i(73).a.isPowerOfTwo;function s(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var l=n.a.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var i=this.format,a=this.type,o=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==n.a.REPEAT&&this.wrapT!==n.a.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,o?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,o?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,o?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,o?this.minFilter:this.getAvailableMinFilter());var s=e.getGLExtension("EXT_texture_filter_anisotropic");if(s&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,s.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===a&&(e.getGLExtension("OES_texture_half_float")||(a=r.a.FLOAT)),this.mipmaps.length)for(var l=this.width,u=this.height,h=0;h=n.a.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,i,o,r,a,0,t.pixels):e.texImage2D(e.TEXTURE_2D,i,o,r,a,0,o,l,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(){return o(this.width)&&o(this.height)},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 i=a.a.createImage();t&&(i.crossOrigin=t);var n=this;return i.onload=function(){n.dirty(),n.trigger("success",n),i.onload=null},i.onerror=function(){n.trigger("error",n),i.onerror=null},i.src=e,this.image=i,this}});Object.defineProperty(l.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(l.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=l},function(e,t,i){var n=i(161);t.a=n.a},function(e,t,i){var n=i(110),r=i(53),a=i(23),o=function(){this.__uid__=a.a.genGUID()};o.__initializers__=[function(e){a.a.extend(this,e)}],a.a.extend(o,n.a),a.a.extend(o.prototype,r.a),t.a=o},function(e,t,i){var n=i(23),r=i(14),a=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,o=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,s=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,l={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"};function u(e){for(var t=[],i=0;i=0){if(1!==l&&4!==l){y();break}l=2,h=[]}else if(1!==l)if(4!==l)p(g),l=0;else{var m=g;c.indexOf(m)>=0||d.indexOf(m)>=0||f.indexOf(m)>=0?u[s].semantic=m:"ignore"===m||"unconfigurable"===m?u[s].ignore=!0:u[s].value="bool"===e?"true"===m:parseFloat(m)}else u[s].value="bool"===e?"true"===g:parseFloat(g),h=null;else{if(2!==l){y();break}if(!(h instanceof Array)){y();break}h.push(+n[++o])}else u[s].value=new r.a.Float32Array(h),h=null,l=5;else if(2===l){if(!(h instanceof Array)){y();break}h.push(+n[++o])}else l=5;else l=4;else{if(0!==l&&3!==l){y();break}l=1}}return u}function x(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),e=v(e),t=v(t),this._shaderID=function(e,t){var i="vertex:"+e+"fragment:"+t;if(g[i])return g[i];var r=n.a.genGUID();return g[i]=r,m[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=x.parseImport(e),this._fragmentCode=x.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()}x.prototype={constructor:x,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var i=this.uniformTemplates[t];e[t]={type:i.type,value:i.value()}}return e},_parseImport:function(){this._vertexCode=x.parseImport(this.vertex),this._fragmentCode=x.parseImport(this.fragment)},_addSemanticUniform:function(e,t,i){if(c.indexOf(i)>=0)this.attributeSemantics[i]={symbol:e,type:t};else if(f.indexOf(i)>=0){var n=!1,r=i;i.match(/TRANSPOSE$/)&&(n=!0,r=i.slice(0,-9)),this.matrixSemantics[i]={symbol:e,type:t,isTranspose:n,semanticNoTranspose:r}}else d.indexOf(i)>=0&&(this.uniformSemantics[i]={symbol:e,type:t})},_addMaterialUniform:function(e,t,i,n,r,a){a[e]={type:i,value:r?h.array:n||h[t],semantic:null}},_parseUniforms:function(){var e={},t=this;function i(e){return null!=e?function(){return e}:null}function n(n,r,a){var o=_(r,a),s=[];for(var u in o){var h=o[u],c=h.semantic,d=u,f=l[r],p=i(o[u].value);o[u].isArray&&(d+="["+o[u].arraySize+"]",f+="v"),s.push(d),t._uniformList.push(u),h.ignore||("sampler2D"!==r&&"samplerCube"!==r||(t.textures[u]={shaderType:"fragment",type:r}),c?t._addSemanticUniform(u,f,c):t._addMaterialUniform(u,r,f,p,o[u].isArray,e))}return s.length>0?"uniform "+r+" "+s.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(a,n),this._fragmentCode=this._fragmentCode.replace(a,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(o,(function(i,n,r){var a=_(n,r),o=p[n]||1,s=[];for(var l in a){var u=a[l].semantic;if(e[l]={type:"float",size:o,semantic:u||null},u){if(c.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:l,type:n}}s.push(l)}return"attribute "+n+" "+s.join(",")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this;function t(t,i,n){var r=e.fragmentDefines;return r[i]||(r[i]="false"!==n&&("true"===n||(n?isNaN(parseFloat(n))?n.trim():parseFloat(n):null))),""}this._vertexCode=this._vertexCode.replace(s,t),this._fragmentCode=this._fragmentCode.replace(s,t)},clone:function(){var e=m[this._shaderID];return new x(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(x.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(x.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(x.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(x.prototype,"uniforms",{get:function(){return this._uniformList}}));var b=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;x.parseImport=function(e){return e=e.replace(b,(function(e,t,i){return(e=x.source(i))?x.parseImport(e):(console.error('Shader chunk "'+i+'" not existed in library'),"")}))};var w=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;x.import=function(e){e.replace(w,(function(e,t,i,n){if(n=n.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,a=i.split("."),o=x.codes,s=0;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},a.cross=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2];return e[0]=r*l-a*s,e[1]=a*o-n*l,e[2]=n*s-r*o,e},a.lerp=function(e,t,i,n){var r=t[0],a=t[1],o=t[2];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=o+n*(i[2]-o),e},a.random=function(e,t){t=t||1;var i=2*Object(r.c)()*Math.PI,n=2*Object(r.c)()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(i)*a,e[1]=Math.sin(i)*a,e[2]=n*t,e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[3]*n+i[7]*r+i[11]*a+i[15];return o=o||1,e[0]=(i[0]*n+i[4]*r+i[8]*a+i[12])/o,e[1]=(i[1]*n+i[5]*r+i[9]*a+i[13])/o,e[2]=(i[2]*n+i[6]*r+i[10]*a+i[14])/o,e},a.transformMat3=function(e,t,i){var n=t[0],r=t[1],a=t[2];return e[0]=n*i[0]+r*i[3]+a*i[6],e[1]=n*i[1]+r*i[4]+a*i[7],e[2]=n*i[2]+r*i[5]+a*i[8],e},a.transformQuat=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2],u=i[3],h=u*n+s*a-l*r,c=u*r+l*n-o*a,d=u*a+o*r-s*n,f=-o*n-s*r-l*a;return e[0]=h*u+f*-o+c*-l-d*-s,e[1]=c*u+f*-s+d*-o-h*-l,e[2]=d*u+f*-l+h*-s-c*-o,e},a.rotateX=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[0],a[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),a[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.rotateY=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),a[1]=r[1],a[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.rotateZ=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),a[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),a[2]=r[2],e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=3),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s1?0:Math.acos(r)},t.a=a},function(e,t){var i={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},n={"[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,o=a.forEach,s=a.filter,l=a.slice,u=a.map,h=a.reduce,c={};function d(e){if(null==e||"object"!=typeof e)return e;var t=e,a=r.call(e);if("[object Array]"===a){if(!S(e)){t=[];for(var o=0,s=e.length;os[0]&&(s[0]=u),h>s[1]&&(s[1]=h),c>s[2]&&(s[2]=c)}i._dirty=!0,n._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,i=t.position.value,a=t.normal.value;if(a&&a.length===i.length)for(var o=0;o65535&&(this.indices=new n.a.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,i=this.getEnabledAttributes(),r={},a=0;a=i.COLOR_ATTACHMENT0&&a<=i.COLOR_ATTACHMENT0+8&&r.push(a);n.drawBuffersEXT(r)}}this.trigger("beforerender",this,e);var o=this.clearDepth?i.DEPTH_BUFFER_BIT:0;if(i.depthMask(!0),this.clearColor){o|=i.COLOR_BUFFER_BIT,i.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&i.clearColor(s[0],s[1],s[2],s[3])}i.clear(o),this.blendWithPrevious?(i.enable(i.BLEND),this.material.transparent=!0):(i.disable(i.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,i){t.a=function(e,t,i){return{seriesType:e,reset:function(e,t){var i=e.getData(),n=e.visualColorAccessPath.split(".");n[n.length-1]="opacity";var r=e.get(n);return i.setVisual("opacity",null==r?1:r),{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t).get(n,!0);null!=i&&e.setItemVisual(t,"opacity",i)}:null}}}}},function(e,t,i){var n,r,a,o,s,l,u=i(3),h=i(12),c=h.a.set,d=h.a.copy,f=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),this.vertices=null};f.prototype={constructor:f,updateFromVertices:function(e){if(e.length>0){var t=this.min,i=this.max,n=t.array,r=i.array;d(n,e[0]),d(r,e[0]);for(var a=1;ar[0]&&(r[0]=o[0]),o[1]>r[1]&&(r[1]=o[1]),o[2]>r[2]&&(r[2]=o[2])}t._dirty=!0,i._dirty=!0}},union:function(e){var t=this.min,i=this.max;return h.a.min(t.array,t.array,e.min.array),h.a.max(i.array,i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},intersection:function(e){var t=this.min,i=this.max;return h.a.max(t.array,t.array,e.min.array),h.a.min(i.array,i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,i=this.max.array,n=e.min.array,r=e.max.array;return!(t[0]>r[0]||t[1]>r[1]||t[2]>r[2]||i[0]=r[0]&&i[1]>=r[1]&&i[2]>=r[2]},containPoint:function(e){var t=this.min.array,i=this.max.array,n=e.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[2]&&i[0]>=n[0]&&i[1]>=n[1]&&i[2]>=n[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:function(e){this.transformFrom(this,e)},transformFrom:(n=h.a.create(),r=h.a.create(),a=h.a.create(),o=h.a.create(),s=h.a.create(),l=h.a.create(),function(e,t){var i=e.min.array,u=e.max.array,h=t.array;return n[0]=h[0]*i[0],n[1]=h[1]*i[0],n[2]=h[2]*i[0],r[0]=h[0]*u[0],r[1]=h[1]*u[0],r[2]=h[2]*u[0],a[0]=h[4]*i[1],a[1]=h[5]*i[1],a[2]=h[6]*i[1],o[0]=h[4]*u[1],o[1]=h[5]*u[1],o[2]=h[6]*u[1],s[0]=h[8]*i[2],s[1]=h[9]*i[2],s[2]=h[10]*i[2],l[0]=h[8]*u[2],l[1]=h[9]*u[2],l[2]=h[10]*u[2],i=this.min.array,u=this.max.array,i[0]=Math.min(n[0],r[0])+Math.min(a[0],o[0])+Math.min(s[0],l[0])+h[12],i[1]=Math.min(n[1],r[1])+Math.min(a[1],o[1])+Math.min(s[1],l[1])+h[13],i[2]=Math.min(n[2],r[2])+Math.min(a[2],o[2])+Math.min(s[2],l[2])+h[14],u[0]=Math.max(n[0],r[0])+Math.max(a[0],o[0])+Math.max(s[0],l[0])+h[12],u[1]=Math.max(n[1],r[1])+Math.max(a[1],o[1])+Math.max(s[1],l[1])+h[13],u[2]=Math.max(n[2],r[2])+Math.max(a[2],o[2])+Math.max(s[2],l[2])+h[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,i=this.max.array,n=e.array,r=t[0],a=t[1],o=t[2],s=i[0],l=i[1],u=t[2],h=i[0],c=i[1],d=i[2];if(1===n[15])t[0]=n[0]*r+n[12],t[1]=n[5]*a+n[13],i[2]=n[10]*o+n[14],i[0]=n[0]*h+n[12],i[1]=n[5]*c+n[13],t[2]=n[10]*d+n[14];else{var f=-1/o;t[0]=n[0]*r*f,t[1]=n[5]*a*f,i[2]=(n[10]*o+n[14])*f,f=-1/u,i[0]=n[0]*s*f,i[1]=n[5]*l*f,f=-1/d,t[2]=(n[10]*d+n[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=h.a.fromValues(0,0,0);this.vertices=e}var i=this.min.array,n=this.max.array;return c(e[0],i[0],i[1],i[2]),c(e[1],i[0],n[1],i[2]),c(e[2],n[0],i[1],i[2]),c(e[3],n[0],n[1],i[2]),c(e[4],i[0],i[1],n[2]),c(e[5],i[0],n[1],n[2]),c(e[6],n[0],i[1],n[2]),c(e[7],n[0],n[1],n[2]),this},copy:function(e){var t=this.min,i=this.max;return d(t.array,e.min.array),d(i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},clone:function(){var e=new f;return e.copy(this),e}},t.a=f},function(e,t,i){var n=i(7),r=i(23),a=i(113).a.parseToFloat,o={};function s(e){var t=Object.keys(e);t.sort();for(var i=[],n=0;n=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==typeof e)for(var i in e){var n=e[i];this.setUniform(i,n)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var i=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var n=this.uniforms;this._enabledUniforms=Object.keys(n),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var a=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=r.a.clone(e.vertexDefines),this.fragmentDefines=r.a.clone(e.fragmentDefines),t){for(var s in i)n[s]&&(n[s].value=i[s].value);r.a.defaults(this.vertexDefines,a),r.a.defaults(this.fragmentDefines,o)}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=r.a.clone(this.vertexDefines),e.fragmentDefines=r.a.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,i){var n=this.vertexDefines,r=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(i=t,t=e,e="both"),i=null!=i?i:null,"vertex"!==e&&"both"!==e||n[t]!==i&&(n[t]=i,this._programKey=""),"fragment"!==e&&"both"!==e||r[t]!==i&&(r[t]=i,"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=i.x&&t>=i.y&&e<=i.x+i.width&&t<=i.y+i.height};var v=new c.a;m.prototype.castRay=function(e,t,i){var n=this.layer.renderer,r=n.viewport;return n.viewport=this.viewport,n.screenToNDC(e,t,v),this.camera.castRay(v,i),n.viewport=r,i},m.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t30},m.prototype._doRender=function(e,t,i){var n=this.scene,r=this.camera;i=i||0,this._updateTransparent(e,n,r,i),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,n,r,!0)),this._updateShadowPCFKernel(i);var a,o=e.clearColor;e.gl.clearColor(o[0],o[1],o[2],o[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,r),this._compositor.updateNormal(e,n,r,this._temporalSS.getFrame())),this._updateSSAO(e,n,r,this._temporalSS.getFrame()),this._enablePostEffect?((a=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(n,r,!0,!0),a.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,n,r,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,n,r,null,0))):this.needsTemporalSS()&&t?((a=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(n,r,!0,!0),e.restoreClear(),a.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(n,r,!0,!0))},m.prototype._updateTransparent=function(e,t,i,n){for(var r=new h.a,a=new u.a,o=i.getWorldPosition(),s=t.getRenderList(i).transparent,l=0;lthis.camera.far||e65535?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,i,n){return 1/(s.dist(e,t)+s.dist(i,t)+s.dist(n,i)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(l)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(l)},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,i,n,r,a){null==a&&(a=1);var o=e[0],s=e[1],l=e[2],u=t[0],h=t[1],c=t[2],d=i[0],f=i[1],p=i[2],g=n[0],m=n[1],v=n[2],y=this._getCubicCurveApproxStep(e,t,i,n),_=y*y,x=_*y,b=3*y,w=3*_,T=6*_,S=6*x,M=o-2*u+d,A=s-2*h+f,I=l-2*c+p,C=3*(u-d)-o+g,D=3*(h-f)-s+m,E=3*(c-p)-l+v,L=o,P=s,N=l,R=(u-o)*b+M*w+C*x,O=(h-s)*b+A*w+D*x,k=(c-l)*b+I*w+E*x,z=M*T+C*S,B=A*T+D*S,F=I*T+E*S,V=C*S,G=D*S,H=E*S,U=0,W=0,j=Math.ceil(1/y),X=new Float32Array(3*(j+1)),Z=(X=[],0);for(W=0;W1&&(L=R>0?Math.min(L,g):Math.max(L,g),P=O>0?Math.min(P,m):Math.max(P,m),N=k>0?Math.min(N,v):Math.max(N,v));return this.addPolyline(X,r,a)},addLine:function(e,t,i,n){return this.addPolyline([e,t],i,n)},addPolyline:function(e,t,i,n,r){if(e.length){var a="number"!=typeof e[0];if(null==r&&(r=a?e.length:e.length/3),!(r<2)){null==n&&(n=0),null==i&&(i=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s,l=(a="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===r,u=this.attributes.position,h=this.attributes.positionPrev,c=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,g=this._vertexOffset;i=Math.max(i,.01);for(var m=n;m1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m0&&(c.set(g-2,o),c.set(g-1,o)),u.set(g,o),u.set(g+1,o),d.set(g,s),d.set(g+1,s),f.set(g,i/2),f.set(g+1,-i/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,o),g++;else if(m>0){var _=3*this._triangleOffset;(p=this.indices)[_]=g-4,p[_+1]=g-3,p[_+2]=g-2,p[_+3]=g-3,p[_+4]=g-1,p[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*r;h.copy(x,x+2),h.copy(x+1,x+3),c.copy(b-1,b-3),c.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(e,t){for(var i=this._itemVertexOffsets[e],n=e1&&t.texParameterf(t.TEXTURE_CUBE_MAP,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===n&&(e.getGLExtension("OES_texture_half_float")||(n=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},a.lerp=function(e,t,i,n){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=o+n*(i[2]-o),e[3]=s+n*(i[3]-s),e},a.random=function(e,t){return t=t||1,e[0]=Object(r.c)(),e[1]=Object(r.c)(),e[2]=Object(r.c)(),e[3]=Object(r.c)(),a.normalize(e,e),a.scale(e,e,t),e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*a+i[12]*o,e[1]=i[1]*n+i[5]*r+i[9]*a+i[13]*o,e[2]=i[2]*n+i[6]*r+i[10]*a+i[14]*o,e[3]=i[3]*n+i[7]*r+i[11]*a+i[15]*o,e},a.transformQuat=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2],u=i[3],h=u*n+s*a-l*r,c=u*r+l*n-o*a,d=u*a+o*r-s*n,f=-o*n-s*r-l*a;return e[0]=h*u+f*-o+c*-l-d*-s,e[1]=c*u+f*-s+d*-o-h*-l,e[2]=d*u+f*-l+h*-s-c*-o,e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=4),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof r.a&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof a.a?(t=this._cameraList.indexOf(e))>=0&&this._cameraList.splice(t,1):e instanceof r.a&&(t=this.lights.indexOf(e))>=0&&this.lights.splice(t,1),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},i=0;i0&&this._doUpdateRenderList(o,t,i,n,r)}},isFrustumCulled:(m=new o.a,v=new h.a,function(e,t,i){var n=e.boundingBox;if(n||(n=e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox),!n)return!1;if(v.array=i,m.transformFrom(n,v),e.castShadow&&this.viewBoundingBoxLastFrame.union(m),e.frustumCulling){if(!m.intersectBoundingBox(t.frustum.boundingBox))return!0;v.array=t.projectionMatrix.array,m.max.array[2]>0&&m.min.array[2]<0&&(m.max.array[2]=-1e-20),m.applyProjection(v);var r=m.min.array,a=m.max.array;if(a[0]<-1||r[0]>1||a[1]<-1||r[1]>1||a[2]<-1||r[2]>1)return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(_);var t=this._lightUniforms;for(var i in t)for(var n in t[i])t[i][n].value.length=0;for(var r=0;r0?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,i){var n=i(0),r=i.n(n);t.a=function(e,t,i){var n=e.getData(),a=e.getRawValue(t),o=r.a.util.isArray(a)?function(e){var a=[],o=function(e,t){var i=[];return r.a.util.each(e.dimensions,(function(n){var r=e.getDimensionInfo(n),a=r.otherDims[t];null!=a&&!1!==a&&(i[a]=r.name)})),i}(n,"tooltip");function s(e,t){var o=n.getDimensionInfo(t);if(o&&!1!==o.otherDims.tooltip){var s=o.type,l="- "+(o.tooltipName||o.name)+": "+("ordinal"===s?e+"":"time"===s?i?"":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 o.length?r.a.util.each(o,(function(e){s(n.get(e,t),e)})):r.a.util.each(e,s),"
"+a.join("
")}(a):r.a.format.encodeHTML(r.a.format.addCommas(a)),s=n.getName(t),l=n.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),h=e.name;return"\0-"===h&&(h=""),h=h?r.a.format.encodeHTML(h)+(i?": ":"
"):"",i?u+h+o:h+u+(s?r.a.format.encodeHTML(s)+": "+o:o)}},function(e,t,i){var n=i(72),r=i(11),a=n.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},(function(){this.joints||(this.joints=[])}),{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=n.a.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});a.POINTS=r.a.POINTS,a.LINES=r.a.LINES,a.LINE_LOOP=r.a.LINE_LOOP,a.LINE_STRIP=r.a.LINE_STRIP,a.TRIANGLES=r.a.TRIANGLES,a.TRIANGLE_STRIP=r.a.TRIANGLE_STRIP,a.TRIANGLE_FAN=r.a.TRIANGLE_FAN,a.BACK=r.a.BACK,a.FRONT=r.a.FRONT,a.FRONT_AND_BACK=r.a.FRONT_AND_BACK,a.CW=r.a.CW,a.CCW=r.a.CCW,t.a=a},function(e,t,i){var n=i(58),r=n.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=n.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,i){var n=i(40),r=i(76),a=i(8),o=i(19),s=i(4),l=i(121);a.a.import(l.a);var u=n.a.extend((function(){var e=new a.a({vertex:a.a.source("clay.skybox.vertex"),fragment:a.a.source("clay.skybox.fragment")}),t=new o.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){"texture2D"===e.textureType?(this.material.define("EQUIRECTANGULAR"),e.minFilter=s.a.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,i){this.renderSkybox(e,i)},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=u},function(e,t,i){var n=i(15),r=i(18),a=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,i=this.attributes,n=[],a=[],o=[],s=[],l=0;l<=e;l++)for(var u=l/e,h=0;h<=t;h++){var c=h/t;if(n.push([2*c-1,2*u-1,0]),a&&a.push([c,u]),o&&o.push([0,0,1]),h0&&this._notFirst?this.animateTo({alpha:h,beta:c,center:d,distance:a,targetOrthographicSize:s,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(h),this.setBeta(c),this.setCenter(d),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==s[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==s[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,i=this,n={},r={};return null!=e.distance&&(n.distance=this.getDistance(),r.distance=e.distance),null!=e.orthographicSize&&(n.orthographicSize=this.getOrthographicSize(),r.orthographicSize=e.orthographicSize),null!=e.alpha&&(n.alpha=this.getAlpha(),r.alpha=e.alpha),null!=e.beta&&(n.beta=this.getBeta(),r.beta=e.beta),null!=e.center&&(n.center=this.getCenter(),r.center=e.center),this._addAnimator(t.animation.animate(n).when(e.duration||1e3,r).during((function(){null!=n.alpha&&i.setAlpha(n.alpha),null!=n.beta&&i.setBeta(n.beta),null!=n.distance&&i.setDistance(n.distance),null!=n.center&&i.setCenter(n.center),null!=n.orthographicSize&&i.setOrthographicSize(n.orthographicSize),i._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e0},_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(),i=this._orthoSize,n=i/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-n/2,t.right=n/2,t.top=i/2,t.bottom=-i/2},_updatePan:function(e){var t=this._panVelocity,i=this._distance,n=this.getCamera(),r=n.worldTransform.y,a=n.worldTransform.x;this._center.scaleAndAdd(a,-t.x*i/200).scaleAndAdd(r,-t.y*i/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new a.a,i=this._theta+Math.PI/2,n=this._phi+Math.PI/2,r=Math.sin(i);t.x=r*Math.cos(n),t.y=-Math.cos(i),t.z=r*Math.sin(n),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 i=e.len();(i*=t)<1e-4&&(i=0),e.normalize().scale(i)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),i=Math.atan2(e.x,e.z);this._theta=t,this._phi=-i,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,i=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,i)||(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===s[this.rotateMouseButton]?this._mode="rotate":e.event.button===s[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),i=l(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*i[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*i[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 i,n=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(n,r)||(i="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)*i*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 i=t.indexOf(e);i>=0&&t.splice(i,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,i){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,i){var n=i(13),r=i(82),a=i(85).parsePercent,o=i(171),s=n.each,l=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function h(e,t,i,n,r){var a=0,o=0;null==n&&(n=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===e){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=o+v)>r||l.newline?(a+=s+i,o=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===e?a=h+i:o=c+i)}))}var c=h,d=n.curry(h,"vertical"),f=n.curry(h,"horizontal");function p(e,t,i){i=o.normalizeCssArray(i||0);var n=t.width,s=t.height,l=a(e.left,n),u=a(e.top,s),h=a(e.right,n),c=a(e.bottom,s),d=a(e.width,n),f=a(e.height,s),p=i[2]+i[0],g=i[1]+i[3],m=e.aspect;switch(isNaN(d)&&(d=n-h-g-l),isNaN(f)&&(f=s-c-p-u),null!=m&&(isNaN(d)&&isNaN(f)&&(m>n/s?d=.8*n:f=.8*s),isNaN(d)&&(d=m*f),isNaN(f)&&(f=d/m)),isNaN(l)&&(l=n-h-d-g),isNaN(u)&&(u=s-c-f-p),e.left||e.right){case"center":l=n/2-d/2-i[3];break;case"right":l=n-d-g}switch(e.top||e.bottom){case"middle":case"center":u=s/2-f/2-i[0];break;case"bottom":u=s-f-p}l=l||0,u=u||0,isNaN(d)&&(d=n-g-l-(h||0)),isNaN(f)&&(f=s-p-u-(c||0));var v=new r(l+i[3],u+i[0],d,f);return v.margin=i,v}function g(e,t){return t&&e&&s(l,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}t.LOCATION_PARAMS=l,t.HV_NAMES=u,t.box=c,t.vbox=d,t.hbox=f,t.getAvailableSize=function(e,t,i){var n=t.width,r=t.height,s=a(e.x,n),l=a(e.y,r),u=a(e.x2,n),h=a(e.y2,r);return(isNaN(s)||isNaN(parseFloat(e.x)))&&(s=0),(isNaN(u)||isNaN(parseFloat(e.x2)))&&(u=n),(isNaN(l)||isNaN(parseFloat(e.y)))&&(l=0),(isNaN(h)||isNaN(parseFloat(e.y2)))&&(h=r),i=o.normalizeCssArray(i||0),{width:Math.max(u-s-i[1]-i[3],0),height:Math.max(h-l-i[0]-i[2],0)}},t.getLayoutRect=p,t.positionElement=function(e,t,i,a,o){var s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if(s||l){var h;if("raw"===u)h="group"===e.type?new r(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(h=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(h=h.clone()).applyTransform(c)}t=p(n.defaults({width:h.width,height:h.height},t),i,a);var d=e.position,f=s?t.x-h.x:0,g=l?t.y-h.y:0;e.attr("position","raw"===u?[f,g]:[d[0]+f,d[1]+g])}},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,i){!n.isObject(i)&&(i={});var r=i.ignoreSize;!n.isArray(r)&&(r=[r,r]);var a=l(u[0],0),o=l(u[1],1);function l(i,n){var a={},o=0,l={},u=0;if(s(i,(function(t){l[t]=e[t]})),s(i,(function(e){h(t,e)&&(a[e]=l[e]=t[e]),c(a,e)&&o++,c(l,e)&&u++})),r[n])return c(t,i[1])?l[i[2]]=null:c(t,i[2])&&(l[i[1]]=null),l;if(2!==u&&o){if(o>=2)return a;for(var d=0;d0&&(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=n},function(e,t,i){t.a=function(e,t){for(var i=0,n=1/t,r=e;r>0;)i+=n*(r%t),r=Math.floor(r/t),n/=t;return i}},function(e,t,i){var n=i(0),r=i.n(n);t.a=function(e,t,i){i=i||e.getSource();var n=t||r.a.getCoordinateSystemDimensions(e.get("coordinateSystem"))||["x","y","z"],a=r.a.helper.createDimensions(i,{dimensionsDefine:i.dimensionsDefine||e.get("dimensions"),encodeDefine:i.encodeDefine||e.get("encode"),coordDimensions:n.map((function(t){var i=e.getReferringComponents(t+"Axis3D")[0];return{type:i&&"category"===i.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&a.forEach((function(t){if(n.indexOf(t.coordDim)>=0){var i=e.getReferringComponents(t.coordDim+"Axis3D")[0];i&&"category"===i.get("type")&&(t.ordinalMeta=i.getOrdinalMeta())}}));var o=r.a.helper.dataStack.enableDataStack(e,a,{byIndex:!0,stackedCoordDimension:"z"}),s=new r.a.List(a,e);return s.setCalculationInfo(o),s.initData(i),s}},function(e,t){e.exports=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,r){var a=e.getData(),o=e.get("symbol")||t,s=e.get("symbolSize"),l=e.get("symbolKeepAspect");if(a.setVisual({legendSymbol:i||o,symbol:o,symbolSize:s,symbolKeepAspect:l}),!n.isSeriesFiltered(e)){var u="function"==typeof s;return{dataEach:a.hasItemOption||u?function(t,i){if("function"==typeof s){var n=e.getRawValue(i),r=e.getDataParams(i);t.setItemVisual(i,"symbolSize",s(n,r))}if(t.hasItemOption){var a=t.getItemModel(i),o=a.getShallow("symbol",!0),l=a.getShallow("symbolSize",!0),u=a.getShallow("symbolKeepAspect",!0);null!=o&&t.setItemVisual(i,"symbol",o),null!=l&&t.setItemVisual(i,"symbolSize",l),null!=u&&t.setItemVisual(i,"symbolKeepAspect",u)}}:null}}}}}},function(e,t,i){var n=i(7),r=i(111),a=i(11),o=i(14),s=i(19),l=i(26),u=i(115),h=i(8),c=i(71),d=i(21),f=i(12);h.a.import(c.a);var p=d.a.create,g={};function m(e){return e.material}function v(e,t,i){return t.uniforms[i].value}function y(e,t,i,n){return i!==n}function _(e){return!0}function x(){}var b={float:a.a.FLOAT,byte:a.a.BYTE,ubyte:a.a.UNSIGNED_BYTE,short:a.a.SHORT,ushort:a.a.UNSIGNED_SHORT};function w(e,t,i){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=i,this.vao=null}function T(e){var t,i;this.bind=function(e){t||((t=o.a.createCanvas()).width=t.height=1,t.getContext("2d"));var n=e.gl,r=!i;r&&(i=n.createTexture()),n.bindTexture(n.TEXTURE_2D,i),r&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var S=n.a.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&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=o.a.createCanvas());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(m9){throw"Error creating WebGL Context "+m9}this._programMgr=new u.a(this),this._placeholderTexture=new T(this)}),{resize:function(e,t){var i=this.canvas,n=this.devicePixelRatio;null!=e?(i.style.width=e+"px",i.style.height=t+"px",i.width=e*n,i.height=t*n,this._width=e,this._height=t):(this._width=i.width/n,this._height=i.height/n),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,i,n,r){if("object"==typeof e){var a=e;e=a.x,t=a.y,i=a.width,n=a.height,r=a.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(e*r,t*r,i*r,n*r),this.viewport={x:e,y:t,width:i,height:n,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,i,n){var r=this.gl,a=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,r.enable(r.SCISSOR_TEST),r.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),r.clearColor(a[0],a[1],a[2],a[3]),r.clear(this.clearBit),s&&r.disable(r.SCISSOR_TEST)}if(i||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var h=u.opaque,c=u.transparent,g=e.material;e.trigger("beforerender",this,e,t,u),n?(this.renderPreZ(h,e,t),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var m=p(),v=f.a.create(),y=0;y0){var s=e[r-1],l=s.joints?s.joints.length:0;if((a.joints?a.joints.length:0)===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var u=this._programMgr.getProgram(a,o,t);this.validateProgram(u),a.__program=u}},renderPass:function(e,t,i){this.trigger("beforerenderpass",this,e,t,i),(i=i||{}).getMaterial=i.getMaterial||m,i.getUniform=i.getUniform||v,i.isMaterialChanged=i.isMaterialChanged||y,i.beforeRender=i.beforeRender||x,i.afterRender=i.afterRender||x;var n=i.ifRender||_;this.updatePrograms(e,this._sceneRendering,i),i.sortCompare&&e.sort(i.sortCompare);var r=this.viewport,a=r.devicePixelRatio,o=[r.x*a,r.y*a,r.width*a,r.height*a],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[o[2],o[3]],h=Date.now();t?(d.a.copy(M.VIEW,t.viewMatrix.array),d.a.copy(M.PROJECTION,t.projectionMatrix.array),d.a.copy(M.VIEWINVERSE,t.worldTransform.array)):(d.a.identity(M.VIEW),d.a.identity(M.PROJECTION),d.a.identity(M.VIEWINVERSE)),d.a.multiply(M.VIEWPROJECTION,M.PROJECTION,M.VIEW),d.a.invert(M.PROJECTIONINVERSE,M.PROJECTION),d.a.invert(M.VIEWPROJECTIONINVERSE,M.VIEWPROJECTION);for(var c,f,p,g,b,w,T,S,A,I,C,D,E=this.gl,L=this._sceneRendering,P=this.getGLExtension("OES_vertex_array_object"),N=0;Nthis._glinfo.getMaxJointNumber()){var a=r.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,i),t.setUniform(n,"1i","skinMatricesTexture",i),t.setUniform(n,"1f","skinMatricesTextureSize",a.width)}else{var o=r.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(n,"SKIN_MATRIX",o)}},_renderObject:function(e,t){var i=this.gl,n=e.geometry,r=e.mode;if(null==r&&(r=4),t.indicesBuffer){var a=this.getGLExtension("OES_element_index_uint")&&n.indices instanceof Uint32Array?i.UNSIGNED_INT:i.UNSIGNED_SHORT;i.drawElements(r,t.indicesBuffer.count,a,0)}else i.drawArrays(r,0,n.vertexCount)},_bindMaterial:function(e,t,i,n,r,a,o){for(var s=this.gl,l=a===i,u=i.currentTextureSlot(),h=t.getEnabledUniforms(),c=t.getTextureUniforms(),d=this._placeholderTexture,f=0;fh)){var c=Math.sqrt(h-u),d=o-c,f=o+c;return n||(n=new s.a),d<0?f<0?null:(l.a.scaleAndAdd(n.array,r,a,f),n):(l.a.scaleAndAdd(n.array,r,a,d),n)}}}(),intersectBoundingBox:function(e,t){var i,n,r,a,o,u,h=this.direction.array,c=this.origin.array,d=e.min.array,f=e.max.array,p=1/h[0],g=1/h[1],m=1/h[2];if(p>=0?(i=(d[0]-c[0])*p,n=(f[0]-c[0])*p):(n=(d[0]-c[0])*p,i=(f[0]-c[0])*p),g>=0?(r=(d[1]-c[1])*g,a=(f[1]-c[1])*g):(a=(d[1]-c[1])*g,r=(f[1]-c[1])*g),i>a||r>n)return null;if((r>i||i!=i)&&(i=r),(a=0?(o=(d[2]-c[2])*m,u=(f[2]-c[2])*m):(u=(d[2]-c[2])*m,o=(f[2]-c[2])*m),i>u||o>n)return null;if((o>i||i!=i)&&(i=o),(u=0?i:n;return t||(t=new s.a),l.a.scaleAndAdd(t.array,c,h,v),t},intersectTriangle:(n=l.a.create(),r=l.a.create(),a=l.a.create(),o=l.a.create(),function(e,t,i,h,c,d){var f=this.direction.array,p=this.origin.array;e=e.array,t=t.array,i=i.array,l.a.sub(n,t,e),l.a.sub(r,i,e),l.a.cross(o,r,f);var g=l.a.dot(n,o);if(h){if(g>-1e-5)return null}else if(g>-1e-5&&g1)return null;l.a.cross(o,n,a);var v=l.a.dot(f,o)/g;if(v<0||v>1||m+v>1)return null;l.a.cross(o,n,r);var y=-l.a.dot(a,o)/g;return y<0?null:(c||(c=new s.a),d&&s.a.set(d,1-m-v,m,v),l.a.scaleAndAdd(c.array,p,f,y),c)}),applyTransform:function(e){s.a.add(this.direction,this.direction,this.origin),s.a.transformMat4(this.origin,this.origin,e),s.a.transformMat4(this.direction,this.direction,e),s.a.sub(this.direction,this.direction,this.origin),s.a.normalize(this.direction,this.direction)},copy:function(e){s.a.copy(this.origin,e.origin),s.a.copy(this.direction,e.direction)},clone:function(){var e=new h;return e.copy(this),e}},t.a=h},function(e,t,i){var n,r,a,o,s=i(20),l=i(12),u=i(33),h=i(34),c={create:function(){var e=new s.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}};c.rotationTo=(n=l.a.create(),r=l.a.fromValues(1,0,0),a=l.a.fromValues(0,1,0),function(e,t,i){var o=l.a.dot(t,i);return o<-.999999?(l.a.cross(n,r,t),l.a.length(n)<1e-6&&l.a.cross(n,a,t),l.a.normalize(n,n),c.setAxisAngle(e,n,Math.PI),e):o>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(l.a.cross(n,t,i),e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=1+o,c.normalize(e,e))}),c.setAxes=(o=h.a.create(),function(e,t,i,n){return o[0]=i[0],o[3]=i[1],o[6]=i[2],o[1]=n[0],o[4]=n[1],o[7]=n[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],c.normalize(e,c.fromMat3(e,o))}),c.clone=u.a.clone,c.fromValues=u.a.fromValues,c.copy=u.a.copy,c.set=u.a.set,c.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},c.setAxisAngle=function(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e},c.add=u.a.add,c.multiply=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1],u=i[2],h=i[3];return e[0]=n*h+o*s+r*u-a*l,e[1]=r*h+o*l+a*s-n*u,e[2]=a*h+o*u+n*l-r*s,e[3]=o*h-n*s-r*l-a*u,e},c.mul=c.multiply,c.scale=u.a.scale,c.rotateX=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+o*s,e[1]=r*l+a*s,e[2]=a*l-r*s,e[3]=o*l-n*s,e},c.rotateY=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l-a*s,e[1]=r*l+o*s,e[2]=a*l+n*s,e[3]=o*l-r*s,e},c.rotateZ=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+r*s,e[1]=r*l-n*s,e[2]=a*l+o*s,e[3]=o*l-a*s,e},c.calculateW=function(e,t){var i=t[0],n=t[1],r=t[2];return e[0]=i,e[1]=n,e[2]=r,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),e},c.dot=u.a.dot,c.lerp=u.a.lerp,c.slerp=function(e,t,i,n){var r,a,o,s,l,u=t[0],h=t[1],c=t[2],d=t[3],f=i[0],p=i[1],g=i[2],m=i[3];return(a=u*f+h*p+c*g+d*m)<0&&(a=-a,f=-f,p=-p,g=-g,m=-m),1-a>1e-6?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-n)*r)/o,l=Math.sin(n*r)/o):(s=1-n,l=n),e[0]=s*u+l*f,e[1]=s*h+l*p,e[2]=s*c+l*g,e[3]=s*d+l*m,e},c.invert=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*i+n*n+r*r+a*a,s=o?1/o:0;return e[0]=-i*s,e[1]=-n*s,e[2]=-r*s,e[3]=a*s,e},c.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},c.length=u.a.length,c.len=c.length,c.squaredLength=u.a.squaredLength,c.sqrLen=c.squaredLength,c.normalize=u.a.normalize,c.fromMat3=function(e,t){var i,n=t[0]+t[4]+t[8];if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*a+o]-t[3*o+a])*i,e[a]=(t[3*a+r]+t[3*r+a])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e},t.a=c},function(e,t,i){var n,r=i(55),a=i(34),o=function(e,t,i,n){e=e||0,t=t||0,i=i||0,n=void 0===n?1:n,this.array=r.a.fromValues(e,t,i,n),this._dirty=!0};o.prototype={constructor:o,add:function(e){return r.a.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return r.a.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,i,n){return this.array[0]=e,this.array[1]=t,this.array[2]=i,this.array[3]=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.array[3]=e[3],this._dirty=!0,this},clone:function(){return new o(this.x,this.y,this.z,this.w)},conjugate:function(){return r.a.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return r.a.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return r.a.dot(this.array,e.array)},fromMat3:function(e){return r.a.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(n=a.a.create(),function(e){return a.a.fromMat4(n,e.array),a.a.transpose(n,n),r.a.fromMat3(this.array,n),this._dirty=!0,this}),identity:function(){return r.a.identity(this.array),this._dirty=!0,this},invert:function(){return r.a.invert(this.array,this.array),this._dirty=!0,this},len:function(){return r.a.len(this.array)},length:function(){return r.a.length(this.array)},lerp:function(e,t,i){return r.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},mul:function(e){return r.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return r.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return r.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return r.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return r.a.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return r.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return r.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return r.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return r.a.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,i){return r.a.setAxes(this.array,e.array,t.array,i.array),this._dirty=!0,this},setAxisAngle:function(e,t){return r.a.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,i){return r.a.slerp(this.array,e.array,t.array,i),this._dirty=!0,this},sqrLen:function(){return r.a.sqrLen(this.array)},squaredLength:function(){return r.a.squaredLength(this.array)},fromEuler:function(e,t){return o.fromEuler(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 l=o.prototype;s(l,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),s(l,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),s(l,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),s(l,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}o.add=function(e,t,i){return r.a.add(e.array,t.array,i.array),e._dirty=!0,e},o.set=function(e,t,i,n,a){r.a.set(e.array,t,i,n,a),e._dirty=!0},o.copy=function(e,t){return r.a.copy(e.array,t.array),e._dirty=!0,e},o.calculateW=function(e,t){return r.a.calculateW(e.array,t.array),e._dirty=!0,e},o.conjugate=function(e,t){return r.a.conjugate(e.array,t.array),e._dirty=!0,e},o.identity=function(e){return r.a.identity(e.array),e._dirty=!0,e},o.invert=function(e,t){return r.a.invert(e.array,t.array),e._dirty=!0,e},o.dot=function(e,t){return r.a.dot(e.array,t.array)},o.len=function(e){return r.a.length(e.array)},o.lerp=function(e,t,i,n){return r.a.lerp(e.array,t.array,i.array,n),e._dirty=!0,e},o.slerp=function(e,t,i,n){return r.a.slerp(e.array,t.array,i.array,n),e._dirty=!0,e},o.multiply=o.mul=function(e,t,i){return r.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},o.rotateX=function(e,t,i){return r.a.rotateX(e.array,t.array,i),e._dirty=!0,e},o.rotateY=function(e,t,i){return r.a.rotateY(e.array,t.array,i),e._dirty=!0,e},o.rotateZ=function(e,t,i){return r.a.rotateZ(e.array,t.array,i),e._dirty=!0,e},o.setAxisAngle=function(e,t,i){return r.a.setAxisAngle(e.array,t.array,i),e._dirty=!0,e},o.normalize=function(e,t){return r.a.normalize(e.array,t.array),e._dirty=!0,e},o.squaredLength=o.sqrLen=function(e){return r.a.sqrLen(e.array)},o.fromMat3=function(e,t){return r.a.fromMat3(e.array,t.array),e._dirty=!0,e},o.setAxes=function(e,t,i,n){return r.a.setAxes(e.array,t.array,i.array,n.array),e._dirty=!0,e},o.rotationTo=function(e,t,i){return r.a.rotationTo(e.array,t.array,i.array),e._dirty=!0,e},o.fromEuler=function(e,t,i){e._dirty=!0,t=t.array;var n=e.array,r=Math.cos(t[0]/2),a=Math.cos(t[1]/2),o=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(i=(i||"XYZ").toUpperCase()){case"XYZ":n[0]=s*a*o+r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o-s*l*u;break;case"YXZ":n[0]=s*a*o+r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o+s*l*u;break;case"ZXY":n[0]=s*a*o-r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o-s*l*u;break;case"ZYX":n[0]=s*a*o-r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o+s*l*u;break;case"YZX":n[0]=s*a*o+r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o-s*l*u;break;case"XZY":n[0]=s*a*o-r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o+s*l*u}},t.a=o},function(e,t,i){var n="__dt__",r=function(){this._contextId=0,this._caches=[],this._context={}};(r.prototype={use:function(e,t){var i=this._caches;i[e]||(i[e]={},t&&(i[e]=t())),this._contextId=e,this._context=i[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=n+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=n+(e=e||""),i=this._caches,r=0;r=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new r(t),s.key=e,i.insertEntry(s),n[e]=s}return a},o.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;e.exports=s},function(e,t,i){var n=i(5),r=i(27),a=i(14),o=i(62),s=i(75),l=i(36),u=i(122),h=i(123),c={loadTexture:function(e,t,i,a){var o;if("function"==typeof t?(a=i=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return o=new n.a({width:0,height:0,sRGB:!1}),c._fetchTexture(e,(function(e){h.a.parseRGBE(e,o,t.exposure),o.dirty(),i&&i(o)}),a),o;e.match(/.dds$/)||"dds"===t.fileType?(o=new n.a({width:0,height:0}),c._fetchTexture(e,(function(e){u.a.parse(e,o),o.dirty(),i&&i(o)}),a)):((o=new n.a).load(e),o.success(i),o.error(a))}else"object"==typeof e&&void 0!==e.px&&((o=new r.a).load(e),o.success(i),o.error(a));return o},loadPanorama:function(e,t,i,n,r,a){var o=this;"function"==typeof n?(a=r=n,n={}):n=n||{},c.loadTexture(t,n,(function(t){t.flipY=n.flipY||!1,o.panoramaToCubeMap(e,t,i,n),t.dispose(e),r&&r(i)}),a)},panoramaToCubeMap:function(e,t,i,n){var r=new o.a,a=new s.a({scene:new l.a});return a.setEnvironmentMap(t),(n=n||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),i.sRGB=t.sRGB,r.texture=i,r.render(e,a.scene),r.texture=null,r.dispose(e),i},heightToNormal:function(e,t){var i=document.createElement("canvas"),n=i.width=e.width,r=i.height=e.height,a=i.getContext("2d");a.drawImage(e,0,0,n,r),t=t||!1;for(var o=a.getImageData(0,0,n,r),s=a.createImageData(n,r),l=0;l20)return console.warn("Given image is not a height map"),e}var d,f,p,g;l%(4*n)==0?(d=o.data[l],p=o.data[l+4]):l%(4*n)==4*(n-1)?(d=o.data[l-4],p=o.data[l]):(d=o.data[l-4],p=o.data[l+4]),l<4*n?(f=o.data[l],g=o.data[l+4*n]):l>n*(r-1)*4?(f=o.data[l-4*n],g=o.data[l]):(f=o.data[l-4*n],g=o.data[l+4*n]),s.data[l]=d-p+127,s.data[l+1]=f-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),i},isHeightImage:function(e,t,i){if(!e||!e.width||!e.height)return!1;var n=document.createElement("canvas"),r=n.getContext("2d"),a=t||32;i=i||20,n.width=n.height=a,r.drawImage(e,0,0,a,a);for(var o=r.getImageData(0,0,a,a),s=0;si)return!1}return!0},_fetchTexture:function(e,t,i){a.a.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:i})},createChessboard:function(e,t,i,r){e=e||512,t=t||64,i=i||"black",r=r||"white";var a=Math.ceil(e/t),o=document.createElement("canvas");o.width=e,o.height=e;var s=o.getContext("2d");s.fillStyle=r,s.fillRect(0,0,e,e),s.fillStyle=i;for(var l=0;l65535?new Uint32Array(3*s):new Uint16Array(3*s),f.material.shader!==t&&f.material.attachShader(t,!0),a.a.setMaterialFromModel(t.__shading,f.material,e,i),l>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(l),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-n))},_updateRegionMesh:function(e,t,i,n){for(var r=e.getData(),o=0,s=0,u=!1,h=this._polygonMesh,c=this._linesMesh,d=i;d0;S&&(T*=t.getDevicePixelRatio(),this._updateLinesGeometry(c.geometry,e,d,x,T,e.coordinateSystem.transform)),c.invisible=!S,c.material.set({color:y})}(h=this._polygonMesh).material.transparent=u,h.material.depthMask=!u,h.geometry.updateBoundingBox(),h.frontFace=this.extrudeY?a.a.Mesh.CCW:a.a.Mesh.CW,h.material.get("normalMap")&&h.geometry.generateTangents(),h.seriesIndex=e.seriesIndex,h.on("mousemove",this._onmousemove,this),h.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var i=a.a.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),n=l.a.firstNotNull(t.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",i),r.material.set("wireframeLineWidth",n)}},_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._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,i){var n=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!n.get("show",!0),!this._groundMesh.invisible){var r=e.get("shading"),o=this._groundMaterials[r];o||(console.warn("Unkown shading "+r),o=this._groundMaterials.lambert),a.a.setMaterialFromModel(r,o,n,i),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",a.a.parseColor(n.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,i){this._triangulationResults=[];for(var n=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],a=e.coordinateSystem,s=t;s1?n:0,L[G][v]=I.points[U+2],l.set(r+G,L[G]),s?(O[0]=(I.points[U]*y[0]-_[0])/b,O[1]=(I.points[U+2]*y[v]-_[v])/b):(O[0]=(H?k:k+V)/b,O[1]=(L[G][m]*y[m]-_[m])/b),h.set(r+G,O)}for(f.sub(P,L[1],L[0]),f.sub(N,L[3],L[0]),f.cross(R,P,N),f.normalize(R,R),G=0;G<4;G++)u.set(r+G,R),p&&c.set(r+G,o);for(G=0;G<6;G++)g[3*a+G]=E[G]+r;r+=4,a+=2,k+=V}}return t.dirty(),{vertexOffset:r,triangleOffset:a}},_getRegionLinesInfo:function(e,t,i){var n=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;n+=i.getPolylineVertexCount(t),r+=i.getPolylineTriangleCount(t);for(var o=0;othis._endIndex)){t-=this._startIndex;for(var n=this._vertexRangeOfDataIndex[2*t];n=2e4},doSortTriangles:function(e,t){var i=this.indices;if(0===t){var n=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 i.constructor(i.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var l,u=0,h=0;h0,i={},n=0;n2?(m=this._updateSymbolSprite(e,p,d,f),u.enableTexture("sprite")):u.disableTexture("sprite"),c.position.init(r-n);var v=[];if(g){u.undefine("VERTEX_SIZE"),u.undefine("VERTEX_COLOR");var y=l.getVisual("color"),_=l.getVisual("opacity");a.a.parseColor(y,v),v[3]*=_,u.set({color:v,u_Size:d.maxSize*this._sizeScale})}else u.set({color:[1,1,1,1]}),u.define("VERTEX_SIZE"),u.define("VERTEX_COLOR"),c.size.init(r-n),c.color.init(r-n),this._originalOpacity=new Float32Array(r-n);for(var x=l.getLayout("points"),b=c.position.value,w=0;w1?(s[0]=i.maxSize,s[1]=i.maxSize/i.aspect):(s[1]=i.maxSize,s[0]=i.maxSize*i.aspect),s[0]=s[0]||1,s[1]=s[1]||1,this._symbolType===i.type&&(r=this._symbolSize,a=s,r&&a&&r[0]===a[0]&&r[1]===a[1])&&this._lineWidth===t.lineWidth||(o.a.createSymbolSprite(i.type,s,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(s[0]/2,10)},this._spriteImageCanvas),o.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=i.type,this._symbolSize=s,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/i.maxSize*n},_updateMaterial:function(e,t){var i="lighter"===e.get("blendMode")?a.a.additiveBlend:null,n=this._mesh.material;n.blend=i,n.set("lineWidth",t.lineWidth/20);var r=a.a.parseColor(t.stroke);n.set("strokeColor",r),n.transparent=!0,n.depthMask=!1,n.depthTest=!this.is2D,n.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,i){var n=e.getData(),r=this._mesh.geometry,a=r.attributes.position.value,o=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(n,t,i),this._labelsBuilder.getLabelPosition=function(e,i,n){var r=3*(e-t);return[a[r],a[r+1],a[r+2]]},this._labelsBuilder.getLabelDistance=function(e,i,n){return r.attributes.size.get(e-t)/o/2+n},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,i){var n,r=e.getData(),a=this._mesh,o=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(n=e.coordinateSystem.model),a.seriesIndex=e.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(t){var u=t.vertexIndex+o._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(r,s),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&i.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:n.componentIndex})),a.dataIndex=u,s=u}),this),a.on("mouseout",(function(e){var t=e.vertexIndex+o._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,t),this._labelsBuilder.updateLabels()),s=-1,a.dataIndex=-1,l&&i.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:n.componentIndex})}),this)},updateLayout:function(e,t,i){var n=e.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=n.getLayout("points");if(this.is2D)for(var o=0;othis._endDataIndex||tthis._endDataIndex||t.05&&(a=!0),f!==o&&(s=!0),o=f,n=c}return a&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:o,aspect:n}}},t.a=c},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(m9){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var n=i(114),r=function(e){this._list=new n.a,this._map={},this._maxSize=e||10};r.prototype.setMaxSize=function(e){this._maxSize=e},r.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var i=this._list.length();if(i>=this._maxSize&&i>0){var n=this._list.head;this._list.remove(n),delete this._map[n.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(this._map.hasOwnProperty(e))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,i){var n,r=i(20),a={create:function(){var e=new r.a(2);return e[0]=0,e[1]=0,e},clone:function(e){var t=new r.a(2);return t[0]=e[0],t[1]=e[1],t},fromValues:function(e,t){var i=new r.a(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,i){return e[0]=t,e[1]=i,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(i*i+n*n)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1];return t*t+i*i},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},a.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},a.normalize=function(e,t){var i=t[0],n=t[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},a.cross=function(e,t,i){var n=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=n,e},a.lerp=function(e,t,i,n){var r=t[0],a=t[1];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e},a.random=function(e,t){t=t||1;var i=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e},a.transformMat2=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r,e[1]=i[1]*n+i[3]*r,e},a.transformMat2d=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},a.transformMat3=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[3]*r+i[6],e[1]=i[1]*n+i[4]*r+i[7],e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[4]*r+i[12],e[1]=i[1]*n+i[5]*r+i[13],e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=2),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end"},function(e,t,i){var n,r=i(35),a=i(11),o=r.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,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},clone:(n=["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>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=n},function(e,t,i){var n,r,a,o,s=i(3),l=i(21),u=i(12),h=i(33),c=function(e,t){this.normal=e||new s.a(0,1,0),this.distance=t||0};c.prototype={constructor:c,distanceToPoint:function(e){return u.a.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new s.a);var i=this.distanceToPoint(e);return u.a.scaleAndAdd(t.array,e.array,this.normal.array,-i),t._dirty=!0,t},normalize:function(){var e=1/u.a.len(this.normal.array);u.a.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,i=this.normal.array,n=u.a.dot(t[0].array,i)>this.distance,r=1;r<8;r++)if(u.a.dot(t[r].array,i)>this.distance!=n)return!0},intersectLine:(o=u.a.create(),function(e,t,i){var n=this.distanceToPoint(e),r=this.distanceToPoint(t);if(n>0&&r>0||n<0&&r<0)return null;var a=this.normal.array,l=this.distance,h=e.array;u.a.sub(o,t.array,e.array),u.a.normalize(o,o);var c=u.a.dot(a,o);if(0===c)return null;i||(i=new s.a);var d=(u.a.dot(a,h)-l)/c;return u.a.scaleAndAdd(i.array,h,o,-d),i._dirty=!0,i}),applyTransform:(n=l.a.create(),r=h.a.create(),a=h.a.create(),a[3]=1,function(e){e=e.array,u.a.scale(a,this.normal.array,this.distance),h.a.transformMat4(a,a,e),this.distance=u.a.dot(a,this.normal.array),l.a.invert(n,e),l.a.transpose(n,n),r[3]=0,u.a.copy(r,this.normal.array),h.a.transformMat4(r,r,n),u.a.copy(this.normal.array,r)}),copy:function(e){u.a.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new c;return e.copy(this),e}},t.a=c},function(e,t,i){var n=i(42);t.a=n.a},function(e,t,i){var n=i(15),r=i(43),a=i(9),o=i(3),s=i(18),l=i(14),u=new a.a,h=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:c("px",this.depthSegments,this.heightSegments),nx:c("nx",this.depthSegments,this.heightSegments),py:c("py",this.widthSegments,this.depthSegments),ny:c("ny",this.widthSegments,this.depthSegments),pz:c("pz",this.widthSegments,this.heightSegments),nz:c("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],i=0,n=0;for(var r in e)i+=e[r].vertexCount,n+=e[r].indices.length;for(var a=0;a>>16)>>>0;c=(((16711935&(c=((252645135&(c=((858993459&(c=((1431655765&c)<<1|(2863311530&c)>>>1)>>>0))<<2|(3435973836&c)>>>2)>>>0))<<4|(4042322160&c)>>>4)>>>0))<<8|(4278255360&c)>>>8)>>>0)/4294967296;var d=Math.sqrt((1-c)/(1+(u*u-1)*c));o[h]=d}for(h=0;ho&&(r=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,i),a+i+l>s)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/o+u[0],a/s+u[1]],[(r+t)/o+u[0],(a+i)/s+u[1]]]},_fitElement:function(e,t,i){var n=e.getBoundingRect(),r=t/n.width,a=i/n.height;e.position=[-n.x*r,-n.y*a],e.scale=[r,a],e.update()}},s.prototype={clear:function(){for(var e=0;e=e)){var r=(i+this._nodeWidth)*this._dpr,a=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:a})}catch(m9){this._canvas.width=r,this._canvas.height=a}var s=new o(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}console.error("Too much labels. Some will be ignored.")},add:function(e,t,i){if(this._coords[e.id])return console.warn("Element already been add"),this._coords[e.id];var n=this._getCurrentNode().add(e,t,i);if(!n){var r=this._expand();if(!r)return;n=r.add(e,t,i)}return this._coords[e.id]=n,n},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=s},function(e,t,i){var n=i(83),r=i(84),a=n.applyTransform,o=Math.min,s=Math.max;function l(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}l.prototype={constructor:l,union:function(e){var t=o(e.x,this.x),i=o(e.y,this.y);this.width=s(e.x+e.width,this.x+this.width)-t,this.height=s(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:function(){var e=[],t=[],i=[],n=[];return function(r){if(r){e[0]=i[0]=this.x,e[1]=n[1]=this.y,t[0]=n[0]=this.x+this.width,t[1]=i[1]=this.y+this.height,a(e,e,r),a(t,t,r),a(i,i,r),a(n,n,r),this.x=o(e[0],t[0],i[0],n[0]),this.y=o(e[1],t[1],i[1],n[1]);var l=s(e[0],t[0],i[0],n[0]),u=s(e[1],t[1],i[1],n[1]);this.width=l-this.x,this.height=u-this.y}}}(),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=r.create();return r.translate(a,a,[-t.x,-t.y]),r.scale(a,a,[i,n]),r.translate(a,a,[e.x,e.y]),a},intersect:function(e){if(!e)return!1;e instanceof l||(e=l.create(e));var t=this,i=t.x,n=t.x+t.width,r=t.y,a=t.y+t.height,o=e.x,s=e.x+e.width,u=e.y,h=e.y+e.height;return!(n=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new l(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}}},l.create=function(e){return new l(e.x,e.y,e.width,e.height)};var u=l;e.exports=u},function(e,t){var i="undefined"==typeof Float32Array?Array:Float32Array;function n(e){return Math.sqrt(a(e))}var r=n;function a(e){return e[0]*e[0]+e[1]*e[1]}var o=a;function s(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var l=s;function u(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var h=u;t.create=function(e,t){var n=new i(2);return null==e&&(e=0),null==t&&(t=0),n[0]=e,n[1]=t,n},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},t.clone=function(e){var t=new i(2);return t[0]=e[0],t[1]=e[1],t},t.set=function(e,t,i){return e[0]=t,e[1]=i,e},t.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},t.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},t.sub=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},t.len=n,t.length=r,t.lenSquare=a,t.lengthSquare=o,t.mul=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},t.div=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},t.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},t.normalize=function(e,t){var i=n(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},t.distance=s,t.dist=l,t.distanceSquare=u,t.distSquare=h,t.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},t.lerp=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},t.applyTransform=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},t.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},t.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}},function(e,t){var i="undefined"==typeof Float32Array?Array:Float32Array;function n(){var e=new i(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=n,t.identity=r,t.copy=a,t.mul=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e},t.translate=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},t.rotate=function(e,t,i){var n=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=r*h+s*u,e[3]=-r*u+h*s,e[4]=h*a+u*l,e[5]=h*l-u*a,e},t.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=t[0]*n,e[1]=t[1]*r,e[2]=t[2]*n,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*r,e},t.invert=function(e,t){var i=t[0],n=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=i*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*r)*l,e[5]=(a*r-i*s)*l,e):null},t.clone=function(e){var t=n();return a(t,e),t}},function(e,t,i){var n=i(13),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 o(e){return Math.floor(Math.log(e)/Math.LN10)}t.linearMap=function(e,t,i,n){var r=t[1]-t[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/r*a+i[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?(i=e,i.replace(/^\s+/,"").replace(/\s+$/,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},t.round=function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?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,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},t.getPrecisionSafe=function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},t.getPixelPrecision=function(e,t){var i=Math.log,n=Math.LN10,r=Math.floor(i(e[1]-e[0])/n),a=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},t.getPercentWithPrecision=function(e,t,i){if(!e[t])return 0;var r=n.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===r)return 0;for(var a=Math.pow(10,i),o=n.map(e,(function(e){return(isNaN(e)?0:e)/r*a*100})),s=100*a,l=n.map(o,(function(e){return Math.floor(e)})),u=n.reduce(l,(function(e,t){return e+t}),0),h=n.map(o,(function(e,t){return e-l[t]}));uc&&(c=h[f],d=f);++l[d],h[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=-20?+e.toFixed(i<0?-i:0):e},t.reformIntervals=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n=0}},function(e,t,i){var n=i(5),r=i(11),a=i(23),o=function(){this._pool={},this._allocatedTextures=[]};o.prototype={constructor:o,get:function(e){var t=u(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var i=this._pool[t];if(!i.length){var r=new n.a(e);return this._allocatedTextures.push(r),r}return i.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;tc&&u.push({pivot:Math.floor((h+c)/2),left:c,right:h}),c=s[l].pivot+1,(h=s[l].right)>c&&u.push({pivot:Math.floor((h+c)/2),left:c,right:h})}s=this._parts=u}else for(l=0;l50&&(u=1e3);var h=[];n.perspective(h,a,this.width/this.height,1,u),this.viewGL.camera.projectionMatrix.setArray(h),this.viewGL.camera.decomposeProjectionMatrix(),h=n.identity([]);var c=this.dataToPoint(this.center);n.scale(h,h,[1,-1,1]),n.translate(h,h,[0,0,-e]),n.rotateX(h,h,t),n.rotateZ(h,h,-this.bearing/180*Math.PI),n.translate(h,h,[-c[0]*this.getScale()*s,-c[1]*this.getScale()*s,0]),this.viewGL.camera.viewMatrix.array=h;var d=[];n.invert(d,h),this.viewGL.camera.worldTransform.array=d,this.viewGL.camera.decomposeWorldTransform();var f,p=r*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var g=this.altitudeExtent[1]-this.altitudeExtent[0];f=this.boxHeight/g*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else f=p/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*s;this.viewGL.rootNode.scale.set(this.getScale()*s,this.getScale()*s,f)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*r,t)},projectOnTileWithScale:function(e,t,i){var n=e[0],r=e[1]*o/180,a=t*(n*o/180+o)/(2*o),s=t*(o-Math.log(Math.tan(o/4+.5*r)))/(2*o);return(i=i||[])[0]=a,i[1]=s,i},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*r,t)},unprojectOnTileWithScale:function(e,t,i){var n=e[0],r=e[1],a=n/t*(2*o)-o,s=2*(Math.atan(Math.exp(o-r/t*(2*o)))-o/4);return(i=i||[])[0]=180*a/o,i[1]=180*s/o,i},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,r,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=l},function(e,t,i){var n=i(2),r=i(1),a=i(22);t.a=function(e,t,i){function o(e,t){var i=t.getWidth(),n=t.getHeight(),r=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,i,n,r),this.width=i,this.height=n,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function s(e,t){if("auto"!==this.model.get("boxHeight")){var i=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),n=e.coordDimToDataDim("alt")[0];if(n){var r=t.getDataExtent(n,!0);i[0]=Math.min(i[0],r[0]),i[1]=Math.max(i[1],r[1])}}}),this),i&&isFinite(i[1]-i[0])&&(this.altitudeExtent=i)}}return{dimensions:t.prototype.dimensions,create:function(l,u){var h=[];return l.eachComponent(e,(function(e){var i=e.__viewGL;i||(i=e.__viewGL=new a.a).setRootNode(new r.a.Node);var n=new t;n.viewGL=e.__viewGL,n.resize=o,n.resize(e,u),h.push(n),e.coordinateSystem=n,n.model=e,n.update=s})),l.eachSeries((function(t){if(t.get("coordinateSystem")===e){var i=t.getReferringComponents(e)[0];if(i||(i=l.getComponent(e)),!i)throw new Error(e+' "'+n.a.firstNotNull(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=i.coordinateSystem}})),i&&i(h,l,u),h}}}},function(e,t,i){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,i){var n=i(84),r=i.n(n),a=i(83),o=i.n(a);function s(e){this.viewGL=e}s.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=r.a.create(),this.updateTransform(e,t)},s.prototype.updateTransform=function(e,t){var i=e.coordinateSystem;i.getRoamTransform&&(r.a.invert(this._viewTransform,i.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},s.prototype.dataToPoint=function(e,t,i){i=e.dataToPoint(t,null,i);var n=this._viewTransform;n&&o.a.applyTransform(i,i,n)},s.prototype.removeTransformInPoint=function(e){return this._viewTransform&&o.a.applyTransform(e,e,this._viewTransform),e},s.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},s.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)},s.prototype._updateCamera=function(e,t,i){this.viewGL.setViewport(0,0,e,t,i);var n=this.viewGL.camera;n.left=n.top=0,n.bottom=t,n.right=e,n.near=0,n.far=100},t.a=s},function(e,t,i){(function(e){var i;"undefined"!=typeof window?i=window.__DEV__:void 0!==e&&(i=e.__DEV__),void 0===i&&(i=!0);var n=i;t.__DEV__=n}).call(t,i(68))},function(e,t,i){var n,r,a,o,s,l,u,h=i(15),c=i(0),d=i.n(c),f=i(38),p=i(6).a.vec2,g=[[0,0],[1,1]],m=h.a.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new h.a.Attribute("position","float",2,"POSITION"),normal:new h.a.Attribute("normal","float",2),offset:new h.a.Attribute("offset","float",1),color:new h.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,i,n){return 1/(p.dist(e,t)+p.dist(i,t)+p.dist(n,i)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),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,i,n,r,a){null==a&&(a=1);var o=e[0],s=e[1],l=t[0],u=t[1],h=i[0],c=i[1],d=n[0],f=n[1],p=this._getCubicCurveApproxStep(e,t,i,n),g=p*p,m=g*p,v=3*p,y=3*g,_=6*g,x=6*m,b=o-2*l+h,w=s-2*u+c,T=3*(l-h)-o+d,S=3*(u-c)-s+f,M=o,A=s,I=(l-o)*v+b*y+T*m,C=(u-s)*v+w*y+S*m,D=b*_+T*x,E=w*_+S*x,L=T*x,P=S*x,N=0,R=0,O=Math.ceil(1/p),k=new Float32Array(3*(O+1)),z=(k=[],0);for(R=0;R1&&(M=I>0?Math.min(M,d):Math.max(M,d),A=C>0?Math.min(A,f):Math.max(A,f));this.addPolyline(k,r,a)},addLine:function(e,t,i,n){this.addPolyline([e,t],i,n)},addPolyline:(n=p.create(),r=p.create(),a=p.create(),o=p.create(),s=[],l=[],u=[],function(e,t,i,h,c){if(e.length){var d="number"!=typeof e[0];if(null==c&&(c=d?e.length:e.length/2),!(c<2)){null==h&&(h=0),null==i&&(i=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,g=d?"number"!=typeof t[0]:t.length/4===c,m=this.attributes.position,v=this.attributes.color,y=this.attributes.offset,_=this.attributes.normal,x=this.indices,b=this._vertexOffset,w=0;w1&&(m.copy(b,b-1),v.copy(b,b-1),b++);else{var M;if(w0){p.sub(n,s,u),p.sub(r,l,s),p.normalize(n,n),p.normalize(r,r),p.add(o,n,r),p.normalize(o,o);var A=i/2*Math.min(1/p.dot(n,o),2);a[0]=-o[1],a[1]=o[0],M=A}else p.sub(n,l,s),p.normalize(n,n),a[0]=-n[1],a[1]=n[0],M=i/2;else p.sub(n,s,u),p.normalize(n,n),a[0]=-n[1],a[1]=n[0],M=i/2;_.set(b,a),_.set(b+1,a),y.set(b,M),y.set(b+1,-M),p.copy(u,s),m.set(b,s),m.set(b+1,s),v.set(b,f),v.set(b+1,f),b+=2}if(this.useNativeLine)v.set(b,f),m.set(b,s),b++;else if(w>0){var I=3*this._faceOffset;(x=this.indices)[I]=b-4,x[I+1]=b-3,x[I+2]=b-2,x[I+3]=b-3,x[I+4]=b-1,x[I+5]=b-2,this._faceOffset+=2}}this._vertexOffset=b}}}),setItemColor:function(e,t){for(var i=this._itemVertexOffsets[e],n=ee&&o=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var i=this.zr;e.scene.traverse((function(e){e.__zr=i,e.addAnimatorsToZr&&e.addAnimatorsToZr(i)}))}},d.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(f,this),e.layer=null,this._viewsToDispose.push(e))}},d.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(f,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},d.prototype.resize=function(e,t){this.renderer.resize(e,t)},d.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},d.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},d.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},d.prototype.needsRefresh=function(){this.zr.refresh()},d.prototype.refresh=function(e){this._backgroundColor=e?l.a.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t20)){e=e.event;var n=this.pickObject(e.offsetX,e.offsetY);n&&(this._dispatchEvent(e.type,e,n),this._dispatchDataEvent(e.type,e,n));var r=this._clickToSetFocusPoint(e);r&&r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},d.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,i=t.viewport,n=this.views.length-1;n>=0;n--){var r=this.views[n];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=i},d.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},d.prototype.pickObject=function(e,t){for(var i=[],n=this.renderer,r=n.viewport,a=0;a=0&&(l.dataIndex=this._lastDataIndex,l.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0):null!=o&&o!==this._lastEventData&&(null!=this._lastEventData&&(l.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0),this._lastEventData=o,this._lastDataIndex=r,this._lastSeriesIndex=a),l.eventData=o,l.dataIndex=r,l.seriesIndex=a,(null!=o||parseInt(r,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),s&&this.zr.handler.dispatchToElement(u,"mouseover",t))},d.prototype._dispatchToView=function(e,t){for(var i=0;i=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}}},function(e,t,i){var n=i(69),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 o(e){return(e=Math.round(e))<0?0:e>255?255:e}function s(e){return e<0?0:e>1?1:e}function l(e){return e.length&&"%"===e.charAt(e.length-1)?o(parseFloat(e)/100*255):o(parseInt(e,10))}function u(e){return e.length&&"%"===e.charAt(e.length-1)?s(parseFloat(e)/100):s(parseFloat(e))}function h(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function c(e,t,i){return e+(t-e)*i}function d(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,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 n.a(20),g=null;function m(e,t){g&&f(g,t),g=p.put(e,g||t.slice())}function v(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=u(e[1]),r=u(e[2]),a=r<=.5?r*(n+1):r+n-r*n,s=2*r-a;return d(t=t||[],o(255*h(s,a,i+1/3)),o(255*h(s,a,i)),o(255*h(s,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}r.parse=function(e,t){if(e){t=t||[];var i=p.get(e);if(i)return f(t,i);var n,r=(e+="").replace(/ /g,"").toLowerCase();if(r in a)return f(t,a[r]),m(e,t),t;if("#"===r.charAt(0))return 4===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=4095?(d(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),m(e,t),t):void d(t,0,0,0,1):7===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=16777215?(d(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),m(e,t),t):void d(t,0,0,0,1):void 0;var o=r.indexOf("("),s=r.indexOf(")");if(-1!==o&&s+1===r.length){var h=r.substr(0,o),c=r.substr(o+1,s-(o+1)).split(","),g=1;switch(h){case"rgba":if(4!==c.length)return void d(t,0,0,0,1);g=u(c.pop());case"rgb":return 3!==c.length?void d(t,0,0,0,1):(d(t,l(c[0]),l(c[1]),l(c[2]),g),m(e,t),t);case"hsla":return 4!==c.length?void d(t,0,0,0,1):(c[3]=u(c[3]),v(c,t),m(e,t),t);case"hsl":return 3!==c.length?void d(t,0,0,0,1):(v(c,t),m(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 i=r.parse(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0;return r.stringify(i,4===i.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,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),l=t[r],u=t[a],h=n-r;return i[0]=o(c(l[0],u[0],h)),i[1]=o(c(l[1],u[1],h)),i[2]=o(c(l[2],u[2],h)),i[3]=s(c(l[3],u[3],h)),i}},r.fastMapToColor=r.fastLerp,r.lerp=function(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),a=Math.floor(n),l=Math.ceil(n),u=r.parse(t[a]),h=r.parse(t[l]),d=n-a,f=r.stringify([o(c(u[0],h[0],d)),o(c(u[1],h[1],d)),o(c(u[2],h[2],d)),s(c(u[3],h[3],d))],"rgba");return i?{color:f,leftIndex:a,rightIndex:l,value:n}:f}},r.mapToColor=r.lerp,r.modifyHSL=function(e,t,i,n){if(e=r.parse(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=u(i)),null!=n&&(e[2]=u(n)),r.stringify(v(e),"rgba")},r.modifyAlpha=function(e,t){if((e=r.parse(e))&&null!=t)return e[3]=s(t),r.stringify(e,"rgba")},r.stringify=function(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}},t.a=r},function(e,t,i){var n=function(){this.head=null,this.tail=null,this._length=0};n.prototype.insert=function(e){var t=new n.Entry(e);return this.insertEntry(t),t},n.prototype.insertAt=function(e,t){if(!(e<0)){for(var i=this.head,r=0;i&&r!=e;)i=i.next,r++;if(i){var a=new n.Entry(t),o=i.prev;o?(o.next=a,a.prev=o):this.head=a,a.next=i,i.prev=a}else this.insert(t)}},n.prototype.insertBeforeEntry=function(e,t){var i=new n.Entry(e),r=t.prev;r?(r.next=i,i.prev=r):this.head=i,i.next=t,t.prev=i,this._length++},n.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},n.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._length--},n.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,i=0;t&&i!=e;)t=t.next,i++;return t?(this.remove(t),t.value):void 0}},n.prototype.getHead=function(){if(this.head)return this.head.value},n.prototype.getTail=function(){if(this.tail)return this.tail.value},n.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,i=0;t&&i!=e;)t=t.next,i++;return t.value}},n.prototype.indexOf=function(e){for(var t=this.head,i=0;t;){if(t.value===e)return i;t=t.next,i++}},n.prototype.length=function(){return this._length},n.prototype.isEmpty=function(){return 0===this._length},n.prototype.forEach=function(e,t){for(var i=this.head,n=0,r=void 0!==t;i;)r?e.call(t,i.value,n):e(i.value,n),i=i.next,n++},n.prototype.clear=function(){this.tail=this.head=null,this._length=0},n.Entry=function(e){this.value=e,this.next=null,this.prev=null},t.a=n},function(e,t,i){var n=i(116),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,i){var n={};for(var a in i)n[a+"_COUNT"]=i[a];return e.replace(r,(function(e,i,r,a){var o="";isNaN(i)&&(i=i in t?t[i]:n[i]),isNaN(r)&&(r=r in t?t[r]:n[r]);for(var s=parseInt(i);s0&&n.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(i)for(var o=0;oh.getMaxJointNumber()&&(p.USE_SKIN_MATRICES_TEXTURE=null),f="\n"+o(p)+"\n"}var g=f+o(t.vertexDefines,u,d),m=f+o(t.fragmentDefines,u,d),v=g+"\n"+t.shader.vertex,y=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=h.getGLExtension(e)}));y.indexOf("EXT_shader_texture_lod")>=0&&(m+="\n#define SUPPORT_TEXTURE_LOD"),y.indexOf("OES_standard_derivatives")>=0&&(m+="\n#define SUPPORT_STANDARD_DERIVATIVES");var _,x,b=function(e){for(var t=[],i=0;i=0&&A[S]>1e-4&&(h.a.transformMat4(D,M,w[I[S]]),h.a.scaleAndAdd(C,C,D,A[S]));E.set(T,C)}}for(T=0;T=0){t||(t=[]);var i=this.indices;return t[0]=i[3*e],t[1]=i[3*e+1],t[2]=i[3*e+2],t}},setTriangleIndices:function(e,t){var i=this.indices;i[3*e]=t[0],i[3*e+1]=t[1],i[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,i=this.vertexCount>65535?o.a.Uint32Array:o.a.Uint16Array;if(e[0]&&e[0].length){var n=0;t=new i(3*e.length);for(var r=0;r=0&&(t.splice(i,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 i=[],n=this.vertexCount,r=0;r0){var r=Math.pow(2,e[3]-128-8+n);t[i+0]=e[0]*r,t[i+1]=e[1]*r,t[i+2]=e[2]*r}else t[i+0]=0,t[i+1]=0,t[i+2]=0;return t[i+3]=1,t}function s(e,t,i,n){for(var r,a,o=0,s=0,l=n;l>0;)if(e[s][0]=t[i++],e[s][1]=t[i++],e[s][2]=t[i++],e[s][3]=t[i++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var u=e[s][3]<>>0;u>0;u--)r=e[s-1],(a=e[s])[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],s++,l--;o+=8}else s++,l--,o=0;return i}function l(e,t,i,n){if(n<8|n>32767)return s(e,t,i,n);if(2!=(r=t[i++]))return s(e,t,i-1,n);if(e[0][1]=t[i++],e[0][2]=t[i++],r=t[i++],(e[0][2]<<8>>>0|r)>>>0!==n)return null;for(var r=0;r<4;r++)for(var a=0;a128){o=(127&o)>>>0;for(var l=t[i++];o--;)e[a++][r]=l}else for(;o--;)e[a++][r]=t[i++]}return i}var u={parseRGBE:function(e,t,i){null==i&&(i=0);var s=new Uint8Array(e),u=s.length;if("#?"===function(e,t,i){for(var n="",r=t;r=u)){h+=2;for(var c="";h=0||(o.forEach((function(t){e.on(t,this[s(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),o.forEach((function(t){e.off(t,this[s(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}},t.a=m},function(e,t,i){var n=i(24),r=i(77),a=n.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){if(e.getGLExtension("EXT_shader_texture_lod")){this._brdfLookup||(this._normalDistribution=r.a.generateNormalDistribution(),this._brdfLookup=r.a.integrateBRDF(e,this._normalDistribution));var i=this.cubemap;if(!i.__prefiltered){var n=r.a.prefilterEnvironmentMap(e,i,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=n.environmentMap,this.cubemap.__prefiltered=!0,i.dispose(e)}}else console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}});t.a=a},function(e,t,i){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,i){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.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * 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,i){t.a="#define SHADER_NAME prefilter\n#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;\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.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, 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,i){var n=i(24),r=i(14),a=n.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,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,i=0;i65535?Uint32Array:Uint16Array,_=this.indices=new y(t*e*6),x=this.radius,b=this.phiStart,w=this.phiLength,T=this.thetaStart,S=this.thetaLength,M=[],A=[],I=0,C=1/(x=this.radius);for(f=0;f<=e;f++)for(d=0;d<=t;d++)h=d/t,c=f/e,s=-x*Math.cos(b+h*w)*Math.sin(T+c*S),l=x*Math.cos(T+c*S),u=x*Math.sin(b+h*w)*Math.sin(T+c*S),M[0]=s,M[1]=l,M[2]=u,A[0]=h,A[1]=c,i.set(I,M),n.set(I,A),M[0]*=C,M[1]*=C,M[2]*=C,a.set(I,M),I++;var D=t+1,E=0;for(f=0;f=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,i=t.length,n=0;n.5?t:e}function c(e,t,i,n,r){var a=e.length;if(1==r)for(var o=0;or)e.length=r;else for(var a=n;a=0&&!(I[i]<=t);i--);i=Math.min(i,x-2)}else{for(i=V;it);i++);i=Math.min(i-1,x-2)}V=i,G=t;var n=I[i+1]-I[i];if(0!==n)if(O=(t-I[i])/n,_)if(z=C[i],k=C[0===i?i:i-1],B=C[i>x-2?x-1:i+1],F=C[i>x-3?x-1:i+2],T)p(k,z,B,F,O,O*O,O*O*O,m(e,s),A);else{if(S)r=p(k,z,B,F,O,O*O,O*O*O,H,1),r=v(H);else{if(M)return h(z,B,O);r=g(k,z,B,F,O,O*O,O*O*O)}y(e,s,r)}else if(T)c(C[i],C[i+1],O,m(e,s),A);else{var r;if(S)c(C[i],C[i+1],O,H,1),r=v(H);else{if(M)return h(C[i],C[i+1],O);r=u(C[i],C[i+1],O)}y(e,s,r)}},ondestroy:i});return t&&"spline"!==t&&(U.easing=t),U}}}var _=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||s,this._setter=n||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};_.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==e&&i[n].push({time:0,value:m(r)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e255?255:e}function o(e){return e<0?0:e>1?1:e}function s(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)?o(parseFloat(e)/100):o(parseFloat(e))}function u(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function h(e,t,i){return e+(t-e)*i}function c(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,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 n(20),p=null;function g(e,t){p&&d(p,t),p=f.put(e,p||t.slice())}function m(e,t){if(e){t=t||[];var i=f.get(e);if(i)return d(t,i);var n,a=(e+="").replace(/ /g,"").toLowerCase();if(a in r)return d(t,r[a]),g(e,t),t;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(c(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),g(e,t),t):void c(t,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(c(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),g(e,t),t):void c(t,0,0,0,1):void 0;var o=a.indexOf("("),u=a.indexOf(")");if(-1!==o&&u+1===a.length){var h=a.substr(0,o),p=a.substr(o+1,u-(o+1)).split(","),m=1;switch(h){case"rgba":if(4!==p.length)return void c(t,0,0,0,1);m=l(p.pop());case"rgb":return 3!==p.length?void c(t,0,0,0,1):(c(t,s(p[0]),s(p[1]),s(p[2]),m),g(e,t),t);case"hsla":return 4!==p.length?void c(t,0,0,0,1):(p[3]=l(p[3]),v(p,t),g(e,t),t);case"hsl":return 3!==p.length?void c(t,0,0,0,1):(v(p,t),g(e,t),t);default:return}}c(t,0,0,0,1)}}function v(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=l(e[1]),r=l(e[2]),o=r<=.5?r*(n+1):r+n-r*n,s=2*r-o;return c(t=t||[],a(255*u(s,o,i+1/3)),a(255*u(s,o,i)),a(255*u(s,o,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function y(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),s=Math.ceil(n),l=t[r],u=t[s],c=n-r;return i[0]=a(h(l[0],u[0],c)),i[1]=a(h(l[1],u[1],c)),i[2]=a(h(l[2],u[2],c)),i[3]=o(h(l[3],u[3],c)),i}}var _=y;function x(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),r=Math.floor(n),s=Math.ceil(n),l=m(t[r]),u=m(t[s]),c=n-r,d=w([a(h(l[0],u[0],c)),a(h(l[1],u[1],c)),a(h(l[2],u[2],c)),o(h(l[3],u[3],c))],"rgba");return i?{color:d,leftIndex:r,rightIndex:s,value:n}:d}}var b=x;function w(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}t.parse=m,t.lift=function(e,t){var i=m(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return w(i,4===i.length?"rgba":"rgb")}},t.toHex=function(e){var t=m(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},t.fastLerp=y,t.fastMapToColor=_,t.lerp=x,t.mapToColor=b,t.modifyHSL=function(e,t,i,n){if(e=m(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=l(i)),null!=n&&(e[2]=l(n)),w(v(e),"rgba")},t.modifyAlpha=function(e,t){if((e=m(e))&&null!=t)return e[3]=o(t),w(e,"rgba")},t.stringify=w},function(e,t,i){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\n#ifdef SUPPORT_STANDARD_DERIVATIVES\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#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\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, 8.12), 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, 8.12);\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;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\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,i){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,i){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,i){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,i){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), 8.12);\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,i){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,i){t.a="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\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 v_Texcoord = texcoord;\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,i){var n=i(0),r=i.n(n),a=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function o(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var i=e[t].normal,n=e[t].emphasis;i&&(e[t]=i),n&&(e.emphasis=e.emphasis||{},e.emphasis[t]=n)}}function s(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){o(e,"itemStyle"),o(e,"lineStyle"),o(e,"areaStyle"),o(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),s(e.xAxis3D),s(e.yAxis3D),s(e.zAxis3D),s(e.grid3D),o(e.geo3D)}},function(e,t,i){i(155),i(159),i(160),i(167);var n=i(0),r=i.n(n);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,i){var n=i(0),r=i.n(n),a=i(156),o=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 s(e,t){return t.type||(t.data?"category":"value")}r.a.helper.mixinAxisModelCommonMethods(o),Object(a.a)("x",o,s,{name:"X"}),Object(a.a)("y",o,s,{name:"Y"}),Object(a.a)("z",o,s,{name:"Z"})},function(e,t,i){var n=i(0),r=i.n(n),a=i(157),o=i(158),s=i.n(o),l=["value","category","time","log"];t.a=function(e,t,i,n){r.a.util.each(l,(function(o){t.extend({type:e+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(t,n){var a=n.getTheme();r.a.util.merge(t,a.get(o+"Axis3D")),r.a.util.merge(t,this.getDefaultOption()),t.type=i(e,t)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=s.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[o+"Axis3D"]),n||{},!0)})})),t.superClass.registerSubTypeDefaulter(e+"Axis3D",r.a.util.curry(i,e))}},function(e,t,i){var n=i(0),r=i.n(n),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},o=r.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),s=r.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),l=r.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),u=r.a.util.defaults({logBase:10},s);u.scale=!0,t.a={categoryAxis3D:o,valueAxis3D:s,timeAxis3D:l,logAxis3D:u}},function(e,t,i){var n=i(13),r=n.createHashMap,a=n.isObject,o=n.map;function s(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}s.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&o(i,h);return new s({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var l=s.prototype;function u(e){return e._map||(e._map=r(e.categories))}function h(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,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=u(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var c=s;e.exports=c},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),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,o.a),r.a.util.merge(l.prototype,s.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(25),l=i(2),u=i(81),h=i(30),c=i(162),d=i(164),f=i(63),p=i(46),g=l.a.firstNotNull;a.a.Shader.import(p.a),["x","y","z"].forEach((function(e){r.a.extendComponentView({type:e+"Axis3D"})}));var m={x:0,y:2,z:1};r.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(e,t){var i=new a.a.Material({shader:a.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),n=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});i.define("fragment","DOUBLE_SIDED"),i.define("both","VERTEX_COLOR"),this.groupGL=new a.a.Node,this._control=new o.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 c.a(e,n,i);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new d.a(e,n);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 s.a({useNativeLine:!1}),material:n,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 h.a,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,i){this._model=e,this._api=i;var n=e.coordinateSystem;n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(n.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),r.off("update"),e.get("show")&&(this._faces.forEach((function(n){n.update(e,t,i)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,i)}),this)),r.on("update",this._onCameraChange.bind(this,e,i),this),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},showAxisPointer:function(e,t,i,n){this._doShowAxisPointer(),this._updateAxisPointer(n.value)},hideAxisPointer:function(e,t,i,n){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,i=this._model.coordinateSystem,n=i.viewGL,r=n.castRay(e.offsetX,e.offsetY,new a.a.Ray),o=0;on[1]?0:1,s=this._faces[2*i+o],l=this._faces[2*i+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),i=e.getAxis("y"),n=e.getAxis("z"),r=n.getExtentMax(),a=n.getExtentMin(),o=t.getExtentMin(),s=t.getExtentMax(),l=i.getExtentMax(),u=i.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,g=f[2].rootNode.invisible?r:a,m=f[0].rootNode.invisible?o:s,v=f[2].rootNode.invisible?r:a,y=f[0].rootNode.invisible?s:o,_=f[4].rootNode.invisible?u:l;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,g,p),c.position.set(m,v,0),d.position.set(y,0,_),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new a.a.Vector4,new a.a.Vector4],i=new a.a.Vector4;this.groupGL.getWorldPosition(i),i.w=1,i.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),i.x/=i.w,i.y/=i.w,this._axes.forEach((function(n){var r=n.axisLineCoords;n.labelsMesh.geometry;for(var a=0;ai.y?"bottom":"top"):(s="middle",o=h>i.x?"left":"right"),n.setSpriteAlign(o,s,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,i=t.dataToPoint(e),n=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function s(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"),i=a.a.parseColor(t.get("color")),n=g(t.get("width"),1),o=g(t.get("opacity"),1);return i[3]*=o,{color:i,lineWidth:n}}n.convertToDynamicArray(!0);for(var h=0;h0&&e.rotation.rotateY(Math.PI),t.normal.z=-n)}(this.rootNode,this.plane,s,this.faceInfo[3])},c.prototype._updateSplitLines=function(e,t,i,n){var o=n.getDevicePixelRatio();t.forEach((function(n,s){var l=n.model,h=t[1-s].getExtent();if(!n.scale.isBlank()){var c=l.getModel("splitLine",i.getModel("splitLine"));if(c.get("show")){var d=c.getModel("lineStyle"),f=d.get("color"),p=u(d.get("opacity"),1),g=u(d.get("width"),1);f=r.a.util.isArray(f)?f:[f];for(var m=n.getTicksCoords({tickModel:c}),v=0,y=0;y65535?new Uint32Array(3*n):new Uint16Array(3*n))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(n=c.create(),r=c.create(),a=c.create(),o=[0,3,1,3,2,1],function(e,t){var i=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;c.sub(n,e[1],e[0]),c.sub(r,e[2],e[1]),c.cross(a,n,r),c.normalize(a,a);for(var u=0;u<4;u++)i.set(this._vertexOffset+u,e[u]),l.set(this._vertexOffset+u,t),s.set(this._vertexOffset+u,a);var h=3*this._faceOffset;for(u=0;u<6;u++)this.indices[h+u]=o[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});u.a.util.defaults(d.prototype,h.a),t.a=d},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(25),s=i(2),l=i(63),u=s.a.firstNotNull,h={x:0,y:2,z:1};function c(e,t){var i=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),n=new l.a;n.material.depthMask=!1;var r=new a.a.Node;r.add(i),r.add(n),this.rootNode=r,this.dim=e,this.linesMesh=i,this.labelsMesh=n,this.axisLineCoords=null,this.labelElements=[]}var d={x:"y",y:"x",z:"y"};c.prototype.update=function(e,t,i){var n=e.coordinateSystem.getAxis(this.dim),o=this.linesMesh.geometry,s=this.labelsMesh.geometry;o.convertToDynamicArray(!0),s.convertToDynamicArray(!0);var l=n.model,c=n.getExtent(),f=i.getDevicePixelRatio(),p=l.getModel("axisLine",e.getModel("axisLine")),g=l.getModel("axisTick",e.getModel("axisTick")),m=l.getModel("axisLabel",e.getModel("axisLabel")),v=p.get("lineStyle.color");if(p.get("show")){var y=p.getModel("lineStyle"),_=[0,0,0];(D=[0,0,0])[E=h[n.dim]]=c[0],_[E]=c[1],this.axisLineCoords=[D,_];var x=a.a.parseColor(v),b=u(y.get("width"),1),w=u(y.get("opacity"),1);x[3]*=w,o.addLine(D,_,x,b*f)}if(g.get("show")){var T=g.getModel("lineStyle"),S=a.a.parseColor(u(T.get("color"),v));b=u(T.get("width"),1),S[3]*=u(T.get("opacity"),1);for(var M=n.getTicksCoords(),A=g.get("length"),I=0;I65535?new Uint32Array(3*i):new Uint16Array(3*i))},setSpriteAlign:function(e,t,i,n,r){var a,o,s,l;switch(null==i&&(i="left"),null==n&&(n="top"),r=r||0,i){case"left":a=r,s=t[0]+r;break;case"center":case"middle":a=-t[0]/2,s=t[0]/2;break;case"right":a=-t[0]-r,s=-r}switch(n){case"bottom":o=r,l=t[1]+r;break;case"middle":o=-t[1]/2,l=t[1]/2;break;case"top":o=-t[1]-r,l=-r}var u=4*e,h=this.attributes.offset;h.set(u,[a,l]),h.set(u+1,[s,l]),h.set(u+2,[s,o]),h.set(u+3,[a,o])},addSprite:function(e,t,i,n,r,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,i,n,r,a);for(var l=0;l"'])/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"};function u(e){return null==e?"":(e+"").replace(s,(function(e,t){return l[t]}))}var h=["a","b","c","d","e","f","g"],c=function(e,t){return"{"+e+(null==t?"":t)+"}"};function d(e,t){return"0000".substr(0,t-(e+="").length)+e}var f=r.truncateText,p=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=o,t.encodeHTML=u,t.formatTpl=function(e,t,i){n.isArray(t)||(t=[t]);var r=t.length;if(!r)return"";for(var a=t[0].$vars||[],o=0;o':'':""},t.formatTime=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=a.parseDate(t),r=i?"UTC":"",o=n["get"+r+"FullYear"](),s=n["get"+r+"Month"]()+1,l=n["get"+r+"Date"](),u=n["get"+r+"Hours"](),h=n["get"+r+"Minutes"](),c=n["get"+r+"Seconds"](),f=n["get"+r+"Milliseconds"]();return e=e.replace("MM",d(s,2)).replace("M",s).replace("yyyy",o).replace("yy",o%100).replace("dd",d(l,2)).replace("d",l).replace("hh",d(u,2)).replace("h",u).replace("mm",d(h,2)).replace("m",h).replace("ss",d(c,2)).replace("s",c).replace("SSS",d(f,3))},t.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},t.truncateText=f,t.getTextRect=p},function(e,t,i){var n=i(82),r=i(173),a=i(13),o=a.getContext,s=a.extend,l=a.retrieve2,u=a.retrieve3,h=a.trim,c={},d=0,f=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,p="12px sans-serif",g={};function m(e,t){var i=e+":"+(t=t||p);if(c[i])return c[i];for(var n=(e+"").split("\n"),r=0,a=0,o=n.length;a5e3&&(d=0,c={}),d++,c[i]=r,r}function v(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function y(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function _(e,t,i,n,r){if(!t)return"";var a=(e+"").split("\n");r=x(t,i,n,r);for(var o=0,s=a.length;o=a;u++)o-=a;var h=m(i);return h>o&&(i="",h=0),o=e-h,n.ellipsis=i,n.ellipsisWidth=h,n.contentWidth=o,n.containerWidth=e,n}function b(e,t){var i=t.containerWidth,n=t.font,r=t.contentWidth;if(!i)return"";var a=m(e,n);if(a<=i)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?w(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=m(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function w(e,t,i,n){for(var r=0,a=0,o=e.length;al)e="",a=[];else if(null!=u)for(var h=x(u-(i?i[1]+i[3]:0),t,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),c=0,d=a.length;ca&&I(i,e.substring(a,o)),I(i,n[2],n[1]),a=f.lastIndex}ay)return{lines:[],width:0,height:0};z.textWidth=m(z.text,D);var L=A.textWidth,P=null==L||"auto"===L;if("string"==typeof L&&"%"===L.charAt(L.length-1))z.percentWidth=L,d.push(z),L=0;else{if(P){L=z.textWidth;var N=A.textBackgroundColor,R=N&&N.image;R&&(R=r.findExistImage(R),r.isImageReady(R)&&(L=Math.max(L,R.width*E/R.height)))}var O=C?C[1]+C[3]:0;L+=O;var k=null!=v?v-S:null;null!=k&&k4){console.warn("Support at most 4 cascade");continue}p.shadowCascade>1&&(o=p),this.renderDirectionalLightShadow(e,t,i,p,c,h,u)}else"SPOT_LIGHT"===p.type?this.renderSpotLightShadow(e,t,p,l,s):"POINT_LIGHT"===p.type&&this.renderPointLightShadow(e,t,p,d);this._shadowMapNumber[p.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(f=0;f0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}for(f=0;f0){var x=u.map(S);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:h,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},o){var b=c.slice(),w=c.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),h.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var T=s.map(S);(_=t.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:T,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function S(e){return e.height}},renderDirectionalLightShadow:(M=new s.a,A=new l.a,I=new o.a,C=new l.a,D=new l.a,E=new l.a,L=new l.a,function(e,t,i,n,r,a,o){var s=this._getDepthMaterial(n),h={getMaterial:function(e){return e.shadowDepthMaterial||s},isMaterialChanged:S,getUniform:T,ifRender:function(e){return e.castShadow},sortCompare:u.a.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var c=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(c).applyTransform(i.viewMatrix)}var d=Math.min(-t.viewBoundingBoxLastFrame.min.z,i.far),f=Math.max(-t.viewBoundingBoxLastFrame.max.z,i.near),p=this._getDirectionalLightCamera(n,t,i),g=E.array;L.copy(p.projectionMatrix),x.a.invert(D.array,p.worldTransform.array),x.a.multiply(D.array,D.array,i.worldTransform.array),x.a.multiply(g,L.array,D.array);for(var v=[],y=i instanceof m.a,_=(i.near+i.far)/(i.near-i.far),b=2*i.near*i.far/(i.near-i.far),w=0;w<=n.shadowCascade;w++){var N=f*Math.pow(d/f,w/n.shadowCascade),R=f+(d-f)*w/n.shadowCascade,O=N*n.cascadeSplitLogFactor+R*(1-n.cascadeSplitLogFactor);v.push(O),r.push(-(-O*_+b)/-O)}var k=this._getTexture(n,n.shadowCascade);o.push(k);var z=e.viewport,B=e.gl;for(this._frameBuffer.attach(k),this._frameBuffer.bind(e),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT),w=0;wl?s>u?v[r>0?"px":"nx"]=!0:v[o>0?"pz":"nz"]=!0:l>u?v[a>0?"py":"ny"]=!0:v[o>0?"pz":"nz"]=!0}for(i=0;i 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\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 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,i){var n=i(8),r=i(5),a=i(4),o=i(10),s=i(177),l=i(189),u=i(191),h=i(193),c=i(1),d=i(194),f=i(196);i(9);var p=i(197),g=i(87),m=i(88),v=i(89),y=i(90),_=i(91),x=i(92),b=i(93),w=i(94),T=i(95),S=i(198),M=i(199);n.a.import(g.a),n.a.import(m.a),n.a.import(v.a),n.a.import(y.a),n.a.import(_.a),n.a.import(x.a),n.a.import(b.a),n.a.import(w.a),n.a.import(T.a),n.a.import(S.a),n.a.import(M.a);var A={color:{parameters:{width:function(e){return e.getWidth()},height:function(e){return e.getHeight()}}}},I=["composite","FXAA"];function C(){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 o.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,o.a.DEPTH_ATTACHMENT),this._normalPass=new d.a,this._compositor=Object(s.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=I.map((function(e){return this._compositor.getNodeByName(e)}),this);var i={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new l.a(i),this._ssrPass=new u.a(i),this._edgePass=new f.a(i)}C.prototype.resize=function(e,t,i){e*=i=i||1,t*=i;var n=this._sourceTexture,r=this._depthTexture;n.width=e,n.height=t,r.width=e,r.height=t},C.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},C.prototype._getPrevNode=function(e){for(var t=I.indexOf(e.name)-1,i=this._finalNodesChain[t];i&&!this._compositor.getNodeByName(i.name);)t-=1,i=this._finalNodesChain[t];return i},C.prototype._getNextNode=function(e){for(var t=I.indexOf(e.name)+1,i=this._finalNodesChain[t];i&&!this._compositor.getNodeByName(i.name);)t+=1,i=this._finalNodesChain[t];return i},C.prototype._addChainNode=function(e){var t=this._getPrevNode(e),i=this._getNextNode(e);t&&(t.outputs=A,e.inputs.texture=t.name,i?(e.outputs=A,i.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},C.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),i=this._getNextNode(e);t&&(i?(t.outputs=A,i.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},C.prototype.updateNormal=function(e,t,i,n){this._ifRenderNormalPass()&&this._normalPass.update(e,t,i)},C.prototype.updateSSAO=function(e,t,i,n){this._ssaoPass.update(e,i,n)},C.prototype.enableSSAO=function(){this._enableSSAO=!0},C.prototype.disableSSAO=function(){this._enableSSAO=!1},C.prototype.enableSSR=function(){this._enableSSR=!0},C.prototype.disableSSR=function(){this._enableSSR=!1},C.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},C.prototype.getSourceFrameBuffer=function(){return this._framebuffer},C.prototype.getSourceTexture=function(){return this._sourceTexture},C.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},C.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},C.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},C.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},C.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},C.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},C.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},C.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},C.prototype.enableEdge=function(){this._enableEdge=!0},C.prototype.disableEdge=function(){this._enableEdge=!1},C.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},C.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var i={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",i);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)}},C.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var i=0;i=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=i.COLOR_ATTACHMENT0&&c<=i.COLOR_ATTACHMENT0+8&&h.push(c);u.drawBuffersEXT(h)}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(),n.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=o},function(e,t,i){var n=i(48).a.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});t.a=n},function(e,t,i){var n=i(16),r=i(48),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 n.a({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var i=e.gl;for(var n in this.inputLinks){var r=(c=this.inputLinks[n]).node.getOutput(e,c.pin);this.pass.setUniform(n,r)}if(this.outputs){this.pass.outputs={};var a={};for(var o in this.outputs){var s=this.updateParameter(o,e);isNaN(s.width)&&this.updateParameter(o,e);var l=this.outputs[o],u=this._compositor.allocateTexture(s);this._outputTextures[o]=u,"string"==typeof(h=l.attachment||i.COLOR_ATTACHMENT0)&&(h=i[h]),a[h]=u}for(var h in this._compositor.getFrameBuffer().bind(e),a)this._compositor.getFrameBuffer().attach(a[h],h);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var n in this.inputLinks){var c;(c=this.inputLinks[n]).node.removeReference(c.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var i,n,r=this.outputs[e],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return i=a.width instanceof Function?a.width.call(this,t):a.width,n=a.height instanceof Function?a.height.call(this,t):a.height,i=Math.ceil(i),n=Math.ceil(n),o.width===i&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t),o.width=i,o.height=n,o},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,i){t.a=function(e){e.import(n.a),e.import(r.a),e.import(a.a),e.import(o.a),e.import(s.a),e.import(l.a),e.import(u.a),e.import(h.a),e.import(c.a),e.import(d.a),e.import(f.a),e.import(p.a),e.import(g.a)};var n=i(185),r=i(87),a=i(186),o=i(88),s=i(187),l=i(89),u=i(90),h=i(91),c=i(92),d=i(93),f=i(188),p=i(94),g=i(95)},function(e,t,i){t.a="@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"},function(e,t,i){var n=i(9),r=i(3),a=i(5),o=i(4),s=i(16),l=i(8),u=i(10),h=i(49),c=i(190);function d(e){for(var t=new Uint8Array(e*e*4),i=0,n=new r.a,a=0;a 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,i){var n=i(9);i(3);var r=i(5),a=i(4),o=i(16),s=i(8),l=i(10);i(49);var u=i(77),h=i(192);function c(e){e=e||{},this._ssrPass=new o.a({fragment:s.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new o.a({fragment:s.a.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),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._ssrTexture=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._prevTexture=new r.a({type:a.a.HALF_FLOAT}),this._currentTexture=new r.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new l.a({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}s.a.import(h.a),c.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var i=e&&t;this._ssrPass.material[i?"enableTexture":"disableTexture"]("specularCubemap")},c.prototype.update=function(e,t,i,r){var a=e.getWidth(),o=e.getHeight(),s=this._ssrTexture,l=this._texture2,u=this._texture3;s.width=this._prevTexture.width=this._currentTexture.width=a/this._downScale,s.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,l.width=u.width=a,l.height=u.height=o;var h=this._frameBuffer,c=this._ssrPass,d=this._blurPass1,f=this._blurPass2,p=this._blendPass,g=new n.a,m=new n.a;n.a.transpose(g,t.worldTransform),n.a.transpose(m,t.viewMatrix),c.setUniform("sourceTexture",i),c.setUniform("projection",t.projectionMatrix.array),c.setUniform("projectionInv",t.invProjectionMatrix.array),c.setUniform("toViewSpace",g.array),c.setUniform("toWorldSpace",m.array),c.setUniform("nearZ",t.near);var v=r/this._totalSamples*this._samplePerFrame;if(c.setUniform("jitterOffset",v),c.setUniform("sampleOffset",r*this._samplePerFrame),d.setUniform("textureSize",[s.width,s.height]),f.setUniform("textureSize",[a,o]),f.setUniform("sourceTexture",i),d.setUniform("projection",t.projectionMatrix.array),f.setUniform("projection",t.projectionMatrix.array),h.attach(s),h.bind(e),c.render(e),this._physicallyCorrect&&(h.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",s),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),h.attach(l),d.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),d.render(e),h.attach(u),f.setUniform("texture",l),f.render(e),h.unbind(e),this._physicallyCorrect){var y=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=y}},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.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=u.a.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},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.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},c.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=c},function(e,t,i){t.a="@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\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: 1;\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\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\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 dPQK *= 1.2;\n\n if (intersect) {\n break;\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 !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * 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 vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\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 : 1.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.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,i){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,i){var n=i(5),r=i(4),a=i(8),o=i(10),s=i(19),l=i(16),u=i(61),h=i(195);function c(e,t,i,n,r){var a=e.gl;t.setUniform(a,"1i",i,r),a.activeTexture(a.TEXTURE0+r),n.isRenderable()?n.bind(e):n.unbind(e)}function d(e,t,i,n,r){var a,o,s,l,u=e.gl;return function(r,h,d){if(!l||l.material!==r.material){var f=r.material,p=r.__program,g=f.get("roughness");null==g&&(g=1);var m=f.get("normalMap")||t,v=f.get("roughnessMap"),y=f.get("bumpMap"),_=f.get("uvRepeat"),x=f.get("uvOffset"),b=f.get("detailUvRepeat"),w=f.get("detailUvOffset"),T=!!y&&f.isTextureEnabled("bumpMap"),S=!!v&&f.isTextureEnabled("roughnessMap"),M=f.isDefined("fragment","DOUBLE_SIDED");y=y||i,v=v||n,d!==h?(h.set("normalMap",m),h.set("bumpMap",y),h.set("roughnessMap",v),h.set("useBumpMap",T),h.set("useRoughnessMap",S),h.set("doubleSide",M),null!=_&&h.set("uvRepeat",_),null!=x&&h.set("uvOffset",x),null!=b&&h.set("detailUvRepeat",b),null!=w&&h.set("detailUvOffset",w),h.set("roughness",g)):(p.setUniform(u,"1f","roughness",g),a!==m&&c(e,p,"normalMap",m,0),o!==y&&y&&c(e,p,"bumpMap",y,1),s!==v&&v&&c(e,p,"roughnessMap",v,2),null!=_&&p.setUniform(u,"2f","uvRepeat",_),null!=x&&p.setUniform(u,"2f","uvOffset",x),null!=b&&p.setUniform(u,"2f","detailUvRepeat",b),null!=w&&p.setUniform(u,"2f","detailUvOffset",w),p.setUniform(u,"1i","useBumpMap",+T),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+M)),a=m,o=y,s=v,l=r}}}function f(e){this._depthTex=new n.a({format:r.a.DEPTH_COMPONENT,type:r.a.UNSIGNED_INT}),this._normalTex=new n.a({type:r.a.HALF_FLOAT}),this._framebuffer=new o.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,o.a.DEPTH_ATTACHMENT),this._normalMaterial=new s.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(h.a),f.prototype.getDepthTexture=function(){return this._depthTex},f.prototype.getNormalTexture=function(){return this._normalTex},f.prototype.update=function(e,t,i){var n=e.getWidth(),r=e.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=n,a.height=r,o.width=n,o.height=r;var l=t.getRenderList(i).opaque;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,i,{getMaterial:function(){return s},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,i){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,i){i(9),i(3);var n=i(5),r=i(4),a=i(16),o=i(8),s=i(10);function l(e){e=e||{},this._edgePass=new a.a({fragment:o.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new n.a({type:r.a.HALF_FLOAT}),this._frameBuffer=new s.a,this._frameBuffer.attach(this._targetTexture)}l.prototype.update=function(e,t,i,n){var r=e.getWidth(),a=e.getHeight(),o=this._targetTexture;o.width=r,o.height=a;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[r,a]),this._edgePass.setUniform("texture",i),this._edgePass.render(e),s.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,i){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,i){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 = texture2D(blurred, v_Texcoord);\n vec4 originalColor = 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 = 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 = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\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 color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"},function(e,t,i){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,i){var n=i(49),r=i(16),a=i(10),o=i(5),s=i(8),l=i(9);function u(e){for(var t=[],i=0;i<30;i++)t.push([Object(n.a)(i,2),Object(n.a)(i,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new o.a,this._sourceFb=new a.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new o.a,this._outputTex=new o.a;var l=this._blendPass=new r.a({fragment:s.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:s.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 i=e.viewport,n=i.devicePixelRatio||e.getDevicePixelRatio(),r=i.width*n,a=i.height*n,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new l.a;s.array[12]=(2*o[0]-1)/r,s.array[13]=(2*o[1]-1)/a,l.a.mul(t.projectionMatrix,s,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,i){var n=this._blendPass;0===this._frame?(n.setUniform("weight1",0),n.setUniform("weight2",1)):(n.setUniform("weight1",.9),n.setUniform("weight2",.1)),n.setUniform("texture1",this._prevFrameTex),n.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),n.render(e),this._blendFb.unbind(e),i||(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,i){var n=i(0),r=i.n(n);i(202),i(203),i(98),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,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31),u=i(96),h=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")}),i=new r.a.List(t,this);i.initData(e.regions);var n={};i.each((function(e){var t=i.getName(e),r=i.getItemModel(e);n[t]=r})),this._regionModelMap=n,this._data=i},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),i=this.coordinateSystem.getRegion(t);return i?i.geometries:[]},getFormattedLabel:function(e,t){var i=this._data.getName(e),n=this.getRegionModel(i),r=n.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==r&&(r=n.get(["label","formatter"]));var a={name:i};if("function"==typeof r)return a.status=t,r(a);if("string"==typeof r){var o=a.seriesName;return r.replace("{a}",null!=o?o:"")}return i},defaultOption:{regions:[]}});r.a.util.merge(h.prototype,u.a),r.a.util.merge(h.prototype,a.a),r.a.util.merge(h.prototype,o.a),r.a.util.merge(h.prototype,s.a),r.a.util.merge(h.prototype,l.a)},function(e,t,i){var n=i(64),r=i(0),a=i.n(r),o=i(1),s=i(45),l=i(30);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new n.a(t),this.groupGL=new o.a.Node,this._lightRoot=new o.a.Node,this._sceneHelper=new l.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:t.getZr()}),this._control.init()},render:function(e,t,i){this.groupGL.add(this._geo3DBuilder.rootNode);var n=e.coordinateSystem;if(n&&n.viewGL){n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(n.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,i,0,e.getData().count());var o=n.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[o]("fragment","SRGB_DECODE")})),r.off("update"),r.on("update",(function(){i.dispatchAction({type:"geo3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,geo3DId:e.id})})),r.update()}},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},dispose:function(){this._control.dispose()}})},function(e,t,i){function n(e,t,i){i=i||2;var n,s,l,u,h,f,g,m=t&&t.length,v=m?t[0]*i:e.length,y=r(e,0,v,i,!0),_=[];if(!y)return _;if(m&&(y=function(e,t,i,n){var o,s,l,u=[];for(o=0,s=t.length;o80*i){n=l=e[0],s=u=e[1];for(var x=i;xl&&(l=h),f>u&&(u=f);g=Math.max(l-n,u-s)}return o(y,_,i,n,s,g),_}function r(e,t,i,n,r){var a,o;if(r===M(e,t,i,n)>0)for(a=t;a=t;a-=n)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(T(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(T(n),(n=t=n.prev)===n.next)return null;i=!0}}while(i||n!==t);return t}function o(e,t,i,n,r,c,d){if(e){!d&&c&&function(e,t,i,n){var r=e;do{null===r.z&&(r.z=f(r.x,r.y,t,i,n)),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,i,n,r,a,o,s,l,u=1;do{for(i=e,e=null,a=null,o=0;i;){for(o++,n=i,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=n}a.nextZ=null,u*=2}while(o>1)}(r)}(e,n,r,c);for(var p,g,m=e;e.prev!==e.next;)if(p=e.prev,g=e.next,c?l(e,n,r,c):s(e))t.push(p.i/i),t.push(e.i/i),t.push(g.i/i),T(e),e=g.next,m=g.next;else if((e=g)===m){d?1===d?o(e=u(e,t,i),t,i,n,r,c,2):2===d&&h(e,t,i,n,r,c):o(a(e),t,i,n,r,c,1);break}}}function s(e){var t=e.prev,i=e,n=e.next;if(v(t,i,n)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&v(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function l(e,t,i,n){var r=e.prev,a=e,o=e.next;if(v(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,c=f(s,l,t,i,n),d=f(u,h,t,i,n),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=c;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(e,t,i){var n=e;do{var r=n.prev,a=n.next.next;!y(r,a)&&_(r,n,n.next,a)&&x(r,a)&&x(a,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(a.i/i),T(n),T(n.next),n=e=a),n=n.next}while(n!==e);return n}function h(e,t,i,n,r,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var h=b(l,u);return l=a(l,l.next),h=a(h,h.next),o(l,t,i,n,r,s),void o(h,t,i,n,r,s)}u=u.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function d(e,t){if(t=function(e,t){var i,n=t,r=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if(o=s,s===r){if(a===n.y)return n;if(a===n.next.y)return n.next}i=n.x=n.x&&n.x>=h&&r!==n.x&&g(ai.x)&&x(n,e)&&(i=n,d=l),n=n.next;return i}(e,t),t){var i=b(t,e);a(i,i.next)}}function f(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,i=e;do{t.x=0&&(e-o)*(n-s)-(i-o)*(t-s)>=0&&(i-o)*(a-s)-(r-o)*(n-s)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&_(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&x(e,t)&&x(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function _(e,t,i,n){return!!(y(e,t)&&y(i,n)||y(e,n)&&y(i,t))||v(e,t,i)>0!=v(e,t,n)>0&&v(i,n,e)>0!=v(i,n,t)>0}function x(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function b(e,t){var i=new S(e.i,e.x,e.y),n=new S(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function w(e,t,i,n){var r=new S(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function T(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 S(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,i,n){for(var r=0,a=t,o=i-n;a0},_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(h.prototype,a.a),r.a.util.merge(h.prototype,o.a),r.a.util.merge(h.prototype,s.a),r.a.util.merge(h.prototype,l.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(30),l=i(210),u=i(2);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 s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new o.a({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,i){var n=e.coordinateSystem,r=e.get("shading");n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL),this._sceneHelper.setScene(n.viewGL.scene),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var s="ecgl."+r;o.material&&o.material.shader.name===s||(o.material=a.a.createMaterial(s)),a.a.setMaterialFromModel(r,o.material,e,i),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=o.material.get(e);t&&(t.flipY=!1)})),o.material.set("color",a.a.parseColor(e.get("baseColor")));var l=.99*n.radius;o.scale.set(l,l,l);var u=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),i,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var h=o.material.setTextureImage("bumpMap",e.get("heightTexture"),i,{flipY:!1,anisotropic:8});h&&h.surface&&h.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,i),this._displaceVertices(e,i),this._updateViewControl(e,i),this._updateLayers(e,i)},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},_updateLayers:function(e,t){var i=e.coordinateSystem,n=e.get("layers"),o=i.radius,s=[],l=[],h=[],c=[];r.a.util.each(n,(function(e){var n=new r.a.Model(e),d=n.get("type"),f=a.a.loadTexture(n.get("texture"),t,{flipY:!1,anisotropic:8});if(f.surface&&f.surface.attachToMesh(this._earthMesh),"blend"===d){var p=n.get("blendTo"),g=u.a.firstNotNull(n.get("intensity"),1);"emission"===p?(h.push(f),c.push(g)):(s.push(f),l.push(g))}else{var m=n.get("id"),v=this._layerMeshes[m];v||(v=this._layerMeshes[m]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===n.get("shading")?(v.material=v.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),v.__lambertMaterial=v.material):(v.material=v.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),v.__colorMaterial=v.material),v.material.enableTexture("diffuseMap");var y=n.get("distance"),_=o+(null==y?i.radius/100:y);v.scale.set(_,_,_),o=_;var x=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));v.material.set("diffuseMap",x),a.a.loadTexture(n.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(v),v.material.set("diffuseMap",e),t.getZr().refresh()})),n.get("show")?this.groupGL.add(v):this.groupGL.remove(v)}}),this);var d=this._earthMesh.material;d.define("fragment","LAYER_DIFFUSEMAP_COUNT",s.length),d.define("fragment","LAYER_EMISSIVEMAP_COUNT",h.length),d.set("layerDiffuseMap",s),d.set("layerDiffuseIntensity",l),d.set("layerEmissiveMap",h),d.set("layerEmissionIntensity",c);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)"),g=u.a.firstNotNull(f.get("lineStyle.width"),1);d.set("wireframeLineWidth",g),d.set("wireframeLineColor",p)}else d.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var i=e.coordinateSystem,n=e.getModel("viewControl");i.viewGL.camera;var r=this,a=this._control;a.setViewGL(i.viewGL);var o,s,l=n.get("targetCoord");null!=l&&(s=l[0]+90,o=l[1]),a.setFromViewControlModel(n,{baseDistance:i.radius,alpha:o,beta:s}),a.off("update"),a.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-i.radius,center:a.getCenter(),from:r.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var i=e.get("displacementQuality"),n=e.get("debug.wireframe.show"),r=e.coordinateSystem;if(e.isDisplacementChanged()||i!==this._displacementQuality||n!==this._showDebugWireframe){this._displacementQuality=i,this._showDebugWireframe=n;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[i]||200,s=o/2;(a.widthSegments!==o||n)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,r),n&&a.generateBarycentric()}},_doDisplaceVertices:function(e,t){var i=e.attributes.position.value,n=e.attributes.texcoord0.value,r=e.__originalPosition;r&&r.length===i.length||((r=new Float32Array(i.length)).set(i),e.__originalPosition=r);for(var a=t.displacementWidth,o=t.displacementHeight,s=t.displacementData,l=0;lOpenStreetMap contributors, © CARTO',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return s.reduce((function(t,i){return t[i]=e.get(i),t}),{})},setMaptalksCameraOption:function(e){null!=e&&s.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(224),o=i(30),s=i(1),l=i(102);s.a.Shader.import(l.a),r.a.extendComponentView({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var i=t.getZr();this._zrLayer=new a.a("maptalks3D",i,e.get("center"),e.get("zoom")),i.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var n=this._zrLayer.getMaptalks(),r=this._dispatchInteractAction.bind(this,t,n);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend"].forEach((function(e){n.on(e,r)}))},render:function(e,t,i){this._zrLayer||this._initMaptalksLayer(e,i);var n=this._zrLayer.getMaptalks(),r=e.get("urlTemplate"),a=n.getBaseLayer();r!==this._oldUrlTemplate&&(a?a.setOptions({urlTemplate:r,attribution:e.get("attribution")}):(a=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:r,subdomains:["a","b","c"],attribution:e.get("attribution")}),n.setBaseLayer(a))),this._oldUrlTemplate=r,n.setCenter(e.get("center")),n.setZoom(e.get("zoom"),{animation:!1}),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMaptalks(n);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i),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,i,n){e.coordinateSystem.setCameraOption(n),this._updateGroundMesh(),i.getZr().refresh()},_dispatchInteractAction:function(e,t,i){e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var i=new s.a.Plane(new s.a.Vector3(0,0,1),0),n=e.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),r=e.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=n.intersectPlane(i),o=r.intersectPlane(i),l=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,i){function n(e,t,i,n){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;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:i,zoom:n,fog:!1}),this._initEvents()}n.prototype.resize=function(){this._maptalks.checkSize()},n.prototype.getMaptalks=function(){return this._maptalks},n.prototype.clear=function(){},n.prototype.refresh=function(){this._maptalks.checkSize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},r.forEach((function(t){this._handlers[t]=function(i){var n={};for(var r in i)n[r]=i[r];n.bubbles=!1;var a=new i.constructor(i.type,n);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(a):e.firstElementChild.dispatchEvent(a)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){r.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()},t.a=n},function(e,t,i){var n=i(0),r=i.n(n);i(226),i(229),i(231);var a=i(17);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,i){var n=i(0),r=i.n(n),a=i(3),o=i(6),s=i(227),l=i(228),u=o.a.vec3,h=r.a.helper.dataStack.isDimensionStacked;function c(e,t){var i=h(e,t[2]);return{dimension:i?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:i}}r.a.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,i=t&&t.type;if("globe"===i)!function(e,t){var i=e.getData(),n=e.get("minHeight")||0,o=e.get("barSize"),s=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==o){var h=t.radius*Math.PI,d=Object(l.a)(i,s[0],s[1]);o=[h/Math.sqrt(i.count()/d),h/Math.sqrt(i.count()/d)]}else r.a.util.isArray(o)||(o=[o,o]);var f=c(i,s);i.each(s,(function(e,r,a,s){var l=i.get(f.dimension,s),h=f.isStacked?l-a:t.altitudeAxis.scale.getExtent()[0],c=Math.max(t.altitudeAxis.dataToCoord(a),n),d=t.dataToPoint([e,r,h]),p=t.dataToPoint([e,r,l]),g=u.sub([],p,d);u.normalize(g,g);var m=[o[0],c,o[1]];i.setItemLayout(s,[d,g,m])})),i.setLayout("orient",a.a.UP.array)}(e,t);else if("cartesian3D"===i)Object(s.a)(e,t);else if("geo3D"===i)!function(e,t){var i=e.getData(),n=e.get("barSize"),a=e.get("minHeight")||0,o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==n){var s=Math.min(t.size[0],t.size[2]),u=Object(l.a)(i,o[0],o[1]);n=[s/Math.sqrt(i.count()/u),s/Math.sqrt(i.count()/u)]}else r.a.util.isArray(n)||(n=[n,n]);var h=[0,1,0],d=c(i,o);i.each(o,(function(e,r,o,s){var l=i.get(d.dimension,s),u=d.isStacked?l-o:t.altitudeAxis.scale.getExtent()[0],c=Math.max(t.altitudeAxis.dataToCoord(o),a),f=t.dataToPoint([e,r,u]),p=[n[0],c,n[1]];i.setItemLayout(s,[f,h,p])})),i.setLayout("orient",[1,0,0])}(e,t);else{if("mapbox3D"!==i&&"maptalks3D"!==i)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.");!function(e,t){var i=e.getData(),n=e.coordDimToDataDim("lng")[0],a=e.coordDimToDataDim("lat")[0],o=e.coordDimToDataDim("alt")[0],s=e.get("barSize"),u=e.get("minHeight")||0;if(null==s){var h=i.getDataExtent(n),d=i.getDataExtent(a),f=t.dataToPoint([h[0],d[0]]),p=t.dataToPoint([h[1],d[1]]),g=Math.min(Math.abs(f[0]-p[0]),Math.abs(f[1]-p[1]))||1,m=Object(l.a)(i,n,a);s=[g/Math.sqrt(i.count()/m),g/Math.sqrt(i.count()/m)]}else r.a.util.isArray(s)||(s=[s,s]),s[0]/=t.getScale()/16,s[1]/=t.getScale()/16;var v=[0,0,1],y=[n,a,o],_=c(i,y);i.each(y,(function(e,n,r,a){var o=i.get(_.dimension,a),l=_.isStacked?o-r:0,h=t.dataToPoint([e,n,l]),c=t.dataToPoint([e,n,o]),d=Math.max(c[2]-h[2],u),f=[s[0],d,s[1]];i.setItemLayout(a,[h,v,f])})),i.setLayout("orient",[1,0,0])}(e,t)}}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(6).a.vec3,o=r.a.helper.dataStack.isDimensionStacked;t.a=function(e,t){var i=e.getData(),n=e.get("barSize");if(null==n){var s,l,u=t.size,h=t.getAxis("x"),c=t.getAxis("y");s="category"===h.type?.7*h.getBandWidth():.6*Math.round(u[0]/Math.sqrt(i.count())),l="category"===c.type?.7*c.getBandWidth():.6*Math.round(u[1]/Math.sqrt(i.count())),n=[s,l]}else r.a.util.isArray(n)||(n=[n,n]);var d=t.getAxis("z").scale.getExtent(),f=function(e){var t=e[0],i=e[1];return!(t>0&&i>0||t<0&&i<0)}(d),p=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),g=o(i,p[2]),m=g?i.getCalculationInfo("stackResultDimension"):p[2];i.each(p,(function(e,r,o,s){var l=i.get(m,s),u=g?l-o:f?0:d[0],h=t.dataToPoint([e,r,u]),c=t.dataToPoint([e,r,l]),p=a.dist(h,c),v=[0,c[1]0&&(p++,c[3]<.99&&(g=!0))}})),s.geometry.setBarCount(p);var m=i.getLayout("orient"),v=this._barIndexOfData=new Int32Array(i.count());p=0,i.each((function(e){if(i.hasValue(e)){var t=i.getItemLayout(e),n=t[0],r=t[1],a=t[2],s=4*e;c[0]=d[s++],c[1]=d[s++],c[2]=d[s++],c[3]=d[s++],c[3]>0&&(o._barMesh.geometry.addBar(n,r,m,a,c,e),v[e]=p++)}else v[e]=-1})),s.geometry.dirty(),s.geometry.updateBoundingBox();var y=s.material;y.transparent=g,y.depthMask=!g,s.geometry.sortTriangles=g,this._initHandler(e,t)},_initHandler:function(e,t){var i=e.getData(),n=this._barMesh,r="cartesian3D"===e.coordinateSystem.type;n.seriesIndex=e.seriesIndex;var a=-1;n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=n.geometry.getDataIndexOfVertex(e.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),r&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get("x",o),i.get("y",o),i.get("z",o,!0)]})),a=o,n.dataIndex=o}),this),n.on("mouseout",(function(e){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,n.dataIndex=-1,r&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var i=this._barIndexOfData[e];if(!(i<0)){var n=t.getItemModel(e).getModel("emphasis.itemStyle"),o=n.get("color"),s=n.get("opacity");if(null==o){var l=t.getItemVisual(e,"color");o=r.a.color.lift(l,-.4)}null==s&&(s=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(o);u[3]*=s,this._barMesh.geometry.setColor(i,u),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var i=this._barIndexOfData[e];if(!(i<0)){var n=t.getItemVisual(e,"color"),r=t.getItemVisual(e,"opacity"),o=a.a.parseColor(n);o[3]*=r,this._barMesh.geometry.setColor(i,o),this._api.getZr().refresh()}}},highlight:function(e,t,i,n){this._toggleStatus("highlight",e,t,i,n)},downplay:function(e,t,i,n){this._toggleStatus("downplay",e,t,i,n)},_toggleStatus:function(e,t,i,n,a){var l=t.getData(),u=o.a.queryDataIndex(l,a),h=this;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):l.each((function(t){"highlight"===e?h._highlight(t):h._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n,r,a,o,s,l,u,h,c=i(0),d=i.n(c),f=i(38),p=i(65),g=i(15),m=i(6),v=m.a.vec3,y=m.a.mat3,_=g.a.extend((function(){return{attributes:{position:new g.a.Attribute("position","float",3,"POSITION"),normal:new g.a.Attribute("normal","float",3,"NORMAL"),color:new g.a.Attribute("color","float",4,"COLOR"),prevPosition:new g.a.Attribute("prevPosition","float",3),prevNormal:new g.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,i=this.getBarVertexCount()*e,n=this.getBarTriangleCount()*e;this.vertexCount!==i&&(this.attributes.position.init(i),t?this.attributes.normal.init(i):this.attributes.normal.value=null,this.attributes.color.init(i)),this.triangleCount!==n&&(this.indices=i>65535?new Uint32Array(3*n):new Uint16Array(3*n),this._dataIndices=new Uint32Array(i))},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 i=this.getBarVertexCount(),n=i*(e+1),r=i*e;r0&&this.bevelSegments>0)this._addBevelBar(e,c,g,m,this.bevelSize,this.bevelSegments,y);else{v.copy(r,c),v.normalize(r,r),v.cross(a,g,r),v.normalize(a,a),v.cross(n,r,a),v.normalize(a,a),v.negate(o,n),v.negate(s,r),v.negate(l,a),t(u[0],e,n,m[0]/2),t(u[0],u[0],a,m[2]/2),t(u[1],e,n,m[0]/2),t(u[1],u[1],l,m[2]/2),t(u[2],e,o,m[0]/2),t(u[2],u[2],l,m[2]/2),t(u[3],e,o,m[0]/2),t(u[3],u[3],a,m[2]/2),t(i,e,r,m[1]),t(u[4],i,n,m[0]/2),t(u[4],u[4],a,m[2]/2),t(u[5],i,n,m[0]/2),t(u[5],u[5],l,m[2]/2),t(u[6],i,o,m[0]/2),t(u[6],u[6],l,m[2]/2),t(u[7],i,o,m[0]/2),t(u[7],u[7],a,m[2]/2);var b=this.attributes;if(this.enableNormal){h[0]=n,h[1]=o,h[2]=r,h[3]=s,h[4]=a,h[5]=l;for(var w=this._vertexOffset,T=0;T=0){var y=3*l,_=new u.a(this._points[y],this._points[y+1],this._points[y+2]);a.push({dataIndex:l,point:_,pointWorld:_.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(_)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t){t.containStroke=function(e,t,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>n+s||oe+s&&a>i+s||al?u.position[1]+=(h-l)/2:u.position[0]+=(h-s)/2;var c=u.getBoundingRect();return u.position[0]-=c.x,u.position[1]-=c.y,u.setStyle(i),u.update(),u.__size=h,u}(e,t,i),l=o.getMarginByStyle(i);return{image:a(s.__size,n,(function(e){s.brush(e)})),margin:l}},createSDFFromCanvas:function(e,t,i,n){return a(t,n,(function(t){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,i){var n=t.width,r=t.height,a=e.canvas.width,o=e.canvas.height,s=n/a,l=r/o;function u(e){return e<128?1:-1}function h(e,a){var o=1/0;e=Math.floor(e*s);for(var h=(a=Math.floor(a*l))*n+e,c=u(t.data[4*h]),d=Math.max(a-i,0);d=0;c--){var d,f=s[2*(d=this.geometry.indices?this.geometry.indices[c]:c)],p=s[2*d+1],g=this.geometry.attributes.size.get(d)/this.sizeScale/2;if(e>f-g*u&&ep-g*h&&t=2e4},doSortVertices:function(e,t){var i=this.indices,n=r.create();if(!i){i=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var a=0;a.05);else for(a=0;a<3;a++)this._progressiveQuickSort(3*t+a);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,i=this.indices;function r(e,i){return t[i]-t[e]}e?Array.prototype.sort.call(i,r):n.a.sort(i,r,0,i.length-1)},_progressiveQuickSort:function(e){var t=this._zList,i=this.indices;this._quickSort=this._quickSort||new n.a,this._quickSort.step(i,(function(e,i){return t[i]-t[e]}),e)}}},function(e,t,i){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,i){var n=i(0),r=i.n(n);i(244),i(245),i(248);var a=i(17);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,i){var n=i(0),r=i.n(n),a=i(6),o=a.a.vec3,s=a.a.vec2,l=o.normalize,u=o.cross,h=o.sub,c=o.add,d=o.create,f=d(),p=d(),g=d(),m=d(),v=[],y=[];function _(e,t){s.copy(v,e[0]),s.copy(y,e[1]);var i=[],n=i[0]=d(),r=i[1]=d(),a=i[2]=d(),_=i[3]=d();t.dataToPoint(v,n),t.dataToPoint(y,_),l(f,n),h(p,_,n),l(p,p),u(g,p,f),l(g,g),u(p,f,g),c(r,f,p),l(r,r),l(f,_),h(p,n,_),l(p,p),u(g,p,f),l(g,g),u(p,f,g),c(a,f,p),l(a,a),c(m,n,_),l(m,m);var x=o.dot(n,m),b=o.dot(m,r),w=(Math.max(o.len(n),o.len(_))-x)/b*2;return o.scaleAndAdd(r,n,r,w),o.scaleAndAdd(a,_,a,w),i}function x(e,t){for(var i=new Float32Array(3*e.length),n=0,r=[],a=0;a0&&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,i){var n=e.getData(),r=e.get("polyline"),a=b(n);n.setLayout("lineType",r?"polyline":"cubicBezier"),n.each((function(e){var s=a.coordsList[e],l=r?x(s,t):function(e,t,i){var n=[],r=n[0]=o.create(),a=n[1]=o.create(),s=n[2]=o.create(),l=n[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,i,Math.min(.1*u,10)),o.scaleAndAdd(s,s,i,Math.min(.1*u,10)),n}(s,t,i);n.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 i=e.getData(),n=e.get("polyline");i.setLayout("lineType",n?"polyline":"cubicBezier");var r=b(i);i.each((function(e){var a=r.coordsList[e],o=n?x:_;i.setItemLayout(e,o(a,t))}))}(e,t):"geo3D"===t.type?w(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||w(e,t,[0,0,1])}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(25),s=i(246),l=i(46);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 o.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new s.a},render:function(e,t,i){this.groupGL.add(this._linesMesh);var n=e.coordinateSystem,r=e.getData();if(n&&n.viewGL){n.viewGL.add(this.groupGL),this._updateLines(e,t,i);var o=n.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var s=this._trailMesh;if(s.stopAnimation(),e.get("effect.show")){this.groupGL.add(s),s.updateData(r,i,this._linesMesh.geometry),s.__time=s.__time||0;var l=36e5;this._curveEffectsAnimator=s.animate("",{loop:!0}).when(l,{__time:l}).during((function(){s.setAnimationTime(s.__time)})).start()}else this.groupGL.remove(s),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,i){var n=e.getData(),r=e.coordinateSystem,o=this._linesMesh.geometry,s=e.get("polyline");o.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);o.segmentScale=l/20;var u="lineStyle.width".split("."),h=i.getDevicePixelRatio();n.each((function(e){var t=n.getItemModel(e).get(u);null==t&&(t=1),n.setItemVisual(e,"lineWidth",t)})),o.useNativeLine=!1;var c=0,d=0;n.each((function(e){var t=n.getItemLayout(e);s?(c+=o.getPolylineVertexCount(t),d+=o.getPolylineTriangleCount(t)):(c+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),d+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),o.setVertexCount(c),o.setTriangleCount(d),o.resetOffset();var f=[];n.each((function(e){var t=n.getItemLayout(e),i=n.getItemVisual(e,"color"),r=n.getItemVisual(e,"opacity"),l=n.getItemVisual(e,"lineWidth")*h;null==r&&(r=1),(f=a.a.parseColor(i,f))[3]*=r,s?o.addPolyline(t,f,l):o.addCubicCurve(t[0],t[1],t[2],t[3],f,l)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0);i.n(n);var r=i(1),a=i(6),o=i(25),s=i(247),l=a.a.vec3;r.a.Shader.import(s.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,i){var n=e.hostModel,a=this.geometry,o=n.getModel("effect"),s=o.get("trailWidth")*t.getDevicePixelRatio(),u=o.get("trailLength"),h=n.get("effect.constantSpeed"),c=1e3*n.get("effect.period"),d=null!=h;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",h/1e3):this.material.set("period",c),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var f=n.get("polyline");a.trailLength=u,this.material.set("trailLength",u),a.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){a.attributes[e].value=i.attributes[e].value})),["dist","distAll","start","offset","color"].forEach((function(e){a.attributes[e].init(a.vertexCount)})),a.indices=i.indices;var p=[],g=o.get("trailColor"),m=o.get("trailOpacity"),v=null!=g,y=null!=m;this.updateWorldTransform();var _=this.worldTransform.x.len(),x=this.worldTransform.y.len(),b=this.worldTransform.z.len(),w=0,T=0;e.each((function(t){var n=e.getItemLayout(t),o=y?m:e.getItemVisual(t,"opacity"),u=e.getItemVisual(t,"color");null==o&&(o=1),(p=r.a.parseColor(v?g:u,p))[3]*=o;for(var h=f?i.getPolylineVertexCount(n):i.getCubicCurveVertexCount(n[0],n[1],n[2],n[3]),S=0,M=[],A=[],I=w;Iw&&(S+=l.dist(M,A)),a.attributes.dist.set(I,S),l.copy(A,M);T=Math.max(T,S);var C=Math.random()*(d?S:c);for(I=w;I0?1:-1)*s/2),a.attributes.color.set(I,p);w+=h})),this.material.set("spotSize",.1*T*u),this.material.set("spotIntensity",o.get("spotIntensity")),a.dirty()},setAnimationTime:function(e){this.material.set("time",e)}})},function(e,t,i){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,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=new r.a.List(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},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,i){var n=i(0),r=i.n(n);i(250),i(251);var a=i(17);r.a.registerVisual(Object(a.a)("polygons3D"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(31);function o(e,t){for(var i=[],n=0;n0;this._updateSurfaceMesh(this._surfaceMesh,e,c,p);var g=this._surfaceMesh.material;p?(g.define("WIREFRAME_QUAD"),g.set("wireframeLineWidth",f),g.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")))):g.undefine("WIREFRAME_QUAD"),this._initHandler(e,i),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,s.a),e},_initHandler:function(e,t){var i=e.getData(),n=this._surfaceMesh,r=e.coordinateSystem;n.seriesIndex=e.seriesIndex;var a=-1;n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=function(e,t){for(var i=1/0,r=-1,a=[],o=0;o=0){var s=[];n.geometry.attributes.position.get(o,s);for(var u=r.pointToData(s),h=1/0,c=-1,d=[],f=0;f65535?Uint32Array:Uint16Array)((m-1)*(v-1)*6),S=function(e,t,i){i[1]=e*v+t,i[0]=e*v+t+1,i[3]=(e+1)*v+t+1,i[2]=(e+1)*v+t},M=!1;if(h){var A=[],I=[],C=0;y?d.init(r.vertexCount):d.value=null;for(var D=[[],[],[]],E=[],L=[],P=l.create(),N=function(e,t,i){var n=3*t;return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i},R=new Float32Array(s.length),O=new Float32Array(s.length/3*4),k=0;k ")),a.value&&(h+=" : "+r.a.format.encodeHTML(a.value)),h}return s.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 "+v)),p++)}var y=r.a.helper.completeDimensions(["value"],e);(c=new r.a.List(y,i)).initData(e);var _=new r.a.List(["value"],i);return _.initData(f,d),a&&a(c,_),l()({mainData:c,struct:s,structAttr:"graph",datas:{node:c,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),s.update(),s}},function(e,t,i){i(104).__DEV__;var n=i(13),r=i(266).enableClassCheck;function a(e){return"_EC_"+e}var o=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},s=o.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,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}s.type="graph",s.isDirected=function(){return this._directed},s.addNode=function(e,t){e=e||""+t;var i=this._nodesMap;if(!i[a(e)]){var n=new l(e,t);return n.hostGraph=this,this.nodes.push(n),i[a(e)]=n,n}},s.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},s.getNodeById=function(e){return this._nodesMap[a(e)]},s.addEdge=function(e,t,i){var n=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),l.isInstance(e)||(e=n[a(e)]),l.isInstance(t)||(t=n[a(t)]),e&&t){var o=e.id+"-"+t.id;if(!r[o]){var s=new u(e,t,i);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),r[o]=s,s}}},s.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},s.getEdge=function(e,t){l.isInstance(e)&&(e=e.id),l.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},s.eachNode=function(e,t){for(var i=this.nodes,n=i.length,r=0;r=0&&e.call(t,i[r],r)},s.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&e.call(t,i[r],r)},s.breadthFirstTraverse=function(e,t,i,n){if(l.isInstance(t)||(t=this._nodesMap[a(t)]),t){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",o=0;o=0&&i.node2.dataIndex>=0})),r=0,a=n.length;r=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},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)}}};n.mixin(l,h("hostGraph","data")),n.mixin(u,h("hostGraph","edgeData")),o.Node=l,o.Edge=u,r(l),r(u);var c=o;e.exports=c},function(e,t,i){i(104).__DEV__;var n=i(13),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 o=0;function s(e,t){var i=n.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function l(e,t,i){return this.superClass.prototype[t].apply(e,i)}t.parseClassType=a,t.enableClassExtend=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return n.extend(i.prototype,e),i.extend=this.extend,i.superCall=s,i.superApply=l,n.inherits(i,this),i.superClass=t,i}},t.enableClassCheck=function(e){var t=["__\0is_clz",o++,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 i={};if(e.registerClass=function(e,t){if(t)if(function(e){n.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=a(t)).sub){if(t.sub!==r){var o=function(e){var t=i[e.main];return t&&t[r]||((t=i[e.main]={})[r]=!0),t}(t);o[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var a=i[e];if(a&&a[r]&&(a=t?a[t]:null),n&&!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=[],o=i[e.main];return o&&o[r]?n.each(o,(function(e,i){i!==r&&t.push(e)})):t.push(o),t},e.hasClass=function(e){return e=a(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return n.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=a(e);var t=i[e.main];return t&&t[r]},e.parseClassType=a,t.registerWhenExtend){var o=e.extend;o&&(e.extend=function(t){var i=o.call(this,t);return e.registerClass(i,t.type)})}return e},t.setReadOnly=function(e,t){}},function(e,t,i){var n=i(13),r=n.each,a="\0__link_datas",o="\0__link_mainData";function s(e,t){if((r=this)[o]===r){var i=n.extend({},this[a]);i[this.dataType]=t,c(t,i,e)}else d(t,this.dataType,this[o],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(i,n){i!==t&&d(i.cloneShallow(),n,t,e)})),t}function h(e){var t=this[o];return null==e||null==t?t:t[a][e]}function c(e,t,i){e[a]={},r(t,(function(t,n){d(t,n,e,i)}))}function d(e,t,i,n){i[a][t]=e,e[o]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=h}var f=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,c(t,i,e),r(i,(function(i){r(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,n.curry(s,e))}))})),t.wrapMethod("cloneShallow",n.curry(u,e)),r(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,n.curry(l,e))})),n.assert(i[t.dataType]===t)};e.exports=f},function(e,t,i){var n=i(0),r=i.n(n),a=i(47),o=i.n(a),s=i(1),l=i(22),u=i(105),h=i(2),c=i(269),d=i(271),f=i(80),p=i.n(f),g=i(6),m=i(273),v=i(67),y=i(274),_=g.a.vec2;s.a.Shader.import(y.a);var x=1;r.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new s.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 s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.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 m.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,i){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=i,this._initLayout(e,t,i),this._pointsBuilder.update(e,t,i),this._forceLayoutInstance instanceof c.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,i),this._control.off("update"),this._control.on("update",(function(){i.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(h.a.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var n=this._pointsBuilder.getPointsMesh();if(n.off("mousemove",this._mousemoveHandler),n.off("mouseout",this._mouseOutHandler,this),i.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var r=e.get("focusNodeAdjacencyOn");"click"===r?i.getZr().on("click",this._clickHandler):"mouseover"===r?(n.on("mousemove",this._mousemoveHandler,this),n.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 i=this._forceEdgesMesh.geometry,n=t.getEdgeData(),r=0,a=this._forceLayoutInstance,o=2*n.count();i.attributes.node.init(o),i.attributes.color.init(o),n.each((function(t){var o=e[t];i.attributes.node.set(r,a.getNodeUV(o.node1)),i.attributes.node.set(r+1,a.getNodeUV(o.node2));var l=n.getItemVisual(o.dataIndex,"color"),u=s.a.parseColor(l);u[3]*=h.a.firstNotNull(n.getItemVisual(o.dataIndex,"opacity"),1),i.attributes.color.set(r,u),i.attributes.color.set(r+1,u),r+=2})),i.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,i=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var n=[],r=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(o){var l=e.graph.getEdgeByIndex(o),u=2*l.node1.dataIndex,c=2*l.node2.dataIndex;n[0]=i[u],n[1]=i[u+1],r[0]=i[c],r[1]=i[c+1];var d=e.getItemVisual(l.dataIndex,"color"),f=s.a.parseColor(d);f[3]*=h.a.firstNotNull(e.getItemVisual(l.dataIndex,"opacity"),1);var p=e.getItemModel(l.dataIndex),g=h.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();t.addLine(n,r,f,g);for(var m=0;m<4;m++)this._originalEdgeColors[4*l.dataIndex+m]=f[m];this._edgeIndicesMap[l.dataIndex]=o}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),i=[],n=0;n=f&&(l._syncNodePosition(e),d=0),i.getZr().refresh(),p()((function(){g(t)}))}))};p()((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),g(u)})),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,i,n){n&&null!=n.from&&n.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(n&&n.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,i)),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,i){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,i),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,i,n){var r=this._model.getData();this._downplayAll();var a=n.dataIndex,o=r.graph,s=[],l=o.getNodeByIndex(a);s.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&s.push(e.node1),e.node2!==l&&s.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(e){this._pointsBuilder.highlight(r,e.dataIndex)}),this),this._pointsBuilder.updateLabels(s.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=s,this._focusEdges=u},unfocusNodeAdjacency:function(e,t,i,n){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),i=s.a.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),n=h.a.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);i[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],i)},_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:function(){var e=[];return function(t,i){this._getColor(t,e),e[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var i=0;i<4;i++)t[i]=this._originalEdgeColors[4*e+i];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 i=this.viewGL.camera,n=e.getData().getLayout("points"),r=_.create(1/0,1/0),a=_.create(-1/0,-1/0),o=[],s=0;si.left&&ui.top)){var h=Math.max(a[0]-r[0],10),c=h/t.getWidth()*t.getHeight();h*=1.4,c*=1.4,r[0]-=.2*h,i.left=r[0],i.top=l-c/2,i.bottom=l+c/2,i.right=h+r[0],i.near=0,i.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,i){var n=i(0),r=i.n(n),a=i(1),o=i(16),s=i(10),l=i(270);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 h(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 o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new o.a({fragment:a.a.Shader.source("clay.compositor.output")});var i=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:i,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:i,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._framebuffer=new s.a({depthBuffer:!1}),this._dummyCamera=new a.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}h.prototype.updateOption=function(e){for(var t in u)this[t]=u[t];var i=this._nodes.length;if(this.jitterTolerence=i>5e4?10:i>5e3?1:.1,this.scaling=i>100?2:10,e)for(var t in u)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var n=this._positionSourceTex.pixels,r=0;re},h.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},h.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)},h.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(i){this[i].width=e,this[i].height=t,this[i].dirty()}),this)},h.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=h,t.a=h},function(e,t,i){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,i){var n=i(5),r=i(4),a=i(272).a.toString();a=a.slice(a.indexOf("{")+1,a.lastIndexOf("}"));var o={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},s=function(e){for(var t in o)this[t]=o[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new n.a({type:r.a.FLOAT,flipY:!1,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST})};s.prototype.initData=function(e,t){var i=new Blob([a]),n=window.URL.createObjectURL(i);this._worker=new Worker(n),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var r=e.length,o=t.length,s=new Float32Array(2*r),l=new Float32Array(r),u=new Float32Array(r),h=new Float32Array(2*o),c=new Float32Array(o),d=0;d5e4?10:a>5e3?1:.1,t.scaling=a>100?2:10,t.barnesHutOptimize=a>1e3,e)for(var i in o)null!=e[i]&&(t[i]=e[i]);if(!t.gravityCenter){for(var s=[1/0,1/0],l=[-1/0,-1/0],u=0;ue},s.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var i=0;i=e&&this.bbox[1]<=t&&this.bbox[3]>=t},u.setBBox=function(e,t,i,n){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=i,this.bbox[3]=n,this.size=(i-e+n-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]),i=this.bbox;if(!t){var n=(i[0]+i[2])/2,r=(i[1]+i[3])/2,a=(i[2]-i[0])/2,o=(i[3]-i[1])/2,s=e.position[0]>=n?1:0,l=e.position[1]>=r?1:0;(t=this._newSubRegion()).setBBox(s*a+i[0],l*o+i[1],(s+1)*a+i[0],(l+1)*o+i[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,i=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,i+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=i/this.mass};var f=d.prototype;f.initNodes=function(e,t,i){var n=t.length;this.nodes.length=0;for(var r=void 0!==i,a=0;a0&&(this.strongGravityMode?this.applyNodeStrongGravity(h):this.applyNodeGravity(h))}for(l=0;l0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m,l=0;l0&&(y=Math.min(_*y,10)/_,n(u.position,u.position,u.force,y))}},f.applyRegionToNodeRepulsion=function(){var t=e();return function(e,i){if(e.node)this.applyNodeToNodeRepulsion(e.node,i,!0);else{a(t,i.position,e.centerOfMass);var r=t[0]*t[0]+t[1]*t[1];if(r>this.barnesHutTheta*e.size*e.size){var o=this.scaling*i.mass*e.mass/r;n(i.force,i.force,t,o)}else for(var s=0;s0)s=this.scaling*e.mass*i.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*e.mass*i.mass}}else s=this.scaling*e.mass*i.mass/o;n(e.force,e.force,t,s),n(i.force,i.force,t,-s)}}}}(),f.applyEdgeAttraction=function(){var t=e();return function(e){var r=e.source,o=e.target;a(t,r.position,o.position);var s,l,u=i(t);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-o.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,n(r.force,r.force,t,l),n(o.force,o.force,t,-l))}}(),f.applyNodeGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position);var r=i(t);n(e.force,e.force,t,this.gravity*e.mass/(r+1))}}(),f.applyNodeStrongGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position),n(e.force,e.force,t,this.gravity*e.mass)}}(),f.updateBBox=function(){for(var e=1/0,t=1/0,i=-1/0,n=-1/0,r=0;r0?1.1:.9,a=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=a/this._zoom;var o=this._convertPos(i,n),s=(o.x-this._dx)*(r-1),l=(o.y-this._dy)*(r-1);this._dx-=s,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,i){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,i){var n=i(0);i.n(n),i(276),i(280)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(22),l=i(277);r.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new s.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new l.a;var i=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})});i.material.enableTexture("diffuseMap"),this.groupGL.add(i),this._planeMesh=i},render:function(e,t,i){var n=this._particleSurface;n.setParticleType(e.get("particleType")),n.setSupersampling(e.get("supersampling")),this._updateData(e,i),this._updateCamera(i.getWidth(),i.getHeight(),i.getDevicePixelRatio());var r=o.a.firstNotNull(e.get("particleDensity"),128);n.setParticleDensity(r,r);var s=this._planeMesh,l=+new Date,u=this,h=!0;s.__percent=0,s.stopAnimation(),s.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-l,20);l+=t,u._renderer&&(n.update(u._renderer,i,t/1e3,h),s.material.set("diffuseMap",n.getSurfaceTexture())),h=!1})).start();var c=e.getModel("itemStyle"),d=a.a.parseColor(c.get("color"));d[3]*=o.a.firstNotNull(c.get("opacity"),1),s.material.set("color",d),n.setColorTextureImage(e.get("colorTexture"),i),n.setParticleSize(e.get("particleSize")),n.particleSpeedScaling=e.get("particleSpeed"),n.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,i){this._updateData(e,i)},afterRender:function(e,t,i,n){var r=n.renderer;this._renderer=r},_updateData:function(e,t){var i=e.coordinateSystem,n=i.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),r=e.getData(),a=r.getDataExtent(n[0]),o=r.getDataExtent(n[1]),s=e.get("gridWidth"),l=e.get("gridHeight");if(null==s||"auto"===s){var u=(a[1]-a[0])/(o[1]-o[0]);s=Math.round(Math.sqrt(u*r.count()))}null!=l&&"auto"!==l||(l=Math.ceil(r.count()/s));var h=this._particleSurface.vectorFieldTexture,c=h.pixels;if(c&&c.length===l*s*4)for(var d=0;d=359&&(r[0]>0&&(r[0]=0),a[0]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 i=t.getContext("2d");return i.fillStyle="#fff",i.arc(e/2,e/2,e/2,0,2*Math.PI),i.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 i=this._downsampleTextures,n=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),r=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s65535?new Uint32Array(3*n):new Uint16Array(3*n))},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,i){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,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){var i=r.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(i.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");i.push("vx","vy");var n=r.a.helper.completeDimensions(i,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new r.a.List(n,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,i){var n=i(0),r=i.n(n);i(282),i(283);var a=i(17);r.a.registerVisual(Object(a.a)("linesGL"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(13);i.n(a);var o=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)),o.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)),o.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),i=t.option instanceof Array?t.option:t.getShallow("coords");if(!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");return i},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],r=0;ri)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new r.a.List(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},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,i){var n=i(0),r=i.n(n),a=i(1),o=i(22),s=i(105),l=i(103),u=i(2);r.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new o.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,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i);var n=this._linesMeshes[0];n||(n=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(n),this._updateLinesMesh(e,n,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalRender:function(e,t,i,n){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),n.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,i){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,i)},_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 s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,i,n){var r=e.getData();t.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,s=e.get("polyline"),l=t.geometry,h=e.coordinateSystem,c=u.a.firstNotNull(e.get("lineStyle.width"),1);c>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),i=i||0,n=n||r.count(),l.resetOffset();var d=0,f=0,p=[],g=[],m=[],v=[],y=[],_=.3,x=.7;function b(){g[0]=p[0]*x+v[0]*_-(p[1]-v[1])*o,g[1]=p[1]*x+v[1]*_-(v[0]-p[0])*o,m[0]=p[0]*_+v[0]*x-(p[1]-v[1])*o,m[1]=p[1]*_+v[1]*x-(v[0]-p[0])*o}if(s||0!==o)for(var w=i;w