@visactor/react-vchart 2.1.0-alpha.10 → 2.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  * Copyright 2011 - 2019 Tim Guan-tin Chien and contributors.
7
7
  * Released under the MIT license
8
8
  */
9
- let sJ=class t extends VZ{constructor(e){super(j({},t.defaultOptions,e)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,c=this.getTextFontFamily(t),d=this.options.createCanvas({width:1,height:1}),u=d.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+c;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let f=p+2*g,m=3*g;const v=Math.ceil(f/this.gridSize),y=Math.ceil(m/this.gridSize);f=v*this.gridSize,m=y*this.gridSize;const _=-p/2,b=.4*-g,x=Math.ceil((f*Math.abs(Math.sin(h))+m*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((f*Math.abs(Math.cos(h))+m*Math.abs(Math.sin(h)))/this.gridSize),A=S*this.gridSize,k=x*this.gridSize;d.setAttribute("width",""+A),d.setAttribute("height",""+k),u.scale(1,1),u.translate(A/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+c,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,_,b);const C=u.getImageData(0,0,A,k).data;if(this.exceedTime())return null;const M=[];let w,T=S;const B=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(C[4*((e*this.gridSize+s)*A+(t*this.gridSize+n))+3])return i.push([t,e]),t<B[3]&&(B[3]=t),t>B[1]&&(B[1]=t),e<B[0]&&(B[0]=e),void(e>B[2]&&(B[2]=e))}};for(;T--;)for(w=x;w--;)E(T,w,M);return{datum:t,occupied:M,bounds:B,gw:S,gh:x,fillTextOffsetX:_,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:c,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let e=0;for(let t=0;t<this.ngx;t++)for(let i=0;i<this.ngy;i++)this.grid[t][i]&&e++;return e/t}canFitText(t,e,i,s,n){let r=n.length;for(;r--;){const i=t+n[r][0],s=e+n[r][1];if(i>=this.ngx||s>=this.ngy||i<0||s<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[i][s])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),Z(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(g(e)){const i=ZZ(e,t.width,t.height,void 0,!1,this.options.createCanvas);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n=qZ(e.backgroundColor,void 0,this.options.createCanvas);const r=(t,e)=>{let i=this.gridSize;for(;i--;){let r=this.gridSize;for(;r--;)if(!n(s,e*this.gridSize+i,t*this.gridSize+r))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let a=this.ngx;for(;a--;){this.grid[a]=[];let t=this.ngy;for(;t--;)r(a,t),!1!==this.grid[a][t]&&(this.grid[a][t]=!0)}s=n=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=zZ(this.options.shape,[e.width,e.height]);return this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(s/this.gridSize),this.initGrid(e),this.result=[],this.progressiveRun()}};sJ.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class nJ extends VZ{constructor(t){super(j({},nJ.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let e=0,i=this.result.length;e<i;e++)if(rJ(t,this.result[e]))return!1;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=this.options.getTextBounds(i);return i.width=s.width(),i.height=s.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}layoutWord(t){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s<this.maxRadius;)s+=.5,l=this.shape(s/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i<t.length&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.result}}function rJ(t,e){return!(t.left+t.width<e.left||t.top+t.height<e.top||t.left>e.left+e.width||t.top>e.top+e.height)}nJ.defaultOptions={enlarge:!1};const aJ={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},oJ=(t,e)=>{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return at.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,h=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]);const c=t.fontFamily?lJ(t.fontFamily):"sans-serif",d=t.fontStyle?lJ(t.fontStyle):"normal",u=t.fontWeight?lJ(t.fontWeight):"normal",p=t.rotate?lJ(t.rotate):0,g=lJ(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",m=t.padding?lJ(t.padding):1,v=null!==(n=t.shape)&&void 0!==n?n:"square",y=null!==(r=t.shrink)&&void 0!==r&&r,_=null!==(a=t.enlarge)&&void 0!==a&&a,b=null!==(o=t.clip)&&void 0!==o&&o,x=t.minFontSize,A=t.randomVisible,k=t.as?Object.assign(Object.assign({},aJ),t.as):aJ,C=t.depth_3d,M=t.postProjection;let w=t.fontSize?lJ(t.fontSize):14;const T=t.fontSizeRange;if(T&&!S(w)){const t=w,e=cJ(dJ(t,l),T);w=i=>e(t(i))}let B=WZ;"fast"===t.layoutType?B=nJ:"grid"===t.layoutType&&(B=sJ);const E=new B(Object.assign(Object.assign({},t),{text:g,padding:m,spiral:f,shape:v,rotate:p,fontFamily:c,fontStyle:d,fontWeight:u,fontSize:w,shrink:y,clip:b,enlarge:_,minFontSize:x,random:A,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r<a;r++)n=e[r],s=n.datum,s[k.x]=n.x,s[k.y]=n.y,s[k.fontFamily]=n.fontFamily,s[k.fontSize]=n.fontSize,s[k.fontStyle]=n.fontStyle,s[k.fontWeight]=n.fontWeight,s[k.angle]=n.angle,"StereographicProjection"===M&&uJ(h,n,s,k,C),t.dataIndexKey&&(s[t.dataIndexKey]=`${r}`),i.push(s);return i}}));return E.layout(l,{width:h[0],height:h[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:E}:E.output()},lJ=t=>y(t)||S(t)||d(t)||_(t)?t:e=>e[t.field],hJ=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),cJ=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=hJ(t[0]),n=hJ(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(hJ(t)-r)/(a-r)*(e[1]-e[0])+e[0]},dJ=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=et(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function uJ(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:i*Math.sin(l)*Math.cos(o)+s.x,y:i*Math.cos(l)+s.y,z:i*Math.sin(l)*Math.sin(o)+s.z}}(t[0],t[1],r,{x:r,y:r,z:null!=n?n:r},e);i[s.x]=a.x,i[s.y]=a.y,i[s.z]=a.z}var pJ;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(pJ||(pJ={}));class gJ{constructor(t=1e3){this._map=new Map,this._maxSize=t}get(t){const e=this._map.get(t);if(void 0!==e)return this._map.delete(t),this._map.set(t,e),e}set(t,e){if(this._map.has(t))this._map.set(t,e);else{if(this._map.size>=this._maxSize){const t=this._map.keys().next().value;void 0!==t&&this._map.delete(t)}this._map.set(t,e)}}clear(){this._map.clear()}size(){return this._map.size}}const fJ=t=>/^[\u4e00-\u9fa5]+$/.test(t),mJ=(t,e)=>{if(u(t))return 0;let i=0;for(const e of t)fJ(e)?i+=1:i+=.53;return i};function vJ(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:c,shapeMaxR:d,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=AJ(i);let f=g.slice(0);const m=e.fontSizeShrinkFactor;let v=null,y=1,_=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let i=0;i<o.length;i++){const n=o[i],{words:c,center:d,maxR:u,ratio:b}=n;let S=!1;for(let i=0;i<c.length;i++){xJ(l,p,t,i,e.measureCache);const n=c[i];if(n.x=d[0],n.y=d[1],!n.skip&&n.hasText&&n.sprite&&yJ(f,n,u,b,a,h,s))n.hasPlaced=!0;else{if(!n.skip&&n.weight>x&&_>r){const e=n.datum[Symbol.for("vGrammar_id")];e!==v&&(v=e,y=_),_*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),f=g.slice(0),S=!0;break}if(!n.skip&&n.datum[Symbol.for("vGrammar_id")]===v){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/_})),n.skip=!0,_=y,v=null,f=g.slice(0),S=!0;break}}}S&&(i=-1)}for(let i=0;i<e.textLayoutTimes;i++){const i=t.filter((t=>(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t<i.length;t++){const n=i[t];xJ(l,p,i,t,e.measureCache),n.x=c[0],n.y=c[1],n.hasText&&yJ(f,n,d,u,a,h,s)&&(n.hasPlaced=!0)}}e.board=f}function yJ(t,e,i,s,n,r,a){const o=e.x,l=e.y,h=function(t){return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}(s),c=1*a;let d,u,p,g=-c;for(;d=h(g+=c);){const{wordSize:s,bounds:{dTop:a,dBottom:h,dLeft:c,dRight:g}}=e;if(u=d[0],p=d[1],Math.min(Math.abs(u),Math.abs(p))>=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-c<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||bJ(e,t,r)))return _J(e,t,r),!0}return!1}function _J(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,c=s[1];let d,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<r;i++)e[u+i]|=n[t*r+i];u+=a}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=r;i++)e[u+i]|=d<<h|(i<r?(d=n[t*r+i])>>>l:0);u+=a}}function bJ(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,c=n[1];let d,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<a;i++)if(e[u+i]&s[t*a+i])return!0;u+=r}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=a;i++)if((d<<h|(i<a?(d=s[t*a+i])>>>l:0))&e[u+i])return!0;u+=r}return!1}function xJ(t,e,i,s,n){const r=i[s];if(r.sprite||0===r.fontSize)return;if(n){const t=n.get(SJ(r));if(t)return r.sprite=t.sprite,r.bounds=t.bounds,r.wordSize=t.wordSize,void(r.hasText=!0)}const a=2048,o=Math.PI/180,l=i.length;t.width=a,t.height=2048,e.clearRect(0,0,a,2048),e.textAlign="center";let h,c,d=0,u=0,p=0,g=0;const f=s;for(--s;++s<l;){const t=i[s],n=Math.max(t.fontSize,2);if(e.save(),e.font=t.fontStyle+" "+t.fontWeight+" "+n+"px "+t.fontFamily,h=e.measureText(t.text+"m").width+2*t.padding,c=2*n+2*t.padding,0!==t.rotate){const e=Math.sin(t.rotate*o),i=Math.cos(t.rotate*o),s=h*i,n=h*e,r=c*i,a=c*e;h=Math.max(Math.abs(s+a),Math.abs(s-a)),c=~~Math.max(Math.abs(n+r),Math.abs(n-r))}if(h=h+31>>5<<5,c=Math.ceil(c),c>p&&(p=c),d+h>=a&&(d=0,u+=p,p=c),u+c>=2048){if(0===u){t.hasText=!1;continue}break}u+c>=g&&(g=u+c),e.translate(d+(h>>1),u+(c>>1)),0!==t.rotate&&e.rotate(t.rotate*o),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[d,u],t.wordSize=[h,c],t.hasText=!0,d+=h}if(0===g)return;const m=e.getImageData(0,0,a,g).data;let v,y;for(;--s>=f;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[d,u]=e;const o=r[0]>>5,l=new Array(o*r[1]).fill(0);let[h,c,p,g]=[1/0,-1/0,1/0,-1/0];for(y=0;y<r[1];y++){let t;for(v=0;v<r[0];v++)if(m[4*((u+y)*a+(d+v))+3]>0){const e=1<<31-v%32;l[o*y+(v>>5)]|=e,v<p&&(p=v),v>g&&(g=v),t|=e}t&&(y<h&&(h=y),y>c&&(c=y))}if(t.bounds={dTop:(r[1]>>1)-h,dBottom:c-(r[1]>>1),dLeft:(r[0]>>1)-p,dRight:g-(r[0]>>1)},t.sprite=l,n){const e=SJ(t);n.set(e,{sprite:l,bounds:t.bounds,wordSize:r})}delete t.LT}}function SJ(t){return String(t.text)+"|"+String(t.fontFamily)+"|"+String(t.fontStyle)+"|"+String(t.fontWeight)+"|"+String(t.fontSize)+"|"+String(t.rotate)+"|"+String(t.padding)}function AJ(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t<s[1];t++)for(let i=0;i<s[0];i++)if(0===e[t*s[0]+i]){const e=1<<31-i%32;r[n*t+(i>>5)]|=e}if(i[0]>s[0]){const t=(1<<i[0]-s[0])-1;for(let e=0;e<s[1];e++)r[n*e+n-1]|=t}return r}function kJ(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),a<t.length&&(i[r].wordsNum+=t.length-a);let o=r;const l=i.map((t=>t.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?vJ(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:c,shapeRatio:d}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=AJ(i);let g=p.slice(0);const f=e.fontSizeEnlargeFactor,m=Math.min(r,t.length);let v=0;t.length>m&&(v=t.sort(((t,e)=>e.weight-t.weight))[m-1].weight);let y=0,_=1,b=!1;for(let r=0;r<a.length;r++){const h=a[r],{words:c,center:d,maxR:x,ratio:S}=h;let A=!1;for(let r=0;r<c.length;r++){xJ(o,u,t,r,e.measureCache);const a=c[r];if(a.x=d[0],a.y=d[1],a.hasText&&a.sprite&&yJ(g,a,x,S,s,l,n)){if(a.hasPlaced=!0,a.weight>=v&&y++,y>=m&&!b){_*=f,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*f})),g=p.slice(0),A=!0,y=0;break}}else{if(a.weight>=v&&_>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/f})),_/=f,b=!0,g=p.slice(0),A=!0;break}if(a.weight>=v)return vJ(t,e,i)}}A&&(r=-1)}for(let i=0;i<e.textLayoutTimes;i++){const i=t.filter((t=>(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t<i.length;t++){const r=i[t];xJ(o,u,i,t,e.measureCache),r.x=h[0],r.y=h[1],r.hasText&&yJ(g,r,c,d,s,l,n)&&(r.hasPlaced=!0)}}e.board=g}(t,e,i):function(t,e,i){const{size:s,stepFactor:n}=e,{segmentation:{regions:r},tempCanvas:a,boardSize:o,shapeCenter:l,shapeMaxR:h,shapeRatio:c}=i,d=AJ(i),u=a.getContext("2d",{willReadFrequently:!0});for(const i of r){const{words:r,center:l,maxR:h,ratio:c}=i;for(let i=0;i<r.length;i++){xJ(a,u,t,i,e.measureCache);const p=r[i];p.x=l[0],p.y=l[1],p.hasText&&p.sprite&&yJ(d,p,h,c,s,o,n)&&(p.hasPlaced=!0)}}for(let i=0;i<e.textLayoutTimes;i++){const i=t.filter((t=>(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t<i.length;t++){const r=i[t];xJ(a,u,i,t,e.measureCache),r.x=l[0],r.y=l[1],r.hasText&&yJ(d,r,h,c,s,o,n)&&(r.hasPlaced=!0)}}e.board=d}(t,e,i);const s=function(t,e,i){const{size:s,fillingTimes:n,fillingXStep:r,fillingYStep:a,getFillingFontStyle:o,getFillingFontWeight:l,getFillingFontFamily:h,fillingInitialFontSize:c,fillingDeltaFontSize:d,fillingInitialOpacity:u,fillingDeltaOpacity:p,fillingRotateList:g,getFillingPadding:f,random:m,board:v,minFillFontSize:y}=e,{boardSize:_,shapeBounds:b,tempCanvas:x,randomGenerator:S}=i,A=x.getContext("2d",{willReadFrequently:!0});let k=c,C=u;const M=[];for(let t=0;t<n;t++)w(k,C),k=Math.max(k>d?k-d:d,y),C=C>p?C-p:p;return M;function w(i,n){const c=t.map((t=>{const{text:e,color:s,fillingColor:r,hasPlaced:a,datum:c}=t;return{x:0,y:0,weight:0,text:e,fontFamily:h(c),fontStyle:o(c),fontWeight:l(c),fontSize:i,rotate:g[~~(S()*g.length)],padding:f(c),opacity:n,visible:!0,color:s,fillingColor:r,hasPlaced:a,datum:c}}));T(c);let d=0;const{x1:u,y1:p,x2:y,y2:k}=b,[C,w]=[u+~~(S()*r*2),p+~~(S()*a*2)];for(let t=w;t<=k;t+=a)for(let i=C;i<=y;i+=r){xJ(x,A,c,d,e.measureCache);const n=c[d];n.x=i,n.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=n;if(!o||!a){++d===c.length&&(d=0,m&&T(c));continue}const{dTop:l,dBottom:h,dLeft:u,dRight:p}=a;n.x-u<0||n.x+p>s[0]||n.y-l<0||n.y+h>s[1]||n.hasText&&n.sprite&&!bJ(n,v,_)&&(_J(n,v,_),M.push(Object.assign({},n)),++d===c.length&&(d=0,m&&T(c)))}}function T(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;e<t.length;e++)t[e].hasPlaced?r.push(t[e]):n.push(t[e]);return n.forEach((t=>t.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}const CJ={x:"x",y:"y",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle",opacity:"opacity",visible:"visible",isFillingWord:"isFillingWord",color:"color"};class MJ{constructor(t){this.progressiveResult=[],this.options=t}layout(t){this.data=t;const e=this.options,i={shapeUrl:e.shape,size:e.size,ratio:e.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0},s=this.options.createCanvas({width:e.size[0],height:e.size[1]}),n=s.getContext("2d",{willReadFrequently:!0});n.textAlign="center",n.textBaseline="middle",i.tempCanvas=s;const r=e.size[0]+31>>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,y(i.shapeUrl)){i.isEmptyPixel=qZ(void 0,void 0,this.options.createCanvas);const t=function(t,e){return t&&(C(t)||M(t)||t.startsWith("<svg"))?new Promise(((i,s)=>{var n;const r=e({image:t}),a=null===(n=r.resources)||void 0===n?void 0:n.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const n=null===(e=r.resources)||void 0===e?void 0:e.get(t);n&&"success"===n.state&&n.data?i(n.data):s(new Error("image load failed: "+t))}else s(new Error("image load failed: "+t))},r.failCallback=()=>{s(new Error("image load failed: "+t))})})):null}(i.shapeUrl,this.options.createImage);t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=this.options.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let s=0;s<t;++s)if(!i(r,e,s))return!1;return!0},d=(t,e,s)=>{for(let n=e;n<s;++n)if(!i(r,n,t))return!1;return!0};for(;a<o&&c(n,a);)++a;for(;o-1>a&&c(n,o-1);)--o;for(;l<h&&d(l,a,o);)++l;for(;h-1>l&&d(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=qZ(i.shapeUrl.backgroundColor,void 0,this.options.createCanvas);const t=ZZ(i.shapeUrl,e.size[0],e.size[1],void 0,!1,this.options.createCanvas);i.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){this.isImageFinished&&!this.isLayoutFinished&&(this.segmentationInput.maskCanvas&&this.doLayout(),this.isLayoutFinished=!0)}progressiveOutput(){return this.progressiveResult}doLayout(){var t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b,x;const S=this.segmentationInput,A=iJ(S);if(!A.segmentation.regions.length)return;const k=this.options,C=this.data,M=k.colorMode||"ordinal",w={getText:Pt(k.text),getFontSize:Pt(k.fontSize),fontSizeRange:k.fontSizeRange,colorMode:M,getColor:k.colorField?Pt(k.colorField):Pt(k.text),getFillingColor:Pt(k.fillingColorField),colorList:k.colorList||("ordinal"===M?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:Pt(k.colorHexField),getFontFamily:Pt(k.fontFamily||"sans-serif"),rotateList:k.rotateList||[0],getPadding:Pt(k.padding||1),getFontStyle:Pt(k.fontStyle||"normal"),getFontWeight:Pt(k.fontWeight||"normal"),getFontOpacity:k.fontOpacity?Pt(k.fontOpacity):()=>1};TJ(C,w,A);const T={size:k.size,ratio:k.ratio||.8,measureCache:null!==(t=k.measureCache)&&void 0!==t?t:new gJ,shapeUrl:k.shape,random:void 0===k.random||k.random,textLayoutTimes:null!==(e=k.textLayoutTimes)&&void 0!==e?e:3,removeWhiteBorder:k.removeWhiteBorder,layoutMode:null!==(i=k.layoutMode)&&void 0!==i?i:"default",fontSizeShrinkFactor:null!==(s=k.fontSizeShrinkFactor)&&void 0!==s?s:.8,stepFactor:null!==(n=k.stepFactor)&&void 0!==n?n:1,importantWordCount:null!==(r=k.importantWordCount)&&void 0!==r?r:10,globalShinkLimit:k.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(a=k.fontSizeEnlargeFactor)&&void 0!==a?a:1.5,fillingRatio:null!==(o=k.fillingRatio)&&void 0!==o?o:.7,fillingTimes:null!==(l=k.fillingTimes)&&void 0!==l?l:4,fillingXStep:k.fillingXRatioStep?Math.max(Math.floor(k.size[0]*k.fillingXRatioStep),1):null!==(h=k.fillingXStep)&&void 0!==h?h:4,fillingYStep:k.fillingYRatioStep?Math.max(Math.floor(k.size[1]*k.fillingYRatioStep),1):null!==(c=k.fillingYStep)&&void 0!==c?c:4,fillingInitialFontSize:k.fillingInitialFontSize,fillingDeltaFontSize:k.fillingDeltaFontSize,fillingInitialOpacity:null!==(d=k.fillingInitialOpacity)&&void 0!==d?d:.8,fillingDeltaOpacity:null!==(u=k.fillingDeltaOpacity)&&void 0!==u?u:.05,getFillingFontFamily:Pt(k.fillingFontFamily||"sans-serif"),getFillingFontStyle:Pt(k.fillingFontStyle||"normal"),getFillingFontWeight:Pt(k.fillingFontWeight||"normal"),getFillingPadding:Pt(null!==(p=k.fillingPadding)&&void 0!==p?p:.4),fillingRotateList:null!==(g=k.fillingRotateList)&&void 0!==g?g:[0,90],fillingDeltaFontSizeFactor:null!==(f=k.fillingDeltaFontSizeFactor)&&void 0!==f?f:.2,fillingColorList:k.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(m=k.minInitFontSize)&&void 0!==m?m:10,minFontSize:null!==(v=k.minFontSize)&&void 0!==v?v:4,minFillFontSize:null!==(y=k.minFillFontSize)&&void 0!==y?y:2},B=((t,e)=>{if(1===e.length&&"#537EF5"===e[0])return!0;if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0})(w.colorList,T.fillingColorList);T.sameColorList=B,wJ(C,w,T,k),function(t,e,i,s){const{getText:n}=e;let{fillingInitialFontSize:r,fillingDeltaFontSize:a}=i;const{fillingRatio:o}=i,l=Math.ceil(Math.sqrt(s.shapeArea)/4);if(!r||!a){const e=o/100,h=t.reduce(((t,e)=>{const i=mJ(n(e));return i>l?t:t+i}),0)/t.length;let c;if(0===h)c=8;else{const t=.2*s.shapeArea;c=Math.sqrt(e*(t/h))}r=~~c,a=c*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(C,w,T,A);const{getText:E,getFontFamily:P,getFontStyle:O,getFontWeight:I,getPadding:R,getColor:D,getFillingColor:L,getColorHex:F,fontSizeScale:z,colorScale:j,fillingColorScale:H,getFontOpacity:N,rotateList:V}=w,U=C.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:P(t),fontWeight:I(t),fontStyle:O(t),rotate:V[~~(S.randomGenerator()*V.length)],fontSize:Math.max(T.minInitFontSize,~~z(t)),opacity:N(t),padding:R(t),color:F&&F(t)||j&&j(D(t))||"black",fillingColor:!L||(null===(e=k.colorField)||void 0===e?void 0:e.field)===(null===(i=k.fillingColorField)||void 0===i?void 0:i.field)&&B?void 0:F&&F(t)||H&&H(L(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),W=$(U.map((t=>t.fontSize)));U.forEach((t=>t.weight=t.fontSize/W)),U.sort(((t,e)=>e.weight-t.weight));const{fillingWords:G,successedWords:Y,failedWords:K}=kJ(U,T,A),X=null!==(b=null===(_=k.text)||void 0===_?void 0:_.field)&&void 0!==b?b:"textKey",q=null!==(x=k.dataIndexKey)&&void 0!==x?x:"defaultDataIndexKey",Z=k.as?Object.assign(Object.assign({},CJ),k.as):CJ;let J,Q;const tt=[];for(let t=0;t<U.length;++t)J=U[t],Q=J.datum,Q[Z.x]=J.x,Q[Z.y]=J.y,Q[Z.fontFamily]=J.fontFamily,Q[Z.fontSize]=J.fontSize,Q[Z.fontStyle]=J.fontStyle,Q[Z.fontWeight]=J.fontWeight,Q[Z.angle]=oe(J.rotate),Q[Z.opacity]=J.opacity,Q[Z.visible]=J.visible,Q[Z.isFillingWord]=!1,Q[Z.color]=J.color,Q[q]=`${J.text}_${t}_keyword`,tt.push(Q);const et=[];G.forEach(((t,e)=>{var i,s;const n=Object.assign({},t.datum);n[Z.x]=t.x,n[Z.y]=t.y,n[Z.fontFamily]=t.fontFamily,n[Z.fontSize]=t.fontSize,n[Z.fontStyle]=t.fontStyle,n[Z.fontWeight]=t.fontWeight,n[Z.angle]=oe(t.rotate),n[Z.opacity]=t.opacity,n[Z.visible]=t.visible,n[Z.isFillingWord]=!0,n[Z.color]=L?(null===(i=k.colorField)||void 0===i?void 0:i.field)===(null===(s=k.fillingColorField)||void 0===s?void 0:s.field)&&B?t.color:t.fillingColor:T.fillingColorList[~~(S.randomGenerator()*T.fillingColorList.length)],n[X]=t.text,n[q]=`${t.text}_${e}_fillingWords`,et.push(n)})),this.options.onLayoutFinished&&this.options.onLayoutFinished({successedWords:Y,failedWords:K}),this.progressiveResult=tt.concat(et)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const wJ=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:c}=e,{sameColorList:d}=i;let u,p,g=e.colorList,f=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new eR).domain(e).range(g).scale(t),c&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!d)){const e=t.map((t=>c(t)));p=t=>(new eR).domain(e).range(f).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new CR).domain(EJ(h,t)).range(g);if(u=t=>e.scale(t),c&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!d)){1===f.length&&(f=[f[0],f[0]]);const e=(new CR).domain(EJ(c,t)).range(f);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},TJ=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new ER).domain(EJ(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&d(n)&&!s){const e=.5,[o,l]=EJ(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),c=BJ(h,i,!0);s=[~~(e*c),~~c];const d=(new ER).domain(EJ(n,t)).range(s);a=t=>d.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=BJ(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},BJ=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=mJ(e.text);return s<a?t+s*(i?(.5+.5*e.weight)**2:1):t}),0);if(0===o)return 12;let l=20;if(1===r.length)l=Math.sqrt(n*(s/(1.7*o)));else{const t=[];for(let e=0;e<r.length;e++){const i=r[e].area,a=r[e].ratio,l=i/s;if(l<.1)continue;const h=l*(o*(a<1?2.7-a:1.7)),c=Math.sqrt(n*(i/h));t.push(c)}l=t.length?Math.min(...t):Math.sqrt(n*(s/(1.7*o)))}return l};const EJ=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=et(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},PJ=(t,e,i)=>{if(!t.size||u(t.size[0])||u(t.size[1])||t.size[0]<=0||t.size[1]<=0)return at.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(t.size[0]),Math.ceil(t.size[1])],t.shape||at.getInstance().error("WordcloudShape shape must be specified."),t.text||at.getInstance().error("WordcloudShape text must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];const s=new MJ(t);return s.layout(e),s.unfinished()?{progressive:s}:s.output()};class OJ extends Lq{constructor(){super(...arguments),this.type=az.wordCloud}}OJ.type=az.wordCloud;const IJ=()=>{Fz.registerGrammarTransform("wordcloud",{transform:oJ}),z$(),zq(),Fz.registerSeries(OJ.type,OJ)},RJ=t=>d(t)?t():t,DJ=(t,e)=>{var i,s,n,r;const a=t.map((t=>Object.assign({},t)));if(!a||0===a.length)return a;const{asTransformRatio:o,asReachRatio:l,asHeightRatio:h,asValueRatio:c,asNextValueRatio:d,asLastValueRatio:u,asLastValue:p,asCurrentValue:g,asNextValue:f}=e,m=RJ(e.valueField),v=null!==(i=RJ(e.heightVisual))&&void 0!==i&&i,y=null===(s=RJ(e.isCone))||void 0===s||s,_=RJ(e.range),b=a.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[m])||-1/0)),-1/0),x=a.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[m])||1/0)),1/0),S=[null!==(n=null==_?void 0:_.min)&&void 0!==n?n:x,null!==(r=null==_?void 0:_.max)&&void 0!==r?r:b];return a.forEach(((t,e)=>{var i,s;const n=Number.parseFloat(t[m]),r=Number.parseFloat(null===(i=a[e-1])||void 0===i?void 0:i[m]),_=Number.parseFloat(null===(s=a[e+1])||void 0===s?void 0:s[m]),b=k(_*n)&&0!==n?_/n:0,x=k(n*r)&&0!==r?n/r:0;p&&(t[p]=r),f&&(t[f]=_),o&&(t[o]=b),l&&(t[l]=0===e?1:x),h&&(t[h]=!0===v?b:1/a.length),c&&(t[c]=n/S[1]),d&&(t[d]=e===a.length-1?y?0:t[c]:_/S[1]),u&&(t[u]=0===e?1:r/S[1]),g&&(t[g]=n)})),a},LJ=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},FJ=`${rj}_FUNNEL_TRANSFORM_RATIO`,zJ=`${rj}_FUNNEL_REACH_RATIO`,jJ=`${rj}_FUNNEL_HEIGHT_RATIO`,HJ=`${rj}_FUNNEL_VALUE_RATIO`,NJ=`${rj}_FUNNEL_LAST_VALUE_RATIO`,VJ=`${rj}_FUNNEL_NEXT_VALUE_RATIO`,UJ=`${rj}_FUNNEL_LAST_VALUE`,WJ=`${rj}_FUNNEL_CURRENT_VALUE`,GJ=`${rj}_FUNNEL_NEXT_VALUE`,YJ=`${rj}_FUNNEL_TRANSFORM_LEVEL`;class KJ extends WV{constructor(t){var e,i;super(t),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?this._transformRatioText:null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?`${(100*(null==t?void 0:t[zJ])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return this._transformRatioText;const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return p(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]},this._transformRatioText=null!==(i=null===(e=t.getSpec())||void 0===e?void 0:e.transformRatioText)&&void 0!==i?i:"转化率"}}class $J extends KN{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class XJ extends $J{constructor(){super(...arguments),this.type=XJ.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}XJ.type="polygon";const qJ=()=>{Fz.registerMark(XJ.type,XJ),kT(),gT(),pV(),Fz.registerGraphicComponent("polygon",Kf)},ZJ=Object.assign(Object.assign({},iU),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class JJ extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class QJ extends CU{constructor(){super(...arguments),this.type=az.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=JJ,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(n=null===(s=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===s?void 0:s.minLength)&&void 0!==n?n:20,this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;oH(this._dataSet,"funnel",DJ),oH(this._dataSet,"funnelTransform",LJ);const t=new so(this._dataSet,{name:`${rj}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new FN(this._option,t)}compile(){var t,e;super.compile(),this._funnelOuterLabelMark&&(null===(t=this._funnelOuterLabelMark.label)||void 0===t||t.compile({group:this._rootMark.getProduct()}),null===(e=this._funnelOuterLabelMark.line)||void 0===e||e.compile({group:this._rootMark.getProduct()}))}compileData(){var t;super.compileData(),null===(t=this._viewDataTransform)||void 0===t||t.compile()}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:()=>this.getValueField(),isCone:()=>this._spec.isCone,asCurrentValue:WJ,asTransformRatio:FJ,asReachRatio:zJ,asHeightRatio:jJ,asValueRatio:HJ,asNextValueRatio:VJ,asLastValueRatio:NJ,asLastValue:UJ,asNextValue:GJ,range:()=>this._spec.range}}),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.transform({type:"funnelTransform",options:{asIsTransformLevel:YJ}})}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},QJ.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:gU(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},QJ.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(QJ.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(QJ.mark.outerLabelLine,{themeSpec:e,markSpec:t,noSeparateStyle:!0,parent:!1})}}initTooltip(){this._tooltipHelper=new KJ(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){var t,e,i,s;const n=this._funnelMark;n&&this.setMarkStyle(n,{points:t=>this.getPoints(t),visible:t=>p(t[this._valueField]),fill:this.getColorAttribute()},"normal",hN.Series);const r=this._funnelTransformMark;r&&this.setMarkStyle(r,{points:t=>this.getPoints(t)},"normal",hN.Series);const a=this._funnelOuterLabelMark.label;a&&(this.setMarkStyle(a,{text:t=>`${t[this.getCategoryField()]}`,x:t=>this._computeOuterLabelPosition(t).x,y:t=>this._computeOuterLabelPosition(t).y,textAlign:t=>this._computeOuterLabelPosition(t).align,textBaseline:t=>this._computeOuterLabelPosition(t).textBaseline,maxLineWidth:t=>this._computeOuterLabelLimit(t),width:0,height:0},"normal",hN.Series),d(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(a,{text:t=>this._spec.outerLabel.formatMethod(`${t[this.getCategoryField()]}`,t)},"normal",hN.User_Mark));const o=this._funnelOuterLabelMark.line;if(o&&a){this.setMarkStyle(o,{x:t=>this._computeOuterLabelLinePosition(t).x1,y:t=>this._computeOuterLabelLinePosition(t).y1,x1:t=>this._computeOuterLabelLinePosition(t).x2,y1:t=>this._computeOuterLabelLinePosition(t).y2},"normal",hN.Series);const n=null!==(i=null===(e=null===(t=this._spec.outerLabel)||void 0===t?void 0:t.line)||void 0===e?void 0:e.visible)&&void 0!==i?i:null===(s=this._spec.outerLabel)||void 0===s?void 0:s.visible;p(n)&&o.setVisible(n)}}initLabelMarkStyle(t){var e;if(!t)return;const i=t.getTarget(),s=t.getComponent();if(i===this._funnelMark){this._labelMark=t,this.setMarkStyle(t,{text:t=>`${t[this.getCategoryField()]} ${t[this.getValueField()]}`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.label),stroke:this.getColorAttribute()},"normal",hN.Series);const i=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&$A(i,this._funnelOuterLabelMark.label,s),this._funnelOuterLabelMark.line&&$A(i,this._funnelOuterLabelMark.line,null!==(e=this._funnelOuterLabelMark.label)&&void 0!==e?e:s)}else this._funnelTransformMark&&i===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*nz(zJ).bind(this)(t)).toFixed(1)}%`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.transformLabel)},"normal",hN.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(cU(null===(s=Fz.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),dU("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(cU(Fz.getAnimationInKey("fadeInOut")(),dU(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(cU(Fz.getAnimationInKey("funnel")({},o),dU(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(cU(null===(a=Fz.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),dU("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[NJ])/2:this._getSecondaryAxisLength(t[HJ])/2,n=this._getSecondaryAxisLength(t[HJ])/2):(s=this._getSecondaryAxisLength(t[HJ])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[VJ])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[YJ])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return p(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[hj]===t[hj]));if(!p(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),c=this._getMainAxisLength(!0);return l+=i*(h+c),l+=s?-c/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(S(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r,a;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const o=this.getPoints(t),l=(Math.abs(o[0].x-o[1].x)+Math.abs(o[2].x-o[3].x))/2,h=this.getCategoryField(),c=null===(n=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[h])===t[h]}),!0))||void 0===n?void 0:n.AABBBounds,d=c?c.x2-c.x1:0,u=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0;let p=this.getLayoutRect().width-Math.max(l,d);return"center"===this._funnelAlign&&(p/=2),p-u-(null!==(a=null===(r=this._spec.outerLabel)||void 0===r?void 0:r.spaceWidth)&&void 0!==a?a:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,c;const d=this.getCategoryField(),u=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===s?void 0:s.find((e=>{var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[d])===t[d]})))||void 0===n?void 0:n.AABBBounds,p=null===(a=null===(r=this._labelMark)||void 0===r?void 0:r.getComponent())||void 0===a?void 0:a.getComponent(),g=null===(o=null==p?void 0:p.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[d])===t[d]}),!0))||void 0===o?void 0:o.AABBBounds,f=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};let m,v,y,_;if(this._isHorizontal()){const e=null!==(h=f.spaceWidth)&&void 0!==h?h:5,i=this.getPoints(t),s=(Math.abs(i[0].y-i[1].y)+Math.abs(i[2].y-i[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(y=this._getPolygonCenter(i).y-s/2-e,_=!1!==f.alignLabel?(null==u?void 0:u.y2)+e:y-e,m=this._getPolygonCenter(i).x,y-_<this._minLabelLineWidth&&(_=y-this._minLabelLineWidth),v=m):(y=this._getPolygonCenter(i).y+s/2+e,_=!1!==f.alignLabel?(null==u?void 0:u.y1)-e:y+e,m=this._getPolygonCenter(i).x,_-y<this._minLabelLineWidth&&(_=y+this._minLabelLineWidth),v=m),{x1:m,x2:v,y1:y,y2:_}}const b=this.getPoints(t),x=(Math.abs(b[0].x-b[1].x)+Math.abs(b[2].x-b[3].x))/2,S=(null==g?void 0:g.x2)-(null==g?void 0:g.x1)||0,A=null!==(c=f.spaceWidth)&&void 0!==c?c:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(m=this._getPolygonCenter(b).x+Math.max(S/2,x/2)+A,v=!1!==f.alignLabel?(null==u?void 0:u.x1)-A:m+A,y=this._getPolygonCenter(b).y,v-m<this._minLabelLineWidth&&(v=m+this._minLabelLineWidth),_=y):(m=this._getPolygonCenter(b).x-Math.max(S/2,x/2)-A,v=!1!==f.alignLabel?(null==u?void 0:u.x2)+A:m-A,y=this._getPolygonCenter(b).y,m-v<this._minLabelLineWidth&&(v=m-this._minLabelLineWidth),_=y),{x1:m,x2:v,y1:y,y2:_}}_computeMaxSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return Mz(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}_computeMinSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return Mz(null!==(t=this._spec.minSize)&&void 0!==t?t:0,e)}_isHorizontal(){return"left"===this._funnelOrient||"right"===this._funnelOrient}_isReverse(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._funnelMark]}}QJ.type=az.funnel,QJ.mark=ZJ,QJ.builtInTheme={funnel:Nz},QJ.transformerConstructor=JJ;const tQ=()=>{qJ(),z$(),$K(),Fz.registerSeries(QJ.type,QJ),Fz.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},rV))),Fz.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:jP,customParameters:(e,i)=>({animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),oV()},eQ=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},iQ=t=>{const e=t.filter((t=>t.context.diffState===TN.update)),i=X(e.map((t=>{var e,i;return null===(i=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0].depth})));return e.filter((t=>{var e,s;return(null===(s=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===s?void 0:s[0].depth)===i}))},sQ=(t,e,i)=>P(t)?[e,i]:[X(t.map((t=>1*t.getFinalAttribute().startAngle))),$(t.map((t=>1*t.getFinalAttribute().endAngle)))],nQ=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=sQ(r,s,n);return eQ(i.getFinalAttribute().startAngle,a)*(n-s)+s},to:(t,e)=>e.getFinalAttribute().startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=sQ(r,s,n);return eQ(i.getFinalAttribute().endAngle,a)*(n-s)+s},to:(t,e)=>e.getFinalAttribute().endAngle},outerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:(t,e)=>e.getFinalAttribute().outerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:(t,e)=>e.getFinalAttribute().innerRadius}}}),rQ=t=>[X(t.map((t=>1*t.getFinalAttribute().startAngle))),$(t.map((t=>1*t.getFinalAttribute().endAngle)))],aQ=t=>({channel:{startAngle:{from:(t,e)=>e.getFinalAttribute().startAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=rQ(r);return eQ(i.getFinalAttribute().startAngle,a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getFinalAttribute().endAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=rQ(r);return eQ(i.getFinalAttribute().endAngle,a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getFinalAttribute().outerRadius,to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:()=>t.animationInfo().innerRadius}}}),oQ=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},lQ=(t,e={})=>{if(!t)return[];const i=[];return Vq(t,i,e),i},hQ=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new mZ(i).layout(t,{width:s,height:n})};class cQ extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}var dQ;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(dQ||(dQ={}));const uQ=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(u(n))return t;if(i.type===dQ.DrillDown){return Y(Vj(t,n,s,"children"))}if(i.type===dQ.DrillUp){const e=Uj(t,n,s,"children");if(e)return Y(e)}return t};class pQ{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=EK(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;oH(t,"drillFilter",uQ),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(u(t.datum)||u(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!_(t)||P(t))return t;const s=t[t.length-1];return this._drillInfo={key:s,path:t,type:dQ.DrillDown},e().reRunAllTransform(),i.emit(tH.drill,{value:{path:t,type:dQ.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:s}=this._drillParams,n=null!==(e=null===(t=this._drillInfo)||void 0===t?void 0:t.path)&&void 0!==e?e:[];if(!_(n)||P(n))return n;const r=n.pop();return this._drillInfo={key:r,path:n,type:dQ.DrillUp},i().reRunAllTransform(),s.emit(tH.drill,{value:{path:n,type:dQ.DrillUp},model:this}),n}}const gQ=Object.assign(Object.assign({},iU),{sunburst:{name:"sunburst",type:"arc"}}),fQ=(t,e,i)=>(t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:XV,operations:["max","min","values"]}),t.push({key:qV,operations:["values"]}),t),mQ={innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}};class vQ extends J${constructor(){super(...arguments),this.type=az.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qV),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:hj},getRawData:()=>this.getRawData()}),this._startAngle=oe(this._spec.startAngle),this._endAngle=oe(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),oH(this._dataSet,"sunburstLayout",hQ),oH(this._dataSet,"flatten",lQ),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[p(this._centerX)?this._centerX:this.getLayoutRect().width/2,p(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return fQ(super.getStatisticFields(),this._categoryField,this._valueField)}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(oH(t.dataSet,"addVChartProperty",LV),t.transform({type:"addVChartProperty",options:{beforeCall:tU.bind(this),call:eU}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){if(!1===this._sunburst.visible)return;const t=this._createMark(vQ.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}_initArcMarkStyle(){u(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(p(this._offsetX)?this._offsetX:0),y:t=>t.y+(p(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(vQ.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return g(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(p(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(p(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},BN.STATE_NORMAL,hN.Series)}initTooltip(){this._tooltipHelper=new cQ(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Y(this.__innerRadius))[0],outerRadius:this._computeRadius(Y(this.__outerRadius))[0],startAngle:Y(this._startAngle)[0],endAngle:Y(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),dU(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_computeRadius(t){return _(t)?t.map((t=>this._computeLayoutRadius()*t)):this._computeLayoutRadius()*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}vQ.type=az.sunburst,vQ.mark=gQ,vQ.builtInTheme={sunburst:mQ},G(vQ,pQ);const yQ=()=>{Fz.registerSeries(vQ.type,vQ),dX(),z$(),oV(),Fz.registerAnimation("sunburst",((t,e)=>({appear:oQ(0,e),enter:nQ(t),exit:aQ(t),disappear:{duration:sV.disappear.duration}})))},_Q=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return 0===s||0===n?t:new nZ(i).layout(t,{width:s,height:n})};class bQ extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const xQ=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},SQ=Object.assign(Object.assign({},iU),{circlePacking:{name:"circlePacking",type:"arc"}});class AQ extends TU{constructor(){super(...arguments),this.type=az.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qV),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:hj},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();u(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),oH(this._dataSet,"circlePackingLayout",_Q),oH(this._dataSet,"flatten",lQ),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,valueField:this._valueField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(oH(t.dataSet,"addVChartProperty",LV),t.transform({type:"addVChartProperty",options:{beforeCall:tU.bind(this),call:eU}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const e=this._createMark(AQ.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}_initCirclePackingMarkStyle(){u(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},BN.STATE_NORMAL,hN.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(AQ.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},BN.STATE_NORMAL,hN.Series)}getStatisticFields(){return fQ(super.getStatisticFields(),this._categoryField,this._valueField)}initTooltip(){this._tooltipHelper=new bQ(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),dU(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}AQ.type=az.circlePacking,AQ.mark=SQ,AQ.builtInTheme={circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},G(AQ,pQ);const kQ=()=>{Fz.registerSeries(AQ.type,AQ),dX(),z$(),aV(),Fz.registerAnimation("circlePacking",((t,e)=>({appear:xQ(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:sV.disappear.duration}})))},CQ=(t,e,i)=>{e.forEach((e=>{u(e[i])||t.add(e[i]),e.children&&e.children.length>0&&CQ(t,e.children,i)}))},MQ=t=>{var e;if(!t||!_(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},wQ=(t,e)=>{const i=d(e)?e():e;if(!t||!(null==i?void 0:i.view)||!t.length)return[];const s=i.view();if(s.x1-s.x0==0||s.y1-s.y0==0||s.x1-s.x0==-1/0||s.x1-s.x0==1/0||s.y1-s.y0==-1/0||s.y1-s.y0==1/0)return[];const n=t[0],r=TQ(n,i),a=new pZ(i),o=[];return o.push(a.layout(r,s)),o},TQ=(t,e)=>{if("source"===e.sourceField&&"target"===e.targetField&&"value"===e.valueField)return t;const i=t.links;return i?Object.assign(Object.assign({},t),{links:i.map((t=>{const i={};return Object.keys(t).forEach((s=>{s===e.sourceField?i.source=t[e.sourceField]:s===e.targetField?i.target=t[e.targetField]:s===e.valueField?i.value=t[e.valueField]:i[s]=t[s]})),i}))}):t},BQ=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},EQ=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class PQ extends WV{constructor(){super(...arguments),this._getDimensionData=t=>{if(!u(null==t?void 0:t.source)&&!u(null==t?void 0:t.target)){if(S(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},this.markTooltipValueCallback=t=>t.value}}const OQ=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t),IQ=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"};class RQ extends XE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s,a=this.target.getFinalAttribute();a&&Object.assign(this.target.attribute,a),this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}class DQ extends XE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s;this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const LQ=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c),d=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.y0-n/2),l=d(t.y1-n/2)):"end"===t.align?(o=d(t.y0+t.thickness/2-n),l=d(t.y1+t.thickness/2-n)):(o=d(t.y0-t.thickness/2),l=d(t.y1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${a},${d(l-n/2)}L${d(a+n)},${d((l+p)/2)}L${a},${d(p+n/2)}`:"",m=t.startArrow&&g?`L${r},${d(u+n/2)}L${d(r-n)},${d((o+u)/2)}L${r},${d(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${f}L${a},${p}L${r},${u}${m}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${f}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${m}Z`:`M${r},${o}C${h},${o},${c},${l},${a},${l}\n ${f}L${a},${p}C${c},${p},${h},${u},${r},${u}${m}Z`},FQ=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(d=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c)),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.x0-n/2),l=d(t.x1-n/2)):"end"===t.align?(o=d(t.x0+t.thickness/2-n),l=d(t.x1+t.thickness/2-n)):(o=d(t.x0-t.thickness/2),l=d(t.x1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${d(l-n/2)},${a}L${d((l+p)/2)},${d(a+n)}L${d(p+n/2)},${a}`:"",m=t.startArrow&&g?`L${d(u+n/2)},${r}L${d((u+o)/2)},${d(r-n)}L${d(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${f}L${p},${a}L${u},${r}${m}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${f}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${m}Z`:`M${o},${r}C${o},${h},${l},${c},${l},${a}\n ${f}L${p},${a}C${p},${c},${u},${h},${u},${r}${m}Z`};class zQ extends y${constructor(){super(...arguments),this.type=zQ.type,this._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},this._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],this._channelEncoder={backgroundStyle:t=>({back:t})},this._positionEncoder=(t,e,i)=>{var s,n;const r=Object.assign(Object.assign({},i.attribute),t),a=null!==(s=r.direction)&&void 0!==s?s:null===(n=this._glyphConfig)||void 0===n?void 0:n.direction,o=["vertical","TB","BT"].includes(a)?FQ:LQ,l="number"==typeof r.ratio&&r.ratio>=0&&r.ratio<=1;return{back:{path:l?o(r,1):""},front:{path:o(r,l?r.ratio:1)}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}zQ.type="linkPath";const jQ=Object.assign(Object.assign({},iU),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class HQ extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}const NQ=(t,e,i,s=!0,n)=>{t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&WN(t,e),UN(t,e,s,n)};class VQ extends TU{constructor(){super(...arguments),this.type=az.sankey,this.transformerConstructor=HQ,this._nodeLayoutZIndex=oN.Node,this._labelLayoutZIndex=oN.Label,this._viewBox=new Ke,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(p(a))return a;if(p(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a;const o=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(o)return o;if(p(this._spec.seriesField)){const e=null===(s=this._nodesSeriesData.latestData)||void 0===s?void 0:s.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,a=null===(r=null===(n=this._option)||void 0===n?void 0:n.globalScale)||void 0===r?void 0:r.getScale("color");return null==a?void 0:a.scale(null==i?void 0:i[this._spec.seriesField])}const l=S(t.source)?this.getNodeList()[t.source]:t.source;return null===(a=this._colorScale)||void 0===a?void 0:a.scale(l)},this._handleEmphasisElement=t=>{var e;const i=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},s=t.item;"adjacency"===i.effect?s&&t.mark===this._nodeMark?this._handleNodeAdjacencyClick(s):s&&t.mark===this._linkMark?this._handleLinkAdjacencyClick(s):this._handleClearEmpty():"related"===i.effect&&(s&&t.mark===this._nodeMark?this._handleNodeRelatedClick(s):s&&t.mark===this._linkMark?this._handleLinkRelatedClick(s):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;const i=null===(t=this._nodeMark)||void 0===t?void 0:t.getGraphics();if(!i||!i.length)return;const s=null===(e=this._linkMark)||void 0===e?void 0:e.getGraphics();s&&s.length&&(i.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])})),s.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])})),this._needClear=!1)},this._handleNodeAdjacencyClick=t=>{const e=Xj(t),i=[e.key];if(this._linkMark){const t=this._linkMark.getGraphics();if(!t||!t.length)return;t.forEach(((t,s)=>{const n=Xj(t);n.source===e.key?(i.includes(n.target)||i.push(n.target),WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),UN(t,BN.STATE_SANKEY_EMPHASIS,!0)):n.target===e.key?(i.includes(n.source)||i.push(n.source),WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),UN(t,BN.STATE_SANKEY_EMPHASIS,!0)):(WN(t,BN.STATE_SANKEY_EMPHASIS),UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{const e=Xj(t),i=[e.source,e.target];if(this._linkMark){const e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach((e=>{e===t?(WN(e,BN.STATE_SANKEY_EMPHASIS_REVERSE),NQ(e,BN.STATE_SANKEY_EMPHASIS,{ratio:1})):(WN(e,BN.STATE_SANKEY_EMPHASIS),UN(e,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;const i=Xj(t),s=this._nodeMark.getGraphics();if(!s||!s.length)return;const n=this._linkMark.getGraphics();if(!n||!n.length)return;const r=(null===(e=Xj(n[0]))||void 0===e?void 0:e.parents)?"parents":"source";if("source"===r){const t=[i.key],e=[];if(n.forEach(((n,r)=>{var a,o,l,h;const c=Xj(n),d=(null==c?void 0:c.parents)?"parents":"source";if(Y(c[d]).includes(i.key)){if(e.includes(null!==(a=c.key)&&void 0!==a?a:c.index)||e.push(null!==(o=c.key)&&void 0!==o?o:c.index),t.includes(c.source)||t.push(c.source),!t.includes(c.target)){t.push(c.target);let i=s.find((t=>t.data[0].key===c.target)).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.target))){t.push(i.target);const e=s.find((t=>t.data[0].key===i.target));n.push(e.data[0].targetLinks)}})),void(i=n)}}}else if(c.target===i.key&&(e.includes(null!==(l=c.key)&&void 0!==l?l:c.index)||e.push(null!==(h=c.key)&&void 0!==h?h:c.index),!t.includes(c.source))){t.push(c.source);let i=s.find((t=>t.data[0].key===c.source)).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.source))){t.push(i.source);const e=s.find((t=>t.data[0].key===i.source));n.push(e.data[0].targetLinks)}})),void(i=n)}}})),this._linkMark){const t=this._linkMark.getGraphics();if(!t||!t.length)return;t.forEach(((t,i)=>{var s;const n=Xj(t);e.includes(null!==(s=n.key)&&void 0!==s?s:n.index)?(WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),UN(t,BN.STATE_SANKEY_EMPHASIS,!0)):(WN(t,BN.STATE_SANKEY_EMPHASIS),UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),t)}else{const t=[i.key],e=i.targetLinks.reduce(((t,e)=>(Y(e.datum).forEach((e=>{const s=e.parents,n=s.length;for(let r=0;r<n;r++){const n=s[r].key,a=s[r+1]?s[r+1].key:i.key,o=e.value,l=t.find((t=>t.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);n.forEach(((s,n)=>{const a=Xj(s),o=a.datum,l=o?o.filter((t=>t[r].some((t=>t.key===i.key)))):null,h=e.find((t=>t.source===a.source&&t.target===a.target));if(l&&l.length){t.includes(a.source)||t.push(a.source),t.includes(a.target)||t.push(a.target);const e=l.reduce(((t,e)=>t+e.value),0)/a.value;return WN(s,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(s,BN.STATE_SANKEY_EMPHASIS,{ratio:e})}if(h)return t.includes(a.source)||t.push(a.source),t.includes(a.target)||t.push(a.target),WN(s,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(s,BN.STATE_SANKEY_EMPHASIS,{ratio:h.value/a.value});WN(s,BN.STATE_SANKEY_EMPHASIS),UN(s,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),t)}this._needClear=!0},this._handleLinkRelatedClick=t=>{const e=this._nodeMark.getGraphics();if(!e||!e.length)return;const i=this._linkMark.getGraphics();if(i&&i.length){if("source"==(Xj(t)?"parents":"source"))this._linkMark&&i.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])})),this._nodeMark&&e.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])}));else{const s=Xj(t),n=[s.source,s.target],r=[];Y(s.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;s<i-1;s++){const i=e[s].key,n=e[s+1].key,a=t.value,o=r.find((t=>t.source===i&&t.target===n));r.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=a:r.push({source:i,target:n,value:a})}})),i.forEach((t=>{const e=Xj(t),i=e.datum;if(e.source===s.source&&e.target===s.target)return WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(t,BN.STATE_SANKEY_EMPHASIS,{ratio:1});const a=i?i.filter((t=>{const e=t.parents.map((t=>t.key));return e.includes(s.source)&&e.includes(s.target)})):null;if(a&&a.length){n.includes(e.source)||n.push(e.source),n.includes(e.target)||n.push(e.target);const i=a.filter((t=>t.parents.some(((e,i)=>{var n;return e.key===s.source&&(null===(n=t.parents[i+1])||void 0===n?void 0:n.key)===s.target})))).reduce(((t,e)=>t+e.value),0)/e.value;return WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(t,BN.STATE_SANKEY_EMPHASIS,{ratio:i})}const o=r.find((t=>t.source===e.source&&t.target===e.target));if(o)return n.includes(e.source)||n.push(e.source),n.includes(e.target)||n.push(e.target),WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(t,BN.STATE_SANKEY_EMPHASIS,{ratio:o.value/e.value});WN(t,BN.STATE_SANKEY_EMPHASIS),UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._highLightElements(e,n)}this._needClear=!0}}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){super.initData();const t=this.getViewData(),e=this.getRawData();if(e&&t){oH(this._dataSet,"sankeyLayout",wQ),oH(this._dataSet,"sankeyFormat",MQ),e.transform({type:"sankeyFormat"},!1),t.transform({type:"sankeyLayout",options:()=>{var t,e,i,s;return{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this.direction,crossNodeAlign:this._spec.crossNodeAlign,nodeAlign:null!==(t=this._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(e=this._spec.nodeGap)&&void 0!==e?e:8,nodeWidth:null!==(i=this._spec.nodeWidth)&&void 0!==i?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(s=this._spec.minNodeHeight)&&void 0!==s?s:4,maxNodeHeight:this._spec.maxNodeHeight,minLinkHeight:this._spec.minLinkHeight,maxLinkHeight:this._spec.maxLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer,dropIsolatedNode:this._spec.dropIsolatedNode,nodeHeight:this._spec.nodeHeight,linkHeight:this._spec.linkHeight,equalNodeHeight:this._spec.equalNodeHeight,linkOverlap:this._spec.linkOverlap,inverse:this._spec.inverse}},level:_H.sankeyLayout});const{dataSet:i}=this._option;oH(i,"sankeyNodes",BQ),oH(i,"flatten",lQ);const s=new so(i,{name:`sankey-node-${this.id}-data`});s.parse([this.getViewData()],{type:"dataview"}),s.transform({type:"sankeyNodes"}),s.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),s.transform({type:"addVChartProperty",options:{beforeCall:JV.bind(this),call:QV}},!1),this._nodesSeriesData=s,oH(i,"sankeyLinks",EQ);const n=new so(i,{name:`sankey-link-${this.id}-data`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"sankeyLinks"}),n.transform({type:"addVChartProperty",options:{beforeCall:JV.bind(this),call:QV}},!1),this._linksSeriesData=n}}compileData(){var t,e;super.compileData(),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}initMark(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});const t=this._createMark(VQ.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);const e=this._createMark(VQ.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){const e=this._nodesSeriesData.latestData,i=Y(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.latestData,i=Y(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;const i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},BN.STATE_NORMAL,hN.Mark),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.node.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByNode},"normal",hN.User_Mark))}_initLinkMarkStyle(){var t,e;const i=this._linkMark;i&&(i.setGlyphConfig({direction:this.direction}),this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},BN.STATE_NORMAL,hN.Series),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.link.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByLink},"normal",hN.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}_createText(t,e){if(u(t)||u(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=IV(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),dU("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(cU(null===(s=Fz.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),dU("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData)||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData)||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:iH.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linkMark.getData().updateData()}_highLightElements(t,e){t&&t.length&&t.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS_REVERSE,BN.STATE_SANKEY_EMPHASIS]),e.includes(Xj(t).key)?UN(t,BN.STATE_SANKEY_EMPHASIS,!0):UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}initTooltip(){this._tooltipHelper=new PQ(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!u(a[0])||(a=this.getNodeList(),a&&a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new yz;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{i.add(t[e]),t.children&&this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{p(t[i])&&e.add(t[i]),p(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return CQ(t,r.nodes,this._seriesField),Array.from(t)}return n}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}getMarkData(t){return t.datum?_(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}VQ.type=az.sankey,VQ.transformerConstructor=HQ,VQ.mark=jQ,VQ.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};const UQ=()=>{qY(),_$(),uT(),Fz.registerGraphicComponent("path",(t=>Ef(t))),Fz.registerMark(zQ.type,zQ),z$(),Fz.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:OQ(t,e)},rV))),Fz.registerAnimation("sankeyLinkPath",((t,e)=>({appear:IQ(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:sV.disappear.duration}}))),oP.registerBuiltInAnimate("linkPathGrowOut",DQ),oP.registerBuiltInAnimate("linkPathGrowIn",RQ),oV(),Fz.registerSeries(VQ.type,VQ)},WQ=(t,e)=>{let i={},s=e.fields;if(d(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=lQ(n);return i=YV([{latestData:r}],e),i};class GQ extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const YQ=Object.assign(Object.assign({},iU),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),KQ=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class $Q extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}const XQ=(t,e)=>{const i=d(e)?e():e,s=i.getViewBox();if(s){const e=new bZ(i).layout(t,s),n=[];return Vq(e,n,{maxDepth:null==i?void 0:i.maxDepth}),n.forEach((t=>{t&&[qV,"name"].forEach((e=>{t[e]=t.datum[t.depth][i.nameField]}))})),n}return[]};class qQ extends TU{constructor(){super(...arguments),this.type=az.treemap,this.transformerConstructor=$Q,this._categoryField="name",this._valueField="value",this._viewBox=new Ke,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qV),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new qe),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:hj},getRawData:()=>this.getRawData()}),k(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){var t;super.initData(),oH(this._dataSet,"treemap",XQ),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"treemap",options:()=>{var t,e,i,s;return{nameField:this._categoryField,valueField:this._valueField,getViewBox:()=>this._viewBox.empty()?null:{x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2},maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:(null===(t=this._spec.nonLeafLabel)||void 0===t?void 0:t.visible)?null===(e=this._spec.nonLeafLabel)||void 0===e?void 0:e.padding:0,labelPosition:null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.position,minVisibleArea:null!==(s=this._spec.minVisibleArea)&&void 0!==s?s:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}_runTreemapTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(oH(this._rawData.dataSet,"addVChartProperty",LV),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:tU.bind(this),call:eU}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=WQ([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=j(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){oH(this._dataSet,"hierarchyDimensionStatistics",WQ),oH(this._dataSet,"flatten",lQ);const i=new so(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return fQ(super.getStatisticFields(),this._categoryField,this._valueField)}initMark(){const t=this._createMark(qQ.mark.nonLeaf,{isSeriesMark:!0});t&&(t.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=t);const e=this._createMark(qQ.mark.leaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=e)}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initRichStyleOfLabelMark(t){"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},BN.STATE_NORMAL,hN.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},BN.STATE_NORMAL,hN.Series),this._initRichStyleOfLabelMark(t))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},BN.STATE_NORMAL,hN.Series),this._initRichStyleOfLabelMark(t))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("treemap"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(t=>{this.handlePan(t)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(t=>{this.handleZoom(t)}))),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new GQ(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:c}=this._matrix;this._matrix.multiply(r,a,o,l,h,c),this.disableMarkAnimation(),this.event.on(Jj.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach((t=>{})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()})),this.event.off(Jj.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach((t=>{})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().disableAnimation()}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}qQ.type=az.treemap,qQ.mark=YQ,qQ.builtInTheme={treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}}},qQ.transformerConstructor=$Q,G(qQ,pQ),G(qQ,OK);const ZQ=()=>{Fz.registerGrammarTransform("filter",{transform:(t,e)=>null==e?void 0:e.filter(t.callback)}),Fz.registerGrammarTransform("map",{transform:(t,e)=>(null==e||e.forEach(((e,i)=>{t.callback(e)})),e)}),qY(),z$(),Fz.registerAnimation("treemap",((t,e)=>({appear:KQ(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:sV.disappear.duration}}))),oV(),Fz.registerSeries(qQ.type,qQ)},JQ=Object.assign(Object.assign({},lq),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),QQ=Object.assign(Object.assign({},iU),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),t0={type:"fadeIn"};function e0(t,e){return"fadeIn"===e?t0:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}class i0 extends yU{constructor(){super(...arguments),this._supportStack=!1}}class s0 extends WV{enableByType(t){return"dimension"!==t}}const n0="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",r0={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:n0,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:n0,fill:"#ddd"}}};class a0 extends cq{constructor(){super(...arguments),this.type=az.gaugePointer,this.transformerConstructor=i0,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(a0.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},a0.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(a0.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new s0(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return p(this.radiusAxisHelper)&&p(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=$(e),s=X(e),n=vt(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),c=Math.sin(l);return{x:a*h+o*c,y:-(o*h-a*c)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}getInteractionTriggers(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),dU("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}a0.type=az.gaugePointer,a0.mark=QQ,a0.builtInTheme={gaugePointer:r0},a0.transformerConstructor=i0;const o0=()=>{Fz.registerSeries(a0.type,a0),CK(),qY(),Fz.registerAnimation("gaugePointer",((t,e)=>{const i=e0(t,e);return{appear:i,enter:i,disappear:{duration:sV.disappear.duration}}})),FX(),DX()};class l0 extends yU{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class h0 extends cq{constructor(){super(...arguments),this.type=az.gauge,this.transformerConstructor=l0,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=oe(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData(),oH(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[Tj]=t[this._angleField[0]],t[wj]=e>0?i[e-1][Tj]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(h0.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(h0.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),e}initMarkStyleWithSpec(t,e){if(super.initMarkStyleWithSpec(t,e),t&&"segment"===t.name){const e=this.getSpec().segment;if(e)for(const i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,hN.User_Mark)}}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueStartWithoutPadAngle(t){return p(t[wj])?this.angleAxisHelper.dataToPosition([t[wj]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[Tj]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),dU("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}h0.type=az.gauge,h0.mark=JQ,h0.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},h0.transformerConstructor=l0;const c0=()=>{Fz.registerSeries(h0.type,h0),dX(),gq(),DX()};class d0 extends KN{constructor(){super(...arguments),this.type=d0.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{fill:void 0,lineWidth:0,padding:0})}_createGraphic(t={}){return Vg(t)}_transformGraphicAttributes(t,e,i){var s,n,r;const a=super._transformGraphicAttributes(t,e,i),o=null!==(n=null!==(s=a.shape)&&void 0!==s?s:a.symbolType)&&void 0!==n?n:null===(r=t.attribute)||void 0===r?void 0:r.symbolType;return u(o)?a.symbolType="rect":a.symbolType=o,a}}d0.type="cell";function u0(t){return!1===t?{}:{type:"fadeIn"}}class p0 extends WV{enableByType(t){return"dimension"!==t}}const g0=Object.assign(Object.assign({},iU),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class f0 extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}const m0={valueField:!0};class v0 extends TU{constructor(){super(...arguments),this.type=az.heatmap,this.transformerConstructor=f0}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Y(t)}_getSpecUpdatePolicy(){const t=super._getSpecUpdatePolicy();return Object.assign(Object.assign({},t),{dataRelatedKeys:Object.assign(Object.assign({},t.dataRelatedKeys),m0)})}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){this._cellMark=this._createMark(v0.mark.cell,{isSeriesMark:!0},{morph:gU(this._spec,v0.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(v0.mark.cellBackground)}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){var e,i,s;t&&this.setMarkStyle(t,{fill:null!==(s=null===(i=null===(e=this._spec.cell)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",hN.Series)}initCellBackgroundMarkStyle(){var t,e,i;const s=ui(null!==(i=null===(e=null===(t=this._spec.cellBackground)||void 0===t?void 0:t.style)||void 0===e?void 0:e.padding)&&void 0!==i?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+s[0]},width:()=>this.getCellSize(this._xAxisHelper)-s[1]-s[3],height:()=>this.getCellSize(this._yAxisHelper)-s[0]-s[2]},"normal",hN.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}getInteractionTriggers(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=wU(this);this._cellMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),dU("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new p0(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"rect"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}v0.type=az.heatmap,v0.mark=g0,v0.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}},cellBackground:{visible:!1},label:{style:{lineWidth:2}}}},v0.transformerConstructor=f0;const y0=()=>{z$(),Fz.registerMark(d0.type,d0),Fz.registerGraphicComponent("symbol",Vg),kT(),MT(),xD(),Fz.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},rV),{appear:u0(e)}))),fG(),dG(),Fz.registerSeries(v0.type,v0)},_0=Object.assign(Object.assign({},iU),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),b0=`${rj}_CORRELATION_X`,x0=`${rj}_CORRELATION_Y`,S0=`${rj}_CORRELATION_SIZE`,A0=t=>d(t)?t():t,k0=(t,e)=>{var i,s,n,r,a,o,l,h;if(!t||!(null==e?void 0:e.view)||!_(t))return t;const c=t,d=e.view();if(d.x1-d.x0==0||d.y1-d.y0==0||d.x1-d.x0==-1/0||d.x1-d.x0==1/0||d.y1-d.y0==-1/0||d.y1-d.y0==1/0)return t;const p=oe(null!==(i=A0(e.startAngle))&&void 0!==i?i:-90),g=oe(null!==(s=A0(e.endAngle))&&void 0!==s?s:270),f=Math.max((d.x1-d.x0)/2,(d.y1-d.y0)/2),m=Ot(null!==(n=A0(e.innerRadius))&&void 0!==n?n:0,f),v=Ot(A0(e.outerRadius),f),y=A0(e.center),b=[S(null==y?void 0:y[0])?y[0]:d.x0+Ot(null!==(r=null==y?void 0:y[0])&&void 0!==r?r:"50%",d.x1-d.x0),S(null==y?void 0:y[1])?y[1]:d.y0+Ot(null!==(a=null==y?void 0:y[1])&&void 0!==a?a:"50%",d.y1-d.y0)],x=Et(A0(e.field)),A=c.map(x),[k,C]=Rt(A),M=k===C?t=>(m+v)/2:t=>m+(v-m)*(t-k)/(C-k),w=A0(e.radiusField),T=A0(e.radiusRange),B=u(w)?x:Et(w),E=null!==(o=null==T?void 0:T[1])&&void 0!==o?o:5;let P=t=>E;if(B){const[t,e]=B!==x?Rt(c.map(B)):[k,C],i=null!==(l=null==T?void 0:T[0])&&void 0!==l?l:5,s=null!==(h=null==T?void 0:T[1])&&void 0!==h?h:5;t!==e&&(P=n=>i+(s-i)*(B(n)-t)/(e-t))}const O=Math.min(p,g),I=Math.max(p,g),R=C0(O,I,c.length),D=[],L=(I-O)/60;return c.forEach(((t,e)=>{const i=M(A[e]),s=P(t);let n,r,a=R[e];for(let t=0;t<60&&(n=b[0]+i*Math.cos(a),r=b[1]+i*Math.sin(a),M0({x:n,y:r,size:s},D)||n-s<d.x0||n+s>d.x1||r-s<d.y0||r+s>d.y1);t++)t<59&&(a+=L,a>I?a=O:a<O&&(a=I));D.push(Object.assign({[b0]:n,[x0]:r,[S0]:s},t))})),D},C0=(t,e,i)=>{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const c=[];let d=t;for(;l<i;)h<n&&(c.push(d+(h%2?Math.floor(h/2)+Math.floor(n/2):h/2)*r*o),h++),l++,h===n&&(h=0,a+=1,o*=-1,0===s?s=r/2:s/=2,d=-1===o?e-s:t+s,a>=2&&(r/=2,n*=2));return c},M0=(t,e)=>!(!e||!e.length)&&e.some((e=>{const i=e.x,s=e.y,n=e.size;return Math.pow(t.x-i,2)+Math.pow(t.y-s,2)<Math.pow(t.size+n,2)})),w0=t=>d(t)?t():t,T0=(t,e)=>{if(!t||!_(t))return[];const i=w0(e.keyword),s=w0(e.categoryField),n=t[0].latestData[0];return{[s]:i,[lj]:null==n?void 0:n[lj],[cj]:null==n?void 0:n[cj]}};class B0 extends y${constructor(){super(...arguments),this.type=B0.type,this._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},this._positionChannels=["ripple","size"],this._positionEncoder=(t,e,i)=>{const{ripple:s=i.attribute.ripple,size:n=i.attribute.size}=t,r=vt(s,0,1),a=.5*n;return{ripple0:{size:n+a*r,fillOpacity:.75-.25*r},ripple1:{size:n+a*(1+r),fillOpacity:.5-.25*r},ripple2:{size:n+a*(2+r),fillOpacity:.25-.25*r}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}}B0.type="ripple";const E0=()=>{_$(),MT(),Fz.registerMark(B0.type,B0),Fz.registerGraphicComponent("symbol",(t=>Vg(t)))},P0=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class O0 extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class I0 extends J${constructor(){super(...arguments),this.type=az.correlation,this.transformerConstructor=O0,this._viewBox=new Ke}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){p(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){p(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){p(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){if(super.initData(),!this._data)return;oH(this._dataSet,"correlation",k0);const t=new io;lH(t,"dataview",ja),oH(t,"correlationCenter",T0);const e=new so(t,{name:`${this.type}_${this.id}_center`});e.parse([this.getViewData()],{type:"dataview"}),e.transform({type:"correlationCenter",options:{keyword:()=>{var t,e,i;return null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:""},categoryField:()=>this._spec.categoryField}}),this._centerSeriesData=new FN(this._option,e)}compileData(){var t;super.compileData(),null===(t=this._centerSeriesData)||void 0===t||t.compile()}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:()=>this._spec.valueField,radiusRange:()=>this._spec.sizeRange,radiusField:()=>this._spec.sizeField,center:()=>[this._spec.centerX,this._spec.centerY],innerRadius:()=>this._spec.innerRadius,outerRadius:()=>this._spec.outerRadius,startAngle:()=>this._spec.startAngle,endAngle:()=>this._spec.endAngle}})}initMark(){const t=this._createMark(I0.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:lj});t&&(t.setMarkConfig({zIndex:oN.Node}),this._nodePointMark=t);const e=this._createMark(I0.mark.ripplePoint,{key:lj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});e&&(this._ripplePointMark=e);const i=this._createMark(I0.mark.centerPoint,{key:lj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(i.setMarkConfig({zIndex:oN.Node}),this._centerPointMark=i)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;const n=this._nodePointMark;if(!n)return;const r=null!==(e=null===(t=this._spec.nodePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(n,{x:t=>t[b0],y:t=>t[x0],size:t=>t[S0],fill:null!==(i=r.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(s=r.fillOpacity)&&void 0!==s?s:1,lineWidth:0},BN.STATE_NORMAL,hN.Series)}_initRipplePointMarkStyle(){var t,e,i,s,n;const r=this._ripplePointMark;if(!r)return;const a=null!==(e=null===(t=this._spec.ripplePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(r,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=a.fill)&&void 0!==i?i:this.getColorAttribute(),opacity:null!==(s=a.fillOpacity)&&void 0!==s?s:.2,ripple:null!==(n=a.ripple)&&void 0!==n?n:0},BN.STATE_NORMAL,hN.Series)}_initCenterPointMarkStyle(){var t,e,i,s,n,r;const a=this._centerPointMark;a&&this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=null===(e=null===(t=this._spec.centerPoint)||void 0===t?void 0:t.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(r=null===(n=null===(s=this._spec.centerPoint)||void 0===s?void 0:s.style)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1},BN.STATE_NORMAL,hN.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},BN.STATE_NORMAL,hN.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),dU("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}I0.type=az.correlation,I0.mark=_0,I0.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},I0.transformerConstructor=O0;const R0=()=>{eW(),E0(),Fz.registerSeries(I0.type,I0),Fz.registerAnimation("correlation",((t,e)=>Object.assign({appear:P0(0,e)},nV)))},D0={duration:2e3,loop:!0,channel:{wave:{from:0,to:1}}},L0=t=>({duration:2e3,channel:{wave:{from:0,to:1},height:t.height,dy:t.dy}}),F0=L0;function z0(t,e){switch(e){case"wave":default:return D0;case"grow":return L0(t);case"waveGrow":return F0(t)}}function j0(t,e){switch(e){case"wave":default:return D0;case"grow":case"waveGrow":return(t=>({duration:2e3,channel:{dy:t.dy}}))(t)}}const H0=Object.assign(Object.assign({},iU),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}});class N0 extends y${constructor(){super(...arguments),this.type=N0.type,this._subMarks={wave0:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:1}},wave1:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.66}},wave2:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.33}}},this._positionChannels=["wave","y","height"],this._positionEncoder=(t,e,i)=>{const{wave:s=i.attribute.wave,y:n=i.attribute.y,height:r=i.attribute.height}=t,a=[],o=[],l=[];for(let t=0;t<21;t++){const e=50*t-500,i=n+(t%2==0?20:0),h=n+r;a.push({x:e+100*s,y:i,y1:h}),o.push({x:e+200*s-40,y:i,y1:h}),l.push({x:e+300*s-20,y:i,y1:h})}return{wave0:{x:0,y:0,points:a},wave1:{x:0,y:0,points:o},wave2:{x:0,y:0,points:l}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{wave:0})}}N0.type="liquid";const V0=(t,e)=>"drop"===t?function(t,e,i){const s=4*i/3,n=Math.max(s,2*i),r=s/2,a=t,o=r+e-n/2,l=Math.asin(r/(.85*(n-r))),h=Math.sin(l)*r,c=Math.cos(l)*r,d=a-c,u=o+h,p=t,g=o+r/Math.sin(l);return`\n M ${d} ${u}\n A ${r} ${r} 0 1 1 ${d+2*c} ${u}\n Q ${p} ${g} ${t} ${e+n/2}\n Q ${p} ${g} ${d} ${u}\n Z \n `}(0,0,e):t;class U0 extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>this.series.getValueField(),this.markTooltipValueCallback=t=>t[this.series.getValueField()],this.shapeStrokeCallback=t=>this.series.getMarkInName("liquid").getAttribute("fill",t)}}class W0 extends CU{constructor(){super(...arguments),this.type=az.liquid,this.transformerConstructor=iW,this._liquidBackgroundMark=null,this._liquidOutlineMark=null,this._getLiquidPosY=()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?e*this._heightRatio:e*(1-this._heightRatio),t+i},this._getLiquidHeight=()=>{const{height:t}=this._getLiquidBackPosAndSize();return t*this._heightRatio},this._getLiquidBackPosAndSize=(t=!1)=>{var e,i;let{top:s=0,bottom:n=0,left:r=0,right:a=0}=this._marginSpec,{top:o=0,bottom:l=0,left:h=0,right:c=0}=t?{}:this._paddingSpec;"triangle"===this._maskShape&&(n/=Math.sqrt(3),s=s/Math.sqrt(3)*2,l/=Math.sqrt(3),o=o/Math.sqrt(3)*2);const{width:d,height:u}=null!==(i=null===(e=this._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},p=d/2+(r+h-(a+c))/2,g=u/2+(s+o-(n+l))/2;let f=d-(r+a+h+c),m=u-(s+n+o+l);const v=Math.min(f,m);return"rect"!==this._maskShape&&(f=v,m=v),{x:p,y:g,size:v,width:f,height:m,startX:p-f/2,startY:g-m/2,endX:p+f/2,endY:g+m/2}},this._getLiquidBackPath=(t=!1)=>{var e;let i;if("rect"===this._maskShape){const{x:e,y:s,width:n,height:r}=this._getLiquidBackPosAndSize(t);i=Xg({x:e-n/2,y:s-r/2,width:n,height:r,fill:!0})}else{const{x:s,y:n,size:r}=this._getLiquidBackPosAndSize(t);i=Vg({x:s,y:n,size:r,symbolType:V0(null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle",r),fill:!0})}return[i]}}setValueField(t){p(t)&&(this._valueField=t)}getValueField(){return this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._marginSpec=Tz(this._spec.outlineMargin),this._paddingSpec=Tz(this._spec.outlinePadding),this.setValueField(this._spec.valueField),this._reverse=null!==(t=this._spec.reverse)&&void 0!==t&&t,this._maskShape=null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle"}viewDataUpdate(t){super.viewDataUpdate(t),this._heightRatio=Yt(...this._data.getLatestData().map((t=>t[this._valueField])))}initMark(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}initMarkStyle(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}_initLiquidOutlineMark(){return this._liquidOutlineMark=this._createMark(W0.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}_initLiquidBackgroundMark(){return this._liquidBackgroundMark=this._createMark(W0.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}_initLiquidMark(){return this._liquidGroupMark=this._createMark(W0.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(W0.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}_initLiquidOutlineMarkStyle(){const t=this._liquidOutlineMark;t.created(),this.setMarkStyle(t,{stroke:this.getColorAttribute(),width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath(!0)},"normal",hN.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}_initLiquidBackgroundMarkStyle(){const t=this._liquidBackgroundMark;t.created(),this.setMarkStyle(t,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath()},"normal",hN.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}_initLiquidMarkStyle(){const t=this._liquidMark,e=this._liquidGroupMark;e&&this.setMarkStyle(e,{x:()=>this._region.getLayoutStartPoint().x+this._region.getLayoutRect().width/2,angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),t&&this.setMarkStyle(t,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",hN.Series)}initTooltip(){this._tooltipHelper=new U0(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}getInteractionTriggers(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}initAnimation(){var t,e,i,s;const n={height:{from:0,to:()=>this._getLiquidHeight()},dy:{from:()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?0:e,t+i}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("liquid"))||void 0===i?void 0:i(n,r),dU("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(cU(null===(s=Fz.getAnimationInKey("liquidGroup"))||void 0===s?void 0:s(n,r),dU("liquidGroup",this._spec,this._markAttributeContext)))}initEvent(){super.initEvent(),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(tH.renderFinished,(()=>{this._option.getChart().getComponentsByKey("indicator").forEach((t=>{var e,i,s;const n=null===(e=this._liquidMark.getGraphics()[0].getSubGraphic())||void 0===e?void 0:e[0];let{y1:r,y2:a}=n.globalAABBBounds;r+=this._region.getLayoutStartPoint().y,a+=this._region.getLayoutStartPoint().y,null===(s=null===(i=null==t?void 0:t.getIndicatorComponent())||void 0===i?void 0:i.getChildren()[0])||void 0===s||s.getChildren().forEach((t=>{const{y1:e,y2:i}=t.globalAABBBounds;if(r<e&&a>i){const e=JT(t.attribute.fill,n.attribute.fill);t.setAttribute("fill",e)}}))}))}))}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}valueToPosition(t,e){return null}getStatisticFields(){return[]}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._liquidMark]}}W0.type=az.liquid,W0.mark=H0,W0.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},W0.transformerConstructor=iW;const G0=()=>{_$(),tT(),Fz.registerMark(N0.type,N0),Fz.registerGraphicComponent("area",(t=>If(t))),XN(),Fz.registerAnimation("liquid",((t,e)=>({appear:z0(t,e),enter:z0(t,e),exit:z0(t,e)}))),Fz.registerAnimation("liquidGroup",((t,e)=>({appear:j0(t,e),enter:j0(t,e),exit:j0(t,e)}))),Fz.registerSeries(W0.type,W0)},Y0=t=>Y(t).join(",");class K0 extends WV{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>Y0(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>Y0(null==t?void 0:t[this.series.getDimensionField()[0]])}}const $0=Object.assign(Object.assign({},iU),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),X0=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},q0=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class Z0 extends XE{onBind(){var t,e;this.fromCircles={},null===(t=IZ(this.target.attribute.arcs))||void 0===t||t.forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},null===(e=IZ(this.target.getFinalAttribute().arcs))||void 0===e||e.forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=PZ(s);this.target.setAttributes({arcs:n,path:OZ(n)})}}class J0 extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}const Q0=(t,e)=>{const i=d(e)?e():e,s=i.getViewBox();return s&&(null==t?void 0:t.length)?RZ(Object.assign({setField:i.setField,valueField:i.valueField},s),t):[]};class t1 extends CU{constructor(){super(...arguments),this.type=az.venn,this.transformerConstructor=J0,this._viewBox=new Ke}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:hj)}initData(){var t;super.initData(),oH(this._dataSet,"venn",Q0),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:()=>({getViewBox:()=>this._viewBox.empty()?null:{x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2},setField:this._categoryField,valueField:this._valueField})})}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(t1.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(t1.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},BN.STATE_NORMAL,hN.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},BN.STATE_HOVER,hN.Series))}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>Y0(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},BN.STATE_NORMAL,hN.Series))}initOverlapLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>Y0(t.sets)},BN.STATE_NORMAL,hN.Series))}initTooltip(){this._tooltipHelper=new K0(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:Y0(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return Y0(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[Y0(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Y(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(Y0(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}}t1.type=az.venn,t1.mark=$0,t1.builtInTheme={venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},t1.transformerConstructor=J0;const e1=()=>{dX(),CK(),Fz.registerAnimation("vennCircle",((t,e)=>({appear:X0(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:sV.disappear.duration}}))),Fz.registerAnimation("vennOverlap",((t,e)=>({appear:q0(e),update:{custom:Z0},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:sV.disappear.duration}}))),oV(),Fz.registerGrammarTransform("vennMark",{transform:DZ}),Fz.registerSeries(t1.type,t1)};class i1 extends iK{constructor(){super(...arguments),this.type=az.mosaic,this.transformerConstructor=tK}get bandWidthField(){return this._bandWidthField}getStack(){return!0}getPercent(){return this._spec.percent}getGroupFields(){return"vertical"===this.direction?this._specXField:this._specYField}setAttrFromSpec(){super.setAttrFromSpec();const t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(kj),this.setFieldX2(Aj)),this.setFieldY(Mj),this.setFieldY2(Cj)):(t&&(this.setFieldY(kj),this.setFieldY2(Aj)),this.setFieldX(Mj),this.setFieldX2(Cj)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}parseLabelStyle(t,e){if((null==e?void 0:e.filterByGroup)&&u(t.dataFilter)){const i=this.getGroupFields(),{field:s,type:n="max",filter:r}=e.filterByGroup;delete t.filterField;const a=i.indexOf(s);if(a<0)return;const o=a%2?"min"===n?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===n?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,l="min"===n?(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])<(null===(s=e.data)||void 0===s?void 0:s[o])}:(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])>(null===(s=e.data)||void 0===s?void 0:s[o])};t.dataFilter=t=>{const e={};return t.forEach((t=>{const i=t.data,n=null==i?void 0:i[s];u(n)||r&&!r(t)||e[n]&&!l(t,e[n])||(e[n]=t)})),t.filter((t=>{var i;const n=null===(i=t.data)||void 0===i?void 0:i[s];return e[n]&&e[n]===t}))}}return t}}i1.type=az.mosaic,i1.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},i1.transformerConstructor=tK;const s1=()=>{qY(),z$(),oV(),dG(),Fz.registerSeries(i1.type,i1)};class n1 extends YG{_isValidSeries(t){return t===az.map}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}let r1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=n1,this.type="map",this.seriesType=az.map}};r1.type="map",r1.seriesType=az.map,r1.transformerConstructor=n1;const a1=()=>{MY(),FK(),Fz.registerChart(r1.type,r1)};class o1 extends YG{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Y(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return p(r)&&n.forEach((t=>{u(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t,e){return super._getDefaultSeriesSpec(t,["radius","outerRadius","innerRadius","startAngle","endAngle","centerX","centerY","sortDataByAxis"],e)}transformSpec(t){super.transformSpec(t),_(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),p(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class l1 extends o1{needAxes(){return!1}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t,["startAngle","endAngle","centerX","centerY","clamp"]);return e.categoryField=t.categoryField||t.radiusField,e.valueField=t.valueField||t.angleField,e}_transformProgressAxisSpec(t,e,i,s,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),u(l.type)&&(l.type="linear"),u(o.type)&&(o.type="band");const h=gW(l,{min:0,max:1});u(l.min)&&(l.min=h.min),u(l.max)&&(l.max=h.max),s&&Object.assign(l,Lz({},s,l)),n&&Object.assign(o,Lz({},n,o))}}class h1 extends o1{needAxes(){return!0}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.categoryField=t.categoryField||t.angleField,e.valueField=t.valueField||t.radiusField,e}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class c1 extends o1{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;const i=super._getDefaultSeriesSpec(t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]);return this._addSeriesRelatedSpecKeys(["valueField","angleField"]),i.categoryField=t.categoryField||t.seriesField,i.valueField=t.valueField||t.angleField,i.emptyCircle=null===(e=t.emptyPlaceholder)||void 0===e?void 0:e.emptyCircle,i}}class d1 extends UG{constructor(){super(...arguments),this.transformerConstructor=c1}}d1.transformerConstructor=c1;let u1=class extends d1{constructor(){super(...arguments),this.transformerConstructor=c1,this.type="pie",this.seriesType=az.pie}};u1.type="pie",u1.seriesType=az.pie,u1.transformerConstructor=c1;const p1=()=>{MY(),_X(),Fz.registerChart(u1.type,u1)};class g1 extends h1{_getDefaultSeriesSpec(t){var e,i,s;const n=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["radius","outerRadius","innerRadius"]),n.radius=null!==(e=t.radius)&&void 0!==e?e:EW,n.outerRadius=null!==(i=t.outerRadius)&&void 0!==i?i:EW,n.innerRadius=null!==(s=t.innerRadius)&&void 0!==s?s:0,n.stack=t.stack,n.percent=t.percent,n}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&u(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Y(t.crosshair||{}).map((t=>Lz({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}const f1=(t,e)=>{if(!t)return null;const i=VU(t,(t=>"angle"===t.getOrient()),e),s=VU(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&DI(i.type)){const l=i.domain(),h=i.range(),c=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-c.x,y:o-t.getLayoutStartPoint().y-c.y};let p=JF({x:1,y:0},d);p=((t,e)=>{const i=2*Math.PI,s=X(e),n=$(e);return t<s?t+=Math.ceil((s-t)/i)*i:t>n&&(t-=Math.ceil((t-n)/i)*i),t})(p,h);const g=QF(d),f=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==f?void 0:f.range();if((p-(null==h?void 0:h[0]))*(p-(null==h?void 0:h[1]))>0||(g-(null==m?void 0:m[0]))*(g-(null==m?void 0:m[1]))>0)return;const v=t.invert(p);if(u(v))return;let y=l.findIndex((t=>(null==t?void 0:t.toString())===v.toString()));y<0&&(y=void 0);const _=HU(v,t,"polar",r);n.push({index:y,value:v,position:i.scale(v),axis:t,data:_})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&DI(s.type)){const h=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let d=JF({x:1,y:0},c);d<-Math.PI/2&&(d=2*Math.PI+d);const p=QF(c),g=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==g?void 0:g.range();if((d-(null==f?void 0:f[0]))*(d-(null==f?void 0:f[1]))>0||(p-(null==l?void 0:l[0]))*(p-(null==l?void 0:l[1]))>0)return;const m=s.invert(p);if(u(m))return;let v=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));v<0&&(v=void 0);const y=HU(m,t,"polar",r);n.push({index:v,value:m,position:s.scale(m),axis:t,data:y})}})),n.length?n:null};let m1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=g1,this.type="rose",this.seriesType=az.rose}_setModelOption(){this._modelOption.getDimensionInfo=f1}};m1.type="rose",m1.seriesType=az.rose,m1.transformerConstructor=g1,G(m1,ZG);const v1=()=>{kY(),MY(),eY(),tY(),jX(),Fz.registerChart(m1.type,m1)};class y1 extends h1{_getDefaultSeriesSpec(t){var e,i,s,n;const r=super._getDefaultSeriesSpec(t),a=null===(i=(e=this._option).getTheme)||void 0===i?void 0:i.call(e,"series","radar","area");return this._addSeriesRelatedSpecKeys(["line","point","area"]),r.line=t.line,r.point=t.point,r.stack=t.stack,r.percent=t.percent,r.area=Lz({visible:null!==(s=null==a?void 0:a.visible)&&void 0!==s&&s},t.area),r.seriesMark=null!==(n=t.seriesMark)&&void 0!==n?n:"area",r.activePoint=t.activePoint,r.pointDis=t.pointDis,r.pointDisMul=t.pointDisMul,r.markOverlap=t.markOverlap,r}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Y(t.crosshair||{}).map((t=>Lz({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}let _1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=y1,this.type="radar",this.seriesType=az.radar}_setModelOption(){this._modelOption.getDimensionInfo=f1}};_1.type="radar",_1.seriesType=az.radar,_1.transformerConstructor=y1,G(_1,ZG);const b1=()=>{kY(),MY(),TY(),eY(),tY(),$X(),Fz.registerChart(_1.type,_1)};class x1 extends YG{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=g(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{O(e,"trimPadding")&&Lz(e,aN(this.type,t))})),this._transformAxisSpec(t)}}let S1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=x1,this.type="common"}_setModelOption(){this._modelOption.getDimensionInfo=(t,e,i)=>{var s,n;return[...null!==(s=oY(t,e,i))&&void 0!==s?s:[],...null!==(n=f1(t,e))&&void 0!==n?n:[]]},this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};S1.type="common",S1.transformerConstructor=x1,G(S1,ZG);const A1=()=>{kY(),MY(),TY(),eY(),Fz.registerChart(S1.type,S1),tY()};class k1 extends YG{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Y(e.data)[0];return t instanceof so?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Y(t.data).find(((t,i)=>e.dataId?t instanceof so?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof so?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(t){var e,i,s,n,r,a,o,l,h,c,d,u,p,g,f;super.transformSpec(t);let m=0;const v=[],y=[],_=[],b=[],x=[],S=this._option.getCompiler().getStage(),A=(S.viewWidth,S.viewHeight);let k=0;if(null==t?void 0:t.legends){v.push({modelId:`legendRow${m}`,col:1,row:m}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${m}`);const o=Y(t.legends);let l=null!==(e=o[0].height)&&void 0!==e?e:40;if(o[0].padding){const t=Tz(o[0].padding);l+=Number(null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0),l+=Number(null!==(s=null==t?void 0:t.top)&&void 0!==s?s:0),o[0].offsetY=Number(null!==(r=null===(n=o[0])||void 0===n?void 0:n.offsetY)&&void 0!==r?r:0)+Number(null!==(a=null==t?void 0:t.top)&&void 0!==a?a:0)}x.push({index:m,size:l}),k+=l,m++}(null==t?void 0:t.dataZoom)&&(v.push({modelId:`dataZoomRow${m}`,col:1,row:m}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${m}`),k+=60,m++,this.addPaddingRow(x,m,10),k+=10,m++),k+=60,null!==t.axes&&"top"!==(null===(l=null===(o=null==t?void 0:t.axes)||void 0===o?void 0:o[0])||void 0===l?void 0:l.orient)||(this.addOrientAxes(y,v,m,t),m++);const C=t.series.filter((t=>t.type!==az.link)).length,M=(A-k-20*C)/C,w=(null===(h=null==t?void 0:t.appendPadding)||void 0===h?void 0:h.left)||0,T=(null===(c=null==t?void 0:t.appendPadding)||void 0===c?void 0:c.right)||0;null===(d=null==t?void 0:t.series)||void 0===d||d.forEach((e=>{var i,s;if([az.bar,az.line,az.area,az.dot].includes(e.type)){if(v.push({modelId:`${e.type}Row${m}`,col:1,row:m}),v.push({modelId:`axesLeftRow${m}`,col:0,row:m}),y.push({id:`${e.type}Row${m}`,clip:!1}),x.push({index:m,size:(null==e?void 0:e.height)||M}),_.push({orient:"left",id:`axesLeftRow${m}`,type:e.type===az.dot?"band":"linear",visible:e.type!==az.dot,title:{visible:!0,autoRotate:!1,style:{text:null==e?void 0:e.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(i=null==e?void 0:e.grid)||void 0===i?void 0:i.visible)||(null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.visible),style:(t,i)=>{var s,n,r,a,o;let l=0;if(0===i){const t=null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==e?void 0:e.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:y.length-1}),e.type===az.dot){v.push({modelId:`scrollBarRightRow${m}`,col:2,row:m});const i=this._getSeriesDataLength(t,e);let s=0;i&&(s=((null==e?void 0:e.height)||M)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===az.dot&&s<1,id:`scrollBarRightRow${m}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:y.length-1,axisId:`axesLeftRow${m}`},Y(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=y.length-1,m++,this.addPaddingRow(x,m,(null==e?void 0:e.padding)||20),m++,e.leftAppendPadding=w,e.type===az.dot&&(e.title.style.dx=-w,e.subTitle.style.dx=-w)}})),this.addPaddingRow(x,m,20),m++,null===(u=null==t?void 0:t.series)||void 0===u||u.forEach((e=>{if(e.type===az.link){const i=e.dotSeriesIndex+1;v.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=w,e.height=t.series[e.dotSeriesIndex].height,e.clipHeight=t.series[e.dotSeriesIndex].clipHeight}})),(null==t?void 0:t.legends)&&this.addAttrToComponentSpec(t.legends,"regionIndex",[y.length-1]),"bottom"===(null===(g=null===(p=null==t?void 0:t.axes)||void 0===p?void 0:p[0])||void 0===g?void 0:g.orient)&&(this.addOrientAxes(y,v,m,t),m++);const B={type:"grid",col:4,row:m,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:T}],rowHeight:x,elements:v};t.layout=B,t.region=y,null===(f=t.axes)||void 0===f||f.push(..._),t.scrollBar=b}}var C1=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};let M1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=k1,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=C1(e,["spec"]);let n;if(i.type===az.link&&(i.dotSeriesSpec=this._spec.series[i.dotSeriesIndex]),i.regionId&&(n=this.getRegionsInUserId(i.regionId)),n||(n=this.getRegionsInIndex(i.regionIndex?[i.regionIndex]:void 0)[0]),!n)return;const r=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),s),{region:n,specKey:"series",globalScale:this._globalScale}));r&&(r.created(),this._series.push(r),n.addSeries(r))}};M1.type="sequence",M1.transformerConstructor=k1;const w1=()=>{kY(),MY(),iq(),oq(),fG(),dG(),Fz.registerChart(M1.type,M1)};class T1 extends KG{transformSpec(t){super.transformSpec(t),t.axes.forEach((t=>t.type="linear"))}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["x2Field","y2Field","barMinHeight","barBackground","barGap"])}}class B1 extends UG{constructor(){super(...arguments),this.transformerConstructor=T1}}B1.transformerConstructor=T1,G(B1,ZG);class E1 extends T1{transformSpec(t){super.transformSpec(t),tN(t)}}let P1=class extends B1{constructor(){super(...arguments),this.transformerConstructor=E1,this.type="histogram",this.seriesType=az.bar}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};P1.type="histogram",P1.seriesType=az.bar,P1.transformerConstructor=E1;const O1=()=>{kY(),MY(),TY(),eY(),tY(),sK(),Fz.registerTransform("bin",oa),Fz.registerChart(P1.type,P1)};class I1 extends l1{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["cornerRadius","progress","track","roundCap"]),s.progress=t.progress,s.track=t.track,s.tickMask=t.tickMask,s.cornerRadius=null!==(e=t.cornerRadius)&&void 0!==e?e:0,s.roundCap=null!==(i=t.roundCap)&&void 0!==i&&i,s}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}let R1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=I1,this.type="circularProgress",this.seriesType=az.circularProgress}_setModelOption(){this._modelOption.getDimensionInfo=f1}};R1.type="circularProgress",R1.seriesType=az.circularProgress,R1.transformerConstructor=I1,G(R1,ZG);const D1=()=>{kY(),MY(),eY(),tY(),yq(),Fz.registerChart(R1.type,R1)};class L1 extends l1{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["pin","pinBackground","pointer"]),e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}_getDefaultCircularProgressSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.type=az.circularProgress,e}transformSpec(t){var e,i,s,n,r;super.transformSpec(t);let a=null===(e=t.series)||void 0===e?void 0:e.find((t=>t.type===az.gauge||t.type===az.circularProgress));u(a)&&(a=null!==(i=t.gauge)&&void 0!==i?i:this._getDefaultCircularProgressSeriesSpec(t),"circularProgress"===a.type&&(u(a.radiusField)&&u(a.categoryField)&&(a.radiusField=null!==(n=null!==(s=t.radiusField)&&void 0!==s?s:t.categoryField)&&void 0!==n?n:t.seriesField),u(a.valueField)&&u(a.angleField)&&(a.valueField=null!==(r=t.valueField)&&void 0!==r?r:t.angleField)),1===t.series.length?t.series.push(a):t.series.forEach((t=>{t.type===a.type&&Object.keys(a).forEach((e=>{e in t||(t[e]=a[e])}))}))),a.type===az.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:oN.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=t),"angle"===e&&(i.angle=t)})),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),u(i.angle.type)&&(i.angle.type="linear"),u(i.radius.type)&&(i.radius.type="linear"),u(i.angle.zIndex)&&(i.angle.zIndex=oN.Region+50)}}let F1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=L1,this.type="gauge",this.seriesType=az.gaugePointer}};F1.type="gauge",F1.seriesType=az.gaugePointer,F1.transformerConstructor=L1;const z1=()=>{MY(),o0(),c0(),yq(),Fz.registerChart(F1.type,F1)};class j1 extends YG{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"])}}class H1 extends UG{constructor(){super(...arguments),this.transformerConstructor=j1,this.type="wordCloud",this.seriesType=az.wordCloud}}H1.transformerConstructor=j1;let N1=class extends H1{constructor(){super(...arguments),this.transformerConstructor=j1,this.type="wordCloud",this.seriesType=az.wordCloud}};N1.type="wordCloud",N1.seriesType=az.wordCloud,N1.transformerConstructor=j1;const V1=()=>{MY(),IJ(),Fz.registerChart(N1.type,N1)},U1=()=>{Fz.registerGrammarTransform("wordcloudShape",{transform:PJ}),Fz.registerGrammarTransform("wordcloud",{transform:oJ}),z$(),zq(),Fz.registerSeries(OJ.type,OJ),MY(),IJ(),Fz.registerChart(N1.type,N1)};class W1 extends YG{needAxes(){return!1}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"])}transformSpec(t){super.transformSpec(t),super.transformSeriesSpec(t)}}let G1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=W1,this.type="funnel",this.seriesType=az.funnel}};G1.type="funnel",G1.seriesType=az.funnel,G1.transformerConstructor=W1;const Y1=()=>{MY(),tQ(),Fz.registerChart(G1.type,G1)};class K1 extends KG{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bandWidth","progress","track","clamp"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"horizontal",this._addSeriesRelatedSpecKeys(["cornerRadius"]),s.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,s}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="band"),u(i.type)&&(i.type="linear");const n=gW(i,{min:0,max:1});u(i.min)&&(i.min=n.min),u(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="linear"),u(e.type)&&(e.type="band");const n=gW(s,{min:0,max:1});u(s.min)&&(s.min=n.min),u(s.max)&&(s.max=n.max)}}}let $1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=K1,this.type="linearProgress",this.seriesType=az.linearProgress}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};$1.type="linearProgress",$1.seriesType=az.linearProgress,$1.transformerConstructor=K1,G($1,ZG);const X1=()=>{kY(),MY(),eY(),tY(),wq(),Fz.registerChart($1.type,$1)};class q1 extends KG{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),tN(t)}}let Z1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=q1,this.type="rangeColumn",this.seriesType=az.rangeColumn}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};Z1.type="rangeColumn",Z1.seriesType=az.rangeColumn,Z1.transformerConstructor=q1;const J1=()=>{kY(),MY(),eY(),tY(),K$(),Fz.registerChart(Z1.type,Z1)};class Q1 extends YG{_getDefaultSeriesSpec(t){const e=p(t.startAngle)?t.startAngle:-90,i=p(t.endAngle)?t.endAngle:e+le(2*Math.PI),s=super._getDefaultSeriesSpec(t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]);return s.startAngle=e,s.endAngle=i,s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let t2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=Q1,this.type="sunburst",this.seriesType=az.sunburst}};t2.type="sunburst",t2.seriesType=az.sunburst,t2.transformerConstructor=Q1;const e2=()=>{MY(),yQ(),Fz.registerChart(t2.type,t2)};class i2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let s2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=i2,this.type="circlePacking",this.seriesType=az.circlePacking}};s2.type="circlePacking",s2.seriesType=az.circlePacking,s2.transformerConstructor=i2;const n2=()=>{MY(),kQ(),Fz.registerChart(s2.type,s2)};class r2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let a2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=r2,this.type="treemap",this.seriesType=az.treemap}};a2.type="treemap",a2.seriesType=az.treemap,a2.transformerConstructor=r2;const o2=()=>{MY(),ZQ(),Fz.registerChart(a2.type,a2)};class l2 extends nK{transformSpec(t){super.transformSpec(t),t.legends&&Y(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),tN(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["bar","stackLabel","leaderLine","total","calculationMode"]),e.bar=t.bar,e.stackLabel=t.stackLabel,e.leaderLine=t.leaderLine,e.total=t.total,e.calculationMode=t.calculationMode,e}}let h2=class extends rK{constructor(){super(...arguments),this.transformerConstructor=l2,this.type="waterfall",this.seriesType=az.waterfall}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};h2.type="waterfall",h2.seriesType=az.waterfall,h2.transformerConstructor=l2;const c2=()=>{kY(),MY(),TY(),eY(),tY(),p$(),Fz.registerChart(h2.type,h2)};class d2 extends KG{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=super._getDefaultSeriesSpec(t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"vertical",s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),tN(t)}}let u2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=d2,this.type="boxPlot",this.seriesType=az.boxPlot}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};u2.type="boxPlot",u2.seriesType=az.boxPlot,u2.transformerConstructor=d2;const p2=()=>{kY(),MY(),eY(),tY(),L$(),Fz.registerTransform("boxplot",la),Fz.registerChart(u2.type,u2)};class g2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","sourceField","targetField","direction","nodeAlign","crossNodeAlign","nodeGap","nodeWidth","linkWidth","minStepWidth","minNodeHeight","maxNodeHeight","minLinkHeight","maxLinkHeight","dropIsolatedNode","nodeHeight","linkHeight","equalNodeHeight","linkOverlap","iterations","nodeKey","linkSortBy","nodeSortBy","setNodeLayer","node","link","emphasis","inverse","overflow"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let f2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=g2,this.type="sankey",this.seriesType=az.sankey}_setStateInDatum(t,e,i,s){const n=_(e)?e[0]:e;if(!n)return void this._interaction.clearByState(t);let r=null;this.filterGraphicsByDatum(n,{filter:(t,e)=>"text"!==e.type&&e.getProduct()&&(!i||i(t,e)),region:s,getDatum:t=>{var e;let i=null===(e=Xj(t))||void 0===e?void 0:e.datum;return _(i)&&(i=i[0]),i},callback:(t,e,i,s)=>{var n,r;const a=e.getProductId();a&&(a.includes("node")||a.includes("link"))&&(null===(r=(n=i)._handleEmphasisElement)||void 0===r||r.call(n,{item:t,mark:e}))},regionCallback:(t,e)=>{n&&t.length&&(r=t[0])}}),r&&this._interaction.updateStateOfGraphics(t,[r])}};f2.type="sankey",f2.seriesType=az.sankey,f2.transformerConstructor=g2;const m2=()=>{MY(),GT(),UQ(),Fz.registerChart(f2.type,f2)};class v2 extends KG{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["area","point","line"]),s.area=t.area,s.point=t.point,s.line=t.line,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),tN(t)}}let y2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=v2,this.type="rangeArea",this.seriesType=az.rangeArea}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};y2.type="rangeArea",y2.seriesType=az.rangeArea,y2.transformerConstructor=v2;const _2=()=>{kY(),MY(),TY(),eY(),tY(),Z$(),Fz.registerChart(y2.type,y2)};class b2 extends KG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","cell"])}}let x2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=b2,this.type="heatmap",this.seriesType=az.heatmap}};x2.type="heatmap",x2.seriesType=az.heatmap,x2.transformerConstructor=b2;const S2=()=>{MY(),y0(),Fz.registerChart(x2.type,x2)};class A2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let k2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=A2,this.type="correlation",this.seriesType=az.correlation}};k2.type="correlation",k2.seriesType=az.correlation,k2.transformerConstructor=A2;const C2=()=>{MY(),R0(),Fz.registerChart(k2.type,k2)};function M2(t){var e,i;const s=Object.assign({},t);return P(t.style)||(s.textStyle=$j(t.style)),P(t.textStyle)||Lz(s.textStyle,$j(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&$j(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&$j(s.background.style),s}var w2=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};const T2=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},B2=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l,customFilter:h}=e,c=a(),d=l();if(0===c.length&&d.length)return[];if(c.length===d.length)return t;const u={};c.forEach((t=>{u[t]=!0}));const g=null!==(i=o())&&void 0!==i?i:cj;return h?h(t,c,g):(_(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===u[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===u[t.source]&&!0===u[t.target])))):p(g)&&(t=t.filter((t=>!0===u[r.getSeriesFieldValue(t,g)]))),t)},E2={position:!0,item:!0,title:!0,pager:!0,background:!0};class P2 extends jW{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=oN.Legend,this.layoutLevel=lN.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{ez(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),ez(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=kz(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;p(s)&&(this._seriesUserId=Y(s)),p(e)&&(this._regionUserId=Y(e)),p(n)&&(this._seriesIndex=Y(n)),p(i)&&(this._regionUserIndex=Y(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}_compareSpec(t,e){const i=super._compareSpec(t,e);i.reRender=!0;const s=!U(e,t);return i.reMake?i:(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):s&&!i.reCompile&&this._isComponentOnlySpecChange(t,e)?(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}),i):(s&&(i.reCompile=!0),i)}_isComponentOnlySpecChange(t,e){const i=e,s=t;return Object.keys(Object.assign(Object.assign({},e),t)).every((t=>U(null==i?void 0:i[t],null==s?void 0:s[t])||E2[t]))}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new FN(this._option,t),this._initSelectedData(),ez(this._regions,(t=>{t.event.on(tH.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;const n=this._selectedData;u(t)||JSON.stringify(n)===JSON.stringify(t)||(ez(this._regions,(e=>{e.legendSelectedFilter&&(t=e.legendSelectedFilter(this,t))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...t],null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(tH.legendSelectedDataChange,{model:this}),null===(s=this._legendComponent)||void 0===s||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;k(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)U(s,this._cacheAttrs)||this._legendComponent.setAttributes(Lz({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(Lz({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t,this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var t,e;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());U(t,this._cacheAttrs)||this._legendComponent.setAttributes(Lz({},t,{defaultSelected:this._selectedData}))}null===(e=(t=this.effect).onSelectedDataChange)||void 0===e||e.call(t),this.event.emit(tH.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}P2.specKey="legends";class O2 extends P2{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(t){super.init(t),ez(this._regions,(t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData(),customFilter:this._spec.customFilter},level:_H.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){oH(this._option.dataSet,"discreteLegendFilter",B2),oH(this._option.dataSet,"discreteLegendDataMake",T2);const t=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return ez(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(u(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!ok(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return d(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=Ij(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){const i=w2(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);let{title:s={},item:n={},pager:r={},background:a={}}=t;s=D(s),n=D(n),r=D(r),a=D(a);const o=i;return s.visible?o.title=M2(s):o.title={visible:!1},P(n.focusIconStyle)||$j(n.focusIconStyle),n.shape&&(n.shape=Gj(n.shape)),n.label&&(n.label=Gj(n.label)),n.value&&(n.value=Gj(n.value)),n.background&&(n.background=Gj(n.background)),Cz(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*e.width/100),Cz(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*e.width/100),Cz(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*e.width/100),o.item=n,"scrollbar"===r.type?(P(r.railStyle)||$j(r.railStyle),P(r.sliderStyle)||$j(r.sliderStyle)):(P(r.textStyle)||$j(r.textStyle),r.handler&&Gj(r.handler)),o.pager=r,a.visible&&!P(a.style)&&(Lz(o,a.style),p(a.padding)&&(o.padding=a.padding)),o}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),this._addLegendItemFormatMethods(i),i}_getLegendConstructor(){return hF}setSelectedData(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((e=>!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener(iF.legendItemClick,(e=>{const i=O(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(tH.legendItemClick,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(iF.legendItemHover,(t=>{const e=O(t,"detail");this.event.emit(tH.legendItemHover,{model:this,value:e,event:t})})),this._legendComponent.addEventListener(iF.legendItemUnHover,(t=>{const e=O(t,"detail");this.event.emit(tH.legendItemUnHover,{model:this,value:e,event:t})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:k(s)?s:1,strokeOpacity:k(n)?n:1,opacity:k(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return d(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=IV(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:c}=IV(o,l);l&&!o&&c&&(t.item.value.formatMethod=(t,e)=>c(l,t,e,a))}}O2.specKey="legends",O2.builtInTheme={discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1}},O2.type=r.discreteLegend;const I2=()=>{Fz.registerComponent(O2.type,O2)},R2=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;k(n)&&(t=Math.min(n,t)),k(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},D2=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r,customFilter:a}=e,o=i(),l=s(),h=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!g(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(o===n())return t;if(l&&!P(o)){const[e,i]=o;return a?a(t,o,l):h(t)?Wj(t,+e,+i,l):t.filter((t=>t[l]>=e&&t[l]<=i))}return t};var L2=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};function F2(t){const e=Lz({},t),{title:i={},handler:s={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:c={},type:u,id:g,visible:f,orient:m,position:v,data:y,defaultSelected:_,field:b,filter:x,regionId:S,regionIndex:A,seriesIndex:k,seriesId:C,padding:M}=e,w=L2(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return i.visible?w.title=M2(i):w.title={visible:!1},w.showHandler=!1!==s.visible,P(s.style)||(w.handlerStyle=$j(s.style)),p(n.width)&&(w.railWidth=n.width),p(n.height)&&(w.railHeight=n.height),P(n.style)||(w.railStyle=$j(n.style)),P(r.style)||(w.trackStyle=$j(r.style)),w.startText=Gj(a),w.endText=Gj(o),w.handlerText=function(t){if(!t)return t;const e=Object.assign({},t),i=t.style;return d(i)?e.style=(t,e,s)=>$j(i(t,e,s)):P(i)||(e.style=$j(i)),e}(l),P(h)||(w.sizeBackground=$j(h)),c.visible&&!P(c.style)&&(Lz(w,c.style),p(c.padding)&&(w.padding=c.padding)),w}const z2={color:gF,size:mF},j2={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},H2=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},j2),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},N2={horizontal:H2(!0),vertical:H2(!1)},V2=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},j2),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},U2={horizontal:V2(!0),vertical:V2(!1)},W2=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],G2=[2,10];let Y2=class extends P2{static getSpecInfo(t){const e=RV(t,this.specKey,this.type,(t=>function(t){return"color"===t||"size"===t}(t.type)));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),ez(this._regions,(t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData,customFilter:this._spec.customFilter},level:_H.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){oH(this._option.dataSet,"continuousLegendFilter",D2),oH(this._option.dataSet,"continuousLegendDataMake",R2);const t=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>iz(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=Ij(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!ok(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=Ij(this._option.dataSet.getDataView(a.dataId),a.fields[0])}}_getLegendAttributes(t){var e,i;const s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",n="horizontal"===s?"bottom":this.layoutOrient;let r=[];const a=this._getScaleInGlobal();a&&"linear"===a.type&&(r=a.range()),P(r)&&(r="color"===this._legendType?W2:G2);let o=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,l=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(o=Math.min(0,this._legendData.getLatestData()[0]),l=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const h=Object.assign({layout:s,align:n,zIndex:this.layoutZIndex,min:o,max:l,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:r},F2(this._spec));return this._addDefaultTitleText(h),h}_getLegendConstructor(){return z2[this._legendType]}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener("change",xt((e=>{const i=O(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(tH.legendFilter,{model:this,value:i,event:e})}),30))}}};Y2.specKey="legends",Y2.builtInTheme={colorLegend:N2,sizeLegend:U2},Y2.type=r.continuousLegend;const K2=()=>{Fz.registerComponent(Y2.type,Y2)},$2=(t,e)=>p(e)?t.map((t=>e[t])):void 0,X2=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),q2=t=>!u(t)&&(_(t)?t.length>0&&t.every(p):Object.keys(t).length>0);const Z2=(t,e)=>{const i=e.getSeries(),s=[];return i.forEach((e=>{var i,n,r,a,o,l,h;const c=e.getDimensionField(),d=e.getMeasureField(),g=e.getSeriesField(),f=p(g)?t[g]:void 0,m=p(g)&&null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[g])||void 0===r?void 0:r.values)&&void 0!==a?a:[],v=$2(c,t);let y=$2(d,t);const _=q2(y),b=!_&&p(g)&&u(f)&&m.length>0,x=()=>{var t;const i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(X2(c,v));if(!_&&(y=$2(d,i),!q2(y)))return;const n=e.type===az.pie?e.dataToCentralPosition(i):e.dataToPosition(i);u(n)||isNaN(n.x)||isNaN(n.y)||s.push({pos:n,data:{dimensionFields:c,dimensionData:v,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:f},series:e})};if("cartesian"===e.coordinate){const t=e,i=DI(null===(l=null===(o=e.getYAxisHelper())||void 0===o?void 0:o.getScale(0))||void 0===l?void 0:l.type)?"y":"x",n=c.map(((t,e)=>[t,e])).filter((([,t])=>u(null==v?void 0:v[t])));let r=[null!=v?v:[]];n.length>0&&n.forEach((([t,i])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=e.getViewDataStatistics)||void 0===s?void 0:s.call(e))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((e=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[i]=e,h.push(n)}))})),r=h})),r.forEach((n=>{var r,a;if(b){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(X2(c,n));m.forEach((r=>{const o=a.find((t=>t[g]===r));if(y=$2(d,o),!q2(y))return;const l=t.dataToPosition(o);u(l)||isNaN(l.x)||isNaN(l.y)||s.push({pos:l,data:{dimensionFields:c,dimensionData:n,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:r},series:e,dimType:i})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(X2(c,n));if(!_&&(y=$2(d,r),!q2(y)))return;const o=t.dataToPosition(r);if(u(o)||isNaN(o.x)||isNaN(o.y))return;s.push({pos:o,data:{dimensionFields:c,dimensionData:n,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:f},dimType:i,series:e})}}))}else if("polar"===e.coordinate)if(e.type===az.pie)x();else{const t=e;if(b){const i=(null===(h=t.getViewData())||void 0===h?void 0:h.latestData.filter(X2(c,v))).find((t=>t[g]===f));m.forEach((n=>{if(y=$2(d,i),!q2(y))return;const r=t.dataToPosition(i);u(r)||isNaN(r.x)||isNaN(r.y)||s.push({pos:r,data:{dimensionFields:c,dimensionData:v,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:n},series:e})}))}else x()}else"geo"===e.coordinate&&(()=>{var i,n,r;console.log("parseMarkInfoOfGeoSeries");let a=null===(i=e.getViewData())||void 0===i?void 0:i.latestData.find(X2(c,v));const o=e.getNameMap(),l=null===(r=null===(n=e.getMapViewData)||void 0===n?void 0:n.call(e))||void 0===r?void 0:r.latestData.find((t=>c.every(((e,i)=>"name"===e?o[t.properties[e]]===(null==v?void 0:v[i]):t.properties[e]===(null==v?void 0:v[i])))));if(!l)return;let h=y;if(l&&!a&&(a=Object.assign({},t)),!_){if(y=$2(d,a),h=y,!q2(y)&&!a)return;q2(y)||(y=[null])}const p=e.dataToPosition(a);u(p)||isNaN(p.x)||isNaN(p.y)||s.push({pos:p,data:{dimensionFields:c,dimensionData:v,measureFields:d,measureData:h,hasMeasureData:_,groupField:g,groupData:f,originDatum:a},series:e})})()})),s},J2=t=>p(t)&&!_(t),Q2=t=>p(t)&&_(t),t3=["panel","shape","titleLabel","keyLabel","valueLabel","spaceRow","maxContentHeight","align"];class e3 extends DW{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){const{spec:i,theme:s}=super._initTheme(t,e),n=Lz({},...t3.map((t=>void 0!==(null==s?void 0:s[t])?{[t]:s[t]}:void 0)),null==s?void 0:s.style),r=Lz({},s);t3.forEach((t=>{delete r[t]})),delete r.style;const a=Lz({},r,i);return a.style=Lz({},n,a.style),{spec:a,theme:s}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return p(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:sk(this._option.mode)||!ek(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.confine=null!==(h=t.confine)&&void 0!==h?h:"canvas"===t.renderMode,p(t.parentElement)?y(t.parentElement)&&(t.parentElement=$_.getElementById(t.parentElement)):ek(this._option.mode)&&(t.parentElement=null==tk?void 0:tk.body)}}let i3=class extends jW{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=e3,this.specKey="tooltip",this.layoutType="none",this._isReleased=!1,this.enable=!0,this._alwaysShow=!1,this._eventList=[],this._isTooltipShown=!1,this._clickLock=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._handleClickToLock=t=>{var e,i;if(this._clickLock)this._handleChartMouseOut(t),this._clickLock=!1;else{if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;this._clickLock=!0}},this._getMouseOutHandler=t=>e=>{var i,s,n,r,a;if(this._isReleased)return;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const o=ek(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:l,clientY:h}=e.event;o&&t&&this._isPointerInChart({x:l,y:h})||(this._enterable?this._outTimer=setTimeout((()=>{this._handleChartMouseOut(e)}),null!==(a=null===(r=this._spec)||void 0===r?void 0:r.showDelay)&&void 0!==a?a:50):this._handleChartMouseOut(e))},this._handleChartMouseOut=t=>{var e;this._cacheActiveType&&(null===(e=this._option)||void 0===e?void 0:e.componentShowContent)&&(!1===this._option.componentShowContent.tooltip||g(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[this._cacheActiveType])||this._alwaysShow||this._isReleased||this._isEnterTooltip||"none"!==this._spec.triggerOff&&(this._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:this})),this._handleMouseMove&&this._handleMouseMove.cancel&&this._handleMouseMove.cancel(),this._cacheEnterableRect=null,this._cacheInfo=void 0,this._cacheParams=void 0,this._cacheActiveType=void 0)},this._getMouseMoveHandler=t=>e=>{var i,s,n,r;this._isReleased||this._isEnterTooltip||(this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),this._alwaysShow||(this._clickLock?t&&(this._handleChartMouseOut(e),this._clickLock=!1):!t&&this._enterable&&(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i))?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout((()=>{this._handleChartMouseMove(e,t)}),null!==(r=null===(n=this._spec)||void 0===n?void 0:n.showDelay)&&void 0!==r?r:50)):this._handleChartMouseMove(e,t)))},this._handleChartMouseMove=(t,e)=>{if(this._isReleased)return;const i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:n}}=i,r={mark:!1,dimension:!1,group:!1},a=["group","mark","dimension"];for(let s=0,n=a.length;s<n;s++){const n=a[s],o=!!this.processor[n]&&this._showTooltipByMouseEvent(n,i,t,e);if("unShowByOption"===o)r[n]="unShowByOption";else if(o){r[n]=!0;break}}Object.values(r).every((t=>!t))&&!function(t){return u(t.mark)&&u(t.model)&&u(t.datum)}(t)&&(n&&J2(this._cacheInfo)?r.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):p(s)&&(r.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),!0===r.mark||!0===r.group||!0===r.dimension&&!u(s)?this._initEventOfTooltipContent():this._cacheActiveType&&"unShowByOption"===r[this._cacheActiveType]||this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;if(!this._showContentByEvent(t))return"unShowByOption";const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._hideTimer&&clearTimeout(this._hideTimer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._hideTimer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&BV.globalConfig.uniqueTooltip&&l&&BV.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return 0;this.event.emit(tH.tooltipHide,Object.assign(Object.assign({},t),{source:eH.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const n=null!==(s=this._spec.handler)&&void 0!==s?s:this.tooltipHandler;if(null==n?void 0:n.hideTooltip){const e=n.hideTooltip.call(n,t);return e||(this._isTooltipShown=!1),e}return 1},this.hideTooltip=()=>{if(this._isReleased)return!1;const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:eH.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}}isTooltipShown(){return this._isTooltipShown}_registerEvent(){}_releaseEvent(){}onLayoutEnd(){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return!!U(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i}release(){var t,e;super.release(),this._isReleased=!0,this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((({eventType:t,handler:e})=>{this.event.off(t,e)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(tH.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(tH.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n,this._enterable=!1;else{const t="canvas"===s?_Y.canvas:_Y.dom,n=Fz.getComponentPluginInType(t);n||ZA("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip)return;const i=null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.getRootDom)||void 0===e?void 0:e.call(t);i&&(i.addEventListener("pointerenter",(()=>{var t;if(!this._enterable)return;this._isEnterTooltip=!0;const e=null===(t=i.getBoundingClientRect)||void 0===t?void 0:t.call(i);e&&(this._cacheEnterableRect={width:e.width,height:e.height}),this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this._showTimer&&(clearTimeout(this._showTimer),this._showTimer=null)})),i.addEventListener("pointerleave",(()=>{var t,e,s;if(this._enterable&&(this._isEnterTooltip=!1,"none"!==this._spec.triggerOff&&this._cacheEnterableRect)){const n=null===(t=i.getBoundingClientRect)||void 0===t?void 0:t.call(i);n&&Object.keys(this._cacheEnterableRect).every((t=>this._cacheEnterableRect[t]===n[t]))&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!==(s=null===(e=this._spec)||void 0===e?void 0:e.showDelay)&&void 0!==s?s:50))}})),this._needInitEventOfTooltip=!1)}_initProcessor(){const t=this._spec.activeType;this.processor={},t.forEach((t=>{const e=Fz.createTooltipProcessor(t,this);e&&(this.processor[t]=e)}))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Y(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=Y(this._spec.triggerOff),s=this._option.mode;e.forEach((t=>{var e;"hover"===t?(this._handleMouseMove=this._throttle(this._getMouseMoveHandler(!1)),this._mountEvent("pointermove",{source:"chart"},this._handleMouseMove),(ik(s)||sk(s))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerleave",{source:"chart"},this._getMouseOutHandler(!1))):"click"===t?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):g(t)&&this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseMoveHandler(!0))})),i.filter((t=>g(t))).forEach((t=>{var e,i;this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseOutHandler(null!==(i=t.checkOutside)&&void 0!==i&&i))})),!e.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}_throttle(t){let e;return e=S(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10,St(t,e)}_showContentByEvent(t){var e;if(null===(e=this._option)||void 0===e?void 0:e.componentShowContent){if(!1===this._option.componentShowContent.tooltip)return!1;if(g(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t])return!1}return!0}reInit(t){var e,i,s;if(super.reInit(t),this.tooltipHandler){const t=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",n=this._spec.enterable&&"html"===t;n&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=n,null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.reInit)||void 0===s||s.call(i)}else this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;const s=function(t,e,i){var s,n,r,a,o,l,h;const c=Object.assign({regionIndex:0},e),d=i.getOption(),g=d.getRegionsInUserIdOrIndex(p(c.regionId)?[c.regionId]:void 0,p(c.regionIndex)?[c.regionIndex]:void 0)[0];if(!g)return"none";const f=Z2(t,g),m=null!==(s=c.activeType)&&void 0!==s?s:f.length>1?"dimension":"mark",v=g.getLayoutStartPoint(),y=g.getLayoutRect(),_=d.globalInstance.getContainer(),b=Object.assign({x:0,y:0},_?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(_):{}),x=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data;return null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>X2(i,s)(t)&&X2(n,r)(t)&&(u(a)||X2([a],[o])(t))))},S=g.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse(),A=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),y.width),y:Math.min(Math.max(t.y,0),y.height)}))(t),n=null!==(e=c.x)&&void 0!==e?e:v.x+s.x,r=null!==(i=c.y)&&void 0!==i?i:v.y+s.y,a={x:0,y:0};S.transformPoint({x:n,y:r},a);const{x:o,y:l}=a;return{canvasX:o,canvasY:l,clientX:b.x+o,clientY:b.y+l}};if("dimension"===m){const e=f[0];if(!e)return"none";const s=new Map;f.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const l=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>x(t))))&&void 0!==i?i:[]}}))}];p(e.dimType)&&(l[0].position=e.pos[e.dimType],l[0].dimType=e.dimType);const h={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:l,chart:null!==(n=d.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:eH.chart,event:A({x:f.reduce(((t,e)=>t+e.pos.x),0)/f.length,y:f.reduce(((t,e)=>t+e.pos.y),0)/f.length}),item:void 0};null===(o=null===(a=null===(r=i.processor)||void 0===r?void 0:r.dimension)||void 0===a?void 0:a.showTooltip)||void 0===o||o.call(a,l,h,!1);const c=d.globalInstance;return BV.globalConfig.uniqueTooltip&&BV.hideTooltip(c.id),m}if("mark"===m){const e=f[0];if(!e)return"none";const s=null!==(l=e.data.originDatum)&&void 0!==l?l:Object.assign(Object.assign({},x(e)),t),n=[{datum:[s],series:e.series}],r={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(h=d.globalInstance.getChart())&&void 0!==h?h:void 0,datum:s,model:e.series,source:eH.chart,event:A(e.pos),item:void 0};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},r,!1);const a=d.globalInstance;return BV.globalConfig.uniqueTooltip&&BV.hideTooltip(a.id),m}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=s),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(u(this._cacheInfo)||u(t))return!1;if(Q2(t)){if(J2(this._cacheInfo))return!1;const e=this._cacheInfo;return e.length===t.length&&t.every(((t,i)=>zU(t,e[i])))}if(Q2(this._cacheInfo))return!1;const s=this._cacheInfo;if((null==t?void 0:t.datum)!==s.datum||(null==t?void 0:t.mark)!==s.mark||(null==t?void 0:t.series)!==s.series)return!1;const n=this._cacheParams;return!u(n)&&!u(e)&&n.mark===e.mark&&n.model===e.model&&n.datum===e.datum}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}getVisible(){return!1!==this._spec.visible}};i3.type=r.tooltip,i3.transformerConstructor=e3,i3.builtInTheme={tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}}},i3.specKey="tooltip";const s3=()=>{Fz.registerComponent(i3.type,i3)};var n3;!function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(n3||(n3={}));var r3=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};const a3={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]},o3={labelZIndex:!0,gridZIndex:!0},l3={xField:!0,yField:!0,categoryField:!0,valueField:!0},h3={visible:!0,width:!0,style:!0};class c3 extends jW{get enableRemain(){return"none"===this.triggerOff}constructor(t,e){super(t,e),this.specKey="crosshair",this.layoutType="none",this.gridZIndex=oN.CrossHair_Grid,this.labelZIndex=oN.CrossHair,this.trigger="hover",this._handleIn=t=>{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),S(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=St((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hideCrosshair())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(g(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hideCrosshair()},this.enable=!0,this.showDefault=!0}_setAllAxisValues(t,e,i){let s=!1;if(t.forEach((t=>{DI(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!this.enable)return!1;const{currentValue:n}=this._stateByField[i];return t.forEach(((t,i)=>{const s=t.axis;n.set(i,{datum:this._getDatumAtPoint(s,e),axis:s})})),!0}clearAxisValue(){Object.keys(this._stateByField).forEach((t=>{this._stateByField[t].currentValue.clear()}))}hideCrosshair(){this.clearAxisValue(),this.hide()}showCrosshair(t){t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach((t=>{const{axis:e,value:i}=t;this.setAxisValue(i,e)})),this.layoutByValue(!1))}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshairBySpec(){let t=!1;return Object.keys(this._stateByField).forEach((e=>{const i=this._spec[e];if(i&&i.visible&&i.defaultSelect){const{axisIndex:s=0,datum:n}=i.defaultSelect,r=this._option.getComponentsByKey("axes").find((t=>t.getSpecIndex()===s));r&&(t=!0,this._stateByField[e].currentValue.clear(),this._stateByField[e].currentValue.set(s,{axis:r,datum:n}))}})),t}_updateVisibleCrosshair(){let t=!1;Object.keys(this._stateByField).forEach((e=>{const i=this._spec[e];i&&i.visible&&this._stateByField[e].currentValue.size?t=!0:this._hideByField(e)})),t&&this.layoutByValue(!1)}_showDefaultCrosshair(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return!U(e,t)&&(i.change=!0,i.reRender=!0,i.reMake||(this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0)),i}_isComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((i=>U(null==e?void 0:e[i],null==t?void 0:t[i])||o3[i]||l3[i]&&this._isFieldComponentOnlySpecChange(null==e?void 0:e[i],null==t?void 0:t[i])))}_isFieldComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},t),e)).every((i=>U(null==t?void 0:t[i],null==e?void 0:e[i])||"label"===i||"line"===i&&this._isLineComponentOnlySpecChange(null==t?void 0:t.line,null==e?void 0:e.line)))}_isLineComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},t),e)).every((i=>U(null==t?void 0:t[i],null==e?void 0:e[i])||h3[i]))}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){var s;if(!1===(null===(s=this._option.componentShowContent)||void 0===s?void 0:s.crosshair))return;const n=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,r=e?{level:iH.chart}:{source:eH.chart};_(t)?t.forEach((t=>{this.event.on(t,r,n)})):this.event.on(t,r,n)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;_(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}onBeforeRender(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:t=n["desktop-browser"]}=this._option,e=function(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:ik(t)||sk(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(t);if(e){const t=Y(this.trigger||"hover"),i=t=>"click"===t?"none"===this.triggerOff?null:e.clickOut:e.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:e[t],out:i(t)})})),s}return null}_registerTooltipEvent(){this.event.on(tH.tooltipHide,{source:eH.chart},this._handleTooltipHideOrRelease),this.event.on(tH.tooltipShow,{source:eH.chart},this._handleTooltipShow),this.event.on(tH.tooltipRelease,{source:eH.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=O(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{a3[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:c,y:d}=this.getLayoutStartPoint();return n.forEach((t=>{var e,i;a=1/0,o=1/0,l=-1/0,h=-1/0;const n=s.find((e=>e.getSpecIndex()===t));if(!n)return;const u=(null===(i=(e=n).getInnerOffset)||void 0===i?void 0:i.call(e))||{left:0,right:0,top:0,bottom:0};n.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-c+u.left),o=Math.min(o,i-d+u.top),l=Math.max(l,e+t.getLayoutRect().width-c-u.right),h=Math.max(h,i+t.getLayoutRect().height-d-u.bottom)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:n})})),r}onLayoutEnd(){const t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),super.onLayoutEnd()}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseFieldInfo(){Object.keys(this._stateByField).forEach((t=>{const e=this._spec[t],{crosshairComp:i}=this._stateByField[t];if(e&&e.visible){if(this._stateByField[t].attributes=this._parseField(e,t),i){const{style:e,type:s}=this._stateByField[t].attributes,n="rect"===s?"rectStyle":"lineStyle";i.setAttributes({[n]:e})}}else i&&i.parent&&i.parent.removeChild(i)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||S(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,n;const r={},{line:a={},label:o={},visible:l}=t;if(r.visible=l,r.type=a.type||"line",!1===a.visible)r.style={visible:!1};else{const e=a.style||{},{stroke:n,fill:o,lineWidth:l}=e,h=e,{strokeOpacity:c,fillOpacity:d,opacity:u}=h,p=r3(h,["strokeOpacity","fillOpacity","opacity"]),g="line"===r.type;let f=g?c:d;if(S(u)&&(f=(null!=f?f:1)*u),r.style=Object.assign({opacity:f,pickable:!1,visible:!0},p),g)r.style.stroke=n||o,r.style.lineWidth=O(a,"width",l||2);else{r.style.fill=o||n,(null===(s=null===(i=null==t?void 0:t.line)||void 0===i?void 0:i.style)||void 0===s?void 0:s.stroke)&&(r.style.stroke=t.line.style.stroke);const e=O(a,"width");if("string"==typeof e){const t=parseInt(e.substring(0,e.length-1),10)/100;r.style.sizePercent=t}else"number"!=typeof e&&"function"!=typeof e||(r.style.size=e)}}if(o.visible){const t=o.labelBackground||{},e=null!==(n=o.syncAxisLabelAngle)&&void 0!==n&&n,i=o.style||{},s=t.style||{},{fill:a="rgba(47, 59, 82, 0.9)",stroke:l,outerBorder:h}=s,d=r3(s,["fill","stroke","outerBorder"]);r.label={visible:!0,formatMethod:o.formatMethod,formatter:o.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,syncAxisLabelAngle:e,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},i),{fill:i.fill||"#fff",stroke:O(i,"stroke")}),panel:(c(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:a,stroke:l,outerBorder:Object.assign({stroke:a,distance:0,lineWidth:3},h)},d):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else r.label={visible:!1};return r}_filterAxisByPoint(t,e,i){return t&&t.forEach((s=>{const n=s.axis;if(a=e,o=i,((r=s).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(n.getSpecIndex()),n.type.startsWith("polarAxis")){const s=n.getCenter(),r=n.getInnerRadius(),a=n.getOuterRadius(),o=ae.distancePP({x:e,y:i},s);(o>a||o<r)&&t.delete(n.getSpecIndex())}var r,a,o})),t}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new _B(e),null==s||s.add(t),i(t)),function(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:c=0,dy:d=0}=t.attribute;let u=0,p=0;a<i&&(u=i-a),o<s&&(p=s-o),l>n&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+c),p&&t.setAttribute("dy",p+d)}(t,this._getLimitBounds())}clearOutEvent(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}_hideByField(t){const{crosshairComp:e,labelsComp:i}=this._stateByField[t];e&&e.hideAll(),i&&Object.keys(i).forEach((t=>{i[t]&&i[t].hideAll()}))}hide(){Object.keys(this._stateByField).forEach((t=>{this._hideByField(t)}))}_getNeedClearVRenderComponents(){return Object.keys(this._stateByField).reduce(((t,e)=>{const{crosshairComp:i,labelsComp:s}=this._stateByField[e];return i&&t.push(i),s&&Object.keys(s).forEach((e=>{s[e]&&t.push(s[e])})),t}),[])}}c3.specKey="crosshair";const d3={trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}};class u3 extends c3{static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._stateByField={xField:{coordKey:"x",anotherAxisKey:"y",currentValue:new Map,labelsComp:{top:null,bottom:null}},yField:{coordKey:"y",anotherAxisKey:"x",currentValue:new Map,labelsComp:{left:null,right:null}}}}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const i=BU(t.getOrient())?"x":"y",s=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(s)}setAxisValue(t,e){BU(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}_layoutCrosshair(t,e,i,s){var n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(p(t.dimType)?"y"===t.dimType:EU(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}this.clearAxisValue();const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else o&&o.size&&this._setAllAxisValues(o,{x:r,y:a},"xField"),l&&l.size&&this._setAllAxisValues(l,{x:r,y:a},"yField"),this.layoutByValue()}layoutByValue(t){if(!this.enable)return;const e=sz(this._regions,"cartesian");e&&(cY(this._stateByField,e,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){const{cacheInfo:e,attributes:i,labelsComp:s,bandSize:n,coordKey:r}=this._stateByField[t];if(!i||!e||e._isCache&&this.enableRemain)return;const{coord:a,labels:o,visible:l,labelsTextStyle:h}=e;if(l){const l=pY(this._stateByField[t]);this._updateCrosshairByField(t,l),Object.keys(o).forEach((l=>{var c,d,u;if(o[l].visible){const p=Object.assign(Object.assign(Object.assign({[r]:a+n/2},o[l]),i.label),{angle:i.label.syncAxisLabelAngle&&null!==(d=null===(c=e.axisLabel)||void 0===c?void 0:c.attribute.angle)&&void 0!==d?d:0,textStyle:Object.assign(Object.assign({},null===(u=i.label)||void 0===u?void 0:u.textStyle),h[l]),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(s[l],p,(e=>{e.name=`crosshair-${t.replace("Field","")}-${l}-label`,s[l]=e}))}else s[l]&&s[l].hideAll()}))}else this._hideByField(t)}_updateCrosshairByField(t,e){const i=this.getContainer(),{attributes:s}=this._stateByField[t];let{crosshairComp:n}=this._stateByField[t];if(n)n.setAttributes(e);else{const r=s.style;"line"===s.type?n=new LB(Object.assign(Object.assign({},e),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===s.type&&(n=new FB(Object.assign(Object.assign({},e),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(n),this._stateByField[t].crosshairComp=n}}}u3.specKey="crosshair",u3.builtInTheme={crosshair:d3},u3.type=r.cartesianCrosshair;const p3=()=>{Fz.registerComponent(u3.type,u3)};class g3 extends c3{static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible))}constructor(t,e){super(t,e),this.type=r.polarCrosshair,this.name=r.polarCrosshair,this._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}}}setAxisValue(t,e){"radius"===e.getOrient()?this._stateByField.valueField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.categoryField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint();return t.positionToData({x:e.x-(i-n),y:e.y-(s-r)})}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}this.clearAxisValue();const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)a&&this._setAllAxisValues(a,{x:n,y:r},"categoryField"),o&&this._setAllAxisValues(o,{x:n,y:r},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}layoutByValue(t){if(!this.enable)return;const e=sz(this._regions,"polar");e&&(((t,e,i=!1)=>{Object.keys(t).forEach((s=>{const{attributes:n,currentValue:r,cacheInfo:a,coordKey:o}=t[s];if(n){const l=!!r.size,h=i&&!l&&p(a),c=h?a:{coord:0,axis:null,visible:l,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(a&&(a._isCache=h),"valueField"===s&&(c.sides=e.angleAxisHelper.getScale(0).domain().length),r.forEach((({axis:t,datum:i=""})=>{var r;const a=t.niceLabelFormatter;if((null===(r=n.label)||void 0===r?void 0:r.visible)&&(c.labels.all.visible=!0,c.labels.all.defaultFormatter=a,c.labels.all.text=i,c.labels.all.offset=pW(t.getSpec())),"categoryField"===s){const s=e.angleAxisHelper.dataToPosition([i]),n=e.angleAxisHelper.getBandwidth(0),r=t.getOuterRadius();c.coord=s,c.coordRange=[s-n/2,s+n/2],c.sizeRange=[r,r]}else{const s=t.startAngle,n=e.radiusAxisHelper.dataToPosition([i]);c.coord=n,c.coordRange=[n,n],c.sizeRange=[s,s]}c.axis=t})),c&&!h&&c.labels.all.visible&&n&&n.label){const t=c.labels.all,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=IV(e,i,t.text,{label:t.text,orient:o});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}t[s].cacheInfo=c}}))})(this._stateByField,e,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){var e,i,s;const{cacheInfo:n,attributes:r,crosshairComp:a,labelsComp:o,coordKey:l}=this._stateByField[t];if(!n||n._isCache&&this.enableRemain)return;const h=this.getContainer(),{visible:c,labels:d,coord:u,sizeRange:p,axis:g}=n;if(c){const n=this.getLayoutStartPoint(),c=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,f=((t,e,i)=>{const{cacheInfo:s,coordKey:n,attributes:r}=t,{axis:a,coord:o,sizeRange:l,coordRange:h}=s,c=a.getCenter(),d={x:c.x+e.x,y:c.y+e.y};if("angle"===n)return"sector"==("rect"===r.type?"sector":"line")?{center:d,innerRadius:a.getInnerRadius(),radius:a.getOuterRadius(),startAngle:h[0],endAngle:h[1]}:{start:ce(d,a.getInnerRadius(),o),end:ce(d,a.getOuterRadius(),o)};const u=a.startAngle,p=a.endAngle,g=s.sides;let f=o;if(!i){const t=a.getCenter(),e=a.coordToPoint({angle:l[0],radius:o}),i=ue(t,e),s=(p-u)/g,n=Math.floor((i-u)/s),r=n*s+u,h=Math.min((n+1)*s+u,p),c=ce(t,o,r),d=ce(t,o,h),m=ye([d.x,d.y],[c.x,c.y],[t.x,t.y],[e.x,e.y]);m&&(f=vt(ae.distancePN(e,m[0],m[1])+o,a.getInnerRadius(),a.getOuterRadius()))}return{center:d,startAngle:u,endAngle:p,radius:f,sides:g}})(this._stateByField[t],n,c);if(a)a.setAttributes(f);else{let e;if("angle"===l){const t="rect"===r.type?"sector":"line";"line"===t?e=new LB(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===t&&(e=new jB(Object.assign(Object.assign({},f),{sectorStyle:r.style,zIndex:this.gridZIndex,pickable:!1})))}else e="polygon"==(c?"circle":"polygon")?new HB(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex+1})):new zB(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=e,h.add(e)}const m=d.all;if(m.visible){const t=g.getCenter(),e={x:t.x+n.x,y:t.y+n.y},i="angle"===l?function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(u):function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(g.startAngle),a="angle"===l?ce(e,p[1]+m.offset,u):ce(e,f.radius,g.startAngle),h=Object.assign(Object.assign(Object.assign(Object.assign({},a),r.label),m),{textStyle:Object.assign(Object.assign({},null===(s=r.label)||void 0===s?void 0:s.textStyle),{textAlign:i.align,textBaseline:i.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(o.all,h,(t=>{t.name=`crosshair-${l}-label`,o.all=t}))}else o.all&&o.all.hideAll()}}}g3.specKey="crosshair",g3.builtInTheme={crosshair:d3},g3.type=r.polarCrosshair;const f3=()=>{Fz.registerComponent(g3.type,g3)},m3=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n,originalFields:r}=e,a=n(),o=i();if(u(o)||u(a))return t;const l=r(),h=_(a)?a[0]:a;return t[h]&&l&&l[h]&&l[h].lockStatisticsByDomain&&!s()&&(t[h].values=o),t},v3=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(u(a)||u(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>{let e=!1;return Y(r).every((i=>{t[i]>=a[0]&&t[i]<=K(a)&&(e=!0)})),e}:t=>{let e=!1;return Y(r).every((i=>{(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(l)},y3=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n,isCategoryState:r,seriesCollection:a}=e.input,{stateField:o,valueField:l}=e.output,h={},c=[],d=[],g=[];let f=!1,m=!1;return n.forEach(((t,e)=>{var n;if(u(i[e]))return;const r=a[e];if(r){const t=r.getRawDataStatisticsByField(i[e]);p(null==t?void 0:t.max)&&p(null==t?void 0:t.min)&&(m=!0)}const o=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];o&&o.lockStatisticsByDomain&&(f=!0,o.domain.forEach((t=>{u(h[t])&&(g.push(t),h[t]=0,c.push(t))}))),t.latestData.forEach((t=>{Y(i[e]).forEach((i=>{u(t[i])||(u(h[t[i]])&&(g.push(t[i]),h[t[i]]=0,c.push(t[i])),u(s[e])||(h[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))})),(f?g:!1===r||m?g.sort(((t,e)=>t-e)):c).forEach((t=>{const e={[o]:t};l&&(e[l]=h[t]),d.push(e)})),d},_3=(t,e,i)=>{const s=e.domain();if(II(e.type))return i?s[0]+(K(s)-s[0])*(1-t):s[0]+(K(s)-s[0])*t;let n=e.range();i&&(n=n.slice().reverse());const r=n[0]+(K(n)-n[0])*t;return e.invert(r)},b3=(t,e,i)=>{const s=e.scale(t);let n=e.range();return!i&&II(e.type)&&(n=n.slice().reverse()),Math.max(0,Math.min(1,(s-n[0])/(K(n)-n[0])))},x3=(t,e)=>{const i=t;if(!i)return!1;const s=i.getScale();return s.range()[0]>s.range()[1]&&(!i.getInverse()||e)},S3=t=>{const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}},A3=(t,e,i)=>"start"===t?"percent"===e&&p(i.start)||"value"===e&&p(i.startValue):"percent"===e&&p(i.end)||"value"===e&&p(i.endValue),k3=(t,e,i)=>{if(II(i.type))return[Math.min(e,t),Math.max(e,t)];const s=i.domain(),n=s.indexOf(t),r=s.indexOf(e);return s.slice(Math.min(n,r),Math.max(n,r)+1)};class C3{enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this.handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this.handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}constructor(t,e,i,s,n,r,a,o){this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.initZoomEvent=()=>{var t,e,i,s,n,r,a;const o={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:p(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a,allowComponentZoom:!0};this._zoomAttr.enable&&this.initZoomEventOfRegions(this.getRegions(),null,this.handleChartZoom,o),this._scrollAttr.enable&&this.initScrollEventOfRegions(this.getRegions(),null,this.handleChartScroll,o),this._dragAttr.enable&&this.initDragEventOfRegions(this.getRegions(),null,this.handleChartDrag,o)},this.handleChartZoom=(t,e)=>{var i,s;if(!this._activeRoam||this._zoomAttr.filter&&!this._zoomAttr.filter(t,e))return;const{zoomDelta:n,zoomX:r,zoomY:a}=t,{x:o,y:l}=this.getRegions()[0].getLayoutStartPoint(),{width:h,height:c}=this.getRegions()[0].getLayoutRect(),d=Math.abs(this.getState().start-this.getState().end),u=null!==(s=null===(i=this._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==s?s:1;if(d>=1&&n<1)return;if(d<=.01&&n>1)return;const p=this._isHorizontal?r:a,g=d*(n-1)*u;let f=g/2,m=g/2;if(p){const t=this._isHorizontal?o:l,e=this._isHorizontal?h:c;f=Math.abs(t-p)/Math.abs(e-t)*g,m=Math.abs(e-p)/Math.abs(e-t)*g}const v=vt(this.getState().start+f,0,1),y=vt(this.getState().end-m,0,1);this._handleChange(Math.min(v,y),Math.max(v,y),!0)},this.handleChartScroll=(t,e)=>{var i;if(!this._activeRoam||this._scrollAttr.filter&&!this._scrollAttr.filter(t,e))return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?Ut(s/n)>=.5:Ut(n/s)>=.5;if(this._scrollAttr.reverse||(r=-r),a){const t=this._spec.scrollStep;k(t)&&(r=(r>0?1:-1)*(t*(this.getState().end-this.getState().start)/1)),this.handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1)}const o=0!==this.getState().start&&1!==this.getState().end;return a&&o},this.handleChartDrag=(t,e)=>{var i;if(!this._activeRoam||this._dragAttr.filter&&!this._dragAttr.filter(t,e))return;const[s,n]=t;let r=this._isHorizontal?s:n;this._dragAttr.reverse&&(r=-r),this.handleChartMove(r,null!==(i=this._dragAttr.rate)&&void 0!==i?i:1)},this.handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this.getState().end<1){const s=Math.min(1-this.getState().end,t/i)*e;this._handleChange(this.getState().start+s,this.getState().end+s,!0)}else if(t<0&&this.getState().start>0){const s=Math.max(-this.getState().start,t/i)*e;this._handleChange(this.getState().start+s,this.getState().end+s,!0)}return!1},this._type=t,this._spec=e,this._handleChange=i,this.getLayoutRect=s,this.getState=n,this.getRegions=r,this._regions=r(),this.getOption=a,this._option=a(),this.getEvent=o,this._isHorizontal="horizontal"===IU(OU(e))}setEventAttrFromSpec(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=j({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=j({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=j({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,c(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.getEvent(),this._option.mode)}}G(C3,OK);class M3 extends jW{get isHorizontal(){return this._isHorizontal}get stateScale(){return this._stateScale}get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:b3(t,this._stateScale,this._isHorizontal),a="percent"===n?e:b3(e,this._stateScale,this._isHorizontal);this._handleChange(r,a,!0)}enableInteraction(){this._dataFilterEvent.enableInteraction()}disableInteraction(){this._dataFilterEvent.disableInteraction()}zoomIn(t){this._dataFilterEvent.zoomIn(t)}zoomOut(t){this._dataFilterEvent.zoomOut(t)}_initEvent(){var t;this._dataFilterEvent.initZoomEvent(),null===(t=this._relatedAxisComponent)||void 0===t||t.event.on(tH.scaleRawDomainUpdate,(({model:t})=>{console.log("scaleRawDomainUpdate",t.getRawDomain())}))}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_updateRangeFactor(t){const e=this._relatedAxisComponent,i=e.getScale(),s=x3(e,this._isHorizontal),n=s?[1-this._end,1-this._start]:[this._start,this._end];if(s)switch(t){case"startHandler":e.scaleRangeFactorEnd(n[1]);break;case"endHandler":e.scaleRangeFactorStart(n[0]);break;default:e.scaleRangeFactorStart(n[0],!0),e.scaleRangeFactorEnd(n[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(n[0]);break;case"endHandler":e.scaleRangeFactorEnd(n[1]);break;default:e.scaleRangeFactorEnd(n[1],!0),e.scaleRangeFactorStart(n[0])}const r=i.rangeFactor();r?(this._start=s?1-r[1]:r[0],this._end=s?1-r[0]:r[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._hasInitStateScale=!1,this._shouldChange=!0,this._stateField="x",this._currentDataCollection=[],this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=k3(this._startValue,this._endValue,this._stateScale),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&S3(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate({value:"force"})}else ez(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),ez(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._orient=OU(t),this._isHorizontal="horizontal"===IU(this._orient),this._dataFilterEvent=new C3(this.type,this._spec,this._handleChange.bind(this),this.getLayoutRect.bind(this),(()=>({start:this._start,end:this._end})),(()=>this._regions),(()=>this._option).bind(this),(()=>this.event))}created(){this._handleDataCollectionChangeBound=this._handleDataCollectionChange.bind(this),super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||U(e,t)||(i.change=!0,i.reRender=!0,!i.reCompile&&this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0),i}_getComponentOnlySpecKeys(){return null}_isComponentOnlySpecChange(t,e){const i=this._getComponentOnlySpecKeys();return!!i&&Object.keys(Object.assign(Object.assign({},e),t)).every((s=>U(null==e?void 0:e[s],null==t?void 0:t[s])||i[s]))}reInit(t){super.reInit(t),this._marks.forEach((t=>{t.getMarks().forEach((t=>{this.initMarkStyleWithSpec(t,this._spec[t.name])}))}))}onLayoutStart(t,e){super.onLayoutStart(t,e);const i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=((t,e,i,s,n)=>{if(II(n.type)){const r=n.domain(),a=r[0],o=K(r)-a,l=p(t)?a+o*t:+e,h=p(i)?a+o*i:+s;return[Math.min(h,l),Math.max(h,l)]}const r=n.domain(),a=n.range(),o=a[a.length-1]-a[0],l=p(t)?r.indexOf(n.invert(o*t+a[0])):r.indexOf(e),h=p(i)?r.indexOf(n.invert(o*i+a[0])):r.indexOf(s);return r.slice(Math.min(l,h),Math.max(l,h)+1)})(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}_initAfterLayout(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}_beforeLayoutEnd(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}onLayoutEnd(){var t;this._beforeLayoutEnd();const e=!(0===this._start&&1===this._end);this._autoVisible(e),super.onLayoutEnd(),null===(t=this._relatedAxisComponent)||void 0===t||t.updateScaleRange()}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}_setAxisFromSpec(){if(p(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):p(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),u(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>IU(t._orient)===IU(this._orient)));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!II(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(p(i)&&(p(i.userId)&&(this._seriesUserId=Y(i.userId)),p(i.specIndex)&&(this._seriesIndex=Y(i.specIndex))),p(this._spec.seriesId)){const t=Y(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(p(this._spec.seriesIndex)){const t=Y(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(p(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Y(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(p(this._spec.regionId)){const t=Y(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}}_collectDataInfo(){const t=[],e=[],i=[],s=[];let n;if(this._relatedAxisComponent){const e={};ez(this._regions,(r=>{var a,o;const l="cartesian"===r.coordinate?r.getXAxisHelper():"polar"===r.coordinate?r.angleAxisHelper:null,h="cartesian"===r.coordinate?r.getYAxisHelper():"polar"===r.coordinate?r.radiusAxisHelper:null;if(!l||!h)return;const c=l.getAxisId()===this._relatedAxisComponent.id?l:h.getAxisId()===this._relatedAxisComponent.id?h:this._isHorizontal?l:h,d=c===l?h:l,u=II(d.getScale(0).type),p=II(c.getScale(0).type);t.push(r.getRawData());const g=r.getSpec(),f="cartesian"===r.coordinate?Y(g.xField):Y(null!==(a=g.angleField)&&void 0!==a?a:g.categoryField),m="cartesian"===r.coordinate?Y(g.yField):Y(null!==(o=g.radiusField)&&void 0!==o?o:g.valueField);if(e[r.id]="link"===r.type?["from_xField"]:c===l?f:m,p?(n=!1,i.push(e[r.id])):(n=!0,i.push(e[r.id][0])),this._valueField){const t="link"===r.type?["from_yField"]:d===l?f:m;u&&s.push(...t)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=e}else ez(this._regions,(n=>{t.push(n.getRawData()),e.push(n),i.push(this._field),this._valueField&&s.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});return{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:n}}_initData(){const{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:n}=this._collectDataInfo(),{dataSet:r}=this._option;lH(r,"dataview",ja),oH(r,"dataFilterComputeDomain",y3);const a=new so(r,{name:`${this.type}_${this.id}_data`});a.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:n},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new FN(this._option,a),a.reRunAllTransform(),this._currentDataCollection=t,r.multipleDataViewAddListener(t,"change",this._handleDataCollectionChangeBound)}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(oH(this._option.dataSet,"dataFilterWithNewDomain",v3),oH(this._option.dataSet,"lockStatisticsFilter",m3),ez(this._regions,(t=>{t.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:()=>t.getViewDataStatistics().getFields(),getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>II(this._stateScale.type)},level:1},!1),t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>II(this._stateScale.type)},level:_H.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onDataUpdate(){var t;const{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:n,isCategoryState:r}=this._collectDataInfo();if(this._currentDataCollection.length!==e.length||this._currentDataCollection.some(((t,i)=>t!==e[i]))){this._currentDataCollection.forEach((t=>{var e;null===(e=null==t?void 0:t.target)||void 0===e||e.removeListener("change",this._handleDataCollectionChangeBound)})),this._currentDataCollection=e;const{dataSet:t}=this._option;t.multipleDataViewAddListener(this._currentDataCollection,"change",this._handleDataCollectionChangeBound)}this._data.getDataView().transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:n,isCategoryState:r},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data.getDataView().reRunAllTransform();const a=this._computeDomainOfStateScale(II(this._stateScale.type));this._stateScale.domain(a,!1),(p(this._spec.start)||p(this._spec.end))&&this._setStateFromSpec(),this._handleChange(this._start,this._end,!0),this._spec.auto&&!U(this._domainCache,a)&&(this._domainCache=a,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_setStateFromSpec(){let t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[i,s]=this._spec.rangeMode;A3("start",i,this._spec)&&A3("end",s,this._spec)&&(t="percent"===i?this._spec.start:b3(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===s?this._spec.end:b3(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?b3(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?b3(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}_setStateFromAxis(){var t,e;this._setStateFromSpec();const i=this._relatedAxisComponent;this._startValue=_3(this._start,this._stateScale,x3(i,this._isHorizontal)),this._endValue=_3(this._end,this._stateScale,x3(i,this._isHorizontal)),this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,II(this._stateScale.type)&&this._stateScale.domain()[0]!==K(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(K(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(K(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=k3(this._startValue,this._endValue,this._stateScale)))}_initStateScale(){var t,e,i,s,n,r;const a=[0,1];if(this._relatedAxisComponent){const o=this._relatedAxisComponent.getScale().clone();this._stateScale=o,null===(e=(t=o).maxBandwidth)||void 0===e||e.call(t,"auto",!0),null===(s=(i=o).minBandwidth)||void 0===s||s.call(i,"auto",!0),null===(r=(n=o).bandwidth)||void 0===r||r.call(n,"auto",!0),o.rangeFactor(a,!0).range(a)}else{let t=!0;this._field&&ez(this._regions,(e=>{const i=e.getRawDataStatisticsByField(this._field);k(null==i?void 0:i.min)&&k(null==i?void 0:i.max)||(t=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=t?new CR:new nR,this._stateScale.domain(this._computeDomainOfStateScale(t),!0).range(a)}}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[X(t),$(t)]:[-1/0,1/0]}return e}_autoVisible(t){if(!this._auto)return;t?this.show():this.hide();const e=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[e]:t?this[`_${e}`]:0},{[e]:hN.Built_In})}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),c=null==l?void 0:l.getScale(),d=S3(h);if(!this._dataUpdating&&DI(c.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==d?void 0:d.bandSize))return this._cacheVisibility;let p=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?c.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&c.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==d?void 0:d.bandSize,DI(c.type)){d&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=c.rangeFactor())&&void 0!==a?a:[];p=!(u(t)&&u(e)||0===t&&1===e)}else{const[t,e]=null!==(o=c.rangeFactor())&&void 0!==o?o:[this._start,this._end];p=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=p,p}_getNeedClearVRenderComponents(){return[this._component]}}G(M3,OK);class w3 extends DW{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=Lz({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=_(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}const T3=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),B3={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:T3(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:T3(!0)},E3={width:!0,height:!0,showDetail:!0,middleHandler:!0,background:!0,startHandler:!0,endHandler:!0,startText:!0,endText:!0,dragMask:!0,selectedBackground:!0,backgroundChart:!0,selectedBackgroundChart:!0,showBackgroundChart:!0};let P3=class extends M3{constructor(t,e){var i;super(t,e),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=w3,this.specKey="dataZoom",this.layoutZIndex=oN.DataZoom,this.layoutLevel=lN.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e=this._isHorizontal?0:this._middleHandlerSize,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e=this._isHorizontal?0:this._middleHandlerSize,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._getPreviewStateScale(),n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._getPreviewStateScale(),n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"filter"}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange)if(i&&this._component)this._component.setStartAndEnd(t,e);else{const i=this._relatedAxisComponent,n=_3(t,this._stateScale,x3(i,this._isHorizontal)),r=_3(e,this._stateScale,x3(i,this._isHorizontal));if(!p(n)||!p(r))return;this._start=t,this._end=e,(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,n,r):this._handleStateChange(n,r,s))&&this.event.emit(tH.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){this._data.getDataView().reRunAllTransform(),this._initAfterLayout();const t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new CR),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}created(){super.created(),this._initValueScale()}updateLayoutAttribute(){!1!==this._cacheVisibility&&super.updateLayoutAttribute()}_beforeLayoutEnd(){super._beforeLayoutEnd();const t=this._relatedAxisComponent;(x3(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=x3(t,this._isHorizontal),this.effect.onZoomChange())}_getComponentOnlySpecKeys(){return E3}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}getBoundsInRect(t){var e,i,s,n;const r={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},a=this._startHandlerSize*(null!==(e=this._spec.startHandler.style.scaleX)&&void 0!==e?e:1),o=this._startHandlerSize*(null!==(i=this._spec.startHandler.style.scaleY)&&void 0!==i?i:1),l=this._endHandlerSize*(null!==(s=this._spec.endHandler.style.scaleX)&&void 0!==s?s:1),h=this._endHandlerSize*(null!==(n=this._spec.endHandler.style.scaleY)&&void 0!==n?n:1),c=this._visible?this._isHorizontal?(a-this._startHandlerSize)/2+(l-this._endHandlerSize)/2:(Math.max(a,l)-this._width)/2:0,d=this._visible?this._isHorizontal?(Math.max(o,h)-this._height)/2:(o-this._startHandlerSize)/2+(h-this._endHandlerSize)/2:0;return this._isHorizontal?(r.y2=r.y1+this._height+d,r.x2=r.x1+t.width+c):(r.x2=r.x1+this._width+c,r.y2=r.y1+t.height+d),r}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec();const c=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),u(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize),u(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,p=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=p?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new CR;e.domain(t),this._valueScale=e}}_updateScaleRange(){this._updateStateScaleRange(),this._updateValueScaleRange()}_updateStateScaleRange(){var t,e,i;const s=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale)return;let n;const r=this._isHorizontal?this.getLayoutRect().width-s:this.getLayoutRect().height-s,a=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,r+this._startHandlerSize/2],o=this._computeWidth(),l=this._computeHeight();n=this._isHorizontal?this._visible?[this._startHandlerSize/2,o-s+this._startHandlerSize/2]:a:this._visible?[this._startHandlerSize/2,l-s+this._startHandlerSize/2]:a,this._stateScale.range(n),null===(i=this._previewStateScale)||void 0===i||i.range(x3(this._relatedAxisComponent,this._isHorizontal)?n.reverse():n)}_updateValueScaleRange(){if(!this._valueScale)return;const t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[X(e),$(e)]:null}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return!(II(t.type)&&e[0]===K(e)||DI(t.type)&&1===(i=e,i&&_(i)?Array.from(new Set(Y(i))):i).length);var i}_getXScale(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}_getYScale(){return this._isHorizontal?this._valueScale:this._stateScale}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:S(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this._computeWidth(),height:this._computeHeight()},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:p(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:x3(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}_getLayoutAttrs(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}_createOrUpdateComponent(t){if(this._visible){const e=!1!==this._spec.showBackgroundChart,i=this._getAttrs(e),s=this._relatedAxisComponent;if(this._component)this._component.setAttributes(i),t&&(this._component.setPreviewData(this._data.getDataView().latestData),e&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>_3(t,this._stateScale,x3(s,this._isHorizontal))))));else{const t=this.getContainer();this._component=new sL(i),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?e&&this._component.setPreviewPointsY1(this._dataToPositionY2):e&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>_3(t,this._stateScale,x3(s,this._isHorizontal)))),this._component.addEventListener("dataZoomChange",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component)}}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,c,d;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:f={},selectedBackgroundChart:m={}}=this._spec;return{backgroundStyle:$j(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:$j(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:$j(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:$j(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:$j(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:$j(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:$j(g.style)},selectedBackgroundStyle:$j(this._spec.selectedBackground.style),dragMaskStyle:$j(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:Lz($j(null===(l=f.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},$j(null===(h=f.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Lz($j(null===(c=m.line)||void 0===c?void 0:c.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},$j(null===(d=m.area)||void 0===d?void 0:d.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=IV(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}onDataUpdate(){super.onDataUpdate(),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}_getPreviewStateScale(){return this._previewStateScale||(x3(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}};P3.type=r.dataZoom,P3.transformerConstructor=w3,P3.builtInTheme={dataZoom:B3},P3.specKey="dataZoom";const O3=()=>{Fz.registerComponent(P3.type,P3)},I3={width:!0,height:!0,rail:!0,slider:!0,round:!0,innerPadding:!0,minSliderSize:!0};let R3=class extends M3{constructor(t,e){var i;super(t,e),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=oN.DataZoom,this.layoutLevel=lN.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"axis"}_handleChange(t,e,i){super._handleChange(t,e,i);const s=YF(this._start,t)&&YF(this._end,e);if(this._shouldChange&&(!s||!1===this._spec.realTime)){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;const s=this._relatedAxisComponent,n=x3(s,this._isHorizontal),r=_3(t,this._stateScale,n),a=_3(e,this._stateScale,n);(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,r,a):this._handleStateChange(r,a))&&this.event.emit(tH.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}_getComponentOnlySpecKeys(){return I3}_beforeLayoutEnd(){var t,e;super._beforeLayoutEnd(),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t)}onLayoutEnd(){this._updateComponentBounds(),super.onLayoutEnd()}_updateScaleRange(){}_updateComponentBounds(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return!1===this._visible?0:S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return!1===this._visible?0:S(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r,a;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:p(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r,minSliderSize:null===(a=this._spec)||void 0===a?void 0:a.minSliderSize},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new UT(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),this._component.addEventListener("scrollUp",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return u(i)||(s.padding=i),P(null==t?void 0:t.style)||(s.railStyle=$j(t.style)),P(null==e?void 0:e.style)||(s.sliderStyle=$j(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}};R3.type=r.scrollBar,R3.builtInTheme={scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},R3.specKey="scrollBar";const D3=()=>{Fz.registerComponent(R3.type,R3)},L3=(t,e)=>{const{datum:i,title:s,content:n}=d(e)?e():e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Y(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},F3=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),z3={title:{visible:!0,autoLimit:!1,autoFit:!1,style:F3("l1FontSize","primaryFontColor")},content:{visible:!0,style:F3("l2FontSize","tertiaryFontColor")}};var j3=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};let H3=class extends jW{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=oN.Indicator,this.layoutLevel=lN.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t&&!1!==t.visible))}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Y(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex))}_compareSpec(t,e){const i=super._compareSpec(t,e);return!!U(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}initEvent(){this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(Xj(e))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))):(this.event.on("element-select:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(Xj(e))})),this.event.on("element-select:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){oH(this._option.dataSet,"indicatorFilter",L3);const t=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:()=>({title:this._title,content:this._content,datum:()=>this._activeDatum})}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new FN(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:n}=t.getLayoutStartPoint(),r=this._spec,{content:a,offsetX:o,offsetY:l,limitRatio:h,title:c}=r,d=j3(r,["content","offsetX","offsetY","limitRatio","title"]),u=[];return Y(a).forEach((t=>{const e=Lz({},this._theme.content,t);u.push({visible:!1!==e.visible&&(!e.field||null!==this._activeDatum),space:e.space||this._gap,autoLimit:e.autoLimit,autoFit:e.autoFit,fitPercent:e.fitPercent,fitStrategy:e.fitStrategy,style:Object.assign(Object.assign({},Kj(H(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:e,height:i},zIndex:this.layoutZIndex,x:s,y:n,dx:o?Ez(o,this._computeLayoutRadius()):0,dy:l?Ez(l,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==c.visible&&(!p(c.field)||null!==this._activeDatum),space:c.space||this._gap,autoLimit:c.autoLimit,autoFit:c.autoFit,fitPercent:c.fitPercent,fitStrategy:c.fitStrategy,style:Object.assign(Object.assign({},Kj(H(c.style,["text"]),this._activeDatum)),{text:this._createText(c.field,c.style.text)})},content:u},d)}_createOrUpdateIndicatorComponent(t){if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)U(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new _F(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",((t,e)=>this._delegateEvent(this._indicatorComponent,t,e)))}this._cacheAttrs=t}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":d(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>!!e.getSeriesInId(t.context.modelId)))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}};H3.type=r.indicator,H3.builtInTheme={indicator:z3},H3.specKey="indicator";const N3=()=>{Fz.registerComponent(H3.type,H3)},V3=["sum","average","min","max","variance","standardDeviation","median"];var U3=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};function W3(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=X(s),r=$(s);return e<n||e>r}function G3(t,e){return t?`${t}_${e}_extend`:`marker_${e}_extend`}function Y3(t,e,i,s,n,r,a){var o,l;const{relativeSeries:h}=s;let c;return S(t.x)&&W3(e,t.x,i)&&(null===(l=null==h?void 0:(o=h.getXAxisHelper()).setExtendDomain)||void 0===l||l.call(o,G3(a,"xAxis"),t.x)),c=Cz(t.x)?q3(t.x,n)+r.x:Z3(h.getXAxisHelper(),[t.x])+r.x,c}function K3(t,e,i,s,n,r,a){var o,l;const{relativeSeries:h}=s;let c;return S(t.y)&&W3(e,t.y,i)&&(null===(l=null===(o=h.getYAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,G3(a,"yAxis"),t.y)),c=Cz(t.y)?q3(t.y,n)+r.y:Z3(h.getYAxisHelper(),[t.y])+r.y,c}function $3(t,e,i,s,n){var r,a;const{relativeSeries:o}=s;return S(t.angle)&&W3(e,t.angle,i)&&(null===(a=null===(r=o.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,G3(n,"angleAxis"),t.angle)),Z3(o.angleAxisHelper,[t.angle])}function X3(t,e,i,s,n){var r,a;const{relativeSeries:o}=s;return S(t.radius)&&W3(e,t.radius,i)&&(null===(a=null===(r=o.radiusAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,G3(n,"radiusAxis"),t.radius)),Z3(o.radiusAxisHelper,[t.radius])}function q3(t,e){return Number(t.substring(0,t.length-1))*e/100}function Z3(t,e){const i=t.getScale(0);return II(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function J3(t){return V3.includes(t)}function Q3(t,e,i,s,n,r=!1,a){const o=e.getRegion(),l=o.getLayoutStartPoint(),h=i.getRegion(),c=h.getLayoutStartPoint(),d=Math.abs(Math.min(l.x,c.x)-Math.max(l.x+o.getLayoutRect().width,c.x+h.getLayoutRect().width)),u=Math.abs(Math.min(l.y,c.y)-Math.max(l.y+o.getLayoutRect().height,c.y+h.getLayoutRect().height)),g={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},f=[],m=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,v=s.getXAxisHelper(),y=s.getYAxisHelper(),_=v.getScale(0).domain(),b=y.getScale(0).domain(),x=r&&!v.isContinuous&&!!v.getBandwidth,S=r&&!y.isContinuous&&!!y.getBandwidth,A={min:null,max:null},k={min:null,max:null};return m.forEach((t=>{const e=p(t.x),i=p(t.y);let s,r;if(e&&i)s=Y3(t,_,n,g,d,l,a),r=K3(t,b,n,g,u,l,a),t5(s,x,A,f.length),t5(r,S,k,f.length),f.push([{x:s,y:r}]);else if(e){s=Y3(t,_,n,g,d,l,a),r=Math.max(l.y+o.getLayoutRect().height,c.y+h.getLayoutRect().height);const e=Math.min(l.y,c.y);t5(s,x,A,f.length),f.push([{x:s,y:r},{x:s,y:e}])}else if(i){s=Math.min(l.x,c.x),r=K3(t,b,n,g,u,l,a);const e=Math.max(l.x+o.getLayoutRect().width,c.x+h.getLayoutRect().width);t5(r,S,k,f.length),f.push([{x:s,y:r},{x:e,y:r}])}})),function(t,e,i,s,n){if(s.min||s.max){const i=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());s.min&&t[s.min.index].forEach((t=>t.x-=i/2)),s.max&&t[s.max.index].forEach((t=>t.x+=i/2))}if(n.min||n.max){const e=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());n.min&&t[n.min.index].forEach((t=>t.y-=e/2)),n.max&&t[n.max.index].forEach((t=>t.y+=e/2))}}(f,v,y,A,k),f}function t5(t,e,i,s){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:s}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:s})),t}function e5(t,e,i,s,n,r){const a={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},o=[],l=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,h=s.angleAxisHelper.getScale(0).domain(),c=s.radiusAxisHelper.getScale(0).domain(),d=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return l.forEach((t=>{const e=p(t.angle),i=p(t.radius);if(e&&i){const e=$3(t,h,n,a,r),i=X3(t,c,n,a,r);o.push([{angle:e,radius:i}])}else if(e){const e=$3(t,h,n,a,r);o.push([{angle:e,radius:-d},{angle:e,radius:d}])}else if(i){const e=X3(t,c,n,a,r);o.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),o}function i5(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{p(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}function s5(t,e,i,s,n){const r=[],a=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,o=_(s);return a.forEach(((t,a)=>{var l,h,c,d;const u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,p=u.getRegion(),g=p.getLayoutStartPoint(),{width:f,height:m}=p.getLayoutRect();let v=0,y=0;if(s){const t=o?s[a]:s,e=t.x,i=t.y;e&&(v=Cz(e)?Number(e.substring(0,e.length-1))*f/100:e),i&&(y=Cz(i)?Number(i.substring(0,i.length-1))*m/100:i)}const _=u.getXAxisHelper().getScale(0).domain(),b=u.getYAxisHelper().getScale(0).domain(),x=Y(t.x),A=Y(t.y);1===x.length&&S(x[0])&&W3(_,x[0],i)&&(null===(h=null===(l=u.getXAxisHelper())||void 0===l?void 0:l.setExtendDomain)||void 0===h||h.call(l,G3(n,"xAxis"),x[0])),1===A.length&&S(A[0])&&W3(b,A[0],i)&&(null===(d=null===(c=u.getYAxisHelper())||void 0===c?void 0:c.setExtendDomain)||void 0===d||d.call(c,G3(n,"yAxis"),A[0])),r.push({x:Z3(u.getXAxisHelper(),x)+g.x+v,y:Z3(u.getYAxisHelper(),A)+g.y+y})})),r}function n5(t,e,i,s){const n=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var r,a,o,l;const h=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,c=h.angleAxisHelper.getScale(0).domain(),d=h.radiusAxisHelper.getScale(0).domain(),u=Y(t.angle),p=Y(t.radius);1===u.length&&S(u[0])&&W3(c,u[0],i)&&(null===(a=null===(r=h.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,G3(s,"angleAxis"),u[0])),1===p.length&&S(p[0])&&W3(d,p[0],i)&&(null===(l=null===(o=h.radiusAxisHelper)||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,G3(s,"radiusAxis"),p[0])),n.push({angle:Z3(h.angleAxisHelper,u),radius:Z3(h.radiusAxisHelper,p)})})),n}function r5(t,e,i){let{x:s,y:n}=t;return Cz(s)&&(s=q3(s,e)),Cz(n)&&(n=q3(n,i)),{x:s,y:n}}function a5(t,e,i){let s;if(s=d(t)?Y(t(e.getData().getLatestData(),e)):Y(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=r5(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>r5(t,n,r)))}function o5(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.x<e&&(e=r.x),r.x+a.width>i&&(i=r.x+a.width),r.y<s&&(s=r.y),r.y+a.height>n&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function l5(t,e,i){const{labelBackground:s={},style:n,shape:r}=t,a=U3(t,["labelBackground","style","shape"]);if(!1!==t.visible){const t=a;return(null==r?void 0:r.visible)?t.shape=Object.assign({visible:!0},$j(r.style)):t.shape={visible:!1},!1!==s.visible?(t.panel=Object.assign({visible:!0,customShape:s.customShape},c5($j(s.style),e,i)),p(s.padding)&&(t.padding=ui(s.padding))):(t.panel={visible:!1},t.padding=0),n&&(t.textStyle=c5($j(n),e,i)),t}return{visible:!1}}function h5(t,e,i){for(const s in t)d(t[s])&&(t[s]=t[s](e,i));return t}function c5(t,e,i){return d(t)?t(e,i):t}function d5(t,e){return d(t)?t(e):t}function u5(t,e,i){return p(t)?"regionLeft"===e?i.getLayoutStartPoint().x-t.x:"regionRight"===e?i.getLayoutStartPoint().x+i.getLayoutRect().width-t.x:"regionTop"===e?i.getLayoutStartPoint().y-t.y:"regionBottom"===e?i.getLayoutStartPoint().y+i.getLayoutRect().height-t.y:e:e}function p5(t){return{isXProcess:p(t.x),isYProcess:p(t.y),isX1Process:p(t.x1),isY1Process:p(t.y1),isAngleProcess:p(t.angle),isRadiusProcess:p(t.radius),isAngle1Process:p(t.angle1),isRadius1Process:p(t.radius1),isCoordinatesProcess:p(t.coordinates),isValidProcess:p(t.process)}}function g5(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h,isValidProcess:c}=p5(t);return{doXProcess:e&&!i&&!n,doXYY1Process:e&&i&&n,doYProcess:i&&!e&&!s,doYXX1Process:i&&e&&s,doXYProcess:e&&i&&s&&n,doAngleProcess:r&&!o&&!a&&!l,doRadiusProcess:a&&!l&&!r&&!o,doAngRadRad1Process:r&&!o&&a&&l,doRadAngAng1Process:a&&r&&o&&!l,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h&&(!c||"process"in t&&"xy"in t.process)}}function f5(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h}=p5(t);return{doXProcess:e&&s&&!i&&!n,doYProcess:i&&n&&!e&&!s,doXYProcess:e&&s&&i&&n,doAngleProcess:r&&o&&!a&&!l,doRadiusProcess:a&&l&&!r&&!o,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h}}function m5(t){return{doXYProcess:p(t.x)&&p(t.y),doPolarProcess:p(t.angle)&&p(t.radius),doGeoProcess:p(t.areaName)}}var v5=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};function y5(t,e){let i;if(e.coordinates){const t=e,{coordinates:s,coordinateType:n,getSeriesByIdOrIndex:r}=t,a=v5(t,["coordinates","coordinateType","getSeriesByIdOrIndex"]);let o,l;if(d(s)){const t=e.getRelativeSeries();o=s(t.getData().getLatestData(),t)}else o=s;o=Y(o),i=o.map((t=>{const e=r(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===n){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:o,yFieldIndex:h}=t;let c=i;p(r)&&(c=Y(i)[r]),n&&Y(i).includes(n)&&(c=n);let d=s;p(h)&&(d=Y(s)[h]),o&&Y(s).includes(o)&&(d=o),l=Object.assign({x:void 0,y:void 0},a),y(t[c])&&J3(t[c])?l.x={field:c,aggrType:t[c]}:l.x=Y(c).map((e=>t[e])),y(t[d])&&J3(t[d])?l.y={field:d,aggrType:t[d]}:l.y=Y(d).map((e=>t[e]))}else if("polar"===n){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let o=s;p(r)&&(o=Y(s)[r]),n&&Y(s).includes(n)&&(o=n);const h=i;l=Object.assign({angle:void 0,radius:void 0},a),y(t[o])&&J3(t[o])?l.angle={field:o,aggrType:t[o]}:l.angle=Y(o).map((e=>t[e])),y(t[h])&&J3(t[h])?l.radius={field:h,aggrType:t[h]}:l.radius=Y(h).map((e=>t[e]))}return l.getRefRelativeSeries=()=>e,l}))}else i=e;const s=[];return i.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(p(e.x)){const s=e.x;_(s)?i.x=s.map((i=>b5(i,t,e))):i.x=b5(s,t,e)}if(p(e.y)){const s=e.y;_(s)?i.y=s.map((i=>b5(i,t,e))):i.y=b5(s,t,e)}if(p(e.angle)){const s=e.angle;_(s)?i.angle=s.map((i=>b5(i,t,e))):i.angle=b5(s,t,e)}if(p(e.radius)){const s=e.radius;_(s)?i.radius=s.map((i=>b5(i,t,e))):i.radius=b5(s,t,e)}if(p(e.areaName)){const s=e.areaName;i.areaName=b5(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)})),s}const _5={min:(t,e)=>KF(t[0].latestData,e.field),max:(t,e)=>$F(t[0].latestData,e.field),sum:function(t,e){return XF(t[0].latestData,e.field)},average:function(t,e){return qF(t[0].latestData,e.field)},variance:function(t,e){return ZF(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(ZF(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return ct(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function b5(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(d(t))return t(a,o,l,s,n,r);if(m(t)){const{aggrType:i,field:s}=t;return _5[i](e,{field:s})}return t}function x5(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}const S5=t=>{var e;const i=null===(e=null==t?void 0:t.dataSet)||void 0===e?void 0:e.dataViewMap;return i?Object.values(i).filter(Boolean):[]},A5=(t,e)=>{var i,s;null===(i=null==t?void 0:t.target)||void 0===i||i.removeListener("change",e.reRunAllTransform),null===(s=null==t?void 0:t.target)||void 0===s||s.removeListener("markRunning",e.markRunning)},k5=t=>{if(!t)return;S5(t).forEach((e=>{A5(e,t)}));const e=null==t?void 0:t.rawData;Array.isArray(e)&&e.forEach((e=>{A5(e,t)}))},C5=(t,e)=>{if(!t)return;const i=new Set(S5(t)),s=[],n=t=>{const r=null==t?void 0:t.rawData;Array.isArray(r)&&r.forEach((t=>{i.has(t)&&e(t)&&!s.includes(t)&&(s.push(t),n(t))}))};n(t),(t=>{const e=Array.from(new Set(t.filter(Boolean)));e.length&&(e.forEach(k5),e.forEach((t=>{var e;null===(e=t.destroy)||void 0===e||e.call(t)})))})([t,...s])},M5="__vchart_marker_coordinate__",w5=["coordinate","coordinates","x","y","x1","y1","angle","angle1","radius","radius1"],T5=["position","positions","coordinatesOffset","regionRelative"],B5=t=>Array.isArray(t)?t.map(B5):t&&"object"==typeof t?"function"!=typeof t.formatMethod?t:Object.assign(Object.assign({},t),{formatMethod:"__vchart_marker_format_method__"}):t,E5=t=>{if(Array.isArray(t))return t.map(E5);if(!t||"object"!=typeof t)return t;const e=Object.assign({},t);return Object.keys(e).forEach((t=>{"style"===t||t.endsWith("Style")?e[t]="__vchart_marker_style__":e[t]=E5(e[t])})),e},P5=(t,e)=>{var i;if(!t||"object"!=typeof t)return t;const s=Object.assign({},t);e.normalizeDomainPosition&&w5.forEach((t=>{s[t]=M5})),e.normalizeAutoRange&&"autoRange"in s&&(s.autoRange="__vchart_marker_auto_range__"),T5.forEach((t=>{t in s&&(s[t]=M5)})),"label"in s&&(s.label=B5(s.label)),Object.keys(s).forEach((t=>{s[t]=E5(s[t])}));const n=null===(i=s.itemContent)||void 0===i?void 0:i.text;return n&&"object"==typeof n&&(s.itemContent=Object.assign(Object.assign({},s.itemContent),{text:Object.assign(Object.assign({},B5(n)),{text:"__vchart_marker_text__"})})),s};class O5 extends jW{constructor(){super(...arguments),this.layoutType="none",this._markerDataChangeHandler=null,this._markerDataOwned=!1,this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}getMarkerData(){return this._markerData}static _getMarkerCoordinateType(t){return"cartesian"}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType))}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkerAttributeContext(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getAutoRangeExtendDomainKeyPrefix(){return`marker_${this.type}_${this.id}`}_getAutoRangeExtendDomainKey(t){return`${this._getAutoRangeExtendDomainKeyPrefix()}_${t}_extend`}_clearAutoRangeExtendDomain(){var t,e;Y(null===(e=(t=this._option).getAllSeries)||void 0===e?void 0:e.call(t)).forEach((t=>{var e,i,s,n,r,a,o,l,h,c;null===(s=null===(i=null===(e=null==t?void 0:t.getXAxisHelper)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.setExtendDomain)||void 0===s||s.call(i,this._getAutoRangeExtendDomainKey("xAxis"),void 0),null===(a=null===(r=null===(n=null==t?void 0:t.getYAxisHelper)||void 0===n?void 0:n.call(t))||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,this._getAutoRangeExtendDomainKey("yAxis"),void 0),null===(l=null===(o=null==t?void 0:t.angleAxisHelper)||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,this._getAutoRangeExtendDomainKey("angleAxis"),void 0),null===(c=null===(h=null==t?void 0:t.radiusAxisHelper)||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,this._getAutoRangeExtendDomainKey("radiusAxis"),void 0)}))}_updateMarkerLayout(){this._clearAutoRangeExtendDomain(),this._markerLayout()}_getFieldInfoFromSpec(t,e,i){return y(e)&&J3(e)?{field:i.getSpec()[{x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"}[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Y(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const e=new io;return e.registerParser("array",s),new so(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}_setMarkerData(t,e=!1){this._releaseMarkerData(),this._markerData=t,this._markerDataOwned=e}_bindMarkerDataChange(){var t;(null===(t=this._markerData)||void 0===t?void 0:t.target)&&(this._markerDataChangeHandler=()=>{this._updateMarkerLayout()},this._markerData.target.on("change",this._markerDataChangeHandler))}_releaseMarkerData(){const t=this._markerData;(null==t?void 0:t.target)&&this._markerDataChangeHandler&&t.target.removeListener("change",this._markerDataChangeHandler),this._markerDataChangeHandler=null,this._markerDataOwned&&C5(t,(t=>t.name===`${this.type}_${this.id}_data`)),this._markerData=null,this._markerDataOwned=!1}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._updateMarkerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(p(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._updateMarkerLayout.bind(this)))}clear(){super.clear(),this._markerComponent=null,this._firstSeries=null}release(){this._releaseMarkerData(),super.release()}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=sz(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e){u(this._spec.offsetX)||(this._layoutOffsetX=Mz(this._spec.offsetX,e.width,e)),u(this._spec.offsetY)||(this._layoutOffsetY=Mz(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e)}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(e,t)||(i.reRender=!0,i.change=!0,i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake||i.reCompile||!this._isAutoRangeSpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,scaleDomain:!0,layout:!0,render:!0}):i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}_isComponentOnlySpecChange(t,e){const i=!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange);return U(P5(e,{normalizeDomainPosition:i}),P5(t,{normalizeDomainPosition:i}))}_isAutoRangeSpecChange(t,e){return!(!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange))&&U(P5(e,{normalizeDomainPosition:!0,normalizeAutoRange:!0}),P5(t,{normalizeDomainPosition:!0,normalizeAutoRange:!0}))}reInit(t){super.reInit(t),this._releaseMarkerData(),this._bindSeries(),this._initDataView(),this._buildMarkerAttributeContext(),this._markerComponent&&this._updateMarkerLayout()}_initCommonDataView(){const{options:t}=this._computeOptions(),e=this._getRelativeDataView();oH(this._option.dataSet,"markerAggregation",y5),oH(this._option.dataSet,"markerFilter",x5),this._releaseMarkerData();const i=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});i.parse([e],{type:"dataview"}),i.transform({type:"markerAggregation",options:t}),i.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(i,!0),this._bindMarkerDataChange()}}function I5(t,e){return function(t,e,i){const{predict:s}=Ft(t,(t=>t[e]),(t=>t[i])),n=KF(t,e),r=$F(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}class R5 extends O5{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=oN.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=g5(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,c,d,u;const{startSymbol:p={},endSymbol:g={}}=this._spec,f=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),m={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:c5($j(null===(n=this._spec.line)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:f.map((t=>l5(t,this._markerData,this._markAttributeContext))),state:{line:h5(null!==(o=null===(a=this._spec.line)||void 0===a?void 0:a.state)&&void 0!==o?o:{},this._markerData,this._markAttributeContext),lineStartSymbol:h5(null!==(h=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==h?h:{},this._markerData,this._markAttributeContext),lineEndSymbol:h5(null!==(d=null===(c=this._spec.endSymbol)||void 0===c?void 0:c.state)&&void 0!==d?d:{},this._markerData,this._markAttributeContext),label:f.map((t=>{var e;return h5(null!==(e=t.state)&&void 0!==e?e:{},this._markerData,this._markAttributeContext)})),labelBackground:f.map((t=>{var e,i;return h5(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},this._markerData,this._markAttributeContext)}))},animation:null!==(u=this._spec.animation)&&void 0!==u&&u,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return p.visible?m.startSymbol=Object.assign(Object.assign({},p),{visible:!0,style:c5($j(p.style),this._markerData,this._markAttributeContext)}):m.startSymbol={visible:!1},g.visible?m.endSymbol=Object.assign(Object.assign({},g),{visible:!0,style:c5($j(g.style),this._markerData,this._markAttributeContext)}):m.endSymbol={visible:!1},this._newMarkLineComponent(m)}_getUpdateMarkerAttrs(){var t,e;const i=this._spec,s=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=this._computePointsAttr(),l=a.getViewData().latestData,h=s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData;let c;if(i.clip||Y(i.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:s}=o5([n.getRegion(),r.getRegion(),a.getRegion()]);c={x:t,y:i,width:e-t,height:s-i}}const d=Y((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),u=Y(this._spec.label),p=d.map(((t,e)=>{const i=u[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,l):null==t?void 0:t.text})}));return Object.assign(Object.assign({},o),{label:p,limitRect:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d}=g5(t);if(this._setMarkerData(this._getRelativeDataView()),!(i||s||n||r||a||o||l||h||c||d||e))return;oH(this._option.dataSet,"markerAggregation",y5),oH(this._option.dataSet,"markerRegression",I5),oH(this._option.dataSet,"markerFilter",x5);const{options:u,needAggr:p,needRegr:g,processData:f}=this._computeOptions(),m=new so(this._option.dataSet);m.parse([f],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:u}),g&&m.transform({type:"markerRegression",options:u}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(m,!0),this._bindMarkerDataChange()}}R5.specKey="markLine";const D5=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),L5={style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}},refY:5},F5={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:D5(!1),endSymbol:D5(!0),label:L5};class z5 extends R5{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new VL(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=p(e.coordinates),o=p(e.process),l=o&&p(e.process.x),h=o&&p(e.process.y),c=p(e.positions),d=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:g,doXYY1Process:f,doYXX1Process:m,doXYProcess:v,doCoordinatesProcess:y}=g5(e);let _=[];if(u||f||g||m||v||a&&l||a&&h){const t=Q3(i,s,n,r,d,!1,this._getAutoRangeExtendDomainKeyPrefix());_=1===t.length?t[0]:t.map((t=>t[0]))}else y?_=s5(i,r,d,e.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):c&&(_=a5(e.positions,r,e.regionRelative));return{points:_}}_markerLayout(){var t,e,i,s,n;const r=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const n=this._startRelativeSeries,a=this._endRelativeSeries,{multiSegment:o,mainSegmentIndex:l}=this._spec.line||{},{connectDirection:h,expandDistance:c=0}=this._spec;let d;if(Cz(c)){const t=n.getRegion(),e=t.getLayoutStartPoint(),i=a.getRegion(),s=i.getLayoutStartPoint();if("bottom"===h||"top"===h){const n=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));d=Number(c.substring(0,c.length-1))*n/100}else{const n=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));d=Number(c.substring(0,c.length-1))*n/100}}else d=c;const{points:u,limitRect:g}=r;if(!u||u.length<2)return void(null===(t=this._markerComponent)||void 0===t||t.setAttributes(r));const f=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(u[0],u[1],h,d);let m;m=o&&p(l)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(u[0],u[1],h,d));const v=Y((null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{}).label),y=Y(r.label),_=Y(this._spec.label);null===(s=this._markerComponent)||void 0===s||s.setAttributes({points:o?[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]]]:f,label:y.map(((t,e)=>{var i,s,n,r;let a=0,o=0,l=null!==(i=m.dx)&&void 0!==i?i:0,h=null!==(s=m.dy)&&void 0!==s?s:0;const c=null!==(n=_[e])&&void 0!==n?n:_[0];return k(null==c?void 0:c.refX)&&(a+=c.refX),k(null==c?void 0:c.refY)&&(o+=c.refY),k(null==c?void 0:c.dx)&&(l+=c.dx),k(null==c?void 0:c.dy)&&(h+=c.dy),Object.assign(Object.assign(Object.assign({},t),m),{refX:a,refY:o,dx:l,dy:h,textStyle:Object.assign(Object.assign({},null===(r=v[e])||void 0===r?void 0:r.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:g,multiSegment:o,mainSegmentIndex:l,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(n=this._markerComponent)||void 0===n||n.setAttributes(r)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:c,doCoordinatesProcess:d}=g5(n);if(c)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(d){if(t=this._processSpecCoo(n),i=!1,e=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&p(n.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&p(n.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&p(n.process.xy)){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}z5.type=r.markLine,z5.coordinateType="cartesian",z5.builtInTheme={markLine:F5};const j5=()=>{Fz.registerComponent(z5.type,z5),NL()};class H5 extends R5{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=g5(this._spec);return e||i?new GL(t):new VL(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d,doCoordinatesProcess:u}=g5(e);let p=[],g={};const f={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||c||d){const t=e5(i,s,n,r,a,this._getAutoRangeExtendDomainKeyPrefix());p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:f}:{points:p.map((t=>ce(f,t.radius,t.angle)))}}else u&&(p=n5(i,r,a,this._getAutoRangeExtendDomainKeyPrefix()),g={points:p.map((t=>ce(f,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=g5(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}H5.type=r.polarMarkLine,H5.coordinateType="polar",H5.builtInTheme={polarMarkLine:F5};const N5=()=>{Fz.registerComponent(H5.type,H5),GL._animate=SL,NL()};let V5=class extends jW{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=oN.Title,this.layoutLevel=lN.Title,this._orient="top",this._orient=kz(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return RV(t,this.specKey,r.title,(t=>!1!==t.visible))}_compareSpec(t,e){const i=super._compareSpec(t,e),s=!U(e,t);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,s&&!i.reMake&&(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}afterSetLayoutStartPoint(t){k(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),k(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:k(t.width())?t.width():0,height:this._spec.height?this._spec.height:k(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r;if(!1===this._spec.visible)return{visible:!1};const a=this.getLayoutRect(),o=Mz(this._spec.width,a.width,null,a.width),l=Mz(this._spec.maxWidth,a.width,null,a.width),h=Math.max(Math.min(o,l,a.width),0),c=p(this._spec.text)&&""!==this._spec.text,d=p(this._spec.subtext)&&""!==this._spec.subtext,u=Object.assign(Object.assign({},H(this._spec,["padding"])),{textType:null!==(t=this._spec.textType)&&void 0!==t?t:"text",text:c?this._spec.text:void 0,subtextType:null!==(e=this._spec.subtextType)&&void 0!==e?e:"text",subtext:d?this._spec.subtext:void 0,x:null!==(i=this._spec.x)&&void 0!==i?i:0,y:null!==(s=this._spec.y)&&void 0!==s?s:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:h,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(n=this._spec.align)&&void 0!==n?n:"left",verticalAlign:null!==(r=this._spec.verticalAlign)&&void 0!==r?r:"top",textStyle:Object.assign({maxLineWidth:h},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:h},this._spec.subtextStyle)});if(c&&(u.textStyle.width=h),d&&(u.subtextStyle.width=h),p(this._spec.width)){const t=Math.max(Math.min(o,a.width),0);c?u.textStyle.width=t:delete u.textStyle.width,d&&(u.subtextStyle.width=t)}return u}_createOrUpdateTitleComponent(t){if(this._titleComponent)U(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new vF(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",((t,e)=>this._delegateEvent(i,t,e)))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}};V5.type=r.title,V5.specKey=r.title,V5.builtInTheme={title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}}};const U5=()=>{Fz.registerComponent(V5.type,V5)};class W5 extends O5{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=oN.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=f5(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o;const l=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),h={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:c5($j(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:l.map((t=>l5(t,this._markerData,this._markAttributeContext))),state:{area:h5(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData,this._markAttributeContext),label:l.map((t=>h5(t.state,this._markerData,this._markAttributeContext))),labelBackground:l.map((t=>{var e;return h5(null===(e=t.labelBackground)||void 0===e?void 0:e.state,this._markerData,this._markAttributeContext)}))},animation:null!==(o=this._spec.animation)&&void 0!==o&&o,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}_markerLayout(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=this._computePointsAttr(),o=this._getRelativeDataView().latestData,l=i?i.latestData[0]&&i.latestData[0].latestData?i.latestData[0].latestData:i.latestData:o;let h;if(e.clip||Y(e.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:a}=o5([s.getRegion(),n.getRegion(),r.getRegion()]);h={x:t,y:i,width:e-t,height:a-i}}if(this._markerComponent){const e=Y(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),i=Y(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},a),{label:e.map(((t,e)=>{const s=i[e]||{};return Object.assign(Object.assign({},t),{text:s.formatMethod?s.formatMethod(l,o):null==t?void 0:t.text})})),limitRect:h,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=f5(t);if(!(e||i||s||n||r||a||o))return null;this._initCommonDataView()}}W5.specKey="markArea";const G5={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}};class Y5 extends W5{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new WL(t)}_computePointsAttr(){var t,e;const i=this._spec,s=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,{doXProcess:o,doYProcess:l,doXYProcess:h,doCoordinatesProcess:c}=f5(i),d=p(i.positions),u=null!==(t=i.autoRange)&&void 0!==t&&t,g=null!==(e=i.includeFullBand)&&void 0!==e&&e;let f=[],m=[];if(h){m=Q3(s,n,r,a,u,g,this._getAutoRangeExtendDomainKeyPrefix());const[t,e]=m;t&&t.length&&e&&e.length&&(f=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(o||l){m=Q3(s,n,r,a,u,g,this._getAutoRangeExtendDomainKeyPrefix());const[t,e]=m;t&&t.length&&e&&e.length&&(f=[...t,e[1],e[0]])}else c?f=s5(s,a,u,i.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):d&&(f=a5(i.positions,a,i.regionRelative));return{points:f}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=f5(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}Y5.type=r.markArea,Y5.coordinateType="cartesian",Y5.builtInTheme={markArea:G5};const K5=()=>{Fz.registerComponent(Y5.type,Y5),UL()};class $5 extends W5{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=f5(this._spec);return i||e||s?new YL(t):new WL(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=f5(e),c=null!==(t=e.autoRange)&&void 0!==t&&t;let d,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=e5(i,s,n,r,c,this._getAutoRangeExtendDomainKeyPrefix());l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(d=n5(i,r,c,this._getAutoRangeExtendDomainKeyPrefix()),u={points:d.map((t=>ce(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=f5(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}$5.type=r.polarMarkArea,$5.coordinateType="polar",$5.builtInTheme={polarMarkArea:G5};const X5=()=>{Fz.registerComponent($5.type,$5),YL._animate=kL,UL()},q5=t=>$j(Object.assign({},t)),Z5=t=>Object.assign(Object.assign({},t),{style:Object.assign({},$j(t.style))}),J5=t=>{var e,i,s,n,r,a,o,l,h,c,d,u,p,g,f;const m=q5(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),v=q5(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),y=(k=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},$j(Object.assign({},k))),_=Z5(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),b=Z5(null!==(c=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==c?c:{}),x=Z5(null!==(u=null===(d=null==t?void 0:t.controller)||void 0===d?void 0:d.backward)&&void 0!==u?u:{}),S=Z5(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(f=t.orient)&&void 0!==f?f:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:m,railStyle:v,handlerStyle:y}),controller:Object.assign(Object.assign({},t.controller),{start:_,pause:b,backward:x,forward:S})});var k;return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},Q5=t=>"left"===t||"right"===t,t4=t=>"top"===t||"bottom"===t;let e4=class extends jW{constructor(){super(...arguments),this.layoutZIndex=oN.Player,this.layoutLevel=lN.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},J5(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},J5(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?U(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new IF(t):this._playerComponent=new LF(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Y(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Y(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Y(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Y(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=Q5(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=Q5(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,c=Math.max(...Y(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Y(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Y(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Y(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=c?h-c:0},this.autoPlayCallback=()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&(this._playerComponent.pause(),this._playerComponent.play())},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.off(tH.rendered,this.autoPlayCallback),this._option.globalInstance.on(tH.rendered,this.autoPlayCallback),this._playerComponent.addEventListener(wF.end,(()=>{var t;this.event.emit(tH.playerEnd,{model:this}),this._alternate&&"discrete"===this._spec.type&&(this._direction="default"===this._direction?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:"reverse"===this._direction?this._specs.length-2:1})),(null===(t=this._spec)||void 0===t?void 0:t.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(wF.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(wF.backward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(wF.forward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(wF.play,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(wF.pause,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}_compareSpec(t,e){const i=super._compareSpec(t,e),s=!U(e,t);return(null==e?void 0:e.type)!==(null==t?void 0:t.type)?(i.reMake=!0,i):(!s||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i)}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),k(t.x)){const e=Q5(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(k(t.y)){const e=t4(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return S(this._spec.width)?Math.min(t.width,Number(this._spec.width)):Q5(this._orient)?this._maxSize():t.width}_computeHeight(t){return S(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):t4(this._orient)?this._maxSize():t.height}_computeDx(t){return Q5(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return t4(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){const e=this._specs[t];this._option.globalInstance.updateFullData(e.data),this.event.emit(tH.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}release(){this._option.globalInstance.off(tH.rendered,this.autoPlayCallback)}};e4.builtInTheme={player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}}},e4.specKey="player",e4.type=r.player;const i4=()=>{Fz.registerComponent(e4.type,e4)};class s4 extends jW{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=oN.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,U(e,t)||(i.change=!0,i.reMake||i.reCompile?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}_getDataLabelType(t,e){const i=t.type;return"line"===i||"area"===i?null!=e?e:"line-data":"rect"===i?"rect":"arc"===i?"arc":"symbol"===i||"cell"===i?"symbol":t.setDataLabelType?t.setDataLabelType():""}_setTransformOfComponent(t,e){t.setAttributeTransform((({labelStyle:t,size:i,itemEncoder:s})=>{const n=i(),r=gz({type:"palette",key:"secondaryFontColor"},this.getColorScheme());return{dataLabels:Y(e).map(((e,i)=>{const a=t(i),o=[],l=e.getGraphics();if(l)return a.data&&a.data.length?a.data.forEach(((t,e)=>{if(l[e]){const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}})):l.forEach((t=>{const{data:e,diffState:n}=t.context;n!==TN.exit&&e.forEach(((t,{})=>{const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}))})),m(a.overlap)&&u(a.overlap.size)&&(a.overlap.size=Object.assign({},n)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:e.getProductId(),getBaseMarks:()=>l},a),{type:this._getDataLabelType(e,a.type),data:o})})),size:n}}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getComponent();i&&t.push(i)})),t}clear(){super.clear(),this.getMarks().forEach((t=>{t&&t.clearComponent()}))}}s4.type=r.label;class n4 extends F${constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}render(){}}n4.type="text",n4.constructorType="label";const r4=()=>{z$(),Fz.registerMark(n4.constructorType,n4)};class a4 extends DW{_initTheme(t,e){return{spec:t,theme:this._theme}}}class o4 extends s4{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=a4,this.layoutZIndex=oN.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((null==e?void 0:e.region)||[]).forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&(this._labelInfoMap.forEach((t=>{t.forEach((({labelMark:t})=>{t.release()}))})),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}initEvent(){this.event.on(tH.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.disableAnimation()})),this.event.on(Jj.AFTER_MARK_RENDER_END,t)}));const t=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.enableAnimation()})),this.event.off(Jj.AFTER_MARK_RENDER_END,t)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),ez(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n<i.length;n++){const r=i[n],a=t.getMarkInName(r);a&&e[r].forEach(((e,i)=>{var n,o,l;if(e.visible){const h=this._labelInfoMap.get(s),c=this._createMark({type:"label",name:`${null!==(n=t.userId)&&void 0!==n?n:t.id}-${r}-label-${i}`},{attributeContext:t.getMarkAttributeContext()});e.showRelatedMarkTooltip&&(null===(l=null===(o=t.tooltipHelper)||void 0===o?void 0:o.activeTriggerSet.mark)||void 0===l||l.add(c)),c.setTarget(a),h.push({labelMark:c,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){const t={};this._labelComponentMap.forEach(((e,i)=>{t[i.name]=i})),this._labelInfoMap.forEach(((e,i)=>{if("region"===this._layoutRule){let s=!1;const n=`${i.getGroupMark().name}-label-component`;let r=t[n];r||(s=!0,r=this._createMark({type:"component",name:n},{componentType:"label"},{support3d:this._spec.support3d})),r&&(s&&(r.setSkipBeforeLayouted(!0),this._marks.addMark(r),e.forEach((t=>{var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(r)}))),e[0]&&p(e[0].labelSpec.zIndex)&&r.setMarkConfig({zIndex:e[0].labelSpec.zIndex}),this._labelComponentMap.set(r,(()=>this._labelInfoMap.get(i))),t[n]=null)}else e.forEach(((e,s)=>{var n;let r=!1;const a=`${e.labelMark.name}-component`;let o=t[a];o||(r=!0,o=this._createMark({type:"component",name:a},{componentType:"label",noSeparateStyle:!0},{support3d:e.baseMark.getMarkConfig().support3d})),o&&(p(e.labelSpec.zIndex)&&o.setMarkConfig({zIndex:e.labelSpec.zIndex}),r&&(o.setSkipBeforeLayouted(!0),this._marks.addMark(o),null===(n=e.baseMark.getData())||void 0===n||n.addRelatedMark(o)),this._labelComponentMap.set(o,(()=>this._labelInfoMap.get(i)[s])),t[a]=null)}))})),Object.keys(t).forEach((e=>{const i=t[e];i&&(i.releaseWithExitAnimation()||i.release(),this._labelComponentMap.delete(i))}))}_initTextMarkStyle(){this._labelComponentMap.forEach(((t,e)=>{Y(t()).forEach((({labelMark:t})=>{t.setComponent(e)}))})),this._labelInfoMap.forEach((t=>{t.forEach((t=>{var e,i;const{labelMark:s,labelSpec:n,series:r}=t;if(this.initMarkStyleWithSpec(s,n),d(null==n?void 0:n.getStyleHandler)){const t=n.getStyleHandler(r);null==t||t.call(r,s,n)}(null===(i=null===(e=s.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&s.setAttribute("stroke",r.getColorAttribute(),"normal",hN.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();_(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e,t.map((({baseMark:t})=>t)),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e,i,[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:t=>{var e,n;const r=i[t],{labelSpec:a,labelMark:o,series:l}=r,h=o.getRule(),c=this._interactiveConfig(a),d=null!==(n=null===(e=this._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==n?n:0;let u=Lz({textStyle:Object.assign({pickable:!0===a.interactive},a.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},e$(h,r),Object.assign(Object.assign(Object.assign({},H(a,["position","style","state","type","stackDataFilterType","getStyleHandler"])),c),{centerOffset:d}),a.stackDataFilterType?{dataFilter:"min"===a.stackDataFilterType?t=>t.filter((t=>t.data[Sj])):t=>t.filter((t=>t.data[xj]))}:{});return l&&l.parseLabelStyle&&(u=l.parseLabelStyle(u,a,o)),"line"!==h&&"area"!==h||(u.type=h),u},size:()=>{var t;return Object.assign({padding:null===(t=i[0].labelSpec.overlap)||void 0===t?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:(t,{labelIndex:e})=>i[e]&&!i[e].labelMark.skipEncode?i$(i[e],t,i[e].labelSpec.formatMethod,i[e].labelSpec.formatter):{data:t}}),this._setTransformOfComponent(t,e)}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=_(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i})}))}getLabelInfoByTextGraphic(t){let e;const i=null==t?void 0:t.parent,s=null==i?void 0:i.parent;if(s){const t=s.getChildren().indexOf(i);this._labelComponentMap.forEach(((i,n)=>{n.getComponent()===s&&(e=Y(i())[t])}))}return e}}o4.type=r.label,o4.specKey="label",o4.transformerConstructor=a4;const l4=()=>{Fz.registerGraphicComponent(o4.type,(t=>new PD(t))),r4(),NW(),Fz.registerComponent(o4.type,o4,!0,1/0)};class h4 extends s4{constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=oN.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var t;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[_j]},"normal",hN.Default);const e=this._getSeries();null===(t=e.initTotalLabelMarkStyle)||void 0===t||t.call(e,this._textMark)}_initLabelComponent(){var t;const e=this._getSeries(),i=this._createMark({type:"component",name:`${null!==(t=e.name)&&void 0!==t?t:e.type}-total-label-component`},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.setMarkConfig({interactive:!1}),e.setSimpleStyle({labelStyle:()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r,position:a="top"}=this._spec,o=this._interactiveConfig(this._spec);return Lz({textStyle:{pickable:!0===this._spec.interactive},position:c4(t,this._baseMark.type,a),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>"bottom"===a?t.data[Sj]:t.data[xj]))},o))}},size:()=>{var t;return Object.assign({padding:null===(t=this._spec.overlap)||void 0===t?void 0:t.padding},this._regions[0].getLayoutRect())},itemEncoder:e=>i$({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod)}),this._setTransformOfComponent(e,this._baseMark)}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function c4(t,e,i="top"){var s,n;let r;const{direction:a}=t;let o;o="bottom"===i?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};const l=("horizontal"===a?null===(s=t.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=o[a][l];break;default:r="top"}return r}h4.type=r.totalLabel,h4.builtInTheme={totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}}},h4.specKey="totalLabel";const d4=()=>{Fz.registerGraphicComponent(h4.type,(t=>new PD(t))),r4(),NW(),Fz.registerComponent(h4.type,h4,!0)};var u4=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};class p4 extends O5{constructor(){super(...arguments),this.specKey="markPoint",this.layoutZIndex=oN.MarkPoint}static _getMarkerCoordinateType(t){const{doPolarProcess:e,doGeoProcess:i}=m5(t);return"polar"===t.coordinateType||e?"polar":"geo"===t.coordinateType||i?"geo":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b,x,S,A,k,C,M,w,T,B,E,P,O,I;const{itemContent:R={},itemLine:D={},targetSymbol:L={}}=this._spec,F=R,{type:z="text",text:H,symbol:N,image:V,richText:U,customMark:W,textStyle:G,symbolStyle:Y,imageStyle:K,richTextStyle:$,customMarkStyle:X,style:q={},state:Z={}}=F,J=u4(F,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]);let Q=null,tt=null,et={};"text"===z?(Q=null!==(t=null==H?void 0:H.state)&&void 0!==t?t:Z,et={dx:0,dy:0},tt=l5(Object.assign(Object.assign({},H),{style:j(et,null!==(s=null!==(i=null!==(e=null==H?void 0:H.style)&&void 0!==e?e:null==H?void 0:H.textStyle)&&void 0!==i?i:G)&&void 0!==s?s:q)}),this._markerData,this._markAttributeContext)):"richText"===z?(Q=null!==(n=null==U?void 0:U.state)&&void 0!==n?n:Z,et={width:100,height:100},tt=c5(j(et,null!==(a=null!==(r=null==U?void 0:U.style)&&void 0!==r?r:$)&&void 0!==a?a:q),this._markerData,this._markAttributeContext)):"symbol"===z?(Q=null!==(o=null==N?void 0:N.state)&&void 0!==o?o:Z,et={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},tt=$j(c5(j(et,null!==(h=null!==(l=null==N?void 0:N.style)&&void 0!==l?l:Y)&&void 0!==h?h:q),this._markerData,this._markAttributeContext))):"image"===z?(Q=null!==(c=null==V?void 0:V.state)&&void 0!==c?c:Z,et={width:80,height:80},tt=c5(j(et,null!==(u=null!==(d=null==V?void 0:V.style)&&void 0!==d?d:K)&&void 0!==u?u:q),this._markerData,this._markAttributeContext)):"custom"===z&&(Q=null!==(p=null==W?void 0:W.state)&&void 0!==p?p:Z,tt=c5(null!==(f=null!==(g=null==W?void 0:W.style)&&void 0!==g?g:X)&&void 0!==f?f:q,this._markerData,this._markAttributeContext));const it={zIndex:this.layoutZIndex,interactive:null===(m=this._spec.interactive)||void 0===m||m,hover:null===(v=this._spec.interactive)||void 0===v||v,select:null===(y=this._spec.interactive)||void 0===y||y,position:{x:0,y:0},clipInRange:null!==(_=this._spec.clip)&&void 0!==_&&_,itemContent:Object.assign(Object.assign({type:z,offsetX:d5(R.offsetX,this._relativeSeries.getRegion()),offsetY:d5(R.offsetX,this._relativeSeries.getRegion())},J),{style:c5(tt,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(b=L.offset)&&void 0!==b?b:0,visible:null!==(x=L.visible)&&void 0!==x&&x,size:null!==(S=L.size)&&void 0!==S?S:20,style:c5(L.style,this._markerData,this._markAttributeContext)},state:{line:h5(null!==(k=null===(A=this._spec.itemLine.line)||void 0===A?void 0:A.state)&&void 0!==k?k:{},this._markerData,this._markAttributeContext),lineStartSymbol:h5(null!==(M=null===(C=this._spec.itemLine.startSymbol)||void 0===C?void 0:C.state)&&void 0!==M?M:{},this._markerData,this._markAttributeContext),lineEndSymbol:h5(null!==(T=null===(w=this._spec.itemLine.endSymbol)||void 0===w?void 0:w.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),itemContent:h5(Q,this._markerData,this._markAttributeContext),textBackground:h5(null===(E=null===(B=this._spec.itemContent.text)||void 0===B?void 0:B.labelBackground)||void 0===E?void 0:E.state,this._markerData,this._markAttributeContext),targetItem:h5(null!==(O=null===(P=this._spec.targetSymbol)||void 0===P?void 0:P.state)&&void 0!==O?O:{},this._markerData,this._markAttributeContext)},animation:null!==(I=this._spec.animation)&&void 0!==I&&I,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},{visible:st,line:nt={}}=D,rt=u4(D,["visible","line"]);return it.itemLine=!1!==st?Object.assign(Object.assign({},rt),{visible:!0,lineStyle:$j(nt.style)}):{visible:!1},new $L(it)}_markerLayout(){var t,e,i,s,n,r,a,o,l,h,c,d,u;const g=this._spec,f=this._markerData,m=this._relativeSeries,{point:v}=this._computePointsAttr(),y=this._getRelativeDataView().latestData,_=f?f.latestData[0]&&f.latestData[0].latestData?f.latestData[0].latestData:f.latestData:y,{itemLine:b={},itemContent:x={}}=this._spec,{visible:S,line:A={}}=b,k=u4(b,["visible","line"]),C=!1!==S?Object.assign(Object.assign({},k),{visible:!0,lineStyle:$j(A.style)}):{visible:!1},M=l5(Object.assign(Object.assign({},x.text),{style:j({dx:0,dy:0},null!==(e=null===(t=x.text)||void 0===t?void 0:t.style)&&void 0!==e?e:x.style)}),f,this._markAttributeContext);let w;if(g.clip||(null===(i=g.itemContent)||void 0===i?void 0:i.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=o5([m.getRegion()]);w={x:t,y:i,width:e-t,height:s-i}}if(this._markerComponent){const t=null!==(s=this._markerComponent.attribute)&&void 0!==s?s:{},e=null!==(r=null===(n=t.itemContent)||void 0===n?void 0:n.textStyle)&&void 0!==r?r:{},i=null===(a=this._spec.itemContent.text)||void 0===a?void 0:a.text;this._markerComponent.setAttributes({position:void 0===v?{x:null,y:null}:v,itemContent:Object.assign(Object.assign({},t.itemContent),{panel:null!==(o=M.panel)&&void 0!==o?o:null===(l=t.itemContent)||void 0===l?void 0:l.panel,padding:null!==(h=M.padding)&&void 0!==h?h:null===(c=t.itemContent)||void 0===c?void 0:c.padding,textStyle:Object.assign(Object.assign(Object.assign({},e),null!==(d=M.textStyle)&&void 0!==d?d:{}),{text:(null===(u=this._spec.itemContent.text)||void 0===u?void 0:u.formatMethod)?this._spec.itemContent.text.formatMethod(_,y):p(i)?i:e.text}),offsetX:u5(v,t.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:u5(v,t.itemContent.offsetY,this._relativeSeries.getRegion())}),itemLine:C,limitRect:w,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}_initDataView(){const t=this._spec,{doXYProcess:e,doPolarProcess:i,doGeoProcess:s}=m5(t);(p(t.coordinate)||e||i||s)&&this._initCommonDataView()}}p4.specKey="markPoint";const g4={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}};class f4 extends p4{constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t,e,i;const s=this._spec,n=this._markerData,r=this._relativeSeries,a=p(s.x)&&p(s.y),o=p(s.coordinate),l=p(s.position),h=null!==(t=null==s?void 0:s.autoRange)&&void 0!==t&&t;let c;return a?c=null===(i=null===(e=Q3(n,r,r,r,h,!1,this._getAutoRangeExtendDomainKeyPrefix()))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:o?c=s5(n,r,h,s.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix())[0]:l&&(c=a5(s.position,r,s.regionRelative)[0]),{point:c}}_computeOptions(){const t=this._spec,{doXYProcess:e}=m5(t),i=p(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}f4.type=r.markPoint,f4.coordinateType="cartesian",f4.builtInTheme={markPoint:g4};const m4=()=>{Fz.registerComponent(f4.type,f4),KL()};class v4 extends p4{constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=e5(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e,this._getAutoRangeExtendDomainKeyPrefix())[0][0];return{point:ce({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}v4.type=r.polarMarkPoint,v4.coordinateType="polar",v4.builtInTheme={polarMarkPoint:g4};const y4=()=>{Fz.registerComponent(v4.type,v4),KL()};class _4 extends p4{constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){return{point:i5(this._markerData,this._relativeSeries)[0][0]}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}_4.type=r.geoMarkPoint,_4.coordinateType="geo",_4.builtInTheme={geoMarkPoint:g4};const b4=()=>{Fz.registerComponent(_4.type,_4),KL()},x4={style:!0,inBrush:!0,outOfBrush:!0};let S4=class extends jW{constructor(){super(...arguments),this.layoutType="none",this.type=r.brush,this.name=r.brush,this.specKey="brush",this.layoutZIndex=oN.Brush,this._linkedSeries=[],this._itemMap={},this._linkedItemMap={},this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._cacheInteractiveRangeAttrs=[],this._releatedAxes=[],this._regionAxisMap={},this._axisDataZoomMap={},this._zoomRecord=[]}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>!1!==t.visible))}init(){const t=this._transformBrushedMarkAttr(this._spec.inBrush),e=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((i=>{i.getActiveMarks().forEach((s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",hN.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",hN.Series))}))}))}reInit(t){super.reInit(t),this.init()}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Y(t).includes(n.userId.toString())||e&&Y(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_bindRegions(){p(this._spec.regionId)||p(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}_bindLinkedSeries(){(p(this._spec.brushLinkSeriesId)||p(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(Y(this._spec.brushLinkSeriesId),Y(this._spec.brushLinkSeriesIndex)))}_initRegionAxisMap(){p(this._spec.axisId)?Y(this._spec.axisId).forEach((t=>{this._releatedAxes.push(this._option.getComponentByUserId(t))})):p(this._spec.axisIndex)?Y(this._spec.axisIndex).forEach((t=>{this._releatedAxes.push(this._option.getComponentByIndex("axes",t))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((t=>{null==t||t.getRegions().forEach((e=>{this._regionAxisMap["region_"+e.id]?this._regionAxisMap["region_"+e.id].push(t):this._regionAxisMap["region_"+e.id]=[t]}))}))}_initAxisDataZoomMap(){this._option.getComponentsByKey("dataZoom").forEach((t=>{t.relatedAxisComponent&&(this._axisDataZoomMap[t.relatedAxisComponent.id]=t)}))}initEvent(){}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)}));const i=super._compareSpec(t,e);return U(e,t)||(i.change=!0,i.reRender=!0,i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}_isComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((i=>U(null==e?void 0:e[i],null==t?void 0:t[i])||x4[i]))}onLayoutEnd(){var t;super.onLayoutEnd(),this._option.disableTriggerEvent||(null===(t=this._spec.visible)||void 0===t||t)&&(this._brushComponents?this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)})):(this._brushComponents=[],this._relativeRegions.forEach(((t,e)=>{this._createBrushComponent(t,e)}))))}_updateBrushComponent(t,e){var i;const s=this._getBrushInteractiveAttr(t),n=this._brushComponents[e];n.setAttributes(Object.assign({brushStyle:$j(null===(i=this._spec)||void 0===i?void 0:i.style)},s)),this._initMarkBrushState(e,""),n.children[0].removeAllChild()}_shouldEnableInteractive(){return!1!==this.getOption().getCompiler().getOption().interactive}_createBrushComponent(t,e){var i,s;const n=this._getBrushInteractiveAttr(t),r=new HF(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:$j(null===(i=this._spec)||void 0===i?void 0:i.style)},n),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));r.id=null!==(s=this._spec.id)&&void 0!==s?s:`brush-${this.id}`,this.getContainer().add(r),this._brushComponents.push(r),this._cacheInteractiveRangeAttrs.push(n),r.addEventListener(RF.brushActive,(i=>{this._initMarkBrushState(e,"outOfBrush"),this._emitEvent(tH.brushActive,t,i)})),r.addEventListener(RF.drawStart,(e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!0),this._setRegionMarkPickable(t,!0),this._emitEvent(tH.brushStart,t,e)})),r.addEventListener(RF.moveStart,(e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!0),this._setRegionMarkPickable(t,!0),this._emitEvent(tH.brushStart,t,e)})),r.addEventListener(RF.drawing,(e=>{this._setRegionMarkPickable(t,!1),this._handleBrushChange(t,e),this._emitEvent(tH.brushChange,t,e)})),r.addEventListener(RF.moving,(e=>{this._setRegionMarkPickable(t,!1),this._handleBrushChange(t,e),this._emitEvent(tH.brushChange,t,e)})),r.addEventListener(RF.brushClear,(i=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0),this._initMarkBrushState(e,""),this._emitEvent(tH.brushClear,t,i)})),r.addEventListener(RF.drawEnd,(i=>{var s;this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0);const{operateMask:n}=i.detail,{updateElementsState:r=!0}=this._spec;if(null===(s=this._spec)||void 0===s?void 0:s.onBrushEnd)!0===this._spec.onBrushEnd(i)?(this.clearGraphic(),this._initMarkBrushState(e,""),this._emitEvent(tH.brushClear,t,i)):(this._spec.onBrushEnd(i),this._emitEvent(tH.brushEnd,t,i));else{const e=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&e.length>0||!r)&&this._setAxisAndDataZoom(n,t),this._emitEvent(tH.brushEnd,t,i)}})),r.addEventListener(RF.moveEnd,(e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0);const{operateMask:i}=e.detail,{updateElementsState:s=!0}=this._spec,n=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&n.length>0||s)&&this._setAxisAndDataZoom(i,t),this._emitEvent(tH.brushEnd,t,e)}))}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a],interactive:this._shouldEnableInteractive()}}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},$j(t)),e)}_handleBrushChange(t,e){const{operateMask:i}=e.detail;this._operateMask=i;const{updateElementsState:s=!0}=this._spec;s&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}_extendDataInBrush(t){var e,i;const s=[];for(const n in t)for(const r in t[n])s.push(Object.assign({},null===(i=null===(e=t[n][r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return s}_extendDatumOutOfBrush(t){var e,i;const s=[];for(const n in t)s.push(null===(i=null===(e=t[n].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return s}_emitEvent(t,e,i){var s;this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap,zoomRecord:this._zoomRecord},vchart:null===(s=this._option)||void 0===s?void 0:s.globalInstance,event:i})}_reconfigItem(t,e){var i,s,n;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const r=null!==(n=null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points)&&void 0!==n?n:[],{a:a,b:o,c:l,d:h,e:c,f:d}=t.globalTransMatrix,u=r.map((t=>({x:a*t.x+l*t.y+c,y:o*t.x+h*t.y+d}))),{markTypeFilter:p=[]}=this._spec;this._itemMap[e.id].forEach((e=>{if(p.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;const a=e.id+"_"+i.context.key,o=this._isBrushContainItem(t.globalAABBBounds,u,i);(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[a])&&o?(UN(i,"inBrush",!0),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][a]=i,delete this._outOfBrushElementsMap[a]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!o&&(WN(i,"inBrush"),UN(i,"outOfBrush",!0),this._outOfBrushElementsMap[a]=i,delete this._inBrushElementsMap[t.name][a])}))}))}_reconfigLinkedItem(t,e){var i;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const s=e.getLayoutStartPoint(),n=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{var i,r;if(!n.includes(e.id)){const n=e.getRegion().getLayoutStartPoint(),a=n.x-s.x,o=n.y-s.y,l=null!==(r=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==r?r:[],{a:h,b:c,c:d,d:u,e:p,f:g}=t.globalTransMatrix,f=a||0,m=o||0,v=l.map((t=>({x:h*t.x+d*t.y+p+f,y:c*t.x+u*t.y+g+m})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+f,t.globalAABBBounds.y1+m,t.globalAABBBounds.x2+f,t.globalAABBBounds.y2+m);const{markTypeFilter:y=[]}=this._spec;this._linkedItemMap[e.id].forEach((e=>{if(y.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;i.context;const a=e.id+"_"+i.context.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[a])&&this._isBrushContainItem(t.globalAABBBounds,v,i)?(UN(i,"inBrush",!0),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][a]=i,delete this._linkedOutOfBrushElementsMap[a]):(null===(r=null===(n=this._linkedInBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!this._isBrushContainItem(t.globalAABBBounds,v,i)&&(WN(i,"inBrush"),UN(i,"outOfBrush",!0),this._linkedOutOfBrushElementsMap[a]=i)}))}))}}))}_isBrushContainItem(t,e,i){let s=[];if(["symbol","rect"].includes(i.type)){const{x1:t,x2:n,y1:r,y2:a}=null==i?void 0:i.globalAABBBounds;return s=[{x:t,y:r},{x:n,y:r},{x:n,y:a},{x:t,y:a}],function(t,e){for(let i=0;i<e.length;i++){if(Fe(t,e[i].x,e[i].y))return!0;if(i>0&&Le(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,s)}return t.intersects(i.globalAABBBounds)}_initItemMap(t,e,i){const{markTypeFilter:s=[]}=this._spec;Object.entries(t).forEach((([t,n])=>{n.forEach((t=>{if(s.includes(t.type))return;const n=t.getGraphics();n&&n.length&&n.forEach((s=>{const n=t.id+"_"+s.context.key;WN(s,["inBrush","outOfBrush"]),i&&UN(s,i,!0),e[n]=s}))}))}))}_initMarkBrushState(t,e){this._brushComponents.forEach(((e,i)=>{i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._initItemMap(this._itemMap,this._outOfBrushElementsMap,e),this._initItemMap(this._linkedItemMap,this._linkedOutOfBrushElementsMap,e)}_setRegionMarkPickable(t,e){t.getGroupMark().getGraphics().forEach((t=>t.setAttribute("childrenPickable",e)))}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:c}=s,d=r?"x":"y",u=r?o:h,p=r?l:c,g=t.getScale().range(),f=null!==(n=t.scaleRangeFactor())&&void 0!==n?n:[0,1],m=K(g)<g[0],v=u-e.getLayoutStartPoint()[d],y=p-e.getLayoutStartPoint()[d],_=m?Math.min(v,y):Math.max(v,y),b=m?Math.max(v,y):Math.min(v,y),x=(b-g[0])/(K(g)-g[0])*(f[1]-f[0])+f[0],S=(_-g[0])/(K(g)-g[0])*(f[1]-f[0])+f[0],A=this._stateClamp(x-a),k=this._stateClamp(S+a);if(this._axisDataZoomMap[t.id]){const e=this._axisDataZoomMap[t.id],i=m?1-A:A,s=m?1-k:k;e.setStartAndEnd(Math.min(i,s),Math.max(i,s),["percent","percent"]),this._zoomRecord.push({operateComponent:e,start:i,end:s,startValue:_3(i,e.stateScale,x3(e.relatedAxisComponent,e.isHorizontal)),endValue:_3(s,e.stateScale,x3(e.relatedAxisComponent,e.isHorizontal))})}else t.scaleRangeFactor([A,k]),t.effect.scaleUpdate(),this._zoomRecord.push({operateComponent:t,start:A,end:k,startValue:t.getScale().invert(b),endValue:t.getScale().invert(_)})}))}}_getNeedClearVRenderComponents(){return this._brushComponents}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach(((e,i)=>{this._initMarkBrushState(i,""),e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}clearBrushStateAndMask(){this._relativeRegions.forEach(((t,e)=>{this._initMarkBrushState(e,""),this._brushComponents[e].children[0].removeAllChild()}))}};S4.type=r.brush,S4.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},S4.specKey="brush";const A4=()=>{Fz.registerComponent(S4.type,S4)},k4={style:!0,state:!0};class C4 extends jW{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=oN.CustomMark,this.layoutLevel=lN.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;let t=null;if(this._spec.parent){const e=this.getChart().getAllMarks().find((t=>t.getUserId()===this._spec.parent));"group"===e.type&&(t=e)}this._createExtensionMark(this._spec,t,`${rj}_series_${this.id}_extensionMark`,0)}_createExtensionMark(t,e,i,s=0){var n,r;const a=this._createMark({type:t.type,name:p(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(p(t.id)&&a.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){const e=cU({},dU(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(u(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e)}))),p(t.dataId)||k(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(a.setDataView(e),e.target.addListener("change",(()=>{a.getData().updateData()})))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(e,t)||(i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i.change=!0,i.reRender=!0,i}_isComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((i=>U(null==e?void 0:e[i],null==t?void 0:t[i])||k4[i]))}reInit(t){super.reInit(t),this._updateMarkStyleWithSpec(this._spec,this.getMarks()[0]),this.getMarks().forEach((t=>{t.commit(!1,!0)}))}_updateMarkStyleWithSpec(t,e){var i,s,n,r;if(t&&e&&(this.initMarkStyleWithSpec(e,t),"group"===t.type)){const a=null!==(n=null===(s=(i=e).getMarks)||void 0===s?void 0:s.call(i))&&void 0!==n?n:[];null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._updateMarkStyleWithSpec(t,a[e])}))}}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Ke).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Ke;return this.getMarks().forEach((e=>{const i=e.getProduct();i&&t.union(i.AABBBounds)})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}getVRenderComponents(){const t=[],e=i=>{if(i&&"group"===i.type)i.getMarks().forEach((t=>{e(t)}));else if("component"===i.type){const e=null==i?void 0:i.getComponent();e&&t.push(e)}};return this.getMarks().forEach((t=>{e(t)})),t}}C4.type=r.customMark,C4.specKey="customMark";const M4=()=>{Fz.registerComponent(C4.type,C4)};class w4{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(k(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:d(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&p(e.modelId)){if(p(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&p(e.modelKey)&&"modelIndex"in e&&p(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r<t[e]+(null!==(i=t[`${e}Span`])&&void 0!==i?i:1);r++)n+=s[r].value;return n}getSizeFromUser(t,e){var i,s;const n="col"===e?this._colSize:this._rowSize;if(!(null===(i=n[t[e]])||void 0===i?void 0:i.isUserSetting))return;let r=0;for(let i=t[e];i<t[e]+(null!==(s=t[`${e}Span`])&&void 0!==s?s:1);i++){if(!n[i].isUserSetting)return;r+=n[i].value}return r}setItemLayoutSizeToGrid(t,e){if(T4(t)){if(e.colSpan&&e.colSpan>1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;t<e.col;t++)i.x+=this._colSize[t].value;for(let t=0;t<e.row;t++)i.y+=this._rowSize[t].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}getItemLayoutRect(t){var e,i;const s=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(s,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(s,"row"))&&void 0!==i?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}layoutItems(t,e,i,s){this._chartLayoutRect=i,this._chartViewBox=s,this.clearLayoutSize(),e.sort(((t,e)=>e.layoutLevel-t.layoutLevel));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>T4(t))),a=n.filter((t=>!T4(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>T4(t))),h=o.filter((t=>!T4(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);k(h.width)||(h.width=l.width),k(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function T4(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}w4.type="grid";const B4=()=>{RB()},E4="vchart-tooltip",P4=`${E4}-container`,O4=`${E4}-title`,I4=`${E4}-content-box`,R4={offsetX:10,offsetY:10},D4="99999999999999";function L4(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\(/g,"&#40;").replace(/ /g," &nbsp;")}const F4=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1,z4=t=>y(t)&&""!==(null==t?void 0:t.trim())||S(t)?L4(t):"",j4=(t,e)=>{let i;if(p(t))if(S(t))i=t;else if(d(t)){const s=t(e);S(s)&&(i=s)}return i},H4={left:[-2,0],right:[2,0],top:[0,-2],bottom:[0,2],insideTop:[0,-1.5],insideBottom:[0,1.5],insideLeft:[-1.5,0],insideRight:[1.5,0],insideTopLeft:[-1.5,-1.5],insideTopRight:[1.5,-1.5],insideBottomLeft:[-1.5,1.5],insideBottomRight:[1.5,1.5],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-2],bl:[-2,2],lb:[-2,2],br:[2,2],rb:[2,2],inside:[0,0],center:[0,0],centerBottom:[0,1],centerTop:[0,-1],centerLeft:[-1,0],centerRight:[1,0]},N4=(t,e,i=2)=>{var s,n;return null!==(n=null===(s=H4[t])||void 0===s?void 0:s["x"===e?0:1])&&void 0!==n?n:i};class V4 extends cW{constructor(){super(...arguments),this._visible=!0,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this.changeTooltip=(t,e,i)=>this._isReleased?1:t?this.changeTooltipPosition(e,i):(this._updateTooltip(!1,e),0),this.changeTooltipPosition=(t,e)=>{var i,s,n,r,a;if(this._isReleased)return 1;const o=t.event,{tooltipSpec:l,activeTooltipSpec:h,changePositionOnly:c}=t;if(!h)return 1;const d=h.activeType;if(h.handler)return null!==(n=null===(s=(i=h.handler).showTooltip)||void 0===s?void 0:s.call(i,d,e,t))&&void 0!==n?n:0;const u=h,p=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,c));h.position=p;const g=null!==(r=h.updatePosition)&&void 0!==r?r:null===(a=l[d])||void 0===a?void 0:a.updatePosition;g&&(h.position=g(h.position,e,t));let f=!1!==(null==u?void 0:u.visible);return e&&"pointerout"!==o.type&&h.visible&&(h.title||h.content)||(f=!1),this._updateTooltip(f,Object.assign(Object.assign({},t),{changePositionOnly:c})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,h,c,u;const f=this._chartOption.getRectByDimensionData,{tooltipSpec:m}=e,v={x:1/0,y:1/0};if(!m)return v;const y=e.event,{activeType:_,data:b}=t,x="dimension"===_?null===(n=null===(s=b[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==b?void 0:b[0],{offsetX:A,offsetY:C}=this._option,M=m[_],w=zV(null==M?void 0:M.position,b,e),T=null!==(r=zV(null==M?void 0:M.positionMode,b,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:B=0,height:E=0}=null!=i?i:{},P="canvas"===m.renderMode,O=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),I=null!==(o=null==O?void 0:O.width)&&void 0!==o?o:aj,R=null!==(l=null==O?void 0:O.height)&&void 0!==l?l:oj;let D=!1;const L={width:0,height:0};let F,z={x:0,y:0},j={x:0,y:0},H=1,N=1;const V=ek(this._env);if(V&&!m.confine?(L.width=window.innerWidth,L.height=window.innerHeight):(L.width=I,L.height=R),V&&!P){const t=this._getParentElement(m);j=null!==(c=null===(h=null==t?void 0:t.getBoundingClientRect)||void 0===h?void 0:h.call(t))&&void 0!==c?c:v;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer;F=null==e?void 0:e.getBoundingClientRect(),z={x:F.x-j.x,y:F.y-j.y},H=F4(e,F),N=F4(t,j)}const U=N/H,W={},G={x:w,y:w},Y={x:["left","right"],y:["top","bottom"]},K=({orient:t,mode:i,offset:s},n)=>{var r;let a,o;const l=e.model,h=null==l?void 0:l.getLayoutStartPoint(),c=null!=s?s:"x"===n?A:C;if("mark"===i){D=!0;const t=e.item,i=null==t?void 0:t.AABBBounds;i&&h&&(a=("x"===n?i.x1:i.y1)+h[n],o=("x"===n?i.x2:i.y2)+h[n])}else if(f&&"crosshair"===i&&"cartesian"===(null===(r=null==x?void 0:x.series)||void 0===r?void 0:r.coordinate)&&x.datum&&x.datum.length){D=!0;const t=f(x,h);t&&(a=t.start[n],o=t.end[n])}else G[n]=t;if(D){const e=Y[n][0],i="x"===n?B:E;switch(N4(t,n)){case-2:W[e]=a-i*U-c;break;case-1.5:W[e]=a+c;break;case 0:W[e]=(a+o)/2-i*U/2;break;case-1:W[e]=(a+o)/2-i*U-c;break;case 1:W[e]=(a+o)/2+c;break;case 1.5:W[e]=o-i*U-c;break;case 2:W[e]=o+c}}},$=["x","y"];if(g(w))if((t=>g(t)&&(p(t.left)||p(t.right)||p(t.top)||p(t.bottom)))(w)){const{left:t,right:e,top:i,bottom:s}=w;W.left=j4(t,y),W.top=j4(i,y),W.right=j4(e,y),W.bottom=j4(s,y)}else(t=>g(t)&&(p(t.x)||p(t.y)))(w)&&$.forEach((t=>{const e=w[t];S(e)||d(e)?W[Y[t][0]]=j4(e,y):K(e,t)}));else p(w)&&(K({orient:w,mode:T},"x"),K({orient:w,mode:T},"y"));const X={x:null,y:null};return $.forEach((t=>{var e;const i="x"===t?B:E,s="x"===t?I:R,n="x"===t?A:C,r=N4(G[t],t);if(k(W[Y[t][0]]))X[t]=W[Y[t][0]];else if(k(W[Y[t][1]]))X[t]=s-i*U-W[Y[t][1]];else{const e="x"===t?y.canvasX:y.canvasY;X[t]=r>0?e+n:0===r?e-i*U/2:e-i*U-n}X[t]*=H,V&&(X[t]+=z[t]),X[t]/=N;const a="x"===t?L.width:L.height,o=m.confine?-(j[t]-(null!==(e=null==F?void 0:F[t])&&void 0!==e?e:0)/H)/N:-j[t]/N,l=a/N+o-i;2!==r&&X[t]<o?D?X[t]=o:(X[t]+=0===r?n+i/2:2*n+i,X[t]>l&&(X[t]=l)):-2!==r&&X[t]>l&&(D?X[t]=l:(X[t]-=0===r?n+i/2:2*n+i,X[t]<o&&(X[t]=o)))})),X}}get env(){return this._env}onAdd(t){super.onAdd(t);const e=t.component;this._component=e,this._chartOption=e.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=e.getCompiler(),this._initFromSpec()}hideTooltip(t){return this.changeTooltip(!1,t)}release(){var t,e,i,s;const n=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};n.handler?null===(s=(i=n.handler).release)||void 0===s||s.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:R4.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:R4.offsetY}:R4}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption()}reInit(){this._initFromSpec()}}V4.specKey="tooltip";const U4=(t,e)=>p(t)?_(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",W4=(t={},e={})=>{var i,s;p(t.fontFamily)&&(e.fontFamily=t.fontFamily);const n=null!==(i=t.fill)&&void 0!==i?i:t.fontColor;return p(n)&&(e.color=n),p(t.fontWeight)&&(e.fontWeight=t.fontWeight),p(t.textAlign)&&(e.textAlign=t.textAlign),p(t.fontSize)&&(e.fontSize=U4(t.fontSize)),p(t.maxWidth)&&(e.maxWidth=U4(t.maxWidth)),t.multiLine||p(t.maxWidth)&&!1!==t.multiLine?(e.whiteSpace="initial",e.wordBreak=null!==(s=t.wordBreak)&&void 0!==s?s:"break-word"):(e.wordBreak="normal",e.whiteSpace="nowrap"),e},G4=(t={})=>{const{lineHeight:e}=t;return t.fontSize?Mz(e,t.fontSize):0},Y4=t=>{var e;const{backgroundColor:i,border:s,shadow:n,padding:r}=t,a={borderWidth:`${null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0}px`};let o=null;(null==s?void 0:s.color)&&(a.borderColor=s.color),i&&(a.backgroundColor=i),a.boxShadow=n?`${n.x}px ${n.y}px ${n.blur}px ${n.spread}px ${n.color}`:"initial";const{radius:l}=null!=s?s:{};return p(l)&&(a.borderRadius=k(l)?`${l}px`:`${l}`),p(r)&&(o=ui(r),a.padding=U4(o)),{panelStyle:a,panelPadding:o}};function K4(t,e){t&&t.style&&e&&Object.keys(e).forEach((i=>{t.style[i]=e[i]}))}const $4=t=>{Fz.registerComponentPlugin(t.type,t)};class X4 extends V4{getVisibility(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}setVisibility(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}getRootDom(){return this._rootDom}constructor(){super(X4.type),this.type=_Y.dom,this._tooltipContainer=null==tk?void 0:tk.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec().parentElement;if(tk&&t&&t.children&&t.children.length){for(let e=0;e<t.children.length;e++)if(t.children[e].classList.contains(P4)){this._container=t.children[e];break}this._container||(this._container=tk.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=D4,this._container.classList.add(P4),t.appendChild(this._container))}}initRootDom(){var t;const e=this._component.getSpec(),i=document.createElement("div"),s=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");K4(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:D4,fontFamily:null!=s?s:Oz.fontFamily,fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh",visibility:"hidden"},this._domStyle.panel)),i.classList.add(e.className),i.setAttribute("vchart-tooltip-id",`${this.id}`),this._container.appendChild(i),this._rootDom=i}_getTooltipBoxSize(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);const s=null===(i=this._rootDom)||void 0===i?void 0:i.getBoundingClientRect();return{width:null==s?void 0:s.width,height:null==s?void 0:s.height}}_removeTooltip(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}_updateTooltip(t,e){var i,s;if(t&&this._rootDom){const{tooltipSpec:n,activeTooltipSpec:r}=e;e.changePositionOnly||(this._tooltipActual=r);const a=this._rootDom;if(a){const{x:o=0,y:l=0}=null!==(i=r.position)&&void 0!==i?i:{};let h={x:o,y:l};const c=this.getVisibility();n.updateElement&&(this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:o,y:l}),n.updateElement(a,r,e),h=this._getActualTooltipPosition(r,e,{width:a.offsetWidth,height:a.offsetHeight}),this._cacheCustomTooltipPosition=h),!c&&t&&(this._rootDom.style.transition="none",this._updatePosition(h,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(h)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){const t=this._component.getSpec();this._domStyle=((t={})=>{var e,i,s,n;const{style:r={},enterable:a,transitionDuration:o}=t,{panel:l={},titleLabel:h,shape:c,keyLabel:d,valueLabel:p,spaceRow:g,align:f}=r,{panelStyle:m,panelPadding:v}=Y4(l),y={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=a?"auto":"none",o&&(m.transitionDuration=o?`${o}ms`:"initial",m.transitionProperty=o?"transform":"initial",m.transitionTimingFunction=o?"ease-out":"initial"),k(g)&&(y.marginBottom=`${g}px`);const _={width:U4(null!==(e=null==c?void 0:c.size)&&void 0!==e?e:8)},b=W4(h),x=W4(d),S=W4(p),A="right"===f?"marginLeft":"marginRight";"right"===f&&(m.direction="rtl"),u(b.textAlign)&&(b.textAlign="right"===f?"right":"left"),u(x.textAlign)&&(x.textAlign="right"===f?"right":"left"),u(S.textAlign)&&(S.textAlign="right"===f?"left":"right"),_[A]=U4(null!==(i=c.spacing)&&void 0!==i?i:8),x[A]=U4(null!==(s=d.spacing)&&void 0!==s?s:26),S[A]=U4(null!==(n=p.spacing)&&void 0!==n?n:0);const C=Math.max(G4(p),G4(d));return y.lineHeight=C>0?`${C}px`:"20px",{panelPadding:v,row:y,panel:m,title:b,shape:_,key:x,value:S}})(t)}_updateDomStringByCol(t){var e;const{title:i={},content:s}=t,n=s&&s.length,r=this._domStyle.row,a=[...this._rootDom.children];let o=a.find((t=>t.className.includes(O4))),l=a.find((t=>t.className.includes(I4)));if(!o&&!1!==i.visible){o=document.createElement("h2");const t=document.createElement("span");o.appendChild(t),o.classList.add(O4),this._rootDom.firstChild?this._rootDom.insertBefore(o,this._rootDom.firstChild):this._rootDom.appendChild(o)}o&&!1!==i.visible?(K4(o,Object.assign(Object.assign(Object.assign({},this._domStyle.title),n?r:{marginBottom:"0px"}),{marginTop:"0px"})),o.firstChild.innerHTML=`${null!==(e=i.value)&&void 0!==e?e:""}`):o&&!1===i.visible&&o.parentNode.removeChild(o);const h=["shape","key","value"];if(!l&&n&&(l=document.createElement("div"),h.forEach((t=>{const e=document.createElement("div");e.classList.add(`${E4}-column`),e.classList.add(`${E4}-${t}-column`),e.setAttribute("data-col",t),l.appendChild(e)})),l.classList.add(I4),this._rootDom.appendChild(l)),l&&n){const t=[...l.children];K4(l,{whiteSpace:"nowrap"}),t.forEach(((t,e)=>{const i=t.getAttribute("data-col");if(i&&h.includes(i)){const e="shape"===i&&s.every((t=>!t.hasShape||!t.shapeType));K4(t,Object.assign(Object.assign({},this._domStyle[i]),{display:e?"none":"inline-block",verticalAlign:"top"}));const n=[...t.children];n.slice(s.length).forEach((t=>{t.parentNode.removeChild(t)})),s.forEach(((e,a)=>{let o=n[a];o||(o=document.createElement("div"),o.classList.add(`${E4}-${i}`),t.appendChild(o));const l=Object.assign({},r);a===s.length-1&&(l.marginBottom="0px"),l.display=!1===e.visible?"none":"block",l.height="initial","key"===i?(o.innerHTML=z4(e.key),e.keyStyle&&W4(e.keyStyle,l)):"value"===i?(o.innerHTML=z4(e.value),e.valueStyle&&W4(e.valueStyle,l)):"shape"===i&&(o.innerHTML=function(t,e){var i,s,n,r,a,o;if(!t||!t.hasShape||!t.shapeType)return"";const l='style="display:inline-block;vertical-align:middle;"',{shapeType:h,shapeStroke:c,shapeHollow:d=!1,shapeFill:u}=t,p=null!==(i=t.shapeSize)&&void 0!==i?i:8,f=t.shapeLineWidth?L4(t.shapeLineWidth)+"px":"0px";let m="currentColor";const v=()=>c?L4(c):m,_=p,b=t=>new Ng({symbolType:t,size:_,fill:!0});let x=b(h);const S=x.getParsedPath();let A,k;if(!S.path&&S.pathStr&&(x=b(S.pathStr)),x.getParsedPath().path){const t=x.getParsedPath().path;k=t.toString(),A=t.bounds}else S.isSvg&&S.svgCache&&(k=S.svgCache.map((t=>t.path.toString())).join(),A=S.svgCache.reduce(((t,e)=>t.union(e.path.bounds)),new Ke));let C=`${A.x1} ${A.y1} ${A.width()} ${A.height()}`;if("0px"!==f){const[t,e,i,s]=C.split(" ").map((t=>Number(t))),n=Number(f.slice(0,-2));C=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}const M=Tu.IsGradientStr(u);if(!u||y(u)&&!M||d)return m=d?"none":u?L4(u):"currentColor",`\n <svg ${l} width="${p}" height="${p}" viewBox="${C}">\n <path\n d="${k}"\n style="fill: ${m}; stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`;const w=M?Tu.Parse(u):g(u)?u:null;if(w){m="gradientColor"+(null!=e?e:"");let t="";const i=(null!==(s=w.stops)&&void 0!==s?s:[]).map((t=>`<stop offset="${L4(t.offset.toString())}" stop-color="${L4(t.color)}"/>`)).join("");return"radial"===w.gradient?t=`<radialGradient id="${m}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${i}\n </radialGradient>`:"linear"===w.gradient&&(t=`<linearGradient id="${m}" x1="${100*(null!==(n=w.x0)&&void 0!==n?n:0)}%" y1="${100*(null!==(r=w.y0)&&void 0!==r?r:0)}%" x2="${100*(null!==(a=w.x1)&&void 0!==a?a:0)}%" y2="${100*(null!==(o=w.y1)&&void 0!==o?o:0)}%">\n ${i}\n </linearGradient>`),`\n <svg ${l} width="${p}" height="${p}" viewBox="-0.5 -0.5 1 1">\n ${t}\n <path\n d="${k}"\n style="fill: url(#${m}); stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`}return""}(e,`${this.id}_${a}`)),K4(o,l)}))}}))}else l&&!n&&l.parentNode.removeChild(l)}_updateDomStyle(t="width",e){var i,s,n,r,a;const o=this._rootDom,l=[...o.children].find((t=>t.className.includes(I4))),h=[...o.children].find((t=>t.className.includes(O4)));if(l){const o=this._component.getSpec(),c={},d=null===(i=o.style)||void 0===i?void 0:i.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&h){const e=[...l.children].reduce(((e,i)=>"height"===t?e+i.getBoundingClientRect().width:Math.max(e,i.getBoundingClientRect().width)),0);e>0&&(h.style.maxWidth=`${e}px`,h.style.maxWidth=`${Math.ceil(l.getBoundingClientRect().width)}px`)}if(p(null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.maxContentHeight)){const t=h&&h.className.includes(O4)?h.getBoundingClientRect().height+(null!==(n=o.style.spaceRow)&&void 0!==n?n:0):0,e=this._chartOption.getChartViewRect(),i=Mz(o.style.maxContentHeight,Math.min(e.height,document.body.clientHeight)-t-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));i>0&&(c.maxHeight=`${i}px`,c.overflowY="auto",c.width=`calc(100% + ${this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px"})`,K4(l,c))}const u=l.children,g=[];if(u){for(let i=0;i<u.length;i++){const s=null!==(r=u[i].children)&&void 0!==r?r:[];for(let i=0;i<s.length;i++){e&&(s[i].style[t]="initial");const n=s[i].getBoundingClientRect()[t];(void 0===g[i]||g[i]<n)&&(g[i]=n)}}for(let e=0;e<u.length;e++){const i=null!==(a=u[e].children)&&void 0!==a?a:[];for(let e=0;e<i.length;e++)i[e].style[t]=`${g[e]}px`}}}}_getParentElement(t){var e;return null!==(e=this._container)&&void 0!==e?e:super._getParentElement(t)}isTooltipShown(){return this.getVisibility()}reInit(){super.reInit(),this._initStyle(),this._rootDom&&K4(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}_updatePosition({x:t,y:e},i=!0){this._rootDom&&(this._rootDom.style.transform=`translate3d(${t}px, ${e}px, 0)`,i&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}X4.type=_Y.dom;const q4=()=>{$4(X4)},Z4={fontFamily:Oz.fontFamily,spacing:10,wordBreak:"break-word"},J4=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>e<s.length-1?t+"\n":t))):s=[t],n=s.map((t=>Object.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=hm({wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n});return{width:r.width(),height:r.height(),text:s}};function Q4(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:Z4),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:e,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:p(t.maxWidth)?!1!==t.multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const t8=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return p(a)&&(r.cornerRadius=[a,a,a,a]),r};class e8 extends V4{constructor(){super(e8.type),this.type=_Y.canvas,this._attributes=null}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new GF({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_getTooltipBoxSize(t,e){var i,s;if(!e||u(this._attributes)){const e=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=((t,e,i)=>{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:c}=e,{panel:d={},titleLabel:u,shape:g,keyLabel:f,valueLabel:m,spaceRow:v,align:y}=l,_=ui(d.padding),b=Tz(d.padding),x=Q4(Object.assign({textAlign:"right"===y?"right":"left"},u),i),S=Q4(Object.assign({textAlign:"right"===y?"right":"left"},f),i),A=Q4(m,i),k={fill:!0,size:null!==(s=null==g?void 0:g.size)&&void 0!==s?s:8,spacing:null!==(n=null==g?void 0:g.spacing)&&void 0!==n?n:6},C={panel:t8(d),padding:_,title:{},content:[],titleStyle:{value:x,spaceRow:v},contentStyle:{shape:k,key:S,value:A,spaceRow:v},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:c,align:y},{title:M={},content:w=[]}=t;let T=b.left+b.right,B=b.top+b.bottom,E=0;const P=!!w.length;let O=0,I=0,R=0,D=0;if(P){const t=[],e=[],i=[],s=[];let n=0;C.content=w.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:c="",shapeFill:d,shapeStroke:u,shapeLineWidth:g,shapeSize:f,value:m,isKeyAdaptive:y,spaceRow:_,keyStyle:b,valueStyle:x,shapeHollow:C}=r,M={height:0,spaceRow:null!=_?_:v};if(p(h)){const i=Lz({},S,Q4(b,void 0,{})),{width:s,height:n,text:r}=J4(h,i);M.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),y?e.push(s):t.push(s),o=Math.max(o,n)}if(p(m)){const t=Lz({},A,Q4(x,void 0,{})),{width:e,height:s,text:n}=J4(m,t);M.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:c};C?t.stroke=d:t.fill=d,t.stroke=null!=u?u:d,t.lineWidth=g,M.shape=t;const e=null!=f?f:k.size;o=Math.max(e,o),s.push(e)}else M.shape={visible:!1};return M.height=o,n+=o,a<w.length-1&&(n+=M.spaceRow),M})),B+=n,O=t.length?$(t):0,I=e.length?$(e):0,R=i.length?$(i):0,D=s.length?$(s)+k.spacing:0,E=Math.max(D+O+S.spacing+R+A.spacing,D+I,E),C.hasContentShape=!!s.length,C.keyWidth=O,C.valueWidth=R}let L=0,F=0,z=0;const{visible:j=!0,value:H="",valueStyle:N,spaceRow:V}=M;C.title.visible=j,C.title.spaceRow=null!=V?V:v;let U={};const W=()=>U.autoWidth&&!1!==U.multiLine;if(j){U=Lz({},x,Q4(N,void 0,{})),W()&&(U.multiLine=null===(r=U.multiLine)||void 0===r||r,U.maxWidth=null!==(a=U.maxWidth)&&void 0!==a?a:P?Math.ceil(E):void 0);const{text:t,width:e,height:i}=J4(H,U);C.title.value=Object.assign(Object.assign({width:W()?Math.min(e,null!==(o=U.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},U),{text:t}),L=C.title.value.width,F=C.title.value.height,z=F+(P?C.title.spaceRow:0)}return B+=z,C.title.width=L,C.title.height=F,W()?T+=E||L:T+=Math.max(L,E),P&&C.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=T-b.left-b.right-D-O-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),C.valueWidth=Math.max(C.valueWidth,i.width))})),C.panel.width=T,C.panel.height=B,C})(t,this._component.getSpec(),e)}const{panel:n}=null!==(s=this._attributes)&&void 0!==s?s:{};return{width:n.width+n.lineWidth,height:n.height+n.lineWidth}}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{activeTooltipSpec:s}=e,n=s.position;e.changePositionOnly?p(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}e8.type=_Y.canvas;const i8=()=>{$4(e8)},s8=t=>{Fz.registerChartPlugin(t.type,t)},n8=/\{([^}]+)\}/,r8=/\{([^}]+)\}/g,a8=/:/;class o8 extends cW{constructor(){super(o8.type),this.type="formatterPlugin",this._timeModeFormat={utc:Ti.getInstance().timeUTCFormat,local:Ti.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=Li.getInstance().format,this._numericSpecifier=Li.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[o8.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;d(r)?this._formatter=r:(this._formatter=this._format.bind(this),d(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),Fz.registerFormatter(this._formatter)}_format(t,e,i){return _(t)?t.map(((t,s)=>{const n=_(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):_(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=n8.test(i),this._isNumericFormatterCache.set(i,s))),s?i.replace(r8,((t,i)=>{if(!a8.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)})):this._formatSingleText(t,i)}_formatSingleText(t,e){if(Ii.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):e.startsWith("calc(")?this._calcFormatter(e,t):t}_calcFormatter(t,e){try{const i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}_calculateMathExpression(t,e){const i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{const t=new Function("return ("+i+")")();if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Invalid calculation result");return t}catch(t){return e}}_isValidMathExpression(t){return/^[0-9+\-*/().]+$/.test(t)}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}o8.pluginType="chart",o8.specKey="formatter",o8.type="formatterPlugin";const l8={state:BN.STATE_ACTIVE,trigger:"pointerover",triggerOff:"pointerout"};class h8 extends yV{constructor(t){super(t),this.type="element-active",this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{this.reset(t.item)},this.options=Object.assign({},l8,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(t){const{state:e,interaction:i}=this.options;this.isGraphicInStateMark(t,e)&&(UN(t,e,!0),i.setStatedGraphics(this,[t]))}}reset(t){const{interaction:e,state:i}=this.options,s=e.getStatedGraphics(this),n=null!=t?t:null==s?void 0:s[0];n&&(null==s?void 0:s.includes(n))&&(WN(n,i),e.setStatedGraphics(this,s.filter((t=>t!==n))))}}h8.type="element-active",h8.defaultOptions=l8;const c8="element-active-by-legend",d8={state:BN.STATE_ACTIVE,filterType:"groupKey"};class u8 extends yV{constructor(t){super(t),this.type=c8,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},d8,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:tH.legendItemHover,handler:this.handleStart},{type:tH.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(u(t))return;const{interaction:e,state:i}=this.options,s=mV(this.options),n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{s(e)===t&&r.push(e)}))})),e.updateStates(this,r,n,i),e.setStatedGraphics(this,r)}resetAll(){const{interaction:t,state:e}=this.options;t.clearAllStatesOfTrigger(this,e),t.setStatedGraphics(this,[])}reset(t){const{state:e,interaction:i}=this.options;if(t){const s=i.getStatedGraphics(this);s&&s.includes(t)&&(WN(t,e),i.setStatedGraphics(this,s.filter((e=>e!==t))))}else this.resetAll()}}u8.type=c8,u8.defaultOptions=d8;const p8="element-highlight-by-group";class g8 extends yV{constructor(t){super(t),this.type=p8,this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{const e=t.item;e&&this.isGraphicInMark(e)&&this.resetAll()},this.options=Object.assign({},vV,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}_getHightlightKey(t){var e;return null===(e=t.context)||void 0===e?void 0:e.groupKey}start(t){if(t&&this.isGraphicInMark(t)){const e=this._getHightlightKey(t);if(u(e))return;const{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{this._getHightlightKey(t)===e&&a.push(t)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}reset(t){if(t){if(this.isGraphicInMark(t)){const{interaction:e}=this.options,i=e.getStatedGraphics(this);WN(t,[this.options.highlightState,this.options.blurState]),e.setStatedGraphics(this,i.filter((e=>e!==t)))}}else this.resetAll()}}g8.type=p8,g8.defaultOptions=vV;const f8="element-highlight-by-key";class m8 extends g8{constructor(){super(...arguments),this.type=f8}_getHightlightKey(t){var e;return null===(e=t.context)||void 0===e?void 0:e.key}}m8.type=f8;const v8="element-highlight-by-legend",y8={highlightState:BN.STATE_HIGHLIGHT,blurState:BN.STATE_BLUR,filterType:"groupKey"};class _8 extends yV{constructor(t){super(t),this.type=v8,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},y8,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:tH.legendItemHover,handler:this.handleStart},{type:tH.legendItemUnHover,handler:this.handleReset}]}start(t){if(t){const e=mV(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(WN(t,[e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}_8.type=v8,_8.defaultOptions=y8;const b8="element-highlight-by-name",x8={highlightState:BN.STATE_HIGHLIGHT,blurState:BN.STATE_BLUR,filterType:"groupKey"};class S8 extends yV{constructor(t){super(t),this.type=b8,this.handleStart=t=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.resetAll()},this.options=Object.assign({},x8,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;const i=Y(this.options.graphicName);return(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)&&i.includes(t.node.name)}_parseTargetKey(t){return this.options.parseData?this.options.parseData(t):"text"===t.node.type?t.node.attribute.text:null}start(t){if(t){const e=mV(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(WN(t,[e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}S8.type=b8,S8.defaultOptions=x8;class A8 extends KN{constructor(){super(...arguments),this.type=A8.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}A8.type="image";const k8=()=>{XN(),QU(),eW(),$K(),z$(),IY(),qY(),CK(),dX(),qJ(),Fz.registerMark(A8.type,A8),kT(),lT(),Fz.registerGraphicComponent("image",xf),E0(),NW()};BV.useRegisters([EY,VY,aK,bK,p1,v1,b1,O1,a1,z1,V1,U1,Y1,c2,p2,D1,X1,J1,_2,e2,n2,o2,m2,S2,w1,C2,A1,dG,fG,vG,_G,xG,FX,DX,I2,K2,s3,p3,f3,O3,D3,N3,RK,j5,K5,m4,N5,X5,y4,b4,U5,i4,l4,d4,A4,M4,B4,()=>{Fz.registerLayout(w4.type,w4)},k8,q4,i8,()=>{s8(o8)},()=>{Fz.registerInteractionTrigger(h8.type,h8)},()=>{Fz.registerInteractionTrigger(c8,u8)},()=>{Fz.registerInteractionTrigger(v8,_8)},()=>{Fz.registerInteractionTrigger(b8,S8)},()=>{Fz.registerInteractionTrigger(p8,g8)},()=>{Fz.registerInteractionTrigger(f8,m8)},gV,HA,zA]);class C8 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","maskShape","reverse","outlineMargin","outlinePadding","indicatorSmartInvert","liquidBackground","liquidOutline"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let M8=class extends UG{constructor(){super(...arguments),this.transformerConstructor=C8,this.type="liquid",this.seriesType=az.liquid}};M8.type="liquid",M8.seriesType=az.liquid,M8.transformerConstructor=C8;const w8=()=>{MY(),G0(),Fz.registerChart(M8.type,M8)};class T8 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","circle","overlap","overlapLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let B8=class extends UG{constructor(){super(...arguments),this.transformerConstructor=T8,this.type="venn",this.seriesType=az.venn}};B8.type="venn",B8.seriesType=az.venn,B8.transformerConstructor=T8;const E8=()=>{MY(),e1(),Fz.registerChart(B8.type,B8)};class P8 extends KG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar","bandWidthField"])}transformSpec(t){super.transformSpec(t),tN(t)}_setDefaultXAxisSpec(t){return{orient:"bottom",type:"linear",label:{visible:!1}}}_setDefaultYAxisSpec(t){return{orient:"left",type:"linear"}}}let O8=class extends UG{constructor(){super(...arguments),this.transformerConstructor=P8,this.type="mosaic",this.seriesType=az.mosaic,this.handleAfterStackRegion=(t,e)=>{t.getSeries().forEach((t=>{const i=t.getStackData(),s=t.getStackValue(),n=t.getStackValueField();i&&n&&(Fj(e[s],n),zj(t,e[s]))}))}}_beforeInit(){this._dataSet&&oH(this._dataSet,"stackSplit",XG)}_initStack(){this._stack=new qG(this,{afterStackRegion:this.handleAfterStackRegion}),this._stack.init()}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};O8.type="mosaic",O8.seriesType=az.mosaic,O8.transformerConstructor=P8;const I8=()=>{kY(),MY(),TY(),eY(),tY(),s1(),Fz.registerChart(O8.type,O8)};class R8 extends cW{constructor(){super(R8.type),this.type="ChartResizeZoomPlugin",this._zoom=1,this._onWheel=t=>{t.preventDefault(),t.stopImmediatePropagation();const e=Math.pow(1.005,-t.deltaY*Math.pow(16,t.deltaMode)*.2*this._rate),i={x:t.offsetX,y:t.offsetY};this.zoom(e,i)}}onAfterInitChart(t,e){var i,s,n,r,a;const o=t.globalInstance,l=null!==(s=null===(i=o.getSpec())||void 0===i?void 0:i[R8.specKey])&&void 0!==s?s:{enabled:!1};!0===l.enabled&&(this._minZoom=null!==(n=l.min)&&void 0!==n?n:.1,this._maxZoom=null!==(r=l.max)&&void 0!==r?r:10,this._rate=null!==(a=l.rate)&&void 0!==a?a:.1,this._container=o.getContainer(),this._triggerEvent=EK(t.globalInstance.getChart().getOption().mode).zoom,this._container&&this._triggerEvent&&this._container.addEventListener(this._triggerEvent,this._onWheel))}zoom(t,e){const i=this.service.globalInstance;if(!i)return;const s=this._zoom;let n=this._zoom*t;if(n<=this._minZoom&&t<1||n>=this._maxZoom&&t>1)if(n<=this._minZoom&&this._zoom>this._minZoom)n=this._minZoom;else{if(!(n>=this._maxZoom&&this._zoom<this._maxZoom))return;n=this._maxZoom}if(n===s)return;const r=n/s;if(this._zoom=n,i.resize(i.getCurrentSize().width*this._zoom,i.getCurrentSize().height*this._zoom),e&&this._container){const{scrollLeft:t,scrollTop:i}=this._container;this._container.scrollLeft=t+e.x*(r-1),this._container.scrollTop=i+e.y*(r-1)}}release(){this._container&&this._triggerEvent&&this._container.removeEventListener(this._triggerEvent,this._onWheel)}}R8.specKey="resizeZoom",R8.type="ChartResizeZoomPlugin";function D8(t,i="ChartContainer",s){const n=e.forwardRef(((i,n)=>{const r=e.useRef(null),[a,o]=e.useState(!1),{className:l,style:h,width:c,height:d,id:u}=i,p=
9
+ let sJ=class t extends VZ{constructor(e){super(j({},t.defaultOptions,e)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,c=this.getTextFontFamily(t),d=this.options.createCanvas({width:1,height:1}),u=d.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+c;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let f=p+2*g,m=3*g;const v=Math.ceil(f/this.gridSize),y=Math.ceil(m/this.gridSize);f=v*this.gridSize,m=y*this.gridSize;const _=-p/2,b=.4*-g,x=Math.ceil((f*Math.abs(Math.sin(h))+m*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((f*Math.abs(Math.cos(h))+m*Math.abs(Math.sin(h)))/this.gridSize),A=S*this.gridSize,k=x*this.gridSize;d.setAttribute("width",""+A),d.setAttribute("height",""+k),u.scale(1,1),u.translate(A/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+c,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,_,b);const C=u.getImageData(0,0,A,k).data;if(this.exceedTime())return null;const M=[];let w,T=S;const B=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(C[4*((e*this.gridSize+s)*A+(t*this.gridSize+n))+3])return i.push([t,e]),t<B[3]&&(B[3]=t),t>B[1]&&(B[1]=t),e<B[0]&&(B[0]=e),void(e>B[2]&&(B[2]=e))}};for(;T--;)for(w=x;w--;)E(T,w,M);return{datum:t,occupied:M,bounds:B,gw:S,gh:x,fillTextOffsetX:_,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:c,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let e=0;for(let t=0;t<this.ngx;t++)for(let i=0;i<this.ngy;i++)this.grid[t][i]&&e++;return e/t}canFitText(t,e,i,s,n){let r=n.length;for(;r--;){const i=t+n[r][0],s=e+n[r][1];if(i>=this.ngx||s>=this.ngy||i<0||s<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[i][s])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),Z(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(g(e)){const i=ZZ(e,t.width,t.height,void 0,!1,this.options.createCanvas);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n=qZ(e.backgroundColor,void 0,this.options.createCanvas);const r=(t,e)=>{let i=this.gridSize;for(;i--;){let r=this.gridSize;for(;r--;)if(!n(s,e*this.gridSize+i,t*this.gridSize+r))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let a=this.ngx;for(;a--;){this.grid[a]=[];let t=this.ngy;for(;t--;)r(a,t),!1!==this.grid[a][t]&&(this.grid[a][t]=!0)}s=n=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=zZ(this.options.shape,[e.width,e.height]);return this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(s/this.gridSize),this.initGrid(e),this.result=[],this.progressiveRun()}};sJ.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class nJ extends VZ{constructor(t){super(j({},nJ.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let e=0,i=this.result.length;e<i;e++)if(rJ(t,this.result[e]))return!1;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=this.options.getTextBounds(i);return i.width=s.width(),i.height=s.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}layoutWord(t){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s<this.maxRadius;)s+=.5,l=this.shape(s/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i<t.length&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.result}}function rJ(t,e){return!(t.left+t.width<e.left||t.top+t.height<e.top||t.left>e.left+e.width||t.top>e.top+e.height)}nJ.defaultOptions={enlarge:!1};const aJ={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},oJ=(t,e)=>{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return at.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,h=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]);const c=t.fontFamily?lJ(t.fontFamily):"sans-serif",d=t.fontStyle?lJ(t.fontStyle):"normal",u=t.fontWeight?lJ(t.fontWeight):"normal",p=t.rotate?lJ(t.rotate):0,g=lJ(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",m=t.padding?lJ(t.padding):1,v=null!==(n=t.shape)&&void 0!==n?n:"square",y=null!==(r=t.shrink)&&void 0!==r&&r,_=null!==(a=t.enlarge)&&void 0!==a&&a,b=null!==(o=t.clip)&&void 0!==o&&o,x=t.minFontSize,A=t.randomVisible,k=t.as?Object.assign(Object.assign({},aJ),t.as):aJ,C=t.depth_3d,M=t.postProjection;let w=t.fontSize?lJ(t.fontSize):14;const T=t.fontSizeRange;if(T&&!S(w)){const t=w,e=cJ(dJ(t,l),T);w=i=>e(t(i))}let B=WZ;"fast"===t.layoutType?B=nJ:"grid"===t.layoutType&&(B=sJ);const E=new B(Object.assign(Object.assign({},t),{text:g,padding:m,spiral:f,shape:v,rotate:p,fontFamily:c,fontStyle:d,fontWeight:u,fontSize:w,shrink:y,clip:b,enlarge:_,minFontSize:x,random:A,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r<a;r++)n=e[r],s=n.datum,s[k.x]=n.x,s[k.y]=n.y,s[k.fontFamily]=n.fontFamily,s[k.fontSize]=n.fontSize,s[k.fontStyle]=n.fontStyle,s[k.fontWeight]=n.fontWeight,s[k.angle]=n.angle,"StereographicProjection"===M&&uJ(h,n,s,k,C),t.dataIndexKey&&(s[t.dataIndexKey]=`${r}`),i.push(s);return i}}));return E.layout(l,{width:h[0],height:h[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:E}:E.output()},lJ=t=>y(t)||S(t)||d(t)||_(t)?t:e=>e[t.field],hJ=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),cJ=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=hJ(t[0]),n=hJ(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(hJ(t)-r)/(a-r)*(e[1]-e[0])+e[0]},dJ=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=et(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function uJ(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:i*Math.sin(l)*Math.cos(o)+s.x,y:i*Math.cos(l)+s.y,z:i*Math.sin(l)*Math.sin(o)+s.z}}(t[0],t[1],r,{x:r,y:r,z:null!=n?n:r},e);i[s.x]=a.x,i[s.y]=a.y,i[s.z]=a.z}var pJ;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(pJ||(pJ={}));class gJ{constructor(t=1e3){this._map=new Map,this._maxSize=t}get(t){const e=this._map.get(t);if(void 0!==e)return this._map.delete(t),this._map.set(t,e),e}set(t,e){if(this._map.has(t))this._map.set(t,e);else{if(this._map.size>=this._maxSize){const t=this._map.keys().next().value;void 0!==t&&this._map.delete(t)}this._map.set(t,e)}}clear(){this._map.clear()}size(){return this._map.size}}const fJ=t=>/^[\u4e00-\u9fa5]+$/.test(t),mJ=(t,e)=>{if(u(t))return 0;let i=0;for(const e of t)fJ(e)?i+=1:i+=.53;return i};function vJ(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:c,shapeMaxR:d,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=AJ(i);let f=g.slice(0);const m=e.fontSizeShrinkFactor;let v=null,y=1,_=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let i=0;i<o.length;i++){const n=o[i],{words:c,center:d,maxR:u,ratio:b}=n;let S=!1;for(let i=0;i<c.length;i++){xJ(l,p,t,i,e.measureCache);const n=c[i];if(n.x=d[0],n.y=d[1],!n.skip&&n.hasText&&n.sprite&&yJ(f,n,u,b,a,h,s))n.hasPlaced=!0;else{if(!n.skip&&n.weight>x&&_>r){const e=n.datum[Symbol.for("vGrammar_id")];e!==v&&(v=e,y=_),_*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),f=g.slice(0),S=!0;break}if(!n.skip&&n.datum[Symbol.for("vGrammar_id")]===v){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/_})),n.skip=!0,_=y,v=null,f=g.slice(0),S=!0;break}}}S&&(i=-1)}for(let i=0;i<e.textLayoutTimes;i++){const i=t.filter((t=>(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t<i.length;t++){const n=i[t];xJ(l,p,i,t,e.measureCache),n.x=c[0],n.y=c[1],n.hasText&&yJ(f,n,d,u,a,h,s)&&(n.hasPlaced=!0)}}e.board=f}function yJ(t,e,i,s,n,r,a){const o=e.x,l=e.y,h=function(t){return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}(s),c=1*a;let d,u,p,g=-c;for(;d=h(g+=c);){const{wordSize:s,bounds:{dTop:a,dBottom:h,dLeft:c,dRight:g}}=e;if(u=d[0],p=d[1],Math.min(Math.abs(u),Math.abs(p))>=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-c<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||bJ(e,t,r)))return _J(e,t,r),!0}return!1}function _J(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,c=s[1];let d,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<r;i++)e[u+i]|=n[t*r+i];u+=a}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=r;i++)e[u+i]|=d<<h|(i<r?(d=n[t*r+i])>>>l:0);u+=a}}function bJ(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,c=n[1];let d,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<a;i++)if(e[u+i]&s[t*a+i])return!0;u+=r}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=a;i++)if((d<<h|(i<a?(d=s[t*a+i])>>>l:0))&e[u+i])return!0;u+=r}return!1}function xJ(t,e,i,s,n){const r=i[s];if(r.sprite||0===r.fontSize)return;if(n){const t=n.get(SJ(r));if(t)return r.sprite=t.sprite,r.bounds=t.bounds,r.wordSize=t.wordSize,void(r.hasText=!0)}const a=2048,o=Math.PI/180,l=i.length;t.width=a,t.height=2048,e.clearRect(0,0,a,2048),e.textAlign="center";let h,c,d=0,u=0,p=0,g=0;const f=s;for(--s;++s<l;){const t=i[s],n=Math.max(t.fontSize,2);if(e.save(),e.font=t.fontStyle+" "+t.fontWeight+" "+n+"px "+t.fontFamily,h=e.measureText(t.text+"m").width+2*t.padding,c=2*n+2*t.padding,0!==t.rotate){const e=Math.sin(t.rotate*o),i=Math.cos(t.rotate*o),s=h*i,n=h*e,r=c*i,a=c*e;h=Math.max(Math.abs(s+a),Math.abs(s-a)),c=~~Math.max(Math.abs(n+r),Math.abs(n-r))}if(h=h+31>>5<<5,c=Math.ceil(c),c>p&&(p=c),d+h>=a&&(d=0,u+=p,p=c),u+c>=2048){if(0===u){t.hasText=!1;continue}break}u+c>=g&&(g=u+c),e.translate(d+(h>>1),u+(c>>1)),0!==t.rotate&&e.rotate(t.rotate*o),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[d,u],t.wordSize=[h,c],t.hasText=!0,d+=h}if(0===g)return;const m=e.getImageData(0,0,a,g).data;let v,y;for(;--s>=f;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[d,u]=e;const o=r[0]>>5,l=new Array(o*r[1]).fill(0);let[h,c,p,g]=[1/0,-1/0,1/0,-1/0];for(y=0;y<r[1];y++){let t;for(v=0;v<r[0];v++)if(m[4*((u+y)*a+(d+v))+3]>0){const e=1<<31-v%32;l[o*y+(v>>5)]|=e,v<p&&(p=v),v>g&&(g=v),t|=e}t&&(y<h&&(h=y),y>c&&(c=y))}if(t.bounds={dTop:(r[1]>>1)-h,dBottom:c-(r[1]>>1),dLeft:(r[0]>>1)-p,dRight:g-(r[0]>>1)},t.sprite=l,n){const e=SJ(t);n.set(e,{sprite:l,bounds:t.bounds,wordSize:r})}delete t.LT}}function SJ(t){return String(t.text)+"|"+String(t.fontFamily)+"|"+String(t.fontStyle)+"|"+String(t.fontWeight)+"|"+String(t.fontSize)+"|"+String(t.rotate)+"|"+String(t.padding)}function AJ(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t<s[1];t++)for(let i=0;i<s[0];i++)if(0===e[t*s[0]+i]){const e=1<<31-i%32;r[n*t+(i>>5)]|=e}if(i[0]>s[0]){const t=(1<<i[0]-s[0])-1;for(let e=0;e<s[1];e++)r[n*e+n-1]|=t}return r}function kJ(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),a<t.length&&(i[r].wordsNum+=t.length-a);let o=r;const l=i.map((t=>t.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?vJ(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:c,shapeRatio:d}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=AJ(i);let g=p.slice(0);const f=e.fontSizeEnlargeFactor,m=Math.min(r,t.length);let v=0;t.length>m&&(v=t.sort(((t,e)=>e.weight-t.weight))[m-1].weight);let y=0,_=1,b=!1;for(let r=0;r<a.length;r++){const h=a[r],{words:c,center:d,maxR:x,ratio:S}=h;let A=!1;for(let r=0;r<c.length;r++){xJ(o,u,t,r,e.measureCache);const a=c[r];if(a.x=d[0],a.y=d[1],a.hasText&&a.sprite&&yJ(g,a,x,S,s,l,n)){if(a.hasPlaced=!0,a.weight>=v&&y++,y>=m&&!b){_*=f,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*f})),g=p.slice(0),A=!0,y=0;break}}else{if(a.weight>=v&&_>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/f})),_/=f,b=!0,g=p.slice(0),A=!0;break}if(a.weight>=v)return vJ(t,e,i)}}A&&(r=-1)}for(let i=0;i<e.textLayoutTimes;i++){const i=t.filter((t=>(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t<i.length;t++){const r=i[t];xJ(o,u,i,t,e.measureCache),r.x=h[0],r.y=h[1],r.hasText&&yJ(g,r,c,d,s,l,n)&&(r.hasPlaced=!0)}}e.board=g}(t,e,i):function(t,e,i){const{size:s,stepFactor:n}=e,{segmentation:{regions:r},tempCanvas:a,boardSize:o,shapeCenter:l,shapeMaxR:h,shapeRatio:c}=i,d=AJ(i),u=a.getContext("2d",{willReadFrequently:!0});for(const i of r){const{words:r,center:l,maxR:h,ratio:c}=i;for(let i=0;i<r.length;i++){xJ(a,u,t,i,e.measureCache);const p=r[i];p.x=l[0],p.y=l[1],p.hasText&&p.sprite&&yJ(d,p,h,c,s,o,n)&&(p.hasPlaced=!0)}}for(let i=0;i<e.textLayoutTimes;i++){const i=t.filter((t=>(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t<i.length;t++){const r=i[t];xJ(a,u,i,t,e.measureCache),r.x=l[0],r.y=l[1],r.hasText&&yJ(d,r,h,c,s,o,n)&&(r.hasPlaced=!0)}}e.board=d}(t,e,i);const s=function(t,e,i){const{size:s,fillingTimes:n,fillingXStep:r,fillingYStep:a,getFillingFontStyle:o,getFillingFontWeight:l,getFillingFontFamily:h,fillingInitialFontSize:c,fillingDeltaFontSize:d,fillingInitialOpacity:u,fillingDeltaOpacity:p,fillingRotateList:g,getFillingPadding:f,random:m,board:v,minFillFontSize:y}=e,{boardSize:_,shapeBounds:b,tempCanvas:x,randomGenerator:S}=i,A=x.getContext("2d",{willReadFrequently:!0});let k=c,C=u;const M=[];for(let t=0;t<n;t++)w(k,C),k=Math.max(k>d?k-d:d,y),C=C>p?C-p:p;return M;function w(i,n){const c=t.map((t=>{const{text:e,color:s,fillingColor:r,hasPlaced:a,datum:c}=t;return{x:0,y:0,weight:0,text:e,fontFamily:h(c),fontStyle:o(c),fontWeight:l(c),fontSize:i,rotate:g[~~(S()*g.length)],padding:f(c),opacity:n,visible:!0,color:s,fillingColor:r,hasPlaced:a,datum:c}}));T(c);let d=0;const{x1:u,y1:p,x2:y,y2:k}=b,[C,w]=[u+~~(S()*r*2),p+~~(S()*a*2)];for(let t=w;t<=k;t+=a)for(let i=C;i<=y;i+=r){xJ(x,A,c,d,e.measureCache);const n=c[d];n.x=i,n.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=n;if(!o||!a){++d===c.length&&(d=0,m&&T(c));continue}const{dTop:l,dBottom:h,dLeft:u,dRight:p}=a;n.x-u<0||n.x+p>s[0]||n.y-l<0||n.y+h>s[1]||n.hasText&&n.sprite&&!bJ(n,v,_)&&(_J(n,v,_),M.push(Object.assign({},n)),++d===c.length&&(d=0,m&&T(c)))}}function T(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;e<t.length;e++)t[e].hasPlaced?r.push(t[e]):n.push(t[e]);return n.forEach((t=>t.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}const CJ={x:"x",y:"y",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle",opacity:"opacity",visible:"visible",isFillingWord:"isFillingWord",color:"color"};class MJ{constructor(t){this.progressiveResult=[],this.options=t}layout(t){this.data=t;const e=this.options,i={shapeUrl:e.shape,size:e.size,ratio:e.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0},s=this.options.createCanvas({width:e.size[0],height:e.size[1]}),n=s.getContext("2d",{willReadFrequently:!0});n.textAlign="center",n.textBaseline="middle",i.tempCanvas=s;const r=e.size[0]+31>>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,y(i.shapeUrl)){i.isEmptyPixel=qZ(void 0,void 0,this.options.createCanvas);const t=function(t,e){return t&&(C(t)||M(t)||t.startsWith("<svg"))?new Promise(((i,s)=>{var n;const r=e({image:t}),a=null===(n=r.resources)||void 0===n?void 0:n.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const n=null===(e=r.resources)||void 0===e?void 0:e.get(t);n&&"success"===n.state&&n.data?i(n.data):s(new Error("image load failed: "+t))}else s(new Error("image load failed: "+t))},r.failCallback=()=>{s(new Error("image load failed: "+t))})})):null}(i.shapeUrl,this.options.createImage);t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=this.options.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let s=0;s<t;++s)if(!i(r,e,s))return!1;return!0},d=(t,e,s)=>{for(let n=e;n<s;++n)if(!i(r,n,t))return!1;return!0};for(;a<o&&c(n,a);)++a;for(;o-1>a&&c(n,o-1);)--o;for(;l<h&&d(l,a,o);)++l;for(;h-1>l&&d(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=qZ(i.shapeUrl.backgroundColor,void 0,this.options.createCanvas);const t=ZZ(i.shapeUrl,e.size[0],e.size[1],void 0,!1,this.options.createCanvas);i.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){this.isImageFinished&&!this.isLayoutFinished&&(this.segmentationInput.maskCanvas&&this.doLayout(),this.isLayoutFinished=!0)}progressiveOutput(){return this.progressiveResult}doLayout(){var t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b,x;const S=this.segmentationInput,A=iJ(S);if(!A.segmentation.regions.length)return;const k=this.options,C=this.data,M=k.colorMode||"ordinal",w={getText:Pt(k.text),getFontSize:Pt(k.fontSize),fontSizeRange:k.fontSizeRange,colorMode:M,getColor:k.colorField?Pt(k.colorField):Pt(k.text),getFillingColor:Pt(k.fillingColorField),colorList:k.colorList||("ordinal"===M?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:Pt(k.colorHexField),getFontFamily:Pt(k.fontFamily||"sans-serif"),rotateList:k.rotateList||[0],getPadding:Pt(k.padding||1),getFontStyle:Pt(k.fontStyle||"normal"),getFontWeight:Pt(k.fontWeight||"normal"),getFontOpacity:k.fontOpacity?Pt(k.fontOpacity):()=>1};TJ(C,w,A);const T={size:k.size,ratio:k.ratio||.8,measureCache:null!==(t=k.measureCache)&&void 0!==t?t:new gJ,shapeUrl:k.shape,random:void 0===k.random||k.random,textLayoutTimes:null!==(e=k.textLayoutTimes)&&void 0!==e?e:3,removeWhiteBorder:k.removeWhiteBorder,layoutMode:null!==(i=k.layoutMode)&&void 0!==i?i:"default",fontSizeShrinkFactor:null!==(s=k.fontSizeShrinkFactor)&&void 0!==s?s:.8,stepFactor:null!==(n=k.stepFactor)&&void 0!==n?n:1,importantWordCount:null!==(r=k.importantWordCount)&&void 0!==r?r:10,globalShinkLimit:k.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(a=k.fontSizeEnlargeFactor)&&void 0!==a?a:1.5,fillingRatio:null!==(o=k.fillingRatio)&&void 0!==o?o:.7,fillingTimes:null!==(l=k.fillingTimes)&&void 0!==l?l:4,fillingXStep:k.fillingXRatioStep?Math.max(Math.floor(k.size[0]*k.fillingXRatioStep),1):null!==(h=k.fillingXStep)&&void 0!==h?h:4,fillingYStep:k.fillingYRatioStep?Math.max(Math.floor(k.size[1]*k.fillingYRatioStep),1):null!==(c=k.fillingYStep)&&void 0!==c?c:4,fillingInitialFontSize:k.fillingInitialFontSize,fillingDeltaFontSize:k.fillingDeltaFontSize,fillingInitialOpacity:null!==(d=k.fillingInitialOpacity)&&void 0!==d?d:.8,fillingDeltaOpacity:null!==(u=k.fillingDeltaOpacity)&&void 0!==u?u:.05,getFillingFontFamily:Pt(k.fillingFontFamily||"sans-serif"),getFillingFontStyle:Pt(k.fillingFontStyle||"normal"),getFillingFontWeight:Pt(k.fillingFontWeight||"normal"),getFillingPadding:Pt(null!==(p=k.fillingPadding)&&void 0!==p?p:.4),fillingRotateList:null!==(g=k.fillingRotateList)&&void 0!==g?g:[0,90],fillingDeltaFontSizeFactor:null!==(f=k.fillingDeltaFontSizeFactor)&&void 0!==f?f:.2,fillingColorList:k.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(m=k.minInitFontSize)&&void 0!==m?m:10,minFontSize:null!==(v=k.minFontSize)&&void 0!==v?v:4,minFillFontSize:null!==(y=k.minFillFontSize)&&void 0!==y?y:2},B=((t,e)=>{if(1===e.length&&"#537EF5"===e[0])return!0;if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0})(w.colorList,T.fillingColorList);T.sameColorList=B,wJ(C,w,T,k),function(t,e,i,s){const{getText:n}=e;let{fillingInitialFontSize:r,fillingDeltaFontSize:a}=i;const{fillingRatio:o}=i,l=Math.ceil(Math.sqrt(s.shapeArea)/4);if(!r||!a){const e=o/100,h=t.reduce(((t,e)=>{const i=mJ(n(e));return i>l?t:t+i}),0)/t.length;let c;if(0===h)c=8;else{const t=.2*s.shapeArea;c=Math.sqrt(e*(t/h))}r=~~c,a=c*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(C,w,T,A);const{getText:E,getFontFamily:P,getFontStyle:O,getFontWeight:I,getPadding:R,getColor:D,getFillingColor:L,getColorHex:F,fontSizeScale:z,colorScale:j,fillingColorScale:H,getFontOpacity:N,rotateList:V}=w,U=C.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:P(t),fontWeight:I(t),fontStyle:O(t),rotate:V[~~(S.randomGenerator()*V.length)],fontSize:Math.max(T.minInitFontSize,~~z(t)),opacity:N(t),padding:R(t),color:F&&F(t)||j&&j(D(t))||"black",fillingColor:!L||(null===(e=k.colorField)||void 0===e?void 0:e.field)===(null===(i=k.fillingColorField)||void 0===i?void 0:i.field)&&B?void 0:F&&F(t)||H&&H(L(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),W=$(U.map((t=>t.fontSize)));U.forEach((t=>t.weight=t.fontSize/W)),U.sort(((t,e)=>e.weight-t.weight));const{fillingWords:G,successedWords:Y,failedWords:K}=kJ(U,T,A),X=null!==(b=null===(_=k.text)||void 0===_?void 0:_.field)&&void 0!==b?b:"textKey",q=null!==(x=k.dataIndexKey)&&void 0!==x?x:"defaultDataIndexKey",Z=k.as?Object.assign(Object.assign({},CJ),k.as):CJ;let J,Q;const tt=[];for(let t=0;t<U.length;++t)J=U[t],Q=J.datum,Q[Z.x]=J.x,Q[Z.y]=J.y,Q[Z.fontFamily]=J.fontFamily,Q[Z.fontSize]=J.fontSize,Q[Z.fontStyle]=J.fontStyle,Q[Z.fontWeight]=J.fontWeight,Q[Z.angle]=oe(J.rotate),Q[Z.opacity]=J.opacity,Q[Z.visible]=J.visible,Q[Z.isFillingWord]=!1,Q[Z.color]=J.color,Q[q]=`${J.text}_${t}_keyword`,tt.push(Q);const et=[];G.forEach(((t,e)=>{var i,s;const n=Object.assign({},t.datum);n[Z.x]=t.x,n[Z.y]=t.y,n[Z.fontFamily]=t.fontFamily,n[Z.fontSize]=t.fontSize,n[Z.fontStyle]=t.fontStyle,n[Z.fontWeight]=t.fontWeight,n[Z.angle]=oe(t.rotate),n[Z.opacity]=t.opacity,n[Z.visible]=t.visible,n[Z.isFillingWord]=!0,n[Z.color]=L?(null===(i=k.colorField)||void 0===i?void 0:i.field)===(null===(s=k.fillingColorField)||void 0===s?void 0:s.field)&&B?t.color:t.fillingColor:T.fillingColorList[~~(S.randomGenerator()*T.fillingColorList.length)],n[X]=t.text,n[q]=`${t.text}_${e}_fillingWords`,et.push(n)})),this.options.onLayoutFinished&&this.options.onLayoutFinished({successedWords:Y,failedWords:K}),this.progressiveResult=tt.concat(et)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const wJ=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:c}=e,{sameColorList:d}=i;let u,p,g=e.colorList,f=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new eR).domain(e).range(g).scale(t),c&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!d)){const e=t.map((t=>c(t)));p=t=>(new eR).domain(e).range(f).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new CR).domain(EJ(h,t)).range(g);if(u=t=>e.scale(t),c&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!d)){1===f.length&&(f=[f[0],f[0]]);const e=(new CR).domain(EJ(c,t)).range(f);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},TJ=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new ER).domain(EJ(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&d(n)&&!s){const e=.5,[o,l]=EJ(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),c=BJ(h,i,!0);s=[~~(e*c),~~c];const d=(new ER).domain(EJ(n,t)).range(s);a=t=>d.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=BJ(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},BJ=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=mJ(e.text);return s<a?t+s*(i?(.5+.5*e.weight)**2:1):t}),0);if(0===o)return 12;let l=20;if(1===r.length)l=Math.sqrt(n*(s/(1.7*o)));else{const t=[];for(let e=0;e<r.length;e++){const i=r[e].area,a=r[e].ratio,l=i/s;if(l<.1)continue;const h=l*(o*(a<1?2.7-a:1.7)),c=Math.sqrt(n*(i/h));t.push(c)}l=t.length?Math.min(...t):Math.sqrt(n*(s/(1.7*o)))}return l};const EJ=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=et(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},PJ=(t,e,i)=>{if(!t.size||u(t.size[0])||u(t.size[1])||t.size[0]<=0||t.size[1]<=0)return at.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(t.size[0]),Math.ceil(t.size[1])],t.shape||at.getInstance().error("WordcloudShape shape must be specified."),t.text||at.getInstance().error("WordcloudShape text must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];const s=new MJ(t);return s.layout(e),s.unfinished()?{progressive:s}:s.output()};class OJ extends Lq{constructor(){super(...arguments),this.type=az.wordCloud}}OJ.type=az.wordCloud;const IJ=()=>{Fz.registerGrammarTransform("wordcloud",{transform:oJ}),z$(),zq(),Fz.registerSeries(OJ.type,OJ)},RJ=t=>d(t)?t():t,DJ=(t,e)=>{var i,s,n,r;const a=t.map((t=>Object.assign({},t)));if(!a||0===a.length)return a;const{asTransformRatio:o,asReachRatio:l,asHeightRatio:h,asValueRatio:c,asNextValueRatio:d,asLastValueRatio:u,asLastValue:p,asCurrentValue:g,asNextValue:f}=e,m=RJ(e.valueField),v=null!==(i=RJ(e.heightVisual))&&void 0!==i&&i,y=null===(s=RJ(e.isCone))||void 0===s||s,_=RJ(e.range),b=a.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[m])||-1/0)),-1/0),x=a.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[m])||1/0)),1/0),S=[null!==(n=null==_?void 0:_.min)&&void 0!==n?n:x,null!==(r=null==_?void 0:_.max)&&void 0!==r?r:b];return a.forEach(((t,e)=>{var i,s;const n=Number.parseFloat(t[m]),r=Number.parseFloat(null===(i=a[e-1])||void 0===i?void 0:i[m]),_=Number.parseFloat(null===(s=a[e+1])||void 0===s?void 0:s[m]),b=k(_*n)&&0!==n?_/n:0,x=k(n*r)&&0!==r?n/r:0;p&&(t[p]=r),f&&(t[f]=_),o&&(t[o]=b),l&&(t[l]=0===e?1:x),h&&(t[h]=!0===v?b:1/a.length),c&&(t[c]=n/S[1]),d&&(t[d]=e===a.length-1?y?0:t[c]:_/S[1]),u&&(t[u]=0===e?1:r/S[1]),g&&(t[g]=n)})),a},LJ=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},FJ=`${rj}_FUNNEL_TRANSFORM_RATIO`,zJ=`${rj}_FUNNEL_REACH_RATIO`,jJ=`${rj}_FUNNEL_HEIGHT_RATIO`,HJ=`${rj}_FUNNEL_VALUE_RATIO`,NJ=`${rj}_FUNNEL_LAST_VALUE_RATIO`,VJ=`${rj}_FUNNEL_NEXT_VALUE_RATIO`,UJ=`${rj}_FUNNEL_LAST_VALUE`,WJ=`${rj}_FUNNEL_CURRENT_VALUE`,GJ=`${rj}_FUNNEL_NEXT_VALUE`,YJ=`${rj}_FUNNEL_TRANSFORM_LEVEL`;class KJ extends WV{constructor(t){var e,i;super(t),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?this._transformRatioText:null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?`${(100*(null==t?void 0:t[zJ])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return this._transformRatioText;const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return p(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]},this._transformRatioText=null!==(i=null===(e=t.getSpec())||void 0===e?void 0:e.transformRatioText)&&void 0!==i?i:"转化率"}}class $J extends KN{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class XJ extends $J{constructor(){super(...arguments),this.type=XJ.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}XJ.type="polygon";const qJ=()=>{Fz.registerMark(XJ.type,XJ),kT(),gT(),pV(),Fz.registerGraphicComponent("polygon",Kf)},ZJ=Object.assign(Object.assign({},iU),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class JJ extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class QJ extends CU{constructor(){super(...arguments),this.type=az.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=JJ,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(n=null===(s=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===s?void 0:s.minLength)&&void 0!==n?n:20,this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;oH(this._dataSet,"funnel",DJ),oH(this._dataSet,"funnelTransform",LJ);const t=new so(this._dataSet,{name:`${rj}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new FN(this._option,t)}compile(){var t,e;super.compile(),this._funnelOuterLabelMark&&(null===(t=this._funnelOuterLabelMark.label)||void 0===t||t.compile({group:this._rootMark.getProduct()}),null===(e=this._funnelOuterLabelMark.line)||void 0===e||e.compile({group:this._rootMark.getProduct()}))}compileData(){var t;super.compileData(),null===(t=this._viewDataTransform)||void 0===t||t.compile()}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:()=>this.getValueField(),isCone:()=>this._spec.isCone,asCurrentValue:WJ,asTransformRatio:FJ,asReachRatio:zJ,asHeightRatio:jJ,asValueRatio:HJ,asNextValueRatio:VJ,asLastValueRatio:NJ,asLastValue:UJ,asNextValue:GJ,range:()=>this._spec.range}}),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.transform({type:"funnelTransform",options:{asIsTransformLevel:YJ}})}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},QJ.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:gU(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},QJ.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(QJ.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(QJ.mark.outerLabelLine,{themeSpec:e,markSpec:t,noSeparateStyle:!0,parent:!1})}}initTooltip(){this._tooltipHelper=new KJ(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){var t,e,i,s;const n=this._funnelMark;n&&this.setMarkStyle(n,{points:t=>this.getPoints(t),visible:t=>p(t[this._valueField]),fill:this.getColorAttribute()},"normal",hN.Series);const r=this._funnelTransformMark;r&&this.setMarkStyle(r,{points:t=>this.getPoints(t)},"normal",hN.Series);const a=this._funnelOuterLabelMark.label;a&&(this.setMarkStyle(a,{text:t=>`${t[this.getCategoryField()]}`,x:t=>this._computeOuterLabelPosition(t).x,y:t=>this._computeOuterLabelPosition(t).y,textAlign:t=>this._computeOuterLabelPosition(t).align,textBaseline:t=>this._computeOuterLabelPosition(t).textBaseline,maxLineWidth:t=>this._computeOuterLabelLimit(t),width:0,height:0},"normal",hN.Series),d(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(a,{text:t=>this._spec.outerLabel.formatMethod(`${t[this.getCategoryField()]}`,t)},"normal",hN.User_Mark));const o=this._funnelOuterLabelMark.line;if(o&&a){this.setMarkStyle(o,{x:t=>this._computeOuterLabelLinePosition(t).x1,y:t=>this._computeOuterLabelLinePosition(t).y1,x1:t=>this._computeOuterLabelLinePosition(t).x2,y1:t=>this._computeOuterLabelLinePosition(t).y2},"normal",hN.Series);const n=null!==(i=null===(e=null===(t=this._spec.outerLabel)||void 0===t?void 0:t.line)||void 0===e?void 0:e.visible)&&void 0!==i?i:null===(s=this._spec.outerLabel)||void 0===s?void 0:s.visible;p(n)&&o.setVisible(n)}}initLabelMarkStyle(t){var e;if(!t)return;const i=t.getTarget(),s=t.getComponent();if(i===this._funnelMark){this._labelMark=t,this.setMarkStyle(t,{text:t=>`${t[this.getCategoryField()]} ${t[this.getValueField()]}`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.label),stroke:this.getColorAttribute()},"normal",hN.Series);const i=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&$A(i,this._funnelOuterLabelMark.label,s),this._funnelOuterLabelMark.line&&$A(i,this._funnelOuterLabelMark.line,null!==(e=this._funnelOuterLabelMark.label)&&void 0!==e?e:s)}else this._funnelTransformMark&&i===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*nz(zJ).bind(this)(t)).toFixed(1)}%`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.transformLabel)},"normal",hN.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(cU(null===(s=Fz.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),dU("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(cU(Fz.getAnimationInKey("fadeInOut")(),dU(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(cU(Fz.getAnimationInKey("funnel")({},o),dU(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(cU(null===(a=Fz.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),dU("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[NJ])/2:this._getSecondaryAxisLength(t[HJ])/2,n=this._getSecondaryAxisLength(t[HJ])/2):(s=this._getSecondaryAxisLength(t[HJ])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[VJ])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[YJ])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return p(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[hj]===t[hj]));if(!p(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),c=this._getMainAxisLength(!0);return l+=i*(h+c),l+=s?-c/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(S(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r,a;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const o=this.getPoints(t),l=(Math.abs(o[0].x-o[1].x)+Math.abs(o[2].x-o[3].x))/2,h=this.getCategoryField(),c=null===(n=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[h])===t[h]}),!0))||void 0===n?void 0:n.AABBBounds,d=c?c.x2-c.x1:0,u=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0;let p=this.getLayoutRect().width-Math.max(l,d);return"center"===this._funnelAlign&&(p/=2),p-u-(null!==(a=null===(r=this._spec.outerLabel)||void 0===r?void 0:r.spaceWidth)&&void 0!==a?a:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,c;const d=this.getCategoryField(),u=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===s?void 0:s.find((e=>{var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[d])===t[d]})))||void 0===n?void 0:n.AABBBounds,p=null===(a=null===(r=this._labelMark)||void 0===r?void 0:r.getComponent())||void 0===a?void 0:a.getComponent(),g=null===(o=null==p?void 0:p.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[d])===t[d]}),!0))||void 0===o?void 0:o.AABBBounds,f=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};let m,v,y,_;if(this._isHorizontal()){const e=null!==(h=f.spaceWidth)&&void 0!==h?h:5,i=this.getPoints(t),s=(Math.abs(i[0].y-i[1].y)+Math.abs(i[2].y-i[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(y=this._getPolygonCenter(i).y-s/2-e,_=!1!==f.alignLabel?(null==u?void 0:u.y2)+e:y-e,m=this._getPolygonCenter(i).x,y-_<this._minLabelLineWidth&&(_=y-this._minLabelLineWidth),v=m):(y=this._getPolygonCenter(i).y+s/2+e,_=!1!==f.alignLabel?(null==u?void 0:u.y1)-e:y+e,m=this._getPolygonCenter(i).x,_-y<this._minLabelLineWidth&&(_=y+this._minLabelLineWidth),v=m),{x1:m,x2:v,y1:y,y2:_}}const b=this.getPoints(t),x=(Math.abs(b[0].x-b[1].x)+Math.abs(b[2].x-b[3].x))/2,S=(null==g?void 0:g.x2)-(null==g?void 0:g.x1)||0,A=null!==(c=f.spaceWidth)&&void 0!==c?c:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(m=this._getPolygonCenter(b).x+Math.max(S/2,x/2)+A,v=!1!==f.alignLabel?(null==u?void 0:u.x1)-A:m+A,y=this._getPolygonCenter(b).y,v-m<this._minLabelLineWidth&&(v=m+this._minLabelLineWidth),_=y):(m=this._getPolygonCenter(b).x-Math.max(S/2,x/2)-A,v=!1!==f.alignLabel?(null==u?void 0:u.x2)+A:m-A,y=this._getPolygonCenter(b).y,m-v<this._minLabelLineWidth&&(v=m-this._minLabelLineWidth),_=y),{x1:m,x2:v,y1:y,y2:_}}_computeMaxSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return Mz(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}_computeMinSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return Mz(null!==(t=this._spec.minSize)&&void 0!==t?t:0,e)}_isHorizontal(){return"left"===this._funnelOrient||"right"===this._funnelOrient}_isReverse(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._funnelMark]}}QJ.type=az.funnel,QJ.mark=ZJ,QJ.builtInTheme={funnel:Nz},QJ.transformerConstructor=JJ;const tQ=()=>{qJ(),z$(),$K(),Fz.registerSeries(QJ.type,QJ),Fz.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},rV))),Fz.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:jP,customParameters:(e,i)=>({animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),oV()},eQ=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},iQ=t=>{const e=t.filter((t=>t.context.diffState===TN.update)),i=X(e.map((t=>{var e,i;return null===(i=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0].depth})));return e.filter((t=>{var e,s;return(null===(s=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===s?void 0:s[0].depth)===i}))},sQ=(t,e,i)=>P(t)?[e,i]:[X(t.map((t=>1*t.getFinalAttribute().startAngle))),$(t.map((t=>1*t.getFinalAttribute().endAngle)))],nQ=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=sQ(r,s,n);return eQ(i.getFinalAttribute().startAngle,a)*(n-s)+s},to:(t,e)=>e.getFinalAttribute().startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=sQ(r,s,n);return eQ(i.getFinalAttribute().endAngle,a)*(n-s)+s},to:(t,e)=>e.getFinalAttribute().endAngle},outerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:(t,e)=>e.getFinalAttribute().outerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:(t,e)=>e.getFinalAttribute().innerRadius}}}),rQ=t=>[X(t.map((t=>1*t.getFinalAttribute().startAngle))),$(t.map((t=>1*t.getFinalAttribute().endAngle)))],aQ=t=>({channel:{startAngle:{from:(t,e)=>e.getFinalAttribute().startAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=rQ(r);return eQ(i.getFinalAttribute().startAngle,a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getFinalAttribute().endAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iQ(i.parent.children),a=rQ(r);return eQ(i.getFinalAttribute().endAngle,a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getFinalAttribute().outerRadius,to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:()=>t.animationInfo().innerRadius}}}),oQ=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},lQ=(t,e={})=>{if(!t)return[];const i=[];return Vq(t,i,e),i},hQ=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new mZ(i).layout(t,{width:s,height:n})};class cQ extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}var dQ;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(dQ||(dQ={}));const uQ=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(u(n))return t;if(i.type===dQ.DrillDown){return Y(Vj(t,n,s,"children"))}if(i.type===dQ.DrillUp){const e=Uj(t,n,s,"children");if(e)return Y(e)}return t};class pQ{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=EK(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;oH(t,"drillFilter",uQ),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(u(t.datum)||u(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!_(t)||P(t))return t;const s=t[t.length-1];return this._drillInfo={key:s,path:t,type:dQ.DrillDown},e().reRunAllTransform(),i.emit(tH.drill,{value:{path:t,type:dQ.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:s}=this._drillParams,n=null!==(e=null===(t=this._drillInfo)||void 0===t?void 0:t.path)&&void 0!==e?e:[];if(!_(n)||P(n))return n;const r=n.pop();return this._drillInfo={key:r,path:n,type:dQ.DrillUp},i().reRunAllTransform(),s.emit(tH.drill,{value:{path:n,type:dQ.DrillUp},model:this}),n}}const gQ=Object.assign(Object.assign({},iU),{sunburst:{name:"sunburst",type:"arc"}}),fQ=(t,e,i)=>(t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:XV,operations:["max","min","values"]}),t.push({key:qV,operations:["values"]}),t),mQ={innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}};class vQ extends J${constructor(){super(...arguments),this.type=az.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qV),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:hj},getRawData:()=>this.getRawData()}),this._startAngle=oe(this._spec.startAngle),this._endAngle=oe(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),oH(this._dataSet,"sunburstLayout",hQ),oH(this._dataSet,"flatten",lQ),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[p(this._centerX)?this._centerX:this.getLayoutRect().width/2,p(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return fQ(super.getStatisticFields(),this._categoryField,this._valueField)}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(oH(t.dataSet,"addVChartProperty",LV),t.transform({type:"addVChartProperty",options:{beforeCall:tU.bind(this),call:eU}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){if(!1===this._sunburst.visible)return;const t=this._createMark(vQ.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}_initArcMarkStyle(){u(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(p(this._offsetX)?this._offsetX:0),y:t=>t.y+(p(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(vQ.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return g(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(p(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(p(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},BN.STATE_NORMAL,hN.Series)}initTooltip(){this._tooltipHelper=new cQ(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Y(this.__innerRadius))[0],outerRadius:this._computeRadius(Y(this.__outerRadius))[0],startAngle:Y(this._startAngle)[0],endAngle:Y(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),dU(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_computeRadius(t){return _(t)?t.map((t=>this._computeLayoutRadius()*t)):this._computeLayoutRadius()*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}vQ.type=az.sunburst,vQ.mark=gQ,vQ.builtInTheme={sunburst:mQ},G(vQ,pQ);const yQ=()=>{Fz.registerSeries(vQ.type,vQ),dX(),z$(),oV(),Fz.registerAnimation("sunburst",((t,e)=>({appear:oQ(0,e),enter:nQ(t),exit:aQ(t),disappear:{duration:sV.disappear.duration}})))},_Q=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return 0===s||0===n?t:new nZ(i).layout(t,{width:s,height:n})};class bQ extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const xQ=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},SQ=Object.assign(Object.assign({},iU),{circlePacking:{name:"circlePacking",type:"arc"}});class AQ extends TU{constructor(){super(...arguments),this.type=az.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qV),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:hj},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();u(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),oH(this._dataSet,"circlePackingLayout",_Q),oH(this._dataSet,"flatten",lQ),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,valueField:this._valueField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(oH(t.dataSet,"addVChartProperty",LV),t.transform({type:"addVChartProperty",options:{beforeCall:tU.bind(this),call:eU}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const e=this._createMark(AQ.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}_initCirclePackingMarkStyle(){u(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},BN.STATE_NORMAL,hN.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(AQ.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},BN.STATE_NORMAL,hN.Series)}getStatisticFields(){return fQ(super.getStatisticFields(),this._categoryField,this._valueField)}initTooltip(){this._tooltipHelper=new bQ(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),dU(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}AQ.type=az.circlePacking,AQ.mark=SQ,AQ.builtInTheme={circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},G(AQ,pQ);const kQ=()=>{Fz.registerSeries(AQ.type,AQ),dX(),z$(),aV(),Fz.registerAnimation("circlePacking",((t,e)=>({appear:xQ(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:sV.disappear.duration}})))},CQ=(t,e,i)=>{e.forEach((e=>{u(e[i])||t.add(e[i]),e.children&&e.children.length>0&&CQ(t,e.children,i)}))},MQ=t=>{var e;if(!t||!_(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},wQ=(t,e)=>{const i=d(e)?e():e;if(!t||!(null==i?void 0:i.view)||!t.length)return[];const s=i.view();if(s.x1-s.x0==0||s.y1-s.y0==0||s.x1-s.x0==-1/0||s.x1-s.x0==1/0||s.y1-s.y0==-1/0||s.y1-s.y0==1/0)return[];const n=t[0],r=TQ(n,i),a=new pZ(i),o=[];return o.push(a.layout(r,s)),o},TQ=(t,e)=>{if("source"===e.sourceField&&"target"===e.targetField&&"value"===e.valueField)return t;const i=t.links;return i?Object.assign(Object.assign({},t),{links:i.map((t=>{const i={};return Object.keys(t).forEach((s=>{s===e.sourceField?i.source=t[e.sourceField]:s===e.targetField?i.target=t[e.targetField]:s===e.valueField?i.value=t[e.valueField]:i[s]=t[s]})),i}))}):t},BQ=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},EQ=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class PQ extends WV{constructor(){super(...arguments),this._getDimensionData=t=>{if(!u(null==t?void 0:t.source)&&!u(null==t?void 0:t.target)){if(S(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},this.markTooltipValueCallback=t=>t.value}}const OQ=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t),IQ=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"};class RQ extends XE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s,a=this.target.getFinalAttribute();a&&Object.assign(this.target.attribute,a),this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}class DQ extends XE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s;this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const LQ=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c),d=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.y0-n/2),l=d(t.y1-n/2)):"end"===t.align?(o=d(t.y0+t.thickness/2-n),l=d(t.y1+t.thickness/2-n)):(o=d(t.y0-t.thickness/2),l=d(t.y1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${a},${d(l-n/2)}L${d(a+n)},${d((l+p)/2)}L${a},${d(p+n/2)}`:"",m=t.startArrow&&g?`L${r},${d(u+n/2)}L${d(r-n)},${d((o+u)/2)}L${r},${d(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${f}L${a},${p}L${r},${u}${m}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${f}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${m}Z`:`M${r},${o}C${h},${o},${c},${l},${a},${l}\n ${f}L${a},${p}C${c},${p},${h},${u},${r},${u}${m}Z`},FQ=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(d=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c)),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.x0-n/2),l=d(t.x1-n/2)):"end"===t.align?(o=d(t.x0+t.thickness/2-n),l=d(t.x1+t.thickness/2-n)):(o=d(t.x0-t.thickness/2),l=d(t.x1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${d(l-n/2)},${a}L${d((l+p)/2)},${d(a+n)}L${d(p+n/2)},${a}`:"",m=t.startArrow&&g?`L${d(u+n/2)},${r}L${d((u+o)/2)},${d(r-n)}L${d(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${f}L${p},${a}L${u},${r}${m}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${f}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${m}Z`:`M${o},${r}C${o},${h},${l},${c},${l},${a}\n ${f}L${p},${a}C${p},${c},${u},${h},${u},${r}${m}Z`};class zQ extends y${constructor(){super(...arguments),this.type=zQ.type,this._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},this._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],this._channelEncoder={backgroundStyle:t=>({back:t})},this._positionEncoder=(t,e,i)=>{var s,n;const r=Object.assign(Object.assign({},i.attribute),t),a=null!==(s=r.direction)&&void 0!==s?s:null===(n=this._glyphConfig)||void 0===n?void 0:n.direction,o=["vertical","TB","BT"].includes(a)?FQ:LQ,l="number"==typeof r.ratio&&r.ratio>=0&&r.ratio<=1;return{back:{path:l?o(r,1):""},front:{path:o(r,l?r.ratio:1)}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}zQ.type="linkPath";const jQ=Object.assign(Object.assign({},iU),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class HQ extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}const NQ=(t,e,i,s=!0,n)=>{t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&WN(t,e),UN(t,e,s,n)};class VQ extends TU{constructor(){super(...arguments),this.type=az.sankey,this.transformerConstructor=HQ,this._nodeLayoutZIndex=oN.Node,this._labelLayoutZIndex=oN.Label,this._viewBox=new Ke,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(p(a))return a;if(p(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a;const o=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(o)return o;if(p(this._spec.seriesField)){const e=null===(s=this._nodesSeriesData.latestData)||void 0===s?void 0:s.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,a=null===(r=null===(n=this._option)||void 0===n?void 0:n.globalScale)||void 0===r?void 0:r.getScale("color");return null==a?void 0:a.scale(null==i?void 0:i[this._spec.seriesField])}const l=S(t.source)?this.getNodeList()[t.source]:t.source;return null===(a=this._colorScale)||void 0===a?void 0:a.scale(l)},this._handleEmphasisElement=t=>{var e;const i=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},s=t.item;"adjacency"===i.effect?s&&t.mark===this._nodeMark?this._handleNodeAdjacencyClick(s):s&&t.mark===this._linkMark?this._handleLinkAdjacencyClick(s):this._handleClearEmpty():"related"===i.effect&&(s&&t.mark===this._nodeMark?this._handleNodeRelatedClick(s):s&&t.mark===this._linkMark?this._handleLinkRelatedClick(s):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;const i=null===(t=this._nodeMark)||void 0===t?void 0:t.getGraphics();if(!i||!i.length)return;const s=null===(e=this._linkMark)||void 0===e?void 0:e.getGraphics();s&&s.length&&(i.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])})),s.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])})),this._needClear=!1)},this._handleNodeAdjacencyClick=t=>{const e=Xj(t),i=[e.key];if(this._linkMark){const t=this._linkMark.getGraphics();if(!t||!t.length)return;t.forEach(((t,s)=>{const n=Xj(t);n.source===e.key?(i.includes(n.target)||i.push(n.target),WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),UN(t,BN.STATE_SANKEY_EMPHASIS,!0)):n.target===e.key?(i.includes(n.source)||i.push(n.source),WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),UN(t,BN.STATE_SANKEY_EMPHASIS,!0)):(WN(t,BN.STATE_SANKEY_EMPHASIS),UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{const e=Xj(t),i=[e.source,e.target];if(this._linkMark){const e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach((e=>{e===t?(WN(e,BN.STATE_SANKEY_EMPHASIS_REVERSE),NQ(e,BN.STATE_SANKEY_EMPHASIS,{ratio:1})):(WN(e,BN.STATE_SANKEY_EMPHASIS),UN(e,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;const i=Xj(t),s=this._nodeMark.getGraphics();if(!s||!s.length)return;const n=this._linkMark.getGraphics();if(!n||!n.length)return;const r=(null===(e=Xj(n[0]))||void 0===e?void 0:e.parents)?"parents":"source";if("source"===r){const t=[i.key],e=[];if(n.forEach(((n,r)=>{var a,o,l,h;const c=Xj(n),d=(null==c?void 0:c.parents)?"parents":"source";if(Y(c[d]).includes(i.key)){if(e.includes(null!==(a=c.key)&&void 0!==a?a:c.index)||e.push(null!==(o=c.key)&&void 0!==o?o:c.index),t.includes(c.source)||t.push(c.source),!t.includes(c.target)){t.push(c.target);let i=s.find((t=>t.data[0].key===c.target)).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.target))){t.push(i.target);const e=s.find((t=>t.data[0].key===i.target));n.push(e.data[0].targetLinks)}})),void(i=n)}}}else if(c.target===i.key&&(e.includes(null!==(l=c.key)&&void 0!==l?l:c.index)||e.push(null!==(h=c.key)&&void 0!==h?h:c.index),!t.includes(c.source))){t.push(c.source);let i=s.find((t=>t.data[0].key===c.source)).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.source))){t.push(i.source);const e=s.find((t=>t.data[0].key===i.source));n.push(e.data[0].targetLinks)}})),void(i=n)}}})),this._linkMark){const t=this._linkMark.getGraphics();if(!t||!t.length)return;t.forEach(((t,i)=>{var s;const n=Xj(t);e.includes(null!==(s=n.key)&&void 0!==s?s:n.index)?(WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),UN(t,BN.STATE_SANKEY_EMPHASIS,!0)):(WN(t,BN.STATE_SANKEY_EMPHASIS),UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),t)}else{const t=[i.key],e=i.targetLinks.reduce(((t,e)=>(Y(e.datum).forEach((e=>{const s=e.parents,n=s.length;for(let r=0;r<n;r++){const n=s[r].key,a=s[r+1]?s[r+1].key:i.key,o=e.value,l=t.find((t=>t.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);n.forEach(((s,n)=>{const a=Xj(s),o=a.datum,l=o?o.filter((t=>t[r].some((t=>t.key===i.key)))):null,h=e.find((t=>t.source===a.source&&t.target===a.target));if(l&&l.length){t.includes(a.source)||t.push(a.source),t.includes(a.target)||t.push(a.target);const e=l.reduce(((t,e)=>t+e.value),0)/a.value;return WN(s,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(s,BN.STATE_SANKEY_EMPHASIS,{ratio:e})}if(h)return t.includes(a.source)||t.push(a.source),t.includes(a.target)||t.push(a.target),WN(s,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(s,BN.STATE_SANKEY_EMPHASIS,{ratio:h.value/a.value});WN(s,BN.STATE_SANKEY_EMPHASIS),UN(s,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),t)}this._needClear=!0},this._handleLinkRelatedClick=t=>{const e=this._nodeMark.getGraphics();if(!e||!e.length)return;const i=this._linkMark.getGraphics();if(i&&i.length){if("source"==(Xj(t)?"parents":"source"))this._linkMark&&i.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])})),this._nodeMark&&e.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS,BN.STATE_SANKEY_EMPHASIS_REVERSE])}));else{const s=Xj(t),n=[s.source,s.target],r=[];Y(s.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;s<i-1;s++){const i=e[s].key,n=e[s+1].key,a=t.value,o=r.find((t=>t.source===i&&t.target===n));r.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=a:r.push({source:i,target:n,value:a})}})),i.forEach((t=>{const e=Xj(t),i=e.datum;if(e.source===s.source&&e.target===s.target)return WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(t,BN.STATE_SANKEY_EMPHASIS,{ratio:1});const a=i?i.filter((t=>{const e=t.parents.map((t=>t.key));return e.includes(s.source)&&e.includes(s.target)})):null;if(a&&a.length){n.includes(e.source)||n.push(e.source),n.includes(e.target)||n.push(e.target);const i=a.filter((t=>t.parents.some(((e,i)=>{var n;return e.key===s.source&&(null===(n=t.parents[i+1])||void 0===n?void 0:n.key)===s.target})))).reduce(((t,e)=>t+e.value),0)/e.value;return WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(t,BN.STATE_SANKEY_EMPHASIS,{ratio:i})}const o=r.find((t=>t.source===e.source&&t.target===e.target));if(o)return n.includes(e.source)||n.push(e.source),n.includes(e.target)||n.push(e.target),WN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE),void NQ(t,BN.STATE_SANKEY_EMPHASIS,{ratio:o.value/e.value});WN(t,BN.STATE_SANKEY_EMPHASIS),UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._highLightElements(e,n)}this._needClear=!0}}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){super.initData();const t=this.getViewData(),e=this.getRawData();if(e&&t){oH(this._dataSet,"sankeyLayout",wQ),oH(this._dataSet,"sankeyFormat",MQ),e.transform({type:"sankeyFormat"},!1),t.transform({type:"sankeyLayout",options:()=>{var t,e,i,s;return{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this.direction,crossNodeAlign:this._spec.crossNodeAlign,nodeAlign:null!==(t=this._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(e=this._spec.nodeGap)&&void 0!==e?e:8,nodeWidth:null!==(i=this._spec.nodeWidth)&&void 0!==i?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(s=this._spec.minNodeHeight)&&void 0!==s?s:4,maxNodeHeight:this._spec.maxNodeHeight,minLinkHeight:this._spec.minLinkHeight,maxLinkHeight:this._spec.maxLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer,dropIsolatedNode:this._spec.dropIsolatedNode,nodeHeight:this._spec.nodeHeight,linkHeight:this._spec.linkHeight,equalNodeHeight:this._spec.equalNodeHeight,linkOverlap:this._spec.linkOverlap,inverse:this._spec.inverse}},level:_H.sankeyLayout});const{dataSet:i}=this._option;oH(i,"sankeyNodes",BQ),oH(i,"flatten",lQ);const s=new so(i,{name:`sankey-node-${this.id}-data`});s.parse([this.getViewData()],{type:"dataview"}),s.transform({type:"sankeyNodes"}),s.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),s.transform({type:"addVChartProperty",options:{beforeCall:JV.bind(this),call:QV}},!1),this._nodesSeriesData=s,oH(i,"sankeyLinks",EQ);const n=new so(i,{name:`sankey-link-${this.id}-data`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"sankeyLinks"}),n.transform({type:"addVChartProperty",options:{beforeCall:JV.bind(this),call:QV}},!1),this._linksSeriesData=n}}compileData(){var t,e;super.compileData(),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}initMark(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});const t=this._createMark(VQ.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);const e=this._createMark(VQ.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){const e=this._nodesSeriesData.latestData,i=Y(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.latestData,i=Y(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;const i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},BN.STATE_NORMAL,hN.Mark),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.node.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByNode},"normal",hN.User_Mark))}_initLinkMarkStyle(){var t,e;const i=this._linkMark;i&&(i.setGlyphConfig({direction:this.direction}),this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},BN.STATE_NORMAL,hN.Series),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.link.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByLink},"normal",hN.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}_createText(t,e){if(u(t)||u(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=IV(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),dU("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(cU(null===(s=Fz.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),dU("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData)||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData)||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:iH.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linkMark.getData().updateData()}_highLightElements(t,e){t&&t.length&&t.forEach((t=>{WN(t,[BN.STATE_SANKEY_EMPHASIS_REVERSE,BN.STATE_SANKEY_EMPHASIS]),e.includes(Xj(t).key)?UN(t,BN.STATE_SANKEY_EMPHASIS,!0):UN(t,BN.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}initTooltip(){this._tooltipHelper=new PQ(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!u(a[0])||(a=this.getNodeList(),a&&a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new yz;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{i.add(t[e]),t.children&&this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{p(t[i])&&e.add(t[i]),p(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return CQ(t,r.nodes,this._seriesField),Array.from(t)}return n}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}getMarkData(t){return t.datum?_(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}VQ.type=az.sankey,VQ.transformerConstructor=HQ,VQ.mark=jQ,VQ.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};const UQ=()=>{qY(),_$(),uT(),Fz.registerGraphicComponent("path",(t=>Ef(t))),Fz.registerMark(zQ.type,zQ),z$(),Fz.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:OQ(t,e)},rV))),Fz.registerAnimation("sankeyLinkPath",((t,e)=>({appear:IQ(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:sV.disappear.duration}}))),oP.registerBuiltInAnimate("linkPathGrowOut",DQ),oP.registerBuiltInAnimate("linkPathGrowIn",RQ),oV(),Fz.registerSeries(VQ.type,VQ)},WQ=(t,e)=>{let i={},s=e.fields;if(d(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=lQ(n);return i=YV([{latestData:r}],e),i};class GQ extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const YQ=Object.assign(Object.assign({},iU),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),KQ=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class $Q extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}const XQ=(t,e)=>{const i=d(e)?e():e,s=i.getViewBox();if(s){const e=new bZ(i).layout(t,s),n=[];return Vq(e,n,{maxDepth:null==i?void 0:i.maxDepth}),n.forEach((t=>{t&&[qV,"name"].forEach((e=>{t[e]=t.datum[t.depth][i.nameField]}))})),n}return[]};class qQ extends TU{constructor(){super(...arguments),this.type=az.treemap,this.transformerConstructor=$Q,this._categoryField="name",this._valueField="value",this._viewBox=new Ke,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qV),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new qe),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:hj},getRawData:()=>this.getRawData()}),k(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){var t;super.initData(),oH(this._dataSet,"treemap",XQ),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"treemap",options:()=>{var t,e,i,s;return{nameField:this._categoryField,valueField:this._valueField,getViewBox:()=>this._viewBox.empty()?null:{x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2},maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:(null===(t=this._spec.nonLeafLabel)||void 0===t?void 0:t.visible)?null===(e=this._spec.nonLeafLabel)||void 0===e?void 0:e.padding:0,labelPosition:null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.position,minVisibleArea:null!==(s=this._spec.minVisibleArea)&&void 0!==s?s:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}_runTreemapTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(oH(this._rawData.dataSet,"addVChartProperty",LV),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:tU.bind(this),call:eU}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=WQ([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=j(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){oH(this._dataSet,"hierarchyDimensionStatistics",WQ),oH(this._dataSet,"flatten",lQ);const i=new so(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return fQ(super.getStatisticFields(),this._categoryField,this._valueField)}initMark(){const t=this._createMark(qQ.mark.nonLeaf,{isSeriesMark:!0});t&&(t.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=t);const e=this._createMark(qQ.mark.leaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=e)}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initRichStyleOfLabelMark(t){"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},BN.STATE_NORMAL,hN.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},BN.STATE_NORMAL,hN.Series),this._initRichStyleOfLabelMark(t))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},BN.STATE_NORMAL,hN.Series),this._initRichStyleOfLabelMark(t))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("treemap"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(t=>{this.handlePan(t)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(t=>{this.handleZoom(t)}))),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new GQ(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:c}=this._matrix;this._matrix.multiply(r,a,o,l,h,c),this.disableMarkAnimation(),this.event.on(Jj.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach((t=>{})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()})),this.event.off(Jj.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach((t=>{})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().disableAnimation()}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}qQ.type=az.treemap,qQ.mark=YQ,qQ.builtInTheme={treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}}},qQ.transformerConstructor=$Q,G(qQ,pQ),G(qQ,OK);const ZQ=()=>{Fz.registerGrammarTransform("filter",{transform:(t,e)=>null==e?void 0:e.filter(t.callback)}),Fz.registerGrammarTransform("map",{transform:(t,e)=>(null==e||e.forEach(((e,i)=>{t.callback(e)})),e)}),qY(),z$(),Fz.registerAnimation("treemap",((t,e)=>({appear:KQ(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:sV.disappear.duration}}))),oV(),Fz.registerSeries(qQ.type,qQ)},JQ=Object.assign(Object.assign({},lq),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),QQ=Object.assign(Object.assign({},iU),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),t0={type:"fadeIn"};function e0(t,e){return"fadeIn"===e?t0:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}class i0 extends yU{constructor(){super(...arguments),this._supportStack=!1}}class s0 extends WV{enableByType(t){return"dimension"!==t}}const n0="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",r0={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:n0,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:n0,fill:"#ddd"}}};class a0 extends cq{constructor(){super(...arguments),this.type=az.gaugePointer,this.transformerConstructor=i0,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(a0.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},a0.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(a0.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new s0(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return p(this.radiusAxisHelper)&&p(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=$(e),s=X(e),n=vt(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),c=Math.sin(l);return{x:a*h+o*c,y:-(o*h-a*c)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}getInteractionTriggers(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),dU("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}a0.type=az.gaugePointer,a0.mark=QQ,a0.builtInTheme={gaugePointer:r0},a0.transformerConstructor=i0;const o0=()=>{Fz.registerSeries(a0.type,a0),CK(),qY(),Fz.registerAnimation("gaugePointer",((t,e)=>{const i=e0(t,e);return{appear:i,enter:i,disappear:{duration:sV.disappear.duration}}})),FX(),DX()};class l0 extends yU{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class h0 extends cq{constructor(){super(...arguments),this.type=az.gauge,this.transformerConstructor=l0,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=oe(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData(),oH(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[Tj]=t[this._angleField[0]],t[wj]=e>0?i[e-1][Tj]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(h0.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(h0.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),e}initMarkStyleWithSpec(t,e){if(super.initMarkStyleWithSpec(t,e),t&&"segment"===t.name){const e=this.getSpec().segment;if(e)for(const i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,hN.User_Mark)}}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueStartWithoutPadAngle(t){return p(t[wj])?this.angleAxisHelper.dataToPosition([t[wj]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[Tj]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),dU("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}h0.type=az.gauge,h0.mark=JQ,h0.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},h0.transformerConstructor=l0;const c0=()=>{Fz.registerSeries(h0.type,h0),dX(),gq(),DX()};class d0 extends KN{constructor(){super(...arguments),this.type=d0.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{fill:void 0,lineWidth:0,padding:0})}_createGraphic(t={}){return Vg(t)}_transformGraphicAttributes(t,e,i){var s,n,r;const a=super._transformGraphicAttributes(t,e,i),o=null!==(n=null!==(s=a.shape)&&void 0!==s?s:a.symbolType)&&void 0!==n?n:null===(r=t.attribute)||void 0===r?void 0:r.symbolType;return u(o)?a.symbolType="rect":a.symbolType=o,a}}d0.type="cell";function u0(t){return!1===t?{}:{type:"fadeIn"}}class p0 extends WV{enableByType(t){return"dimension"!==t}}const g0=Object.assign(Object.assign({},iU),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class f0 extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}const m0={valueField:!0};class v0 extends TU{constructor(){super(...arguments),this.type=az.heatmap,this.transformerConstructor=f0}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Y(t)}_getSpecUpdatePolicy(){const t=super._getSpecUpdatePolicy();return Object.assign(Object.assign({},t),{dataRelatedKeys:Object.assign(Object.assign({},t.dataRelatedKeys),m0)})}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){this._cellMark=this._createMark(v0.mark.cell,{isSeriesMark:!0},{morph:gU(this._spec,v0.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(v0.mark.cellBackground)}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){var e,i,s;t&&this.setMarkStyle(t,{fill:null!==(s=null===(i=null===(e=this._spec.cell)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",hN.Series)}initCellBackgroundMarkStyle(){var t,e,i;const s=ui(null!==(i=null===(e=null===(t=this._spec.cellBackground)||void 0===t?void 0:t.style)||void 0===e?void 0:e.padding)&&void 0!==i?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+s[0]},width:()=>this.getCellSize(this._xAxisHelper)-s[1]-s[3],height:()=>this.getCellSize(this._yAxisHelper)-s[0]-s[2]},"normal",hN.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}getInteractionTriggers(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=wU(this);this._cellMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),dU("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new p0(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"rect"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}v0.type=az.heatmap,v0.mark=g0,v0.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}},cellBackground:{visible:!1},label:{style:{lineWidth:2}}}},v0.transformerConstructor=f0;const y0=()=>{z$(),Fz.registerMark(d0.type,d0),Fz.registerGraphicComponent("symbol",Vg),kT(),MT(),xD(),Fz.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},rV),{appear:u0(e)}))),fG(),dG(),Fz.registerSeries(v0.type,v0)},_0=Object.assign(Object.assign({},iU),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),b0=`${rj}_CORRELATION_X`,x0=`${rj}_CORRELATION_Y`,S0=`${rj}_CORRELATION_SIZE`,A0=t=>d(t)?t():t,k0=(t,e)=>{var i,s,n,r,a,o,l,h;if(!t||!(null==e?void 0:e.view)||!_(t))return t;const c=t,d=e.view();if(d.x1-d.x0==0||d.y1-d.y0==0||d.x1-d.x0==-1/0||d.x1-d.x0==1/0||d.y1-d.y0==-1/0||d.y1-d.y0==1/0)return t;const p=oe(null!==(i=A0(e.startAngle))&&void 0!==i?i:-90),g=oe(null!==(s=A0(e.endAngle))&&void 0!==s?s:270),f=Math.max((d.x1-d.x0)/2,(d.y1-d.y0)/2),m=Ot(null!==(n=A0(e.innerRadius))&&void 0!==n?n:0,f),v=Ot(A0(e.outerRadius),f),y=A0(e.center),b=[S(null==y?void 0:y[0])?y[0]:d.x0+Ot(null!==(r=null==y?void 0:y[0])&&void 0!==r?r:"50%",d.x1-d.x0),S(null==y?void 0:y[1])?y[1]:d.y0+Ot(null!==(a=null==y?void 0:y[1])&&void 0!==a?a:"50%",d.y1-d.y0)],x=Et(A0(e.field)),A=c.map(x),[k,C]=Rt(A),M=k===C?t=>(m+v)/2:t=>m+(v-m)*(t-k)/(C-k),w=A0(e.radiusField),T=A0(e.radiusRange),B=u(w)?x:Et(w),E=null!==(o=null==T?void 0:T[1])&&void 0!==o?o:5;let P=t=>E;if(B){const[t,e]=B!==x?Rt(c.map(B)):[k,C],i=null!==(l=null==T?void 0:T[0])&&void 0!==l?l:5,s=null!==(h=null==T?void 0:T[1])&&void 0!==h?h:5;t!==e&&(P=n=>i+(s-i)*(B(n)-t)/(e-t))}const O=Math.min(p,g),I=Math.max(p,g),R=C0(O,I,c.length),D=[],L=(I-O)/60;return c.forEach(((t,e)=>{const i=M(A[e]),s=P(t);let n,r,a=R[e];for(let t=0;t<60&&(n=b[0]+i*Math.cos(a),r=b[1]+i*Math.sin(a),M0({x:n,y:r,size:s},D)||n-s<d.x0||n+s>d.x1||r-s<d.y0||r+s>d.y1);t++)t<59&&(a+=L,a>I?a=O:a<O&&(a=I));D.push(Object.assign({[b0]:n,[x0]:r,[S0]:s},t))})),D},C0=(t,e,i)=>{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const c=[];let d=t;for(;l<i;)h<n&&(c.push(d+(h%2?Math.floor(h/2)+Math.floor(n/2):h/2)*r*o),h++),l++,h===n&&(h=0,a+=1,o*=-1,0===s?s=r/2:s/=2,d=-1===o?e-s:t+s,a>=2&&(r/=2,n*=2));return c},M0=(t,e)=>!(!e||!e.length)&&e.some((e=>{const i=e.x,s=e.y,n=e.size;return Math.pow(t.x-i,2)+Math.pow(t.y-s,2)<Math.pow(t.size+n,2)})),w0=t=>d(t)?t():t,T0=(t,e)=>{if(!t||!_(t))return[];const i=w0(e.keyword),s=w0(e.categoryField),n=t[0].latestData[0];return{[s]:i,[lj]:null==n?void 0:n[lj],[cj]:null==n?void 0:n[cj]}};class B0 extends y${constructor(){super(...arguments),this.type=B0.type,this._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},this._positionChannels=["ripple","size"],this._positionEncoder=(t,e,i)=>{const{ripple:s=i.attribute.ripple,size:n=i.attribute.size}=t,r=vt(s,0,1),a=.5*n;return{ripple0:{size:n+a*r,fillOpacity:.75-.25*r},ripple1:{size:n+a*(1+r),fillOpacity:.5-.25*r},ripple2:{size:n+a*(2+r),fillOpacity:.25-.25*r}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}}B0.type="ripple";const E0=()=>{_$(),MT(),Fz.registerMark(B0.type,B0),Fz.registerGraphicComponent("symbol",(t=>Vg(t)))},P0=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class O0 extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class I0 extends J${constructor(){super(...arguments),this.type=az.correlation,this.transformerConstructor=O0,this._viewBox=new Ke}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){p(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){p(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){p(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){if(super.initData(),!this._data)return;oH(this._dataSet,"correlation",k0);const t=new io;lH(t,"dataview",ja),oH(t,"correlationCenter",T0);const e=new so(t,{name:`${this.type}_${this.id}_center`});e.parse([this.getViewData()],{type:"dataview"}),e.transform({type:"correlationCenter",options:{keyword:()=>{var t,e,i;return null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:""},categoryField:()=>this._spec.categoryField}}),this._centerSeriesData=new FN(this._option,e)}compileData(){var t;super.compileData(),null===(t=this._centerSeriesData)||void 0===t||t.compile()}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:()=>this._spec.valueField,radiusRange:()=>this._spec.sizeRange,radiusField:()=>this._spec.sizeField,center:()=>[this._spec.centerX,this._spec.centerY],innerRadius:()=>this._spec.innerRadius,outerRadius:()=>this._spec.outerRadius,startAngle:()=>this._spec.startAngle,endAngle:()=>this._spec.endAngle}})}initMark(){const t=this._createMark(I0.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:lj});t&&(t.setMarkConfig({zIndex:oN.Node}),this._nodePointMark=t);const e=this._createMark(I0.mark.ripplePoint,{key:lj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});e&&(this._ripplePointMark=e);const i=this._createMark(I0.mark.centerPoint,{key:lj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(i.setMarkConfig({zIndex:oN.Node}),this._centerPointMark=i)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;const n=this._nodePointMark;if(!n)return;const r=null!==(e=null===(t=this._spec.nodePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(n,{x:t=>t[b0],y:t=>t[x0],size:t=>t[S0],fill:null!==(i=r.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(s=r.fillOpacity)&&void 0!==s?s:1,lineWidth:0},BN.STATE_NORMAL,hN.Series)}_initRipplePointMarkStyle(){var t,e,i,s,n;const r=this._ripplePointMark;if(!r)return;const a=null!==(e=null===(t=this._spec.ripplePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(r,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=a.fill)&&void 0!==i?i:this.getColorAttribute(),opacity:null!==(s=a.fillOpacity)&&void 0!==s?s:.2,ripple:null!==(n=a.ripple)&&void 0!==n?n:0},BN.STATE_NORMAL,hN.Series)}_initCenterPointMarkStyle(){var t,e,i,s,n,r;const a=this._centerPointMark;a&&this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=null===(e=null===(t=this._spec.centerPoint)||void 0===t?void 0:t.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(r=null===(n=null===(s=this._spec.centerPoint)||void 0===s?void 0:s.style)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1},BN.STATE_NORMAL,hN.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},BN.STATE_NORMAL,hN.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),dU("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}I0.type=az.correlation,I0.mark=_0,I0.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},I0.transformerConstructor=O0;const R0=()=>{eW(),E0(),Fz.registerSeries(I0.type,I0),Fz.registerAnimation("correlation",((t,e)=>Object.assign({appear:P0(0,e)},nV)))},D0={duration:2e3,loop:!0,channel:{wave:{from:0,to:1}}},L0=t=>({duration:2e3,channel:{wave:{from:0,to:1},height:t.height,dy:t.dy}}),F0=L0;function z0(t,e){switch(e){case"wave":default:return D0;case"grow":return L0(t);case"waveGrow":return F0(t)}}function j0(t,e){switch(e){case"wave":default:return D0;case"grow":case"waveGrow":return(t=>({duration:2e3,channel:{dy:t.dy}}))(t)}}const H0=Object.assign(Object.assign({},iU),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}});class N0 extends y${constructor(){super(...arguments),this.type=N0.type,this._subMarks={wave0:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:1}},wave1:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.66}},wave2:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.33}}},this._positionChannels=["wave","y","height"],this._positionEncoder=(t,e,i)=>{const{wave:s=i.attribute.wave,y:n=i.attribute.y,height:r=i.attribute.height}=t,a=[],o=[],l=[];for(let t=0;t<21;t++){const e=50*t-500,i=n+(t%2==0?20:0),h=n+r;a.push({x:e+100*s,y:i,y1:h}),o.push({x:e+200*s-40,y:i,y1:h}),l.push({x:e+300*s-20,y:i,y1:h})}return{wave0:{x:0,y:0,points:a},wave1:{x:0,y:0,points:o},wave2:{x:0,y:0,points:l}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{wave:0})}}N0.type="liquid";const V0=(t,e)=>"drop"===t?function(t,e,i){const s=4*i/3,n=Math.max(s,2*i),r=s/2,a=t,o=r+e-n/2,l=Math.asin(r/(.85*(n-r))),h=Math.sin(l)*r,c=Math.cos(l)*r,d=a-c,u=o+h,p=t,g=o+r/Math.sin(l);return`\n M ${d} ${u}\n A ${r} ${r} 0 1 1 ${d+2*c} ${u}\n Q ${p} ${g} ${t} ${e+n/2}\n Q ${p} ${g} ${d} ${u}\n Z \n `}(0,0,e):t;class U0 extends WV{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>this.series.getValueField(),this.markTooltipValueCallback=t=>t[this.series.getValueField()],this.shapeStrokeCallback=t=>this.series.getMarkInName("liquid").getAttribute("fill",t)}}class W0 extends CU{constructor(){super(...arguments),this.type=az.liquid,this.transformerConstructor=iW,this._liquidBackgroundMark=null,this._liquidOutlineMark=null,this._getLiquidPosY=()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?e*this._heightRatio:e*(1-this._heightRatio),t+i},this._getLiquidHeight=()=>{const{height:t}=this._getLiquidBackPosAndSize();return t*this._heightRatio},this._getLiquidBackPosAndSize=(t=!1)=>{var e,i;let{top:s=0,bottom:n=0,left:r=0,right:a=0}=this._marginSpec,{top:o=0,bottom:l=0,left:h=0,right:c=0}=t?{}:this._paddingSpec;"triangle"===this._maskShape&&(n/=Math.sqrt(3),s=s/Math.sqrt(3)*2,l/=Math.sqrt(3),o=o/Math.sqrt(3)*2);const{width:d,height:u}=null!==(i=null===(e=this._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},p=d/2+(r+h-(a+c))/2,g=u/2+(s+o-(n+l))/2;let f=d-(r+a+h+c),m=u-(s+n+o+l);const v=Math.min(f,m);return"rect"!==this._maskShape&&(f=v,m=v),{x:p,y:g,size:v,width:f,height:m,startX:p-f/2,startY:g-m/2,endX:p+f/2,endY:g+m/2}},this._getLiquidBackPath=(t=!1)=>{var e;let i;if("rect"===this._maskShape){const{x:e,y:s,width:n,height:r}=this._getLiquidBackPosAndSize(t);i=Xg({x:e-n/2,y:s-r/2,width:n,height:r,fill:!0})}else{const{x:s,y:n,size:r}=this._getLiquidBackPosAndSize(t);i=Vg({x:s,y:n,size:r,symbolType:V0(null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle",r),fill:!0})}return[i]}}setValueField(t){p(t)&&(this._valueField=t)}getValueField(){return this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._marginSpec=Tz(this._spec.outlineMargin),this._paddingSpec=Tz(this._spec.outlinePadding),this.setValueField(this._spec.valueField),this._reverse=null!==(t=this._spec.reverse)&&void 0!==t&&t,this._maskShape=null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle"}viewDataUpdate(t){super.viewDataUpdate(t),this._heightRatio=Yt(...this._data.getLatestData().map((t=>t[this._valueField])))}initMark(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}initMarkStyle(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}_initLiquidOutlineMark(){return this._liquidOutlineMark=this._createMark(W0.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}_initLiquidBackgroundMark(){return this._liquidBackgroundMark=this._createMark(W0.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}_initLiquidMark(){return this._liquidGroupMark=this._createMark(W0.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(W0.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}_initLiquidOutlineMarkStyle(){const t=this._liquidOutlineMark;t.created(),this.setMarkStyle(t,{stroke:this.getColorAttribute(),width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath(!0)},"normal",hN.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}_initLiquidBackgroundMarkStyle(){const t=this._liquidBackgroundMark;t.created(),this.setMarkStyle(t,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath()},"normal",hN.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}_initLiquidMarkStyle(){const t=this._liquidMark,e=this._liquidGroupMark;e&&this.setMarkStyle(e,{x:()=>this._region.getLayoutStartPoint().x+this._region.getLayoutRect().width/2,angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),t&&this.setMarkStyle(t,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",hN.Series)}initTooltip(){this._tooltipHelper=new U0(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}getInteractionTriggers(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}initAnimation(){var t,e,i,s;const n={height:{from:0,to:()=>this._getLiquidHeight()},dy:{from:()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?0:e,t+i}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(cU(null===(i=Fz.getAnimationInKey("liquid"))||void 0===i?void 0:i(n,r),dU("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(cU(null===(s=Fz.getAnimationInKey("liquidGroup"))||void 0===s?void 0:s(n,r),dU("liquidGroup",this._spec,this._markAttributeContext)))}initEvent(){super.initEvent(),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(tH.renderFinished,(()=>{this._option.getChart().getComponentsByKey("indicator").forEach((t=>{var e,i,s;const n=null===(e=this._liquidMark.getGraphics()[0].getSubGraphic())||void 0===e?void 0:e[0];let{y1:r,y2:a}=n.globalAABBBounds;r+=this._region.getLayoutStartPoint().y,a+=this._region.getLayoutStartPoint().y,null===(s=null===(i=null==t?void 0:t.getIndicatorComponent())||void 0===i?void 0:i.getChildren()[0])||void 0===s||s.getChildren().forEach((t=>{const{y1:e,y2:i}=t.globalAABBBounds;if(r<e&&a>i){const e=JT(t.attribute.fill,n.attribute.fill);t.setAttribute("fill",e)}}))}))}))}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}valueToPosition(t,e){return null}getStatisticFields(){return[]}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._liquidMark]}}W0.type=az.liquid,W0.mark=H0,W0.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},W0.transformerConstructor=iW;const G0=()=>{_$(),tT(),Fz.registerMark(N0.type,N0),Fz.registerGraphicComponent("area",(t=>If(t))),XN(),Fz.registerAnimation("liquid",((t,e)=>({appear:z0(t,e),enter:z0(t,e),exit:z0(t,e)}))),Fz.registerAnimation("liquidGroup",((t,e)=>({appear:j0(t,e),enter:j0(t,e),exit:j0(t,e)}))),Fz.registerSeries(W0.type,W0)},Y0=t=>Y(t).join(",");class K0 extends WV{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>Y0(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>Y0(null==t?void 0:t[this.series.getDimensionField()[0]])}}const $0=Object.assign(Object.assign({},iU),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),X0=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},q0=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class Z0 extends XE{onBind(){var t,e;this.fromCircles={},null===(t=IZ(this.target.attribute.arcs))||void 0===t||t.forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},null===(e=IZ(this.target.getFinalAttribute().arcs))||void 0===e||e.forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=PZ(s);this.target.setAttributes({arcs:n,path:OZ(n)})}}class J0 extends yU{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}const Q0=(t,e)=>{const i=d(e)?e():e,s=i.getViewBox();return s&&(null==t?void 0:t.length)?RZ(Object.assign({setField:i.setField,valueField:i.valueField},s),t):[]};class t1 extends CU{constructor(){super(...arguments),this.type=az.venn,this.transformerConstructor=J0,this._viewBox=new Ke}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:hj)}initData(){var t;super.initData(),oH(this._dataSet,"venn",Q0),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:()=>({getViewBox:()=>this._viewBox.empty()?null:{x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2},setField:this._categoryField,valueField:this._valueField})})}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(t1.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(t1.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},BN.STATE_NORMAL,hN.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},BN.STATE_NORMAL,hN.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},BN.STATE_HOVER,hN.Series))}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>Y0(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},BN.STATE_NORMAL,hN.Series))}initOverlapLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>Y0(t.sets)},BN.STATE_NORMAL,hN.Series))}initTooltip(){this._tooltipHelper=new K0(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:Y0(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return Y0(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[Y0(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Y(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(Y0(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),dU(t.name,this._spec,this._markAttributeContext)))}))}}t1.type=az.venn,t1.mark=$0,t1.builtInTheme={venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},t1.transformerConstructor=J0;const e1=()=>{dX(),CK(),Fz.registerAnimation("vennCircle",((t,e)=>({appear:X0(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:sV.disappear.duration}}))),Fz.registerAnimation("vennOverlap",((t,e)=>({appear:q0(e),update:{custom:Z0},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:sV.disappear.duration}}))),oV(),Fz.registerGrammarTransform("vennMark",{transform:DZ}),Fz.registerSeries(t1.type,t1)};class i1 extends iK{constructor(){super(...arguments),this.type=az.mosaic,this.transformerConstructor=tK}get bandWidthField(){return this._bandWidthField}getStack(){return!0}getPercent(){return this._spec.percent}getGroupFields(){return"vertical"===this.direction?this._specXField:this._specYField}setAttrFromSpec(){super.setAttrFromSpec();const t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(kj),this.setFieldX2(Aj)),this.setFieldY(Mj),this.setFieldY2(Cj)):(t&&(this.setFieldY(kj),this.setFieldY2(Aj)),this.setFieldX(Mj),this.setFieldX2(Cj)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}parseLabelStyle(t,e){if((null==e?void 0:e.filterByGroup)&&u(t.dataFilter)){const i=this.getGroupFields(),{field:s,type:n="max",filter:r}=e.filterByGroup;delete t.filterField;const a=i.indexOf(s);if(a<0)return;const o=a%2?"min"===n?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===n?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,l="min"===n?(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])<(null===(s=e.data)||void 0===s?void 0:s[o])}:(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])>(null===(s=e.data)||void 0===s?void 0:s[o])};t.dataFilter=t=>{const e={};return t.forEach((t=>{const i=t.data,n=null==i?void 0:i[s];u(n)||r&&!r(t)||e[n]&&!l(t,e[n])||(e[n]=t)})),t.filter((t=>{var i;const n=null===(i=t.data)||void 0===i?void 0:i[s];return e[n]&&e[n]===t}))}}return t}}i1.type=az.mosaic,i1.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},i1.transformerConstructor=tK;const s1=()=>{qY(),z$(),oV(),dG(),Fz.registerSeries(i1.type,i1)};class n1 extends YG{_isValidSeries(t){return t===az.map}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}let r1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=n1,this.type="map",this.seriesType=az.map}};r1.type="map",r1.seriesType=az.map,r1.transformerConstructor=n1;const a1=()=>{MY(),FK(),Fz.registerChart(r1.type,r1)};class o1 extends YG{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Y(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return p(r)&&n.forEach((t=>{u(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t,e){return super._getDefaultSeriesSpec(t,["radius","outerRadius","innerRadius","startAngle","endAngle","centerX","centerY","sortDataByAxis"],e)}transformSpec(t){super.transformSpec(t),_(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),p(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class l1 extends o1{needAxes(){return!1}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t,["startAngle","endAngle","centerX","centerY","clamp"]);return e.categoryField=t.categoryField||t.radiusField,e.valueField=t.valueField||t.angleField,e}_transformProgressAxisSpec(t,e,i,s,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),u(l.type)&&(l.type="linear"),u(o.type)&&(o.type="band");const h=gW(l,{min:0,max:1});u(l.min)&&(l.min=h.min),u(l.max)&&(l.max=h.max),s&&Object.assign(l,Lz({},s,l)),n&&Object.assign(o,Lz({},n,o))}}class h1 extends o1{needAxes(){return!0}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.categoryField=t.categoryField||t.angleField,e.valueField=t.valueField||t.radiusField,e}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class c1 extends o1{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;const i=super._getDefaultSeriesSpec(t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]);return this._addSeriesRelatedSpecKeys(["valueField","angleField"]),i.categoryField=t.categoryField||t.seriesField,i.valueField=t.valueField||t.angleField,i.emptyCircle=null===(e=t.emptyPlaceholder)||void 0===e?void 0:e.emptyCircle,i}}class d1 extends UG{constructor(){super(...arguments),this.transformerConstructor=c1}}d1.transformerConstructor=c1;let u1=class extends d1{constructor(){super(...arguments),this.transformerConstructor=c1,this.type="pie",this.seriesType=az.pie}};u1.type="pie",u1.seriesType=az.pie,u1.transformerConstructor=c1;const p1=()=>{MY(),_X(),Fz.registerChart(u1.type,u1)};class g1 extends h1{_getDefaultSeriesSpec(t){var e,i,s;const n=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["radius","outerRadius","innerRadius"]),n.radius=null!==(e=t.radius)&&void 0!==e?e:EW,n.outerRadius=null!==(i=t.outerRadius)&&void 0!==i?i:EW,n.innerRadius=null!==(s=t.innerRadius)&&void 0!==s?s:0,n.stack=t.stack,n.percent=t.percent,n}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&u(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Y(t.crosshair||{}).map((t=>Lz({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}const f1=(t,e)=>{if(!t)return null;const i=VU(t,(t=>"angle"===t.getOrient()),e),s=VU(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&DI(i.type)){const l=i.domain(),h=i.range(),c=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-c.x,y:o-t.getLayoutStartPoint().y-c.y};let p=JF({x:1,y:0},d);p=((t,e)=>{const i=2*Math.PI,s=X(e),n=$(e);return t<s?t+=Math.ceil((s-t)/i)*i:t>n&&(t-=Math.ceil((t-n)/i)*i),t})(p,h);const g=QF(d),f=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==f?void 0:f.range();if((p-(null==h?void 0:h[0]))*(p-(null==h?void 0:h[1]))>0||(g-(null==m?void 0:m[0]))*(g-(null==m?void 0:m[1]))>0)return;const v=t.invert(p);if(u(v))return;let y=l.findIndex((t=>(null==t?void 0:t.toString())===v.toString()));y<0&&(y=void 0);const _=HU(v,t,"polar",r);n.push({index:y,value:v,position:i.scale(v),axis:t,data:_})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&DI(s.type)){const h=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let d=JF({x:1,y:0},c);d<-Math.PI/2&&(d=2*Math.PI+d);const p=QF(c),g=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==g?void 0:g.range();if((d-(null==f?void 0:f[0]))*(d-(null==f?void 0:f[1]))>0||(p-(null==l?void 0:l[0]))*(p-(null==l?void 0:l[1]))>0)return;const m=s.invert(p);if(u(m))return;let v=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));v<0&&(v=void 0);const y=HU(m,t,"polar",r);n.push({index:v,value:m,position:s.scale(m),axis:t,data:y})}})),n.length?n:null};let m1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=g1,this.type="rose",this.seriesType=az.rose}_setModelOption(){this._modelOption.getDimensionInfo=f1}};m1.type="rose",m1.seriesType=az.rose,m1.transformerConstructor=g1,G(m1,ZG);const v1=()=>{kY(),MY(),eY(),tY(),jX(),Fz.registerChart(m1.type,m1)};class y1 extends h1{_getDefaultSeriesSpec(t){var e,i,s,n;const r=super._getDefaultSeriesSpec(t),a=null===(i=(e=this._option).getTheme)||void 0===i?void 0:i.call(e,"series","radar","area");return this._addSeriesRelatedSpecKeys(["line","point","area"]),r.line=t.line,r.point=t.point,r.stack=t.stack,r.percent=t.percent,r.area=Lz({visible:null!==(s=null==a?void 0:a.visible)&&void 0!==s&&s},t.area),r.seriesMark=null!==(n=t.seriesMark)&&void 0!==n?n:"area",r.activePoint=t.activePoint,r.pointDis=t.pointDis,r.pointDisMul=t.pointDisMul,r.markOverlap=t.markOverlap,r}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Y(t.crosshair||{}).map((t=>Lz({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}let _1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=y1,this.type="radar",this.seriesType=az.radar}_setModelOption(){this._modelOption.getDimensionInfo=f1}};_1.type="radar",_1.seriesType=az.radar,_1.transformerConstructor=y1,G(_1,ZG);const b1=()=>{kY(),MY(),TY(),eY(),tY(),$X(),Fz.registerChart(_1.type,_1)};class x1 extends YG{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=g(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{O(e,"trimPadding")&&Lz(e,aN(this.type,t))})),this._transformAxisSpec(t)}}let S1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=x1,this.type="common"}_setModelOption(){this._modelOption.getDimensionInfo=(t,e,i)=>{var s,n;return[...null!==(s=oY(t,e,i))&&void 0!==s?s:[],...null!==(n=f1(t,e))&&void 0!==n?n:[]]},this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};S1.type="common",S1.transformerConstructor=x1,G(S1,ZG);const A1=()=>{kY(),MY(),TY(),eY(),Fz.registerChart(S1.type,S1),tY()};class k1 extends YG{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Y(e.data)[0];return t instanceof so?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Y(t.data).find(((t,i)=>e.dataId?t instanceof so?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof so?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(t){var e,i,s,n,r,a,o,l,h,c,d,u,p,g,f;super.transformSpec(t);let m=0;const v=[],y=[],_=[],b=[],x=[],S=this._option.getCompiler().getStage(),A=(S.viewWidth,S.viewHeight);let k=0;if(null==t?void 0:t.legends){v.push({modelId:`legendRow${m}`,col:1,row:m}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${m}`);const o=Y(t.legends);let l=null!==(e=o[0].height)&&void 0!==e?e:40;if(o[0].padding){const t=Tz(o[0].padding);l+=Number(null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0),l+=Number(null!==(s=null==t?void 0:t.top)&&void 0!==s?s:0),o[0].offsetY=Number(null!==(r=null===(n=o[0])||void 0===n?void 0:n.offsetY)&&void 0!==r?r:0)+Number(null!==(a=null==t?void 0:t.top)&&void 0!==a?a:0)}x.push({index:m,size:l}),k+=l,m++}(null==t?void 0:t.dataZoom)&&(v.push({modelId:`dataZoomRow${m}`,col:1,row:m}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${m}`),k+=60,m++,this.addPaddingRow(x,m,10),k+=10,m++),k+=60,null!==t.axes&&"top"!==(null===(l=null===(o=null==t?void 0:t.axes)||void 0===o?void 0:o[0])||void 0===l?void 0:l.orient)||(this.addOrientAxes(y,v,m,t),m++);const C=t.series.filter((t=>t.type!==az.link)).length,M=(A-k-20*C)/C,w=(null===(h=null==t?void 0:t.appendPadding)||void 0===h?void 0:h.left)||0,T=(null===(c=null==t?void 0:t.appendPadding)||void 0===c?void 0:c.right)||0;null===(d=null==t?void 0:t.series)||void 0===d||d.forEach((e=>{var i,s;if([az.bar,az.line,az.area,az.dot].includes(e.type)){if(v.push({modelId:`${e.type}Row${m}`,col:1,row:m}),v.push({modelId:`axesLeftRow${m}`,col:0,row:m}),y.push({id:`${e.type}Row${m}`,clip:!1}),x.push({index:m,size:(null==e?void 0:e.height)||M}),_.push({orient:"left",id:`axesLeftRow${m}`,type:e.type===az.dot?"band":"linear",visible:e.type!==az.dot,title:{visible:!0,autoRotate:!1,style:{text:null==e?void 0:e.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(i=null==e?void 0:e.grid)||void 0===i?void 0:i.visible)||(null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.visible),style:(t,i)=>{var s,n,r,a,o;let l=0;if(0===i){const t=null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==e?void 0:e.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:y.length-1}),e.type===az.dot){v.push({modelId:`scrollBarRightRow${m}`,col:2,row:m});const i=this._getSeriesDataLength(t,e);let s=0;i&&(s=((null==e?void 0:e.height)||M)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===az.dot&&s<1,id:`scrollBarRightRow${m}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:y.length-1,axisId:`axesLeftRow${m}`},Y(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=y.length-1,m++,this.addPaddingRow(x,m,(null==e?void 0:e.padding)||20),m++,e.leftAppendPadding=w,e.type===az.dot&&(e.title.style.dx=-w,e.subTitle.style.dx=-w)}})),this.addPaddingRow(x,m,20),m++,null===(u=null==t?void 0:t.series)||void 0===u||u.forEach((e=>{if(e.type===az.link){const i=e.dotSeriesIndex+1;v.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=w,e.height=t.series[e.dotSeriesIndex].height,e.clipHeight=t.series[e.dotSeriesIndex].clipHeight}})),(null==t?void 0:t.legends)&&this.addAttrToComponentSpec(t.legends,"regionIndex",[y.length-1]),"bottom"===(null===(g=null===(p=null==t?void 0:t.axes)||void 0===p?void 0:p[0])||void 0===g?void 0:g.orient)&&(this.addOrientAxes(y,v,m,t),m++);const B={type:"grid",col:4,row:m,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:T}],rowHeight:x,elements:v};t.layout=B,t.region=y,null===(f=t.axes)||void 0===f||f.push(..._),t.scrollBar=b}}var C1=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};let M1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=k1,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=C1(e,["spec"]);let n;if(i.type===az.link&&(i.dotSeriesSpec=this._spec.series[i.dotSeriesIndex]),i.regionId&&(n=this.getRegionsInUserId(i.regionId)),n||(n=this.getRegionsInIndex(i.regionIndex?[i.regionIndex]:void 0)[0]),!n)return;const r=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),s),{region:n,specKey:"series",globalScale:this._globalScale}));r&&(r.created(),this._series.push(r),n.addSeries(r))}};M1.type="sequence",M1.transformerConstructor=k1;const w1=()=>{kY(),MY(),iq(),oq(),fG(),dG(),Fz.registerChart(M1.type,M1)};class T1 extends KG{transformSpec(t){super.transformSpec(t),t.axes.forEach((t=>t.type="linear"))}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["x2Field","y2Field","barMinHeight","barBackground","barGap"])}}class B1 extends UG{constructor(){super(...arguments),this.transformerConstructor=T1}}B1.transformerConstructor=T1,G(B1,ZG);class E1 extends T1{transformSpec(t){super.transformSpec(t),tN(t)}}let P1=class extends B1{constructor(){super(...arguments),this.transformerConstructor=E1,this.type="histogram",this.seriesType=az.bar}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};P1.type="histogram",P1.seriesType=az.bar,P1.transformerConstructor=E1;const O1=()=>{kY(),MY(),TY(),eY(),tY(),sK(),Fz.registerTransform("bin",oa),Fz.registerChart(P1.type,P1)};class I1 extends l1{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["cornerRadius","progress","track","roundCap"]),s.progress=t.progress,s.track=t.track,s.tickMask=t.tickMask,s.cornerRadius=null!==(e=t.cornerRadius)&&void 0!==e?e:0,s.roundCap=null!==(i=t.roundCap)&&void 0!==i&&i,s}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}let R1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=I1,this.type="circularProgress",this.seriesType=az.circularProgress}_setModelOption(){this._modelOption.getDimensionInfo=f1}};R1.type="circularProgress",R1.seriesType=az.circularProgress,R1.transformerConstructor=I1,G(R1,ZG);const D1=()=>{kY(),MY(),eY(),tY(),yq(),Fz.registerChart(R1.type,R1)};class L1 extends l1{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["pin","pinBackground","pointer"]),e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}_getDefaultCircularProgressSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.type=az.circularProgress,e}transformSpec(t){var e,i,s,n,r;super.transformSpec(t);let a=null===(e=t.series)||void 0===e?void 0:e.find((t=>t.type===az.gauge||t.type===az.circularProgress));u(a)&&(a=null!==(i=t.gauge)&&void 0!==i?i:this._getDefaultCircularProgressSeriesSpec(t),"circularProgress"===a.type&&(u(a.radiusField)&&u(a.categoryField)&&(a.radiusField=null!==(n=null!==(s=t.radiusField)&&void 0!==s?s:t.categoryField)&&void 0!==n?n:t.seriesField),u(a.valueField)&&u(a.angleField)&&(a.valueField=null!==(r=t.valueField)&&void 0!==r?r:t.angleField)),1===t.series.length?t.series.push(a):t.series.forEach((t=>{t.type===a.type&&Object.keys(a).forEach((e=>{e in t||(t[e]=a[e])}))}))),a.type===az.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:oN.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=t),"angle"===e&&(i.angle=t)})),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),u(i.angle.type)&&(i.angle.type="linear"),u(i.radius.type)&&(i.radius.type="linear"),u(i.angle.zIndex)&&(i.angle.zIndex=oN.Region+50)}}let F1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=L1,this.type="gauge",this.seriesType=az.gaugePointer}};F1.type="gauge",F1.seriesType=az.gaugePointer,F1.transformerConstructor=L1;const z1=()=>{MY(),o0(),c0(),yq(),Fz.registerChart(F1.type,F1)};class j1 extends YG{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"])}}class H1 extends UG{constructor(){super(...arguments),this.transformerConstructor=j1,this.type="wordCloud",this.seriesType=az.wordCloud}}H1.transformerConstructor=j1;let N1=class extends H1{constructor(){super(...arguments),this.transformerConstructor=j1,this.type="wordCloud",this.seriesType=az.wordCloud}};N1.type="wordCloud",N1.seriesType=az.wordCloud,N1.transformerConstructor=j1;const V1=()=>{MY(),IJ(),Fz.registerChart(N1.type,N1)},U1=()=>{Fz.registerGrammarTransform("wordcloudShape",{transform:PJ}),Fz.registerGrammarTransform("wordcloud",{transform:oJ}),z$(),zq(),Fz.registerSeries(OJ.type,OJ),MY(),IJ(),Fz.registerChart(N1.type,N1)};class W1 extends YG{needAxes(){return!1}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"])}transformSpec(t){super.transformSpec(t),super.transformSeriesSpec(t)}}let G1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=W1,this.type="funnel",this.seriesType=az.funnel}};G1.type="funnel",G1.seriesType=az.funnel,G1.transformerConstructor=W1;const Y1=()=>{MY(),tQ(),Fz.registerChart(G1.type,G1)};class K1 extends KG{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bandWidth","progress","track","clamp"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"horizontal",this._addSeriesRelatedSpecKeys(["cornerRadius"]),s.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,s}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="band"),u(i.type)&&(i.type="linear");const n=gW(i,{min:0,max:1});u(i.min)&&(i.min=n.min),u(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="linear"),u(e.type)&&(e.type="band");const n=gW(s,{min:0,max:1});u(s.min)&&(s.min=n.min),u(s.max)&&(s.max=n.max)}}}let $1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=K1,this.type="linearProgress",this.seriesType=az.linearProgress}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};$1.type="linearProgress",$1.seriesType=az.linearProgress,$1.transformerConstructor=K1,G($1,ZG);const X1=()=>{kY(),MY(),eY(),tY(),wq(),Fz.registerChart($1.type,$1)};class q1 extends KG{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),tN(t)}}let Z1=class extends UG{constructor(){super(...arguments),this.transformerConstructor=q1,this.type="rangeColumn",this.seriesType=az.rangeColumn}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};Z1.type="rangeColumn",Z1.seriesType=az.rangeColumn,Z1.transformerConstructor=q1;const J1=()=>{kY(),MY(),eY(),tY(),K$(),Fz.registerChart(Z1.type,Z1)};class Q1 extends YG{_getDefaultSeriesSpec(t){const e=p(t.startAngle)?t.startAngle:-90,i=p(t.endAngle)?t.endAngle:e+le(2*Math.PI),s=super._getDefaultSeriesSpec(t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]);return s.startAngle=e,s.endAngle=i,s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let t2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=Q1,this.type="sunburst",this.seriesType=az.sunburst}};t2.type="sunburst",t2.seriesType=az.sunburst,t2.transformerConstructor=Q1;const e2=()=>{MY(),yQ(),Fz.registerChart(t2.type,t2)};class i2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let s2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=i2,this.type="circlePacking",this.seriesType=az.circlePacking}};s2.type="circlePacking",s2.seriesType=az.circlePacking,s2.transformerConstructor=i2;const n2=()=>{MY(),kQ(),Fz.registerChart(s2.type,s2)};class r2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let a2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=r2,this.type="treemap",this.seriesType=az.treemap}};a2.type="treemap",a2.seriesType=az.treemap,a2.transformerConstructor=r2;const o2=()=>{MY(),ZQ(),Fz.registerChart(a2.type,a2)};class l2 extends nK{transformSpec(t){super.transformSpec(t),t.legends&&Y(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),tN(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["bar","stackLabel","leaderLine","total","calculationMode"]),e.bar=t.bar,e.stackLabel=t.stackLabel,e.leaderLine=t.leaderLine,e.total=t.total,e.calculationMode=t.calculationMode,e}}let h2=class extends rK{constructor(){super(...arguments),this.transformerConstructor=l2,this.type="waterfall",this.seriesType=az.waterfall}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};h2.type="waterfall",h2.seriesType=az.waterfall,h2.transformerConstructor=l2;const c2=()=>{kY(),MY(),TY(),eY(),tY(),p$(),Fz.registerChart(h2.type,h2)};class d2 extends KG{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=super._getDefaultSeriesSpec(t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"vertical",s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),tN(t)}}let u2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=d2,this.type="boxPlot",this.seriesType=az.boxPlot}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};u2.type="boxPlot",u2.seriesType=az.boxPlot,u2.transformerConstructor=d2;const p2=()=>{kY(),MY(),eY(),tY(),L$(),Fz.registerTransform("boxplot",la),Fz.registerChart(u2.type,u2)};class g2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","sourceField","targetField","direction","nodeAlign","crossNodeAlign","nodeGap","nodeWidth","linkWidth","minStepWidth","minNodeHeight","maxNodeHeight","minLinkHeight","maxLinkHeight","dropIsolatedNode","nodeHeight","linkHeight","equalNodeHeight","linkOverlap","iterations","nodeKey","linkSortBy","nodeSortBy","setNodeLayer","node","link","emphasis","inverse","overflow"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let f2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=g2,this.type="sankey",this.seriesType=az.sankey}_setStateInDatum(t,e,i,s){const n=_(e)?e[0]:e;if(!n)return void this._interaction.clearByState(t);let r=null;this.filterGraphicsByDatum(n,{filter:(t,e)=>"text"!==e.type&&e.getProduct()&&(!i||i(t,e)),region:s,getDatum:t=>{var e;let i=null===(e=Xj(t))||void 0===e?void 0:e.datum;return _(i)&&(i=i[0]),i},callback:(t,e,i,s)=>{var n,r;const a=e.getProductId();a&&(a.includes("node")||a.includes("link"))&&(null===(r=(n=i)._handleEmphasisElement)||void 0===r||r.call(n,{item:t,mark:e}))},regionCallback:(t,e)=>{n&&t.length&&(r=t[0])}}),r&&this._interaction.updateStateOfGraphics(t,[r])}};f2.type="sankey",f2.seriesType=az.sankey,f2.transformerConstructor=g2;const m2=()=>{MY(),GT(),UQ(),Fz.registerChart(f2.type,f2)};class v2 extends KG{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return this._addSeriesRelatedSpecKeys(["area","point","line"]),s.area=t.area,s.point=t.point,s.line=t.line,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),tN(t)}}let y2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=v2,this.type="rangeArea",this.seriesType=az.rangeArea}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};y2.type="rangeArea",y2.seriesType=az.rangeArea,y2.transformerConstructor=v2;const _2=()=>{kY(),MY(),TY(),eY(),tY(),Z$(),Fz.registerChart(y2.type,y2)};class b2 extends KG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","cell"])}}let x2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=b2,this.type="heatmap",this.seriesType=az.heatmap}};x2.type="heatmap",x2.seriesType=az.heatmap,x2.transformerConstructor=b2;const S2=()=>{MY(),y0(),Fz.registerChart(x2.type,x2)};class A2 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let k2=class extends UG{constructor(){super(...arguments),this.transformerConstructor=A2,this.type="correlation",this.seriesType=az.correlation}};k2.type="correlation",k2.seriesType=az.correlation,k2.transformerConstructor=A2;const C2=()=>{MY(),R0(),Fz.registerChart(k2.type,k2)};function M2(t){var e,i;const s=Object.assign({},t);return P(t.style)||(s.textStyle=$j(t.style)),P(t.textStyle)||Lz(s.textStyle,$j(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&$j(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&$j(s.background.style),s}var w2=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};const T2=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},B2=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l,customFilter:h}=e,c=a(),d=l();if(0===c.length&&d.length)return[];if(c.length===d.length)return t;const u={};c.forEach((t=>{u[t]=!0}));const g=null!==(i=o())&&void 0!==i?i:cj;return h?h(t,c,g):(_(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===u[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===u[t.source]&&!0===u[t.target])))):p(g)&&(t=t.filter((t=>!0===u[r.getSeriesFieldValue(t,g)]))),t)},E2={position:!0,item:!0,title:!0,pager:!0,background:!0};class P2 extends jW{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=oN.Legend,this.layoutLevel=lN.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{ez(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),ez(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=kz(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;p(s)&&(this._seriesUserId=Y(s)),p(e)&&(this._regionUserId=Y(e)),p(n)&&(this._seriesIndex=Y(n)),p(i)&&(this._regionUserIndex=Y(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}_compareSpec(t,e){const i=super._compareSpec(t,e);i.reRender=!0;const s=!U(e,t);return i.reMake?i:(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):s&&!i.reCompile&&this._isComponentOnlySpecChange(t,e)?(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}),i):(s&&(i.reCompile=!0),i)}_isComponentOnlySpecChange(t,e){const i=e,s=t;return Object.keys(Object.assign(Object.assign({},e),t)).every((t=>U(null==i?void 0:i[t],null==s?void 0:s[t])||E2[t]))}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new FN(this._option,t),this._initSelectedData(),ez(this._regions,(t=>{t.event.on(tH.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;const n=this._selectedData;u(t)||JSON.stringify(n)===JSON.stringify(t)||(ez(this._regions,(e=>{e.legendSelectedFilter&&(t=e.legendSelectedFilter(this,t))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...t],null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(tH.legendSelectedDataChange,{model:this}),null===(s=this._legendComponent)||void 0===s||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;k(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)U(s,this._cacheAttrs)||this._legendComponent.setAttributes(Lz({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(Lz({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t,this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var t,e;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());U(t,this._cacheAttrs)||this._legendComponent.setAttributes(Lz({},t,{defaultSelected:this._selectedData}))}null===(e=(t=this.effect).onSelectedDataChange)||void 0===e||e.call(t),this.event.emit(tH.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}P2.specKey="legends";class O2 extends P2{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(t){super.init(t),ez(this._regions,(t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData(),customFilter:this._spec.customFilter},level:_H.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){oH(this._option.dataSet,"discreteLegendFilter",B2),oH(this._option.dataSet,"discreteLegendDataMake",T2);const t=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return ez(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(u(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!ok(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return d(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=Ij(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){const i=w2(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);let{title:s={},item:n={},pager:r={},background:a={}}=t;s=D(s),n=D(n),r=D(r),a=D(a);const o=i;return s.visible?o.title=M2(s):o.title={visible:!1},P(n.focusIconStyle)||$j(n.focusIconStyle),n.shape&&(n.shape=Gj(n.shape)),n.label&&(n.label=Gj(n.label)),n.value&&(n.value=Gj(n.value)),n.background&&(n.background=Gj(n.background)),Cz(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*e.width/100),Cz(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*e.width/100),Cz(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*e.width/100),o.item=n,"scrollbar"===r.type?(P(r.railStyle)||$j(r.railStyle),P(r.sliderStyle)||$j(r.sliderStyle)):(P(r.textStyle)||$j(r.textStyle),r.handler&&Gj(r.handler)),o.pager=r,a.visible&&!P(a.style)&&(Lz(o,a.style),p(a.padding)&&(o.padding=a.padding)),o}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),this._addLegendItemFormatMethods(i),i}_getLegendConstructor(){return hF}setSelectedData(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((e=>!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener(iF.legendItemClick,(e=>{const i=O(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(tH.legendItemClick,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(iF.legendItemHover,(t=>{const e=O(t,"detail");this.event.emit(tH.legendItemHover,{model:this,value:e,event:t})})),this._legendComponent.addEventListener(iF.legendItemUnHover,(t=>{const e=O(t,"detail");this.event.emit(tH.legendItemUnHover,{model:this,value:e,event:t})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:k(s)?s:1,strokeOpacity:k(n)?n:1,opacity:k(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return d(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=IV(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:c}=IV(o,l);l&&!o&&c&&(t.item.value.formatMethod=(t,e)=>c(l,t,e,a))}}O2.specKey="legends",O2.builtInTheme={discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1}},O2.type=r.discreteLegend;const I2=()=>{Fz.registerComponent(O2.type,O2)},R2=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;k(n)&&(t=Math.min(n,t)),k(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},D2=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r,customFilter:a}=e,o=i(),l=s(),h=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!g(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(o===n())return t;if(l&&!P(o)){const[e,i]=o;return a?a(t,o,l):h(t)?Wj(t,+e,+i,l):t.filter((t=>t[l]>=e&&t[l]<=i))}return t};var L2=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};function F2(t){const e=Lz({},t),{title:i={},handler:s={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:c={},type:u,id:g,visible:f,orient:m,position:v,data:y,defaultSelected:_,field:b,filter:x,regionId:S,regionIndex:A,seriesIndex:k,seriesId:C,padding:M}=e,w=L2(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return i.visible?w.title=M2(i):w.title={visible:!1},w.showHandler=!1!==s.visible,P(s.style)||(w.handlerStyle=$j(s.style)),p(n.width)&&(w.railWidth=n.width),p(n.height)&&(w.railHeight=n.height),P(n.style)||(w.railStyle=$j(n.style)),P(r.style)||(w.trackStyle=$j(r.style)),w.startText=Gj(a),w.endText=Gj(o),w.handlerText=function(t){if(!t)return t;const e=Object.assign({},t),i=t.style;return d(i)?e.style=(t,e,s)=>$j(i(t,e,s)):P(i)||(e.style=$j(i)),e}(l),P(h)||(w.sizeBackground=$j(h)),c.visible&&!P(c.style)&&(Lz(w,c.style),p(c.padding)&&(w.padding=c.padding)),w}const z2={color:gF,size:mF},j2={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},H2=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},j2),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},N2={horizontal:H2(!0),vertical:H2(!1)},V2=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},j2),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},U2={horizontal:V2(!0),vertical:V2(!1)},W2=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],G2=[2,10];let Y2=class extends P2{static getSpecInfo(t){const e=RV(t,this.specKey,this.type,(t=>function(t){return"color"===t||"size"===t}(t.type)));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),ez(this._regions,(t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData,customFilter:this._spec.customFilter},level:_H.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){oH(this._option.dataSet,"continuousLegendFilter",D2),oH(this._option.dataSet,"continuousLegendDataMake",R2);const t=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>iz(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=Ij(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!ok(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=Ij(this._option.dataSet.getDataView(a.dataId),a.fields[0])}}_getLegendAttributes(t){var e,i;const s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",n="horizontal"===s?"bottom":this.layoutOrient;let r=[];const a=this._getScaleInGlobal();a&&"linear"===a.type&&(r=a.range()),P(r)&&(r="color"===this._legendType?W2:G2);let o=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,l=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(o=Math.min(0,this._legendData.getLatestData()[0]),l=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const h=Object.assign({layout:s,align:n,zIndex:this.layoutZIndex,min:o,max:l,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:r},F2(this._spec));return this._addDefaultTitleText(h),h}_getLegendConstructor(){return z2[this._legendType]}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener("change",xt((e=>{const i=O(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(tH.legendFilter,{model:this,value:i,event:e})}),30))}}};Y2.specKey="legends",Y2.builtInTheme={colorLegend:N2,sizeLegend:U2},Y2.type=r.continuousLegend;const K2=()=>{Fz.registerComponent(Y2.type,Y2)},$2=(t,e)=>p(e)?t.map((t=>e[t])):void 0,X2=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),q2=t=>!u(t)&&(_(t)?t.length>0&&t.every(p):Object.keys(t).length>0);const Z2=(t,e)=>{const i=e.getSeries(),s=[];return i.forEach((e=>{var i,n,r,a,o,l,h;const c=e.getDimensionField(),d=e.getMeasureField(),g=e.getSeriesField(),f=p(g)?t[g]:void 0,m=p(g)&&null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[g])||void 0===r?void 0:r.values)&&void 0!==a?a:[],v=$2(c,t);let y=$2(d,t);const _=q2(y),b=!_&&p(g)&&u(f)&&m.length>0,x=()=>{var t;const i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(X2(c,v));if(!_&&(y=$2(d,i),!q2(y)))return;const n=e.type===az.pie?e.dataToCentralPosition(i):e.dataToPosition(i);u(n)||isNaN(n.x)||isNaN(n.y)||s.push({pos:n,data:{dimensionFields:c,dimensionData:v,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:f},series:e})};if("cartesian"===e.coordinate){const t=e,i=DI(null===(l=null===(o=e.getYAxisHelper())||void 0===o?void 0:o.getScale(0))||void 0===l?void 0:l.type)?"y":"x",n=c.map(((t,e)=>[t,e])).filter((([,t])=>u(null==v?void 0:v[t])));let r=[null!=v?v:[]];n.length>0&&n.forEach((([t,i])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=e.getViewDataStatistics)||void 0===s?void 0:s.call(e))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((e=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[i]=e,h.push(n)}))})),r=h})),r.forEach((n=>{var r,a;if(b){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(X2(c,n));m.forEach((r=>{const o=a.find((t=>t[g]===r));if(y=$2(d,o),!q2(y))return;const l=t.dataToPosition(o);u(l)||isNaN(l.x)||isNaN(l.y)||s.push({pos:l,data:{dimensionFields:c,dimensionData:n,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:r},series:e,dimType:i})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(X2(c,n));if(!_&&(y=$2(d,r),!q2(y)))return;const o=t.dataToPosition(r);if(u(o)||isNaN(o.x)||isNaN(o.y))return;s.push({pos:o,data:{dimensionFields:c,dimensionData:n,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:f},dimType:i,series:e})}}))}else if("polar"===e.coordinate)if(e.type===az.pie)x();else{const t=e;if(b){const i=(null===(h=t.getViewData())||void 0===h?void 0:h.latestData.filter(X2(c,v))).find((t=>t[g]===f));m.forEach((n=>{if(y=$2(d,i),!q2(y))return;const r=t.dataToPosition(i);u(r)||isNaN(r.x)||isNaN(r.y)||s.push({pos:r,data:{dimensionFields:c,dimensionData:v,measureFields:d,measureData:y,hasMeasureData:_,groupField:g,groupData:n},series:e})}))}else x()}else"geo"===e.coordinate&&(()=>{var i,n,r;console.log("parseMarkInfoOfGeoSeries");let a=null===(i=e.getViewData())||void 0===i?void 0:i.latestData.find(X2(c,v));const o=e.getNameMap(),l=null===(r=null===(n=e.getMapViewData)||void 0===n?void 0:n.call(e))||void 0===r?void 0:r.latestData.find((t=>c.every(((e,i)=>"name"===e?o[t.properties[e]]===(null==v?void 0:v[i]):t.properties[e]===(null==v?void 0:v[i])))));if(!l)return;let h=y;if(l&&!a&&(a=Object.assign({},t)),!_){if(y=$2(d,a),h=y,!q2(y)&&!a)return;q2(y)||(y=[null])}const p=e.dataToPosition(a);u(p)||isNaN(p.x)||isNaN(p.y)||s.push({pos:p,data:{dimensionFields:c,dimensionData:v,measureFields:d,measureData:h,hasMeasureData:_,groupField:g,groupData:f,originDatum:a},series:e})})()})),s},J2=t=>p(t)&&!_(t),Q2=t=>p(t)&&_(t),t3=["panel","shape","titleLabel","keyLabel","valueLabel","spaceRow","maxContentHeight","align"];class e3 extends DW{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){const{spec:i,theme:s}=super._initTheme(t,e),n=Lz({},...t3.map((t=>void 0!==(null==s?void 0:s[t])?{[t]:s[t]}:void 0)),null==s?void 0:s.style),r=Lz({},s);t3.forEach((t=>{delete r[t]})),delete r.style;const a=Lz({},r,i);return a.style=Lz({},n,a.style),{spec:a,theme:s}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return p(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:sk(this._option.mode)||!ek(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.confine=null!==(h=t.confine)&&void 0!==h?h:"canvas"===t.renderMode,p(t.parentElement)?y(t.parentElement)&&(t.parentElement=$_.getElementById(t.parentElement)):ek(this._option.mode)&&(t.parentElement=null==tk?void 0:tk.body)}}let i3=class extends jW{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=e3,this.specKey="tooltip",this.layoutType="none",this._isReleased=!1,this.enable=!0,this._alwaysShow=!1,this._eventList=[],this._isTooltipShown=!1,this._clickLock=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._handleClickToLock=t=>{var e,i;if(this._clickLock)this._handleChartMouseOut(t),this._clickLock=!1;else{if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;this._clickLock=!0}},this._getMouseOutHandler=t=>e=>{var i,s,n,r,a;if(this._isReleased)return;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const o=ek(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:l,clientY:h}=e.event;o&&t&&this._isPointerInChart({x:l,y:h})||(this._enterable?this._outTimer=setTimeout((()=>{this._handleChartMouseOut(e)}),null!==(a=null===(r=this._spec)||void 0===r?void 0:r.showDelay)&&void 0!==a?a:50):this._handleChartMouseOut(e))},this._handleChartMouseOut=t=>{var e;this._cacheActiveType&&(null===(e=this._option)||void 0===e?void 0:e.componentShowContent)&&(!1===this._option.componentShowContent.tooltip||g(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[this._cacheActiveType])||this._alwaysShow||this._isReleased||this._isEnterTooltip||"none"!==this._spec.triggerOff&&(this._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:this})),this._handleMouseMove&&this._handleMouseMove.cancel&&this._handleMouseMove.cancel(),this._cacheEnterableRect=null,this._cacheInfo=void 0,this._cacheParams=void 0,this._cacheActiveType=void 0)},this._getMouseMoveHandler=t=>e=>{var i,s,n,r;this._isReleased||this._isEnterTooltip||(this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),this._alwaysShow||(this._clickLock?t&&(this._handleChartMouseOut(e),this._clickLock=!1):!t&&this._enterable&&(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i))?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout((()=>{this._handleChartMouseMove(e,t)}),null!==(r=null===(n=this._spec)||void 0===n?void 0:n.showDelay)&&void 0!==r?r:50)):this._handleChartMouseMove(e,t)))},this._handleChartMouseMove=(t,e)=>{if(this._isReleased)return;const i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:n}}=i,r={mark:!1,dimension:!1,group:!1},a=["group","mark","dimension"];for(let s=0,n=a.length;s<n;s++){const n=a[s],o=!!this.processor[n]&&this._showTooltipByMouseEvent(n,i,t,e);if("unShowByOption"===o)r[n]="unShowByOption";else if(o){r[n]=!0;break}}Object.values(r).every((t=>!t))&&!function(t){return u(t.mark)&&u(t.model)&&u(t.datum)}(t)&&(n&&J2(this._cacheInfo)?r.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):p(s)&&(r.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),!0===r.mark||!0===r.group||!0===r.dimension&&!u(s)?this._initEventOfTooltipContent():this._cacheActiveType&&"unShowByOption"===r[this._cacheActiveType]||this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;if(!this._showContentByEvent(t))return"unShowByOption";const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._hideTimer&&clearTimeout(this._hideTimer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._hideTimer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&BV.globalConfig.uniqueTooltip&&l&&BV.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return 0;this.event.emit(tH.tooltipHide,Object.assign(Object.assign({},t),{source:eH.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const n=null!==(s=this._spec.handler)&&void 0!==s?s:this.tooltipHandler;if(null==n?void 0:n.hideTooltip){const e=n.hideTooltip.call(n,t);return e||(this._isTooltipShown=!1),e}return 1},this.hideTooltip=()=>{if(this._isReleased)return!1;const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:eH.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}}isTooltipShown(){return this._isTooltipShown}_registerEvent(){}_releaseEvent(){}onLayoutEnd(){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return!!U(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i}release(){var t,e;super.release(),this._isReleased=!0,this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((({eventType:t,handler:e})=>{this.event.off(t,e)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(tH.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(tH.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n,this._enterable=!1;else{const t="canvas"===s?_Y.canvas:_Y.dom,n=Fz.getComponentPluginInType(t);n||ZA("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip)return;const i=null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.getRootDom)||void 0===e?void 0:e.call(t);i&&(i.addEventListener("pointerenter",(()=>{var t;if(!this._enterable)return;this._isEnterTooltip=!0;const e=null===(t=i.getBoundingClientRect)||void 0===t?void 0:t.call(i);e&&(this._cacheEnterableRect={width:e.width,height:e.height}),this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this._showTimer&&(clearTimeout(this._showTimer),this._showTimer=null)})),i.addEventListener("pointerleave",(()=>{var t,e,s;if(this._enterable&&(this._isEnterTooltip=!1,"none"!==this._spec.triggerOff&&this._cacheEnterableRect)){const n=null===(t=i.getBoundingClientRect)||void 0===t?void 0:t.call(i);n&&Object.keys(this._cacheEnterableRect).every((t=>this._cacheEnterableRect[t]===n[t]))&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!==(s=null===(e=this._spec)||void 0===e?void 0:e.showDelay)&&void 0!==s?s:50))}})),this._needInitEventOfTooltip=!1)}_initProcessor(){const t=this._spec.activeType;this.processor={},t.forEach((t=>{const e=Fz.createTooltipProcessor(t,this);e&&(this.processor[t]=e)}))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Y(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=Y(this._spec.triggerOff),s=this._option.mode;e.forEach((t=>{var e;"hover"===t?(this._handleMouseMove=this._throttle(this._getMouseMoveHandler(!1)),this._mountEvent("pointermove",{source:"chart"},this._handleMouseMove),(ik(s)||sk(s))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerleave",{source:"chart"},this._getMouseOutHandler(!1))):"click"===t?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):g(t)&&this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseMoveHandler(!0))})),i.filter((t=>g(t))).forEach((t=>{var e,i;this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseOutHandler(null!==(i=t.checkOutside)&&void 0!==i&&i))})),!e.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}_throttle(t){let e;return e=S(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10,St(t,e)}_showContentByEvent(t){var e;if(null===(e=this._option)||void 0===e?void 0:e.componentShowContent){if(!1===this._option.componentShowContent.tooltip)return!1;if(g(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t])return!1}return!0}reInit(t){var e,i,s;if(super.reInit(t),this.tooltipHandler){const t=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",n=this._spec.enterable&&"html"===t;n&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=n,null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.reInit)||void 0===s||s.call(i)}else this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;const s=function(t,e,i){var s,n,r,a,o,l,h;const c=Object.assign({regionIndex:0},e),d=i.getOption(),g=d.getRegionsInUserIdOrIndex(p(c.regionId)?[c.regionId]:void 0,p(c.regionIndex)?[c.regionIndex]:void 0)[0];if(!g)return"none";const f=Z2(t,g),m=null!==(s=c.activeType)&&void 0!==s?s:f.length>1?"dimension":"mark",v=g.getLayoutStartPoint(),y=g.getLayoutRect(),_=d.globalInstance.getContainer(),b=Object.assign({x:0,y:0},_?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(_):{}),x=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data;return null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>X2(i,s)(t)&&X2(n,r)(t)&&(u(a)||X2([a],[o])(t))))},S=g.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse(),A=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),y.width),y:Math.min(Math.max(t.y,0),y.height)}))(t),n=null!==(e=c.x)&&void 0!==e?e:v.x+s.x,r=null!==(i=c.y)&&void 0!==i?i:v.y+s.y,a={x:0,y:0};S.transformPoint({x:n,y:r},a);const{x:o,y:l}=a;return{canvasX:o,canvasY:l,clientX:b.x+o,clientY:b.y+l}};if("dimension"===m){const e=f[0];if(!e)return"none";const s=new Map;f.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const l=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>x(t))))&&void 0!==i?i:[]}}))}];p(e.dimType)&&(l[0].position=e.pos[e.dimType],l[0].dimType=e.dimType);const h={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:l,chart:null!==(n=d.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:eH.chart,event:A({x:f.reduce(((t,e)=>t+e.pos.x),0)/f.length,y:f.reduce(((t,e)=>t+e.pos.y),0)/f.length}),item:void 0};null===(o=null===(a=null===(r=i.processor)||void 0===r?void 0:r.dimension)||void 0===a?void 0:a.showTooltip)||void 0===o||o.call(a,l,h,!1);const c=d.globalInstance;return BV.globalConfig.uniqueTooltip&&BV.hideTooltip(c.id),m}if("mark"===m){const e=f[0];if(!e)return"none";const s=null!==(l=e.data.originDatum)&&void 0!==l?l:Object.assign(Object.assign({},x(e)),t),n=[{datum:[s],series:e.series}],r={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(h=d.globalInstance.getChart())&&void 0!==h?h:void 0,datum:s,model:e.series,source:eH.chart,event:A(e.pos),item:void 0};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},r,!1);const a=d.globalInstance;return BV.globalConfig.uniqueTooltip&&BV.hideTooltip(a.id),m}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=s),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(u(this._cacheInfo)||u(t))return!1;if(Q2(t)){if(J2(this._cacheInfo))return!1;const e=this._cacheInfo;return e.length===t.length&&t.every(((t,i)=>zU(t,e[i])))}if(Q2(this._cacheInfo))return!1;const s=this._cacheInfo;if((null==t?void 0:t.datum)!==s.datum||(null==t?void 0:t.mark)!==s.mark||(null==t?void 0:t.series)!==s.series)return!1;const n=this._cacheParams;return!u(n)&&!u(e)&&n.mark===e.mark&&n.model===e.model&&n.datum===e.datum}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}getVisible(){return!1!==this._spec.visible}};i3.type=r.tooltip,i3.transformerConstructor=e3,i3.builtInTheme={tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}}},i3.specKey="tooltip";const s3=()=>{Fz.registerComponent(i3.type,i3)};var n3;!function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(n3||(n3={}));var r3=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};const a3={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]},o3={labelZIndex:!0,gridZIndex:!0},l3={xField:!0,yField:!0,categoryField:!0,valueField:!0},h3={visible:!0,width:!0,style:!0};class c3 extends jW{get enableRemain(){return"none"===this.triggerOff}constructor(t,e){super(t,e),this.specKey="crosshair",this.layoutType="none",this.gridZIndex=oN.CrossHair_Grid,this.labelZIndex=oN.CrossHair,this.trigger="hover",this._handleIn=t=>{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),S(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=St((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hideCrosshair())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(g(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hideCrosshair()},this.enable=!0,this.showDefault=!0}_setAllAxisValues(t,e,i){let s=!1;if(t.forEach((t=>{DI(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!this.enable)return!1;const{currentValue:n}=this._stateByField[i];return t.forEach(((t,i)=>{const s=t.axis;n.set(i,{datum:this._getDatumAtPoint(s,e),axis:s})})),!0}clearAxisValue(){Object.keys(this._stateByField).forEach((t=>{this._stateByField[t].currentValue.clear()}))}hideCrosshair(){this.clearAxisValue(),this.hide()}showCrosshair(t){t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach((t=>{const{axis:e,value:i}=t;this.setAxisValue(i,e)})),this.layoutByValue(!1))}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshairBySpec(){let t=!1;return Object.keys(this._stateByField).forEach((e=>{const i=this._spec[e];if(i&&i.visible&&i.defaultSelect){const{axisIndex:s=0,datum:n}=i.defaultSelect,r=this._option.getComponentsByKey("axes").find((t=>t.getSpecIndex()===s));r&&(t=!0,this._stateByField[e].currentValue.clear(),this._stateByField[e].currentValue.set(s,{axis:r,datum:n}))}})),t}_updateVisibleCrosshair(){let t=!1;Object.keys(this._stateByField).forEach((e=>{const i=this._spec[e];i&&i.visible&&this._stateByField[e].currentValue.size?t=!0:this._hideByField(e)})),t&&this.layoutByValue(!1)}_showDefaultCrosshair(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return!U(e,t)&&(i.change=!0,i.reRender=!0,i.reMake||(this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0)),i}_isComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((i=>U(null==e?void 0:e[i],null==t?void 0:t[i])||o3[i]||l3[i]&&this._isFieldComponentOnlySpecChange(null==e?void 0:e[i],null==t?void 0:t[i])))}_isFieldComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},t),e)).every((i=>U(null==t?void 0:t[i],null==e?void 0:e[i])||"label"===i||"line"===i&&this._isLineComponentOnlySpecChange(null==t?void 0:t.line,null==e?void 0:e.line)))}_isLineComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},t),e)).every((i=>U(null==t?void 0:t[i],null==e?void 0:e[i])||h3[i]))}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){var s;if(!1===(null===(s=this._option.componentShowContent)||void 0===s?void 0:s.crosshair))return;const n=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,r=e?{level:iH.chart}:{source:eH.chart};_(t)?t.forEach((t=>{this.event.on(t,r,n)})):this.event.on(t,r,n)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;_(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}onBeforeRender(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:t=n["desktop-browser"]}=this._option,e=function(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:ik(t)||sk(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(t);if(e){const t=Y(this.trigger||"hover"),i=t=>"click"===t?"none"===this.triggerOff?null:e.clickOut:e.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:e[t],out:i(t)})})),s}return null}_registerTooltipEvent(){this.event.on(tH.tooltipHide,{source:eH.chart},this._handleTooltipHideOrRelease),this.event.on(tH.tooltipShow,{source:eH.chart},this._handleTooltipShow),this.event.on(tH.tooltipRelease,{source:eH.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=O(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{a3[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:c,y:d}=this.getLayoutStartPoint();return n.forEach((t=>{var e,i;a=1/0,o=1/0,l=-1/0,h=-1/0;const n=s.find((e=>e.getSpecIndex()===t));if(!n)return;const u=(null===(i=(e=n).getInnerOffset)||void 0===i?void 0:i.call(e))||{left:0,right:0,top:0,bottom:0};n.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-c+u.left),o=Math.min(o,i-d+u.top),l=Math.max(l,e+t.getLayoutRect().width-c-u.right),h=Math.max(h,i+t.getLayoutRect().height-d-u.bottom)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:n})})),r}onLayoutEnd(){const t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),super.onLayoutEnd()}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseFieldInfo(){Object.keys(this._stateByField).forEach((t=>{const e=this._spec[t],{crosshairComp:i}=this._stateByField[t];if(e&&e.visible){if(this._stateByField[t].attributes=this._parseField(e,t),i){const{style:e,type:s}=this._stateByField[t].attributes,n="rect"===s?"rectStyle":"lineStyle";i.setAttributes({[n]:e})}}else i&&i.parent&&i.parent.removeChild(i)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||S(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,n;const r={},{line:a={},label:o={},visible:l}=t;if(r.visible=l,r.type=a.type||"line",!1===a.visible)r.style={visible:!1};else{const e=a.style||{},{stroke:n,fill:o,lineWidth:l}=e,h=e,{strokeOpacity:c,fillOpacity:d,opacity:u}=h,p=r3(h,["strokeOpacity","fillOpacity","opacity"]),g="line"===r.type;let f=g?c:d;if(S(u)&&(f=(null!=f?f:1)*u),r.style=Object.assign({opacity:f,pickable:!1,visible:!0},p),g)r.style.stroke=n||o,r.style.lineWidth=O(a,"width",l||2);else{r.style.fill=o||n,(null===(s=null===(i=null==t?void 0:t.line)||void 0===i?void 0:i.style)||void 0===s?void 0:s.stroke)&&(r.style.stroke=t.line.style.stroke);const e=O(a,"width");if("string"==typeof e){const t=parseInt(e.substring(0,e.length-1),10)/100;r.style.sizePercent=t}else"number"!=typeof e&&"function"!=typeof e||(r.style.size=e)}}if(o.visible){const t=o.labelBackground||{},e=null!==(n=o.syncAxisLabelAngle)&&void 0!==n&&n,i=o.style||{},s=t.style||{},{fill:a="rgba(47, 59, 82, 0.9)",stroke:l,outerBorder:h}=s,d=r3(s,["fill","stroke","outerBorder"]);r.label={visible:!0,formatMethod:o.formatMethod,formatter:o.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,syncAxisLabelAngle:e,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},i),{fill:i.fill||"#fff",stroke:O(i,"stroke")}),panel:(c(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:a,stroke:l,outerBorder:Object.assign({stroke:a,distance:0,lineWidth:3},h)},d):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else r.label={visible:!1};return r}_filterAxisByPoint(t,e,i){return t&&t.forEach((s=>{const n=s.axis;if(a=e,o=i,((r=s).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(n.getSpecIndex()),n.type.startsWith("polarAxis")){const s=n.getCenter(),r=n.getInnerRadius(),a=n.getOuterRadius(),o=ae.distancePP({x:e,y:i},s);(o>a||o<r)&&t.delete(n.getSpecIndex())}var r,a,o})),t}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new _B(e),null==s||s.add(t),i(t)),function(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:c=0,dy:d=0}=t.attribute;let u=0,p=0;a<i&&(u=i-a),o<s&&(p=s-o),l>n&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+c),p&&t.setAttribute("dy",p+d)}(t,this._getLimitBounds())}clearOutEvent(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}_hideByField(t){const{crosshairComp:e,labelsComp:i}=this._stateByField[t];e&&e.hideAll(),i&&Object.keys(i).forEach((t=>{i[t]&&i[t].hideAll()}))}hide(){Object.keys(this._stateByField).forEach((t=>{this._hideByField(t)}))}_getNeedClearVRenderComponents(){return Object.keys(this._stateByField).reduce(((t,e)=>{const{crosshairComp:i,labelsComp:s}=this._stateByField[e];return i&&t.push(i),s&&Object.keys(s).forEach((e=>{s[e]&&t.push(s[e])})),t}),[])}}c3.specKey="crosshair";const d3={trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}};class u3 extends c3{static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._stateByField={xField:{coordKey:"x",anotherAxisKey:"y",currentValue:new Map,labelsComp:{top:null,bottom:null}},yField:{coordKey:"y",anotherAxisKey:"x",currentValue:new Map,labelsComp:{left:null,right:null}}}}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const i=BU(t.getOrient())?"x":"y",s=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(s)}setAxisValue(t,e){BU(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}_layoutCrosshair(t,e,i,s){var n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(p(t.dimType)?"y"===t.dimType:EU(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}this.clearAxisValue();const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else o&&o.size&&this._setAllAxisValues(o,{x:r,y:a},"xField"),l&&l.size&&this._setAllAxisValues(l,{x:r,y:a},"yField"),this.layoutByValue()}layoutByValue(t){if(!this.enable)return;const e=sz(this._regions,"cartesian");e&&(cY(this._stateByField,e,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){const{cacheInfo:e,attributes:i,labelsComp:s,bandSize:n,coordKey:r}=this._stateByField[t];if(!i||!e||e._isCache&&this.enableRemain)return;const{coord:a,labels:o,visible:l,labelsTextStyle:h}=e;if(l){const l=pY(this._stateByField[t]);this._updateCrosshairByField(t,l),Object.keys(o).forEach((l=>{var c,d,u;if(o[l].visible){const p=Object.assign(Object.assign(Object.assign({[r]:a+n/2},o[l]),i.label),{angle:i.label.syncAxisLabelAngle&&null!==(d=null===(c=e.axisLabel)||void 0===c?void 0:c.attribute.angle)&&void 0!==d?d:0,textStyle:Object.assign(Object.assign({},null===(u=i.label)||void 0===u?void 0:u.textStyle),h[l]),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(s[l],p,(e=>{e.name=`crosshair-${t.replace("Field","")}-${l}-label`,s[l]=e}))}else s[l]&&s[l].hideAll()}))}else this._hideByField(t)}_updateCrosshairByField(t,e){const i=this.getContainer(),{attributes:s}=this._stateByField[t];let{crosshairComp:n}=this._stateByField[t];if(n)n.setAttributes(e);else{const r=s.style;"line"===s.type?n=new LB(Object.assign(Object.assign({},e),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===s.type&&(n=new FB(Object.assign(Object.assign({},e),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(n),this._stateByField[t].crosshairComp=n}}}u3.specKey="crosshair",u3.builtInTheme={crosshair:d3},u3.type=r.cartesianCrosshair;const p3=()=>{Fz.registerComponent(u3.type,u3)};class g3 extends c3{static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible))}constructor(t,e){super(t,e),this.type=r.polarCrosshair,this.name=r.polarCrosshair,this._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}}}setAxisValue(t,e){"radius"===e.getOrient()?this._stateByField.valueField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.categoryField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint();return t.positionToData({x:e.x-(i-n),y:e.y-(s-r)})}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}this.clearAxisValue();const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)a&&this._setAllAxisValues(a,{x:n,y:r},"categoryField"),o&&this._setAllAxisValues(o,{x:n,y:r},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}layoutByValue(t){if(!this.enable)return;const e=sz(this._regions,"polar");e&&(((t,e,i=!1)=>{Object.keys(t).forEach((s=>{const{attributes:n,currentValue:r,cacheInfo:a,coordKey:o}=t[s];if(n){const l=!!r.size,h=i&&!l&&p(a),c=h?a:{coord:0,axis:null,visible:l,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(a&&(a._isCache=h),"valueField"===s&&(c.sides=e.angleAxisHelper.getScale(0).domain().length),r.forEach((({axis:t,datum:i=""})=>{var r;const a=t.niceLabelFormatter;if((null===(r=n.label)||void 0===r?void 0:r.visible)&&(c.labels.all.visible=!0,c.labels.all.defaultFormatter=a,c.labels.all.text=i,c.labels.all.offset=pW(t.getSpec())),"categoryField"===s){const s=e.angleAxisHelper.dataToPosition([i]),n=e.angleAxisHelper.getBandwidth(0),r=t.getOuterRadius();c.coord=s,c.coordRange=[s-n/2,s+n/2],c.sizeRange=[r,r]}else{const s=t.startAngle,n=e.radiusAxisHelper.dataToPosition([i]);c.coord=n,c.coordRange=[n,n],c.sizeRange=[s,s]}c.axis=t})),c&&!h&&c.labels.all.visible&&n&&n.label){const t=c.labels.all,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=IV(e,i,t.text,{label:t.text,orient:o});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}t[s].cacheInfo=c}}))})(this._stateByField,e,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){var e,i,s;const{cacheInfo:n,attributes:r,crosshairComp:a,labelsComp:o,coordKey:l}=this._stateByField[t];if(!n||n._isCache&&this.enableRemain)return;const h=this.getContainer(),{visible:c,labels:d,coord:u,sizeRange:p,axis:g}=n;if(c){const n=this.getLayoutStartPoint(),c=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,f=((t,e,i)=>{const{cacheInfo:s,coordKey:n,attributes:r}=t,{axis:a,coord:o,sizeRange:l,coordRange:h}=s,c=a.getCenter(),d={x:c.x+e.x,y:c.y+e.y};if("angle"===n)return"sector"==("rect"===r.type?"sector":"line")?{center:d,innerRadius:a.getInnerRadius(),radius:a.getOuterRadius(),startAngle:h[0],endAngle:h[1]}:{start:ce(d,a.getInnerRadius(),o),end:ce(d,a.getOuterRadius(),o)};const u=a.startAngle,p=a.endAngle,g=s.sides;let f=o;if(!i){const t=a.getCenter(),e=a.coordToPoint({angle:l[0],radius:o}),i=ue(t,e),s=(p-u)/g,n=Math.floor((i-u)/s),r=n*s+u,h=Math.min((n+1)*s+u,p),c=ce(t,o,r),d=ce(t,o,h),m=ye([d.x,d.y],[c.x,c.y],[t.x,t.y],[e.x,e.y]);m&&(f=vt(ae.distancePN(e,m[0],m[1])+o,a.getInnerRadius(),a.getOuterRadius()))}return{center:d,startAngle:u,endAngle:p,radius:f,sides:g}})(this._stateByField[t],n,c);if(a)a.setAttributes(f);else{let e;if("angle"===l){const t="rect"===r.type?"sector":"line";"line"===t?e=new LB(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===t&&(e=new jB(Object.assign(Object.assign({},f),{sectorStyle:r.style,zIndex:this.gridZIndex,pickable:!1})))}else e="polygon"==(c?"circle":"polygon")?new HB(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex+1})):new zB(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=e,h.add(e)}const m=d.all;if(m.visible){const t=g.getCenter(),e={x:t.x+n.x,y:t.y+n.y},i="angle"===l?function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(u):function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(g.startAngle),a="angle"===l?ce(e,p[1]+m.offset,u):ce(e,f.radius,g.startAngle),h=Object.assign(Object.assign(Object.assign(Object.assign({},a),r.label),m),{textStyle:Object.assign(Object.assign({},null===(s=r.label)||void 0===s?void 0:s.textStyle),{textAlign:i.align,textBaseline:i.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(o.all,h,(t=>{t.name=`crosshair-${l}-label`,o.all=t}))}else o.all&&o.all.hideAll()}}}g3.specKey="crosshair",g3.builtInTheme={crosshair:d3},g3.type=r.polarCrosshair;const f3=()=>{Fz.registerComponent(g3.type,g3)},m3=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n,originalFields:r}=e,a=n(),o=i();if(u(o)||u(a))return t;const l=r(),h=_(a)?a[0]:a;return t[h]&&l&&l[h]&&l[h].lockStatisticsByDomain&&!s()&&(t[h].values=o),t},v3=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(u(a)||u(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>{let e=!1;return Y(r).every((i=>{t[i]>=a[0]&&t[i]<=K(a)&&(e=!0)})),e}:t=>{let e=!1;return Y(r).every((i=>{(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(l)},y3=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n,isCategoryState:r,seriesCollection:a}=e.input,{stateField:o,valueField:l}=e.output,h={},c=[],d=[],g=[];let f=!1,m=!1;return n.forEach(((t,e)=>{var n;if(u(i[e]))return;const r=a[e];if(r){const t=r.getRawDataStatisticsByField(i[e]);p(null==t?void 0:t.max)&&p(null==t?void 0:t.min)&&(m=!0)}const o=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];o&&o.lockStatisticsByDomain&&(f=!0,o.domain.forEach((t=>{u(h[t])&&(g.push(t),h[t]=0,c.push(t))}))),t.latestData.forEach((t=>{Y(i[e]).forEach((i=>{u(t[i])||(u(h[t[i]])&&(g.push(t[i]),h[t[i]]=0,c.push(t[i])),u(s[e])||(h[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))})),(f?g:!1===r||m?g.sort(((t,e)=>t-e)):c).forEach((t=>{const e={[o]:t};l&&(e[l]=h[t]),d.push(e)})),d},_3=(t,e,i)=>{const s=e.domain();if(II(e.type))return i?s[0]+(K(s)-s[0])*(1-t):s[0]+(K(s)-s[0])*t;let n=e.range();i&&(n=n.slice().reverse());const r=n[0]+(K(n)-n[0])*t;return e.invert(r)},b3=(t,e,i)=>{const s=e.scale(t);let n=e.range();return!i&&II(e.type)&&(n=n.slice().reverse()),Math.max(0,Math.min(1,(s-n[0])/(K(n)-n[0])))},x3=(t,e)=>{const i=t;if(!i)return!1;const s=i.getScale();return s.range()[0]>s.range()[1]&&(!i.getInverse()||e)},S3=t=>{const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}},A3=(t,e,i)=>"start"===t?"percent"===e&&p(i.start)||"value"===e&&p(i.startValue):"percent"===e&&p(i.end)||"value"===e&&p(i.endValue),k3=(t,e,i)=>{if(II(i.type))return[Math.min(e,t),Math.max(e,t)];const s=i.domain(),n=s.indexOf(t),r=s.indexOf(e);return s.slice(Math.min(n,r),Math.max(n,r)+1)};class C3{enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this.handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this.handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}constructor(t,e,i,s,n,r,a,o){this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.initZoomEvent=()=>{var t,e,i,s,n,r,a;const o={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:p(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a,allowComponentZoom:!0};this._zoomAttr.enable&&this.initZoomEventOfRegions(this.getRegions(),null,this.handleChartZoom,o),this._scrollAttr.enable&&this.initScrollEventOfRegions(this.getRegions(),null,this.handleChartScroll,o),this._dragAttr.enable&&this.initDragEventOfRegions(this.getRegions(),null,this.handleChartDrag,o)},this.handleChartZoom=(t,e)=>{var i,s;if(!this._activeRoam||this._zoomAttr.filter&&!this._zoomAttr.filter(t,e))return;const{zoomDelta:n,zoomX:r,zoomY:a}=t,{x:o,y:l}=this.getRegions()[0].getLayoutStartPoint(),{width:h,height:c}=this.getRegions()[0].getLayoutRect(),d=Math.abs(this.getState().start-this.getState().end),u=null!==(s=null===(i=this._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==s?s:1;if(d>=1&&n<1)return;if(d<=.01&&n>1)return;const p=this._isHorizontal?r:a,g=d*(n-1)*u;let f=g/2,m=g/2;if(p){const t=this._isHorizontal?o:l,e=this._isHorizontal?h:c;f=Math.abs(t-p)/Math.abs(e-t)*g,m=Math.abs(e-p)/Math.abs(e-t)*g}const v=vt(this.getState().start+f,0,1),y=vt(this.getState().end-m,0,1);this._handleChange(Math.min(v,y),Math.max(v,y),!0)},this.handleChartScroll=(t,e)=>{var i;if(!this._activeRoam||this._scrollAttr.filter&&!this._scrollAttr.filter(t,e))return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?Ut(s/n)>=.5:Ut(n/s)>=.5;if(this._scrollAttr.reverse||(r=-r),a){const t=this._spec.scrollStep;k(t)&&(r=(r>0?1:-1)*(t*(this.getState().end-this.getState().start)/1)),this.handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1)}const o=0!==this.getState().start&&1!==this.getState().end;return a&&o},this.handleChartDrag=(t,e)=>{var i;if(!this._activeRoam||this._dragAttr.filter&&!this._dragAttr.filter(t,e))return;const[s,n]=t;let r=this._isHorizontal?s:n;this._dragAttr.reverse&&(r=-r),this.handleChartMove(r,null!==(i=this._dragAttr.rate)&&void 0!==i?i:1)},this.handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this.getState().end<1){const s=Math.min(1-this.getState().end,t/i)*e;this._handleChange(this.getState().start+s,this.getState().end+s,!0)}else if(t<0&&this.getState().start>0){const s=Math.max(-this.getState().start,t/i)*e;this._handleChange(this.getState().start+s,this.getState().end+s,!0)}return!1},this._type=t,this._spec=e,this._handleChange=i,this.getLayoutRect=s,this.getState=n,this.getRegions=r,this._regions=r(),this.getOption=a,this._option=a(),this.getEvent=o,this._isHorizontal="horizontal"===IU(OU(e))}setEventAttrFromSpec(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=j({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=j({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=j({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,c(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.getEvent(),this._option.mode)}}G(C3,OK);class M3 extends jW{get isHorizontal(){return this._isHorizontal}get stateScale(){return this._stateScale}get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:b3(t,this._stateScale,this._isHorizontal),a="percent"===n?e:b3(e,this._stateScale,this._isHorizontal);this._handleChange(r,a,!0)}enableInteraction(){this._dataFilterEvent.enableInteraction()}disableInteraction(){this._dataFilterEvent.disableInteraction()}zoomIn(t){this._dataFilterEvent.zoomIn(t)}zoomOut(t){this._dataFilterEvent.zoomOut(t)}_initEvent(){var t;this._dataFilterEvent.initZoomEvent(),null===(t=this._relatedAxisComponent)||void 0===t||t.event.on(tH.scaleRawDomainUpdate,(({model:t})=>{console.log("scaleRawDomainUpdate",t.getRawDomain())}))}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_updateRangeFactor(t){const e=this._relatedAxisComponent,i=e.getScale(),s=x3(e,this._isHorizontal),n=s?[1-this._end,1-this._start]:[this._start,this._end];if(s)switch(t){case"startHandler":e.scaleRangeFactorEnd(n[1]);break;case"endHandler":e.scaleRangeFactorStart(n[0]);break;default:e.scaleRangeFactorStart(n[0],!0),e.scaleRangeFactorEnd(n[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(n[0]);break;case"endHandler":e.scaleRangeFactorEnd(n[1]);break;default:e.scaleRangeFactorEnd(n[1],!0),e.scaleRangeFactorStart(n[0])}const r=i.rangeFactor();r?(this._start=s?1-r[1]:r[0],this._end=s?1-r[0]:r[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._hasInitStateScale=!1,this._shouldChange=!0,this._stateField="x",this._currentDataCollection=[],this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=k3(this._startValue,this._endValue,this._stateScale),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&S3(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate({value:"force"})}else ez(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),ez(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._orient=OU(t),this._isHorizontal="horizontal"===IU(this._orient),this._dataFilterEvent=new C3(this.type,this._spec,this._handleChange.bind(this),this.getLayoutRect.bind(this),(()=>({start:this._start,end:this._end})),(()=>this._regions),(()=>this._option).bind(this),(()=>this.event))}created(){this._handleDataCollectionChangeBound=this._handleDataCollectionChange.bind(this),super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||U(e,t)||(i.change=!0,i.reRender=!0,!i.reCompile&&this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0),i}_getComponentOnlySpecKeys(){return null}_isComponentOnlySpecChange(t,e){const i=this._getComponentOnlySpecKeys();return!!i&&Object.keys(Object.assign(Object.assign({},e),t)).every((s=>U(null==e?void 0:e[s],null==t?void 0:t[s])||i[s]))}reInit(t){super.reInit(t),this._marks.forEach((t=>{t.getMarks().forEach((t=>{this.initMarkStyleWithSpec(t,this._spec[t.name])}))}))}onLayoutStart(t,e){super.onLayoutStart(t,e);const i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=((t,e,i,s,n)=>{if(II(n.type)){const r=n.domain(),a=r[0],o=K(r)-a,l=p(t)?a+o*t:+e,h=p(i)?a+o*i:+s;return[Math.min(h,l),Math.max(h,l)]}const r=n.domain(),a=n.range(),o=a[a.length-1]-a[0],l=p(t)?r.indexOf(n.invert(o*t+a[0])):r.indexOf(e),h=p(i)?r.indexOf(n.invert(o*i+a[0])):r.indexOf(s);return r.slice(Math.min(l,h),Math.max(l,h)+1)})(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}_initAfterLayout(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}_beforeLayoutEnd(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}onLayoutEnd(){var t;this._beforeLayoutEnd();const e=!(0===this._start&&1===this._end);this._autoVisible(e),super.onLayoutEnd(),null===(t=this._relatedAxisComponent)||void 0===t||t.updateScaleRange()}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}_setAxisFromSpec(){if(p(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):p(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),u(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>IU(t._orient)===IU(this._orient)));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!II(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(p(i)&&(p(i.userId)&&(this._seriesUserId=Y(i.userId)),p(i.specIndex)&&(this._seriesIndex=Y(i.specIndex))),p(this._spec.seriesId)){const t=Y(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(p(this._spec.seriesIndex)){const t=Y(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(p(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Y(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(p(this._spec.regionId)){const t=Y(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}}_collectDataInfo(){const t=[],e=[],i=[],s=[];let n;if(this._relatedAxisComponent){const e={};ez(this._regions,(r=>{var a,o;const l="cartesian"===r.coordinate?r.getXAxisHelper():"polar"===r.coordinate?r.angleAxisHelper:null,h="cartesian"===r.coordinate?r.getYAxisHelper():"polar"===r.coordinate?r.radiusAxisHelper:null;if(!l||!h)return;const c=l.getAxisId()===this._relatedAxisComponent.id?l:h.getAxisId()===this._relatedAxisComponent.id?h:this._isHorizontal?l:h,d=c===l?h:l,u=II(d.getScale(0).type),p=II(c.getScale(0).type);t.push(r.getRawData());const g=r.getSpec(),f="cartesian"===r.coordinate?Y(g.xField):Y(null!==(a=g.angleField)&&void 0!==a?a:g.categoryField),m="cartesian"===r.coordinate?Y(g.yField):Y(null!==(o=g.radiusField)&&void 0!==o?o:g.valueField);if(e[r.id]="link"===r.type?["from_xField"]:c===l?f:m,p?(n=!1,i.push(e[r.id])):(n=!0,i.push(e[r.id][0])),this._valueField){const t="link"===r.type?["from_yField"]:d===l?f:m;u&&s.push(...t)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=e}else ez(this._regions,(n=>{t.push(n.getRawData()),e.push(n),i.push(this._field),this._valueField&&s.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});return{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:n}}_initData(){const{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:n}=this._collectDataInfo(),{dataSet:r}=this._option;lH(r,"dataview",ja),oH(r,"dataFilterComputeDomain",y3);const a=new so(r,{name:`${this.type}_${this.id}_data`});a.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:n},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new FN(this._option,a),a.reRunAllTransform(),this._currentDataCollection=t,r.multipleDataViewAddListener(t,"change",this._handleDataCollectionChangeBound)}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(oH(this._option.dataSet,"dataFilterWithNewDomain",v3),oH(this._option.dataSet,"lockStatisticsFilter",m3),ez(this._regions,(t=>{t.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:()=>t.getViewDataStatistics().getFields(),getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>II(this._stateScale.type)},level:1},!1),t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>II(this._stateScale.type)},level:_H.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onDataUpdate(){var t;const{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:n,isCategoryState:r}=this._collectDataInfo();if(this._currentDataCollection.length!==e.length||this._currentDataCollection.some(((t,i)=>t!==e[i]))){this._currentDataCollection.forEach((t=>{var e;null===(e=null==t?void 0:t.target)||void 0===e||e.removeListener("change",this._handleDataCollectionChangeBound)})),this._currentDataCollection=e;const{dataSet:t}=this._option;t.multipleDataViewAddListener(this._currentDataCollection,"change",this._handleDataCollectionChangeBound)}this._data.getDataView().transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:n,isCategoryState:r},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data.getDataView().reRunAllTransform();const a=this._computeDomainOfStateScale(II(this._stateScale.type));this._stateScale.domain(a,!1),(p(this._spec.start)||p(this._spec.end))&&this._setStateFromSpec(),this._handleChange(this._start,this._end,!0),this._spec.auto&&!U(this._domainCache,a)&&(this._domainCache=a,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_setStateFromSpec(){let t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[i,s]=this._spec.rangeMode;A3("start",i,this._spec)&&A3("end",s,this._spec)&&(t="percent"===i?this._spec.start:b3(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===s?this._spec.end:b3(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?b3(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?b3(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}_setStateFromAxis(){var t,e;this._setStateFromSpec();const i=this._relatedAxisComponent;this._startValue=_3(this._start,this._stateScale,x3(i,this._isHorizontal)),this._endValue=_3(this._end,this._stateScale,x3(i,this._isHorizontal)),this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,II(this._stateScale.type)&&this._stateScale.domain()[0]!==K(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(K(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(K(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=k3(this._startValue,this._endValue,this._stateScale)))}_initStateScale(){var t,e,i,s,n,r;const a=[0,1];if(this._relatedAxisComponent){const o=this._relatedAxisComponent.getScale().clone();this._stateScale=o,null===(e=(t=o).maxBandwidth)||void 0===e||e.call(t,"auto",!0),null===(s=(i=o).minBandwidth)||void 0===s||s.call(i,"auto",!0),null===(r=(n=o).bandwidth)||void 0===r||r.call(n,"auto",!0),o.rangeFactor(a,!0).range(a)}else{let t=!0;this._field&&ez(this._regions,(e=>{const i=e.getRawDataStatisticsByField(this._field);k(null==i?void 0:i.min)&&k(null==i?void 0:i.max)||(t=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=t?new CR:new nR,this._stateScale.domain(this._computeDomainOfStateScale(t),!0).range(a)}}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[X(t),$(t)]:[-1/0,1/0]}return e}_autoVisible(t){if(!this._auto)return;t?this.show():this.hide();const e=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[e]:t?this[`_${e}`]:0},{[e]:hN.Built_In})}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),c=null==l?void 0:l.getScale(),d=S3(h);if(!this._dataUpdating&&DI(c.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==d?void 0:d.bandSize))return this._cacheVisibility;let p=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?c.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&c.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==d?void 0:d.bandSize,DI(c.type)){d&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=c.rangeFactor())&&void 0!==a?a:[];p=!(u(t)&&u(e)||0===t&&1===e)}else{const[t,e]=null!==(o=c.rangeFactor())&&void 0!==o?o:[this._start,this._end];p=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=p,p}_getNeedClearVRenderComponents(){return[this._component]}}G(M3,OK);class w3 extends DW{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=Lz({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=_(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}const T3=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),B3={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:T3(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:T3(!0)},E3={width:!0,height:!0,showDetail:!0,middleHandler:!0,background:!0,startHandler:!0,endHandler:!0,startText:!0,endText:!0,dragMask:!0,selectedBackground:!0,backgroundChart:!0,selectedBackgroundChart:!0,showBackgroundChart:!0};let P3=class extends M3{constructor(t,e){var i;super(t,e),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=w3,this.specKey="dataZoom",this.layoutZIndex=oN.DataZoom,this.layoutLevel=lN.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e=this._isHorizontal?0:this._middleHandlerSize,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e=this._isHorizontal?0:this._middleHandlerSize,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._getPreviewStateScale(),n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._getPreviewStateScale(),n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"filter"}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange)if(i&&this._component)this._component.setStartAndEnd(t,e);else{const i=this._relatedAxisComponent,n=_3(t,this._stateScale,x3(i,this._isHorizontal)),r=_3(e,this._stateScale,x3(i,this._isHorizontal));if(!p(n)||!p(r))return;this._start=t,this._end=e,(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,n,r):this._handleStateChange(n,r,s))&&this.event.emit(tH.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){this._data.getDataView().reRunAllTransform(),this._initAfterLayout();const t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new CR),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}created(){super.created(),this._initValueScale()}updateLayoutAttribute(){!1!==this._cacheVisibility&&super.updateLayoutAttribute()}_beforeLayoutEnd(){super._beforeLayoutEnd();const t=this._relatedAxisComponent;(x3(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=x3(t,this._isHorizontal),this.effect.onZoomChange())}_getComponentOnlySpecKeys(){return E3}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}getBoundsInRect(t){var e,i,s,n;const r={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},a=this._startHandlerSize*(null!==(e=this._spec.startHandler.style.scaleX)&&void 0!==e?e:1),o=this._startHandlerSize*(null!==(i=this._spec.startHandler.style.scaleY)&&void 0!==i?i:1),l=this._endHandlerSize*(null!==(s=this._spec.endHandler.style.scaleX)&&void 0!==s?s:1),h=this._endHandlerSize*(null!==(n=this._spec.endHandler.style.scaleY)&&void 0!==n?n:1),c=this._visible?this._isHorizontal?(a-this._startHandlerSize)/2+(l-this._endHandlerSize)/2:(Math.max(a,l)-this._width)/2:0,d=this._visible?this._isHorizontal?(Math.max(o,h)-this._height)/2:(o-this._startHandlerSize)/2+(h-this._endHandlerSize)/2:0;return this._isHorizontal?(r.y2=r.y1+this._height+d,r.x2=r.x1+t.width+c):(r.x2=r.x1+this._width+c,r.y2=r.y1+t.height+d),r}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec();const c=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),u(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize),u(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,p=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=p?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new CR;e.domain(t),this._valueScale=e}}_updateScaleRange(){this._updateStateScaleRange(),this._updateValueScaleRange()}_updateStateScaleRange(){var t,e,i;const s=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale)return;let n;const r=this._isHorizontal?this.getLayoutRect().width-s:this.getLayoutRect().height-s,a=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,r+this._startHandlerSize/2],o=this._computeWidth(),l=this._computeHeight();n=this._isHorizontal?this._visible?[this._startHandlerSize/2,o-s+this._startHandlerSize/2]:a:this._visible?[this._startHandlerSize/2,l-s+this._startHandlerSize/2]:a,this._stateScale.range(n),null===(i=this._previewStateScale)||void 0===i||i.range(x3(this._relatedAxisComponent,this._isHorizontal)?n.reverse():n)}_updateValueScaleRange(){if(!this._valueScale)return;const t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[X(e),$(e)]:null}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return!(II(t.type)&&e[0]===K(e)||DI(t.type)&&1===(i=e,i&&_(i)?Array.from(new Set(Y(i))):i).length);var i}_getXScale(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}_getYScale(){return this._isHorizontal?this._valueScale:this._stateScale}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:S(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this._computeWidth(),height:this._computeHeight()},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:p(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:x3(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}_getLayoutAttrs(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}_createOrUpdateComponent(t){if(this._visible){const e=!1!==this._spec.showBackgroundChart,i=this._getAttrs(e),s=this._relatedAxisComponent;if(this._component)this._component.setAttributes(i),t&&(this._component.setPreviewData(this._data.getDataView().latestData),e&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>_3(t,this._stateScale,x3(s,this._isHorizontal))))));else{const t=this.getContainer();this._component=new sL(i),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?e&&this._component.setPreviewPointsY1(this._dataToPositionY2):e&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>_3(t,this._stateScale,x3(s,this._isHorizontal)))),this._component.addEventListener("dataZoomChange",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component)}}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,c,d;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:f={},selectedBackgroundChart:m={}}=this._spec;return{backgroundStyle:$j(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:$j(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:$j(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:$j(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:$j(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:$j(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:$j(g.style)},selectedBackgroundStyle:$j(this._spec.selectedBackground.style),dragMaskStyle:$j(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:Lz($j(null===(l=f.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},$j(null===(h=f.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Lz($j(null===(c=m.line)||void 0===c?void 0:c.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},$j(null===(d=m.area)||void 0===d?void 0:d.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=IV(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}onDataUpdate(){super.onDataUpdate(),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}_getPreviewStateScale(){return this._previewStateScale||(x3(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}};P3.type=r.dataZoom,P3.transformerConstructor=w3,P3.builtInTheme={dataZoom:B3},P3.specKey="dataZoom";const O3=()=>{Fz.registerComponent(P3.type,P3)},I3={width:!0,height:!0,rail:!0,slider:!0,round:!0,innerPadding:!0,minSliderSize:!0};let R3=class extends M3{constructor(t,e){var i;super(t,e),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=oN.DataZoom,this.layoutLevel=lN.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"axis"}_handleChange(t,e,i){super._handleChange(t,e,i);const s=YF(this._start,t)&&YF(this._end,e);if(this._shouldChange&&(!s||!1===this._spec.realTime)){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;const s=this._relatedAxisComponent,n=x3(s,this._isHorizontal),r=_3(t,this._stateScale,n),a=_3(e,this._stateScale,n);(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,r,a):this._handleStateChange(r,a))&&this.event.emit(tH.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}_getComponentOnlySpecKeys(){return I3}_beforeLayoutEnd(){var t,e;super._beforeLayoutEnd(),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t)}onLayoutEnd(){this._updateComponentBounds(),super.onLayoutEnd()}_updateScaleRange(){}_updateComponentBounds(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return!1===this._visible?0:S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return!1===this._visible?0:S(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r,a;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:p(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r,minSliderSize:null===(a=this._spec)||void 0===a?void 0:a.minSliderSize},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new UT(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),this._component.addEventListener("scrollUp",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return u(i)||(s.padding=i),P(null==t?void 0:t.style)||(s.railStyle=$j(t.style)),P(null==e?void 0:e.style)||(s.sliderStyle=$j(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}};R3.type=r.scrollBar,R3.builtInTheme={scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},R3.specKey="scrollBar";const D3=()=>{Fz.registerComponent(R3.type,R3)},L3=(t,e)=>{const{datum:i,title:s,content:n}=d(e)?e():e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Y(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},F3=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),z3={title:{visible:!0,autoLimit:!1,autoFit:!1,style:F3("l1FontSize","primaryFontColor")},content:{visible:!0,style:F3("l2FontSize","tertiaryFontColor")}};var j3=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};let H3=class extends jW{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=oN.Indicator,this.layoutLevel=lN.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t&&!1!==t.visible))}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Y(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex))}_compareSpec(t,e){const i=super._compareSpec(t,e);return!!U(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}initEvent(){this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(Xj(e))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))):(this.event.on("element-select:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(Xj(e))})),this.event.on("element-select:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){oH(this._option.dataSet,"indicatorFilter",L3);const t=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:()=>({title:this._title,content:this._content,datum:()=>this._activeDatum})}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new FN(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:n}=t.getLayoutStartPoint(),r=this._spec,{content:a,offsetX:o,offsetY:l,limitRatio:h,title:c}=r,d=j3(r,["content","offsetX","offsetY","limitRatio","title"]),u=[];return Y(a).forEach((t=>{const e=Lz({},this._theme.content,t);u.push({visible:!1!==e.visible&&(!e.field||null!==this._activeDatum),space:e.space||this._gap,autoLimit:e.autoLimit,autoFit:e.autoFit,fitPercent:e.fitPercent,fitStrategy:e.fitStrategy,style:Object.assign(Object.assign({},Kj(H(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:e,height:i},zIndex:this.layoutZIndex,x:s,y:n,dx:o?Ez(o,this._computeLayoutRadius()):0,dy:l?Ez(l,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==c.visible&&(!p(c.field)||null!==this._activeDatum),space:c.space||this._gap,autoLimit:c.autoLimit,autoFit:c.autoFit,fitPercent:c.fitPercent,fitStrategy:c.fitStrategy,style:Object.assign(Object.assign({},Kj(H(c.style,["text"]),this._activeDatum)),{text:this._createText(c.field,c.style.text)})},content:u},d)}_createOrUpdateIndicatorComponent(t){if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)U(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new _F(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",((t,e)=>this._delegateEvent(this._indicatorComponent,t,e)))}this._cacheAttrs=t}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":d(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>!!e.getSeriesInId(t.context.modelId)))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}};H3.type=r.indicator,H3.builtInTheme={indicator:z3},H3.specKey="indicator";const N3=()=>{Fz.registerComponent(H3.type,H3)},V3=["sum","average","min","max","variance","standardDeviation","median"];var U3=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};function W3(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=X(s),r=$(s);return e<n||e>r}function G3(t,e){return t?`${t}_${e}_extend`:`marker_${e}_extend`}function Y3(t,e,i,s,n,r,a){var o,l;const{relativeSeries:h}=s;let c;return S(t.x)&&W3(e,t.x,i)&&(null===(l=null==h?void 0:(o=h.getXAxisHelper()).setExtendDomain)||void 0===l||l.call(o,G3(a,"xAxis"),t.x)),c=Cz(t.x)?q3(t.x,n)+r.x:Z3(h.getXAxisHelper(),[t.x])+r.x,c}function K3(t,e,i,s,n,r,a){var o,l;const{relativeSeries:h}=s;let c;return S(t.y)&&W3(e,t.y,i)&&(null===(l=null===(o=h.getYAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,G3(a,"yAxis"),t.y)),c=Cz(t.y)?q3(t.y,n)+r.y:Z3(h.getYAxisHelper(),[t.y])+r.y,c}function $3(t,e,i,s,n){var r,a;const{relativeSeries:o}=s;return S(t.angle)&&W3(e,t.angle,i)&&(null===(a=null===(r=o.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,G3(n,"angleAxis"),t.angle)),Z3(o.angleAxisHelper,[t.angle])}function X3(t,e,i,s,n){var r,a;const{relativeSeries:o}=s;return S(t.radius)&&W3(e,t.radius,i)&&(null===(a=null===(r=o.radiusAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,G3(n,"radiusAxis"),t.radius)),Z3(o.radiusAxisHelper,[t.radius])}function q3(t,e){return Number(t.substring(0,t.length-1))*e/100}function Z3(t,e){const i=t.getScale(0);return II(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function J3(t){return V3.includes(t)}function Q3(t,e,i,s,n,r=!1,a){const o=e.getRegion(),l=o.getLayoutStartPoint(),h=i.getRegion(),c=h.getLayoutStartPoint(),d=Math.abs(Math.min(l.x,c.x)-Math.max(l.x+o.getLayoutRect().width,c.x+h.getLayoutRect().width)),u=Math.abs(Math.min(l.y,c.y)-Math.max(l.y+o.getLayoutRect().height,c.y+h.getLayoutRect().height)),g={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},f=[],m=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,v=s.getXAxisHelper(),y=s.getYAxisHelper(),_=v.getScale(0).domain(),b=y.getScale(0).domain(),x=r&&!v.isContinuous&&!!v.getBandwidth,S=r&&!y.isContinuous&&!!y.getBandwidth,A={min:null,max:null},k={min:null,max:null};return m.forEach((t=>{const e=p(t.x),i=p(t.y);let s,r;if(e&&i)s=Y3(t,_,n,g,d,l,a),r=K3(t,b,n,g,u,l,a),t5(s,x,A,f.length),t5(r,S,k,f.length),f.push([{x:s,y:r}]);else if(e){s=Y3(t,_,n,g,d,l,a),r=Math.max(l.y+o.getLayoutRect().height,c.y+h.getLayoutRect().height);const e=Math.min(l.y,c.y);t5(s,x,A,f.length),f.push([{x:s,y:r},{x:s,y:e}])}else if(i){s=Math.min(l.x,c.x),r=K3(t,b,n,g,u,l,a);const e=Math.max(l.x+o.getLayoutRect().width,c.x+h.getLayoutRect().width);t5(r,S,k,f.length),f.push([{x:s,y:r},{x:e,y:r}])}})),function(t,e,i,s,n){if(s.min||s.max){const i=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());s.min&&t[s.min.index].forEach((t=>t.x-=i/2)),s.max&&t[s.max.index].forEach((t=>t.x+=i/2))}if(n.min||n.max){const e=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());n.min&&t[n.min.index].forEach((t=>t.y-=e/2)),n.max&&t[n.max.index].forEach((t=>t.y+=e/2))}}(f,v,y,A,k),f}function t5(t,e,i,s){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:s}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:s})),t}function e5(t,e,i,s,n,r){const a={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},o=[],l=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,h=s.angleAxisHelper.getScale(0).domain(),c=s.radiusAxisHelper.getScale(0).domain(),d=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return l.forEach((t=>{const e=p(t.angle),i=p(t.radius);if(e&&i){const e=$3(t,h,n,a,r),i=X3(t,c,n,a,r);o.push([{angle:e,radius:i}])}else if(e){const e=$3(t,h,n,a,r);o.push([{angle:e,radius:-d},{angle:e,radius:d}])}else if(i){const e=X3(t,c,n,a,r);o.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),o}function i5(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{p(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}function s5(t,e,i,s,n){const r=[],a=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,o=_(s);return a.forEach(((t,a)=>{var l,h,c,d;const u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,p=u.getRegion(),g=p.getLayoutStartPoint(),{width:f,height:m}=p.getLayoutRect();let v=0,y=0;if(s){const t=o?s[a]:s,e=t.x,i=t.y;e&&(v=Cz(e)?Number(e.substring(0,e.length-1))*f/100:e),i&&(y=Cz(i)?Number(i.substring(0,i.length-1))*m/100:i)}const _=u.getXAxisHelper().getScale(0).domain(),b=u.getYAxisHelper().getScale(0).domain(),x=Y(t.x),A=Y(t.y);1===x.length&&S(x[0])&&W3(_,x[0],i)&&(null===(h=null===(l=u.getXAxisHelper())||void 0===l?void 0:l.setExtendDomain)||void 0===h||h.call(l,G3(n,"xAxis"),x[0])),1===A.length&&S(A[0])&&W3(b,A[0],i)&&(null===(d=null===(c=u.getYAxisHelper())||void 0===c?void 0:c.setExtendDomain)||void 0===d||d.call(c,G3(n,"yAxis"),A[0])),r.push({x:Z3(u.getXAxisHelper(),x)+g.x+v,y:Z3(u.getYAxisHelper(),A)+g.y+y})})),r}function n5(t,e,i,s){const n=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var r,a,o,l;const h=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,c=h.angleAxisHelper.getScale(0).domain(),d=h.radiusAxisHelper.getScale(0).domain(),u=Y(t.angle),p=Y(t.radius);1===u.length&&S(u[0])&&W3(c,u[0],i)&&(null===(a=null===(r=h.angleAxisHelper)||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,G3(s,"angleAxis"),u[0])),1===p.length&&S(p[0])&&W3(d,p[0],i)&&(null===(l=null===(o=h.radiusAxisHelper)||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,G3(s,"radiusAxis"),p[0])),n.push({angle:Z3(h.angleAxisHelper,u),radius:Z3(h.radiusAxisHelper,p)})})),n}function r5(t,e,i){let{x:s,y:n}=t;return Cz(s)&&(s=q3(s,e)),Cz(n)&&(n=q3(n,i)),{x:s,y:n}}function a5(t,e,i){let s;if(s=d(t)?Y(t(e.getData().getLatestData(),e)):Y(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=r5(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>r5(t,n,r)))}function o5(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.x<e&&(e=r.x),r.x+a.width>i&&(i=r.x+a.width),r.y<s&&(s=r.y),r.y+a.height>n&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function l5(t,e,i){const{labelBackground:s={},style:n,shape:r}=t,a=U3(t,["labelBackground","style","shape"]);if(!1!==t.visible){const t=a;return(null==r?void 0:r.visible)?t.shape=Object.assign({visible:!0},$j(r.style)):t.shape={visible:!1},!1!==s.visible?(t.panel=Object.assign({visible:!0,customShape:s.customShape},c5($j(s.style),e,i)),p(s.padding)&&(t.padding=ui(s.padding))):(t.panel={visible:!1},t.padding=0),n&&(t.textStyle=c5($j(n),e,i)),t}return{visible:!1}}function h5(t,e,i){for(const s in t)d(t[s])&&(t[s]=t[s](e,i));return t}function c5(t,e,i){return d(t)?t(e,i):t}function d5(t,e){return d(t)?t(e):t}function u5(t,e,i){return p(t)?"regionLeft"===e?i.getLayoutStartPoint().x-t.x:"regionRight"===e?i.getLayoutStartPoint().x+i.getLayoutRect().width-t.x:"regionTop"===e?i.getLayoutStartPoint().y-t.y:"regionBottom"===e?i.getLayoutStartPoint().y+i.getLayoutRect().height-t.y:e:e}function p5(t){return{isXProcess:p(t.x),isYProcess:p(t.y),isX1Process:p(t.x1),isY1Process:p(t.y1),isAngleProcess:p(t.angle),isRadiusProcess:p(t.radius),isAngle1Process:p(t.angle1),isRadius1Process:p(t.radius1),isCoordinatesProcess:p(t.coordinates),isValidProcess:p(t.process)}}function g5(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h,isValidProcess:c}=p5(t);return{doXProcess:e&&!i&&!n,doXYY1Process:e&&i&&n,doYProcess:i&&!e&&!s,doYXX1Process:i&&e&&s,doXYProcess:e&&i&&s&&n,doAngleProcess:r&&!o&&!a&&!l,doRadiusProcess:a&&!l&&!r&&!o,doAngRadRad1Process:r&&!o&&a&&l,doRadAngAng1Process:a&&r&&o&&!l,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h&&(!c||"process"in t&&"xy"in t.process)}}function f5(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h}=p5(t);return{doXProcess:e&&s&&!i&&!n,doYProcess:i&&n&&!e&&!s,doXYProcess:e&&s&&i&&n,doAngleProcess:r&&o&&!a&&!l,doRadiusProcess:a&&l&&!r&&!o,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h}}function m5(t){return{doXYProcess:p(t.x)&&p(t.y),doPolarProcess:p(t.angle)&&p(t.radius),doGeoProcess:p(t.areaName)}}var v5=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};function y5(t,e){let i;if(e.coordinates){const t=e,{coordinates:s,coordinateType:n,getSeriesByIdOrIndex:r}=t,a=v5(t,["coordinates","coordinateType","getSeriesByIdOrIndex"]);let o,l;if(d(s)){const t=e.getRelativeSeries();o=s(t.getData().getLatestData(),t)}else o=s;o=Y(o),i=o.map((t=>{const e=r(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===n){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:o,yFieldIndex:h}=t;let c=i;p(r)&&(c=Y(i)[r]),n&&Y(i).includes(n)&&(c=n);let d=s;p(h)&&(d=Y(s)[h]),o&&Y(s).includes(o)&&(d=o),l=Object.assign({x:void 0,y:void 0},a),y(t[c])&&J3(t[c])?l.x={field:c,aggrType:t[c]}:l.x=Y(c).map((e=>t[e])),y(t[d])&&J3(t[d])?l.y={field:d,aggrType:t[d]}:l.y=Y(d).map((e=>t[e]))}else if("polar"===n){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let o=s;p(r)&&(o=Y(s)[r]),n&&Y(s).includes(n)&&(o=n);const h=i;l=Object.assign({angle:void 0,radius:void 0},a),y(t[o])&&J3(t[o])?l.angle={field:o,aggrType:t[o]}:l.angle=Y(o).map((e=>t[e])),y(t[h])&&J3(t[h])?l.radius={field:h,aggrType:t[h]}:l.radius=Y(h).map((e=>t[e]))}return l.getRefRelativeSeries=()=>e,l}))}else i=e;const s=[];return i.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(p(e.x)){const s=e.x;_(s)?i.x=s.map((i=>b5(i,t,e))):i.x=b5(s,t,e)}if(p(e.y)){const s=e.y;_(s)?i.y=s.map((i=>b5(i,t,e))):i.y=b5(s,t,e)}if(p(e.angle)){const s=e.angle;_(s)?i.angle=s.map((i=>b5(i,t,e))):i.angle=b5(s,t,e)}if(p(e.radius)){const s=e.radius;_(s)?i.radius=s.map((i=>b5(i,t,e))):i.radius=b5(s,t,e)}if(p(e.areaName)){const s=e.areaName;i.areaName=b5(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)})),s}const _5={min:(t,e)=>KF(t[0].latestData,e.field),max:(t,e)=>$F(t[0].latestData,e.field),sum:function(t,e){return XF(t[0].latestData,e.field)},average:function(t,e){return qF(t[0].latestData,e.field)},variance:function(t,e){return ZF(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(ZF(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return ct(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function b5(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(d(t))return t(a,o,l,s,n,r);if(m(t)){const{aggrType:i,field:s}=t;return _5[i](e,{field:s})}return t}function x5(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}const S5=t=>{var e;const i=null===(e=null==t?void 0:t.dataSet)||void 0===e?void 0:e.dataViewMap;return i?Object.values(i).filter(Boolean):[]},A5=(t,e)=>{var i,s;null===(i=null==t?void 0:t.target)||void 0===i||i.removeListener("change",e.reRunAllTransform),null===(s=null==t?void 0:t.target)||void 0===s||s.removeListener("markRunning",e.markRunning)},k5=t=>{if(!t)return;S5(t).forEach((e=>{A5(e,t)}));const e=null==t?void 0:t.rawData;Array.isArray(e)&&e.forEach((e=>{A5(e,t)}))},C5=(t,e)=>{if(!t)return;const i=new Set(S5(t)),s=[],n=t=>{const r=null==t?void 0:t.rawData;Array.isArray(r)&&r.forEach((t=>{i.has(t)&&e(t)&&!s.includes(t)&&(s.push(t),n(t))}))};n(t),(t=>{const e=Array.from(new Set(t.filter(Boolean)));e.length&&(e.forEach(k5),e.forEach((t=>{var e;null===(e=t.destroy)||void 0===e||e.call(t)})))})([t,...s])},M5="__vchart_marker_coordinate__",w5=["coordinate","coordinates","x","y","x1","y1","angle","angle1","radius","radius1"],T5=["position","positions","coordinatesOffset","regionRelative"],B5=["offsetX","offsetY","confine"],E5=t=>Array.isArray(t)?t.map(E5):t&&"object"==typeof t?"function"!=typeof t.formatMethod?t:Object.assign(Object.assign({},t),{formatMethod:"__vchart_marker_format_method__"}):t,P5=t=>{if(Array.isArray(t))return t.map(P5);if(!t||"object"!=typeof t)return t;const e=Object.assign({},t);return Object.keys(e).forEach((t=>{"style"===t||t.endsWith("Style")?e[t]="__vchart_marker_style__":e[t]=P5(e[t])})),e},O5=(t,e)=>{if(!t||"object"!=typeof t)return t;const i=Object.assign({},t);e.normalizeDomainPosition&&w5.forEach((t=>{i[t]=M5})),e.normalizeAutoRange&&"autoRange"in i&&(i.autoRange="__vchart_marker_auto_range__"),T5.forEach((t=>{t in i&&(i[t]=M5)})),"label"in i&&(i.label=E5(i.label)),Object.keys(i).forEach((t=>{i[t]=P5(i[t])}));const s=i.itemContent;if(s&&"object"==typeof s){i.itemContent=Object.assign({},s),B5.forEach((t=>{t in i.itemContent&&(i.itemContent[t]=M5)}));const t=i.itemContent.text;t&&"object"==typeof t&&(i.itemContent.text=Object.assign(Object.assign({},E5(t)),{text:"__vchart_marker_text__"}))}return i};class I5 extends jW{constructor(){super(...arguments),this.layoutType="none",this._markerDataChangeHandler=null,this._markerDataOwned=!1,this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}getMarkerData(){return this._markerData}static _getMarkerCoordinateType(t){return"cartesian"}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType))}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkerAttributeContext(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getAutoRangeExtendDomainKeyPrefix(){return`marker_${this.type}_${this.id}`}_getAutoRangeExtendDomainKey(t){return`${this._getAutoRangeExtendDomainKeyPrefix()}_${t}_extend`}_clearAutoRangeExtendDomain(){var t,e;Y(null===(e=(t=this._option).getAllSeries)||void 0===e?void 0:e.call(t)).forEach((t=>{var e,i,s,n,r,a,o,l,h,c;null===(s=null===(i=null===(e=null==t?void 0:t.getXAxisHelper)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.setExtendDomain)||void 0===s||s.call(i,this._getAutoRangeExtendDomainKey("xAxis"),void 0),null===(a=null===(r=null===(n=null==t?void 0:t.getYAxisHelper)||void 0===n?void 0:n.call(t))||void 0===r?void 0:r.setExtendDomain)||void 0===a||a.call(r,this._getAutoRangeExtendDomainKey("yAxis"),void 0),null===(l=null===(o=null==t?void 0:t.angleAxisHelper)||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,this._getAutoRangeExtendDomainKey("angleAxis"),void 0),null===(c=null===(h=null==t?void 0:t.radiusAxisHelper)||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,this._getAutoRangeExtendDomainKey("radiusAxis"),void 0)}))}_updateMarkerLayout(){this._clearAutoRangeExtendDomain(),this._markerLayout()}_getFieldInfoFromSpec(t,e,i){return y(e)&&J3(e)?{field:i.getSpec()[{x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"}[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Y(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const e=new io;return e.registerParser("array",s),new so(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}_setMarkerData(t,e=!1){this._releaseMarkerData(),this._markerData=t,this._markerDataOwned=e}_bindMarkerDataChange(){var t;(null===(t=this._markerData)||void 0===t?void 0:t.target)&&(this._markerDataChangeHandler=()=>{this._updateMarkerLayout()},this._markerData.target.on("change",this._markerDataChangeHandler))}_releaseMarkerData(){const t=this._markerData;(null==t?void 0:t.target)&&this._markerDataChangeHandler&&t.target.removeListener("change",this._markerDataChangeHandler),this._markerDataChangeHandler=null,this._markerDataOwned&&C5(t,(t=>t.name===`${this.type}_${this.id}_data`)),this._markerData=null,this._markerDataOwned=!1}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._updateMarkerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(p(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._updateMarkerLayout.bind(this)))}clear(){super.clear(),this._markerComponent=null,this._firstSeries=null}release(){this._releaseMarkerData(),super.release()}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=sz(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e){u(this._spec.offsetX)||(this._layoutOffsetX=Mz(this._spec.offsetX,e.width,e)),u(this._spec.offsetY)||(this._layoutOffsetY=Mz(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e)}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(e,t)||(i.reRender=!0,i.change=!0,i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake||i.reCompile||!this._isAutoRangeSpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,scaleDomain:!0,layout:!0,render:!0}):i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}_isComponentOnlySpecChange(t,e){const i=!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange);return U(O5(e,{normalizeDomainPosition:i}),O5(t,{normalizeDomainPosition:i}))}_isAutoRangeSpecChange(t,e){return!(!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange))&&U(O5(e,{normalizeDomainPosition:!0,normalizeAutoRange:!0}),O5(t,{normalizeDomainPosition:!0,normalizeAutoRange:!0}))}reInit(t){super.reInit(t),this._releaseMarkerData(),this._bindSeries(),this._initDataView(),this._buildMarkerAttributeContext(),this._markerComponent&&this._updateMarkerLayout()}_initCommonDataView(){const{options:t}=this._computeOptions(),e=this._getRelativeDataView();oH(this._option.dataSet,"markerAggregation",y5),oH(this._option.dataSet,"markerFilter",x5),this._releaseMarkerData();const i=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`});i.parse([e],{type:"dataview"}),i.transform({type:"markerAggregation",options:t}),i.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(i,!0),this._bindMarkerDataChange()}}function R5(t,e){return function(t,e,i){const{predict:s}=Ft(t,(t=>t[e]),(t=>t[i])),n=KF(t,e),r=$F(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}class D5 extends I5{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=oN.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=g5(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,c,d,u;const{startSymbol:p={},endSymbol:g={}}=this._spec,f=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),m={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:c5($j(null===(n=this._spec.line)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:f.map((t=>l5(t,this._markerData,this._markAttributeContext))),state:{line:h5(null!==(o=null===(a=this._spec.line)||void 0===a?void 0:a.state)&&void 0!==o?o:{},this._markerData,this._markAttributeContext),lineStartSymbol:h5(null!==(h=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==h?h:{},this._markerData,this._markAttributeContext),lineEndSymbol:h5(null!==(d=null===(c=this._spec.endSymbol)||void 0===c?void 0:c.state)&&void 0!==d?d:{},this._markerData,this._markAttributeContext),label:f.map((t=>{var e;return h5(null!==(e=t.state)&&void 0!==e?e:{},this._markerData,this._markAttributeContext)})),labelBackground:f.map((t=>{var e,i;return h5(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},this._markerData,this._markAttributeContext)}))},animation:null!==(u=this._spec.animation)&&void 0!==u&&u,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return p.visible?m.startSymbol=Object.assign(Object.assign({},p),{visible:!0,style:c5($j(p.style),this._markerData,this._markAttributeContext)}):m.startSymbol={visible:!1},g.visible?m.endSymbol=Object.assign(Object.assign({},g),{visible:!0,style:c5($j(g.style),this._markerData,this._markAttributeContext)}):m.endSymbol={visible:!1},this._newMarkLineComponent(m)}_getUpdateMarkerAttrs(){var t,e;const i=this._spec,s=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=this._computePointsAttr(),l=a.getViewData().latestData,h=s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData;let c;if(i.clip||Y(i.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:s}=o5([n.getRegion(),r.getRegion(),a.getRegion()]);c={x:t,y:i,width:e-t,height:s-i}}const d=Y((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),u=Y(this._spec.label),p=d.map(((t,e)=>{const i=u[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,l):null==t?void 0:t.text})}));return Object.assign(Object.assign({},o),{label:p,limitRect:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d}=g5(t);if(this._setMarkerData(this._getRelativeDataView()),!(i||s||n||r||a||o||l||h||c||d||e))return;oH(this._option.dataSet,"markerAggregation",y5),oH(this._option.dataSet,"markerRegression",R5),oH(this._option.dataSet,"markerFilter",x5);const{options:u,needAggr:p,needRegr:g,processData:f}=this._computeOptions(),m=new so(this._option.dataSet);m.parse([f],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:u}),g&&m.transform({type:"markerRegression",options:u}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(m,!0),this._bindMarkerDataChange()}}D5.specKey="markLine";const L5=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),F5={style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}},refY:5},z5={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:L5(!1),endSymbol:L5(!0),label:F5};class j5 extends D5{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new VL(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=p(e.coordinates),o=p(e.process),l=o&&p(e.process.x),h=o&&p(e.process.y),c=p(e.positions),d=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:g,doXYY1Process:f,doYXX1Process:m,doXYProcess:v,doCoordinatesProcess:y}=g5(e);let _=[];if(u||f||g||m||v||a&&l||a&&h){const t=Q3(i,s,n,r,d,!1,this._getAutoRangeExtendDomainKeyPrefix());_=1===t.length?t[0]:t.map((t=>t[0]))}else y?_=s5(i,r,d,e.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):c&&(_=a5(e.positions,r,e.regionRelative));return{points:_}}_markerLayout(){var t,e,i,s,n;const r=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const n=this._startRelativeSeries,a=this._endRelativeSeries,{multiSegment:o,mainSegmentIndex:l}=this._spec.line||{},{connectDirection:h,expandDistance:c=0}=this._spec;let d;if(Cz(c)){const t=n.getRegion(),e=t.getLayoutStartPoint(),i=a.getRegion(),s=i.getLayoutStartPoint();if("bottom"===h||"top"===h){const n=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));d=Number(c.substring(0,c.length-1))*n/100}else{const n=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));d=Number(c.substring(0,c.length-1))*n/100}}else d=c;const{points:u,limitRect:g}=r;if(!u||u.length<2)return void(null===(t=this._markerComponent)||void 0===t||t.setAttributes(r));const f=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(u[0],u[1],h,d);let m;m=o&&p(l)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(u[0],u[1],h,d));const v=Y((null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{}).label),y=Y(r.label),_=Y(this._spec.label);null===(s=this._markerComponent)||void 0===s||s.setAttributes({points:o?[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]]]:f,label:y.map(((t,e)=>{var i,s,n,r;let a=0,o=0,l=null!==(i=m.dx)&&void 0!==i?i:0,h=null!==(s=m.dy)&&void 0!==s?s:0;const c=null!==(n=_[e])&&void 0!==n?n:_[0];return k(null==c?void 0:c.refX)&&(a+=c.refX),k(null==c?void 0:c.refY)&&(o+=c.refY),k(null==c?void 0:c.dx)&&(l+=c.dx),k(null==c?void 0:c.dy)&&(h+=c.dy),Object.assign(Object.assign(Object.assign({},t),m),{refX:a,refY:o,dx:l,dy:h,textStyle:Object.assign(Object.assign({},null===(r=v[e])||void 0===r?void 0:r.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:g,multiSegment:o,mainSegmentIndex:l,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(n=this._markerComponent)||void 0===n||n.setAttributes(r)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:c,doCoordinatesProcess:d}=g5(n);if(c)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(d){if(t=this._processSpecCoo(n),i=!1,e=new so(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&p(n.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&p(n.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&p(n.process.xy)){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}j5.type=r.markLine,j5.coordinateType="cartesian",j5.builtInTheme={markLine:z5};const H5=()=>{Fz.registerComponent(j5.type,j5),NL()};class N5 extends D5{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=g5(this._spec);return e||i?new GL(t):new VL(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d,doCoordinatesProcess:u}=g5(e);let p=[],g={};const f={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||c||d){const t=e5(i,s,n,r,a,this._getAutoRangeExtendDomainKeyPrefix());p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:f}:{points:p.map((t=>ce(f,t.radius,t.angle)))}}else u&&(p=n5(i,r,a,this._getAutoRangeExtendDomainKeyPrefix()),g={points:p.map((t=>ce(f,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=g5(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}N5.type=r.polarMarkLine,N5.coordinateType="polar",N5.builtInTheme={polarMarkLine:z5};const V5=()=>{Fz.registerComponent(N5.type,N5),GL._animate=SL,NL()};let U5=class extends jW{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=oN.Title,this.layoutLevel=lN.Title,this._orient="top",this._orient=kz(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return RV(t,this.specKey,r.title,(t=>!1!==t.visible))}_compareSpec(t,e){const i=super._compareSpec(t,e),s=!U(e,t);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,s&&!i.reMake&&(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}afterSetLayoutStartPoint(t){k(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),k(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:k(t.width())?t.width():0,height:this._spec.height?this._spec.height:k(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r;if(!1===this._spec.visible)return{visible:!1};const a=this.getLayoutRect(),o=Mz(this._spec.width,a.width,null,a.width),l=Mz(this._spec.maxWidth,a.width,null,a.width),h=Math.max(Math.min(o,l,a.width),0),c=p(this._spec.text)&&""!==this._spec.text,d=p(this._spec.subtext)&&""!==this._spec.subtext,u=Object.assign(Object.assign({},H(this._spec,["padding"])),{textType:null!==(t=this._spec.textType)&&void 0!==t?t:"text",text:c?this._spec.text:void 0,subtextType:null!==(e=this._spec.subtextType)&&void 0!==e?e:"text",subtext:d?this._spec.subtext:void 0,x:null!==(i=this._spec.x)&&void 0!==i?i:0,y:null!==(s=this._spec.y)&&void 0!==s?s:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:h,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(n=this._spec.align)&&void 0!==n?n:"left",verticalAlign:null!==(r=this._spec.verticalAlign)&&void 0!==r?r:"top",textStyle:Object.assign({maxLineWidth:h},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:h},this._spec.subtextStyle)});if(c&&(u.textStyle.width=h),d&&(u.subtextStyle.width=h),p(this._spec.width)){const t=Math.max(Math.min(o,a.width),0);c?u.textStyle.width=t:delete u.textStyle.width,d&&(u.subtextStyle.width=t)}return u}_createOrUpdateTitleComponent(t){if(this._titleComponent)U(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new vF(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",((t,e)=>this._delegateEvent(i,t,e)))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}};U5.type=r.title,U5.specKey=r.title,U5.builtInTheme={title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}}};const W5=()=>{Fz.registerComponent(U5.type,U5)};class G5 extends I5{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=oN.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=f5(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o;const l=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),h={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:c5($j(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:l.map((t=>l5(t,this._markerData,this._markAttributeContext))),state:{area:h5(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData,this._markAttributeContext),label:l.map((t=>h5(t.state,this._markerData,this._markAttributeContext))),labelBackground:l.map((t=>{var e;return h5(null===(e=t.labelBackground)||void 0===e?void 0:e.state,this._markerData,this._markAttributeContext)}))},animation:null!==(o=this._spec.animation)&&void 0!==o&&o,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}_markerLayout(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=this._computePointsAttr(),o=this._getRelativeDataView().latestData,l=i?i.latestData[0]&&i.latestData[0].latestData?i.latestData[0].latestData:i.latestData:o;let h;if(e.clip||Y(e.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:a}=o5([s.getRegion(),n.getRegion(),r.getRegion()]);h={x:t,y:i,width:e-t,height:a-i}}if(this._markerComponent){const e=Y(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),i=Y(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},a),{label:e.map(((t,e)=>{const s=i[e]||{};return Object.assign(Object.assign({},t),{text:s.formatMethod?s.formatMethod(l,o):null==t?void 0:t.text})})),limitRect:h,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=f5(t);if(!(e||i||s||n||r||a||o))return null;this._initCommonDataView()}}G5.specKey="markArea";const Y5={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}};class K5 extends G5{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new WL(t)}_computePointsAttr(){var t,e;const i=this._spec,s=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,{doXProcess:o,doYProcess:l,doXYProcess:h,doCoordinatesProcess:c}=f5(i),d=p(i.positions),u=null!==(t=i.autoRange)&&void 0!==t&&t,g=null!==(e=i.includeFullBand)&&void 0!==e&&e;let f=[],m=[];if(h){m=Q3(s,n,r,a,u,g,this._getAutoRangeExtendDomainKeyPrefix());const[t,e]=m;t&&t.length&&e&&e.length&&(f=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(o||l){m=Q3(s,n,r,a,u,g,this._getAutoRangeExtendDomainKeyPrefix());const[t,e]=m;t&&t.length&&e&&e.length&&(f=[...t,e[1],e[0]])}else c?f=s5(s,a,u,i.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):d&&(f=a5(i.positions,a,i.regionRelative));return{points:f}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=f5(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}K5.type=r.markArea,K5.coordinateType="cartesian",K5.builtInTheme={markArea:Y5};const $5=()=>{Fz.registerComponent(K5.type,K5),UL()};class X5 extends G5{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=f5(this._spec);return i||e||s?new YL(t):new WL(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=f5(e),c=null!==(t=e.autoRange)&&void 0!==t&&t;let d,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=e5(i,s,n,r,c,this._getAutoRangeExtendDomainKeyPrefix());l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(d=n5(i,r,c,this._getAutoRangeExtendDomainKeyPrefix()),u={points:d.map((t=>ce(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=f5(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}X5.type=r.polarMarkArea,X5.coordinateType="polar",X5.builtInTheme={polarMarkArea:Y5};const q5=()=>{Fz.registerComponent(X5.type,X5),YL._animate=kL,UL()},Z5=t=>$j(Object.assign({},t)),J5=t=>Object.assign(Object.assign({},t),{style:Object.assign({},$j(t.style))}),Q5=t=>{var e,i,s,n,r,a,o,l,h,c,d,u,p,g,f;const m=Z5(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),v=Z5(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),y=(k=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},$j(Object.assign({},k))),_=J5(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),b=J5(null!==(c=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==c?c:{}),x=J5(null!==(u=null===(d=null==t?void 0:t.controller)||void 0===d?void 0:d.backward)&&void 0!==u?u:{}),S=J5(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(f=t.orient)&&void 0!==f?f:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:m,railStyle:v,handlerStyle:y}),controller:Object.assign(Object.assign({},t.controller),{start:_,pause:b,backward:x,forward:S})});var k;return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},t4=t=>"left"===t||"right"===t,e4=t=>"top"===t||"bottom"===t;let i4=class extends jW{constructor(){super(...arguments),this.layoutZIndex=oN.Player,this.layoutLevel=lN.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},Q5(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},Q5(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?U(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new IF(t):this._playerComponent=new LF(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Y(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Y(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Y(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Y(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=t4(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=t4(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,c=Math.max(...Y(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Y(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Y(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Y(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=c?h-c:0},this.autoPlayCallback=()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&(this._playerComponent.pause(),this._playerComponent.play())},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.off(tH.rendered,this.autoPlayCallback),this._option.globalInstance.on(tH.rendered,this.autoPlayCallback),this._playerComponent.addEventListener(wF.end,(()=>{var t;this.event.emit(tH.playerEnd,{model:this}),this._alternate&&"discrete"===this._spec.type&&(this._direction="default"===this._direction?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:"reverse"===this._direction?this._specs.length-2:1})),(null===(t=this._spec)||void 0===t?void 0:t.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(wF.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(wF.backward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(wF.forward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(wF.play,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(wF.pause,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(tH.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}_compareSpec(t,e){const i=super._compareSpec(t,e),s=!U(e,t);return(null==e?void 0:e.type)!==(null==t?void 0:t.type)?(i.reMake=!0,i):(!s||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i)}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),k(t.x)){const e=t4(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(k(t.y)){const e=e4(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return S(this._spec.width)?Math.min(t.width,Number(this._spec.width)):t4(this._orient)?this._maxSize():t.width}_computeHeight(t){return S(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):e4(this._orient)?this._maxSize():t.height}_computeDx(t){return t4(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return e4(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){const e=this._specs[t];this._option.globalInstance.updateFullData(e.data),this.event.emit(tH.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}release(){this._option.globalInstance.off(tH.rendered,this.autoPlayCallback)}};i4.builtInTheme={player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}}},i4.specKey="player",i4.type=r.player;const s4=()=>{Fz.registerComponent(i4.type,i4)};class n4 extends jW{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=oN.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,U(e,t)||(i.change=!0,i.reMake||i.reCompile?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}_getDataLabelType(t,e){const i=t.type;return"line"===i||"area"===i?null!=e?e:"line-data":"rect"===i?"rect":"arc"===i?"arc":"symbol"===i||"cell"===i?"symbol":t.setDataLabelType?t.setDataLabelType():""}_setTransformOfComponent(t,e){t.setAttributeTransform((({labelStyle:t,size:i,itemEncoder:s})=>{const n=i(),r=gz({type:"palette",key:"secondaryFontColor"},this.getColorScheme());return{dataLabels:Y(e).map(((e,i)=>{const a=t(i),o=[],l=e.getGraphics();if(l)return a.data&&a.data.length?a.data.forEach(((t,e)=>{if(l[e]){const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}})):l.forEach((t=>{const{data:e,diffState:n}=t.context;n!==TN.exit&&e.forEach(((t,{})=>{const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}))})),m(a.overlap)&&u(a.overlap.size)&&(a.overlap.size=Object.assign({},n)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:e.getProductId(),getBaseMarks:()=>l},a),{type:this._getDataLabelType(e,a.type),data:o})})),size:n}}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getComponent();i&&t.push(i)})),t}clear(){super.clear(),this.getMarks().forEach((t=>{t&&t.clearComponent()}))}}n4.type=r.label;class r4 extends F${constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}render(){}}r4.type="text",r4.constructorType="label";const a4=()=>{z$(),Fz.registerMark(r4.constructorType,r4)};class o4 extends DW{_initTheme(t,e){return{spec:t,theme:this._theme}}}class l4 extends n4{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=o4,this.layoutZIndex=oN.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((null==e?void 0:e.region)||[]).forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&(this._labelInfoMap.forEach((t=>{t.forEach((({labelMark:t})=>{t.release()}))})),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}initEvent(){this.event.on(tH.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.disableAnimation()})),this.event.on(Jj.AFTER_MARK_RENDER_END,t)}));const t=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.enableAnimation()})),this.event.off(Jj.AFTER_MARK_RENDER_END,t)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),ez(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n<i.length;n++){const r=i[n],a=t.getMarkInName(r);a&&e[r].forEach(((e,i)=>{var n,o,l;if(e.visible){const h=this._labelInfoMap.get(s),c=this._createMark({type:"label",name:`${null!==(n=t.userId)&&void 0!==n?n:t.id}-${r}-label-${i}`},{attributeContext:t.getMarkAttributeContext()});e.showRelatedMarkTooltip&&(null===(l=null===(o=t.tooltipHelper)||void 0===o?void 0:o.activeTriggerSet.mark)||void 0===l||l.add(c)),c.setTarget(a),h.push({labelMark:c,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){const t={};this._labelComponentMap.forEach(((e,i)=>{t[i.name]=i})),this._labelInfoMap.forEach(((e,i)=>{if("region"===this._layoutRule){let s=!1;const n=`${i.getGroupMark().name}-label-component`;let r=t[n];r||(s=!0,r=this._createMark({type:"component",name:n},{componentType:"label"},{support3d:this._spec.support3d})),r&&(s&&(r.setSkipBeforeLayouted(!0),this._marks.addMark(r),e.forEach((t=>{var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(r)}))),e[0]&&p(e[0].labelSpec.zIndex)&&r.setMarkConfig({zIndex:e[0].labelSpec.zIndex}),this._labelComponentMap.set(r,(()=>this._labelInfoMap.get(i))),t[n]=null)}else e.forEach(((e,s)=>{var n;let r=!1;const a=`${e.labelMark.name}-component`;let o=t[a];o||(r=!0,o=this._createMark({type:"component",name:a},{componentType:"label",noSeparateStyle:!0},{support3d:e.baseMark.getMarkConfig().support3d})),o&&(p(e.labelSpec.zIndex)&&o.setMarkConfig({zIndex:e.labelSpec.zIndex}),r&&(o.setSkipBeforeLayouted(!0),this._marks.addMark(o),null===(n=e.baseMark.getData())||void 0===n||n.addRelatedMark(o)),this._labelComponentMap.set(o,(()=>this._labelInfoMap.get(i)[s])),t[a]=null)}))})),Object.keys(t).forEach((e=>{const i=t[e];i&&(i.releaseWithExitAnimation()||i.release(),this._labelComponentMap.delete(i))}))}_initTextMarkStyle(){this._labelComponentMap.forEach(((t,e)=>{Y(t()).forEach((({labelMark:t})=>{t.setComponent(e)}))})),this._labelInfoMap.forEach((t=>{t.forEach((t=>{var e,i;const{labelMark:s,labelSpec:n,series:r}=t;if(this.initMarkStyleWithSpec(s,n),d(null==n?void 0:n.getStyleHandler)){const t=n.getStyleHandler(r);null==t||t.call(r,s,n)}(null===(i=null===(e=s.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&s.setAttribute("stroke",r.getColorAttribute(),"normal",hN.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();_(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e,t.map((({baseMark:t})=>t)),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e,i,[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:t=>{var e,n;const r=i[t],{labelSpec:a,labelMark:o,series:l}=r,h=o.getRule(),c=this._interactiveConfig(a),d=null!==(n=null===(e=this._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==n?n:0;let u=Lz({textStyle:Object.assign({pickable:!0===a.interactive},a.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},e$(h,r),Object.assign(Object.assign(Object.assign({},H(a,["position","style","state","type","stackDataFilterType","getStyleHandler"])),c),{centerOffset:d}),a.stackDataFilterType?{dataFilter:"min"===a.stackDataFilterType?t=>t.filter((t=>t.data[Sj])):t=>t.filter((t=>t.data[xj]))}:{});return l&&l.parseLabelStyle&&(u=l.parseLabelStyle(u,a,o)),"line"!==h&&"area"!==h||(u.type=h),u},size:()=>{var t;return Object.assign({padding:null===(t=i[0].labelSpec.overlap)||void 0===t?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:(t,{labelIndex:e})=>i[e]&&!i[e].labelMark.skipEncode?i$(i[e],t,i[e].labelSpec.formatMethod,i[e].labelSpec.formatter):{data:t}}),this._setTransformOfComponent(t,e)}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=_(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i})}))}getLabelInfoByTextGraphic(t){let e;const i=null==t?void 0:t.parent,s=null==i?void 0:i.parent;if(s){const t=s.getChildren().indexOf(i);this._labelComponentMap.forEach(((i,n)=>{n.getComponent()===s&&(e=Y(i())[t])}))}return e}}l4.type=r.label,l4.specKey="label",l4.transformerConstructor=o4;const h4=()=>{Fz.registerGraphicComponent(l4.type,(t=>new PD(t))),a4(),NW(),Fz.registerComponent(l4.type,l4,!0,1/0)};class c4 extends n4{constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=oN.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var t;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[_j]},"normal",hN.Default);const e=this._getSeries();null===(t=e.initTotalLabelMarkStyle)||void 0===t||t.call(e,this._textMark)}_initLabelComponent(){var t;const e=this._getSeries(),i=this._createMark({type:"component",name:`${null!==(t=e.name)&&void 0!==t?t:e.type}-total-label-component`},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.setMarkConfig({interactive:!1}),e.setSimpleStyle({labelStyle:()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r,position:a="top"}=this._spec,o=this._interactiveConfig(this._spec);return Lz({textStyle:{pickable:!0===this._spec.interactive},position:d4(t,this._baseMark.type,a),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>"bottom"===a?t.data[Sj]:t.data[xj]))},o))}},size:()=>{var t;return Object.assign({padding:null===(t=this._spec.overlap)||void 0===t?void 0:t.padding},this._regions[0].getLayoutRect())},itemEncoder:e=>i$({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod)}),this._setTransformOfComponent(e,this._baseMark)}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function d4(t,e,i="top"){var s,n;let r;const{direction:a}=t;let o;o="bottom"===i?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};const l=("horizontal"===a?null===(s=t.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=o[a][l];break;default:r="top"}return r}c4.type=r.totalLabel,c4.builtInTheme={totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}}},c4.specKey="totalLabel";const u4=()=>{Fz.registerGraphicComponent(c4.type,(t=>new PD(t))),a4(),NW(),Fz.registerComponent(c4.type,c4,!0)};var p4=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};class g4 extends I5{constructor(){super(...arguments),this.specKey="markPoint",this.layoutZIndex=oN.MarkPoint}static _getMarkerCoordinateType(t){const{doPolarProcess:e,doGeoProcess:i}=m5(t);return"polar"===t.coordinateType||e?"polar":"geo"===t.coordinateType||i?"geo":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b,x,S,A,k,C,M,w,T,B,E,P,O,I;const{itemContent:R={},itemLine:D={},targetSymbol:L={}}=this._spec,F=this._relativeSeries.getRegion(),z=R,{type:H="text",text:N,symbol:V,image:U,richText:W,customMark:G,textStyle:Y,symbolStyle:K,imageStyle:$,richTextStyle:X,customMarkStyle:q,style:Z={},state:J={}}=z,Q=p4(z,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]);let tt=null,et=null,it={};"text"===H?(tt=null!==(t=null==N?void 0:N.state)&&void 0!==t?t:J,it={dx:0,dy:0},et=l5(Object.assign(Object.assign({},N),{style:j(it,null!==(s=null!==(i=null!==(e=null==N?void 0:N.style)&&void 0!==e?e:null==N?void 0:N.textStyle)&&void 0!==i?i:Y)&&void 0!==s?s:Z)}),this._markerData,this._markAttributeContext)):"richText"===H?(tt=null!==(n=null==W?void 0:W.state)&&void 0!==n?n:J,it={width:100,height:100},et=c5(j(it,null!==(a=null!==(r=null==W?void 0:W.style)&&void 0!==r?r:X)&&void 0!==a?a:Z),this._markerData,this._markAttributeContext)):"symbol"===H?(tt=null!==(o=null==V?void 0:V.state)&&void 0!==o?o:J,it={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},et=$j(c5(j(it,null!==(h=null!==(l=null==V?void 0:V.style)&&void 0!==l?l:K)&&void 0!==h?h:Z),this._markerData,this._markAttributeContext))):"image"===H?(tt=null!==(c=null==U?void 0:U.state)&&void 0!==c?c:J,it={width:80,height:80},et=c5(j(it,null!==(u=null!==(d=null==U?void 0:U.style)&&void 0!==d?d:$)&&void 0!==u?u:Z),this._markerData,this._markAttributeContext)):"custom"===H&&(tt=null!==(p=null==G?void 0:G.state)&&void 0!==p?p:J,et=c5(null!==(f=null!==(g=null==G?void 0:G.style)&&void 0!==g?g:q)&&void 0!==f?f:Z,this._markerData,this._markAttributeContext));const st={zIndex:this.layoutZIndex,interactive:null===(m=this._spec.interactive)||void 0===m||m,hover:null===(v=this._spec.interactive)||void 0===v||v,select:null===(y=this._spec.interactive)||void 0===y||y,position:{x:0,y:0},clipInRange:null!==(_=this._spec.clip)&&void 0!==_&&_,itemContent:Object.assign(Object.assign({type:H,offsetX:d5(R.offsetX,F),offsetY:d5(R.offsetY,F)},Q),{style:c5(et,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(b=L.offset)&&void 0!==b?b:0,visible:null!==(x=L.visible)&&void 0!==x&&x,size:null!==(S=L.size)&&void 0!==S?S:20,style:c5(L.style,this._markerData,this._markAttributeContext)},state:{line:h5(null!==(k=null===(A=this._spec.itemLine.line)||void 0===A?void 0:A.state)&&void 0!==k?k:{},this._markerData,this._markAttributeContext),lineStartSymbol:h5(null!==(M=null===(C=this._spec.itemLine.startSymbol)||void 0===C?void 0:C.state)&&void 0!==M?M:{},this._markerData,this._markAttributeContext),lineEndSymbol:h5(null!==(T=null===(w=this._spec.itemLine.endSymbol)||void 0===w?void 0:w.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),itemContent:h5(tt,this._markerData,this._markAttributeContext),textBackground:h5(null===(E=null===(B=this._spec.itemContent.text)||void 0===B?void 0:B.labelBackground)||void 0===E?void 0:E.state,this._markerData,this._markAttributeContext),targetItem:h5(null!==(O=null===(P=this._spec.targetSymbol)||void 0===P?void 0:P.state)&&void 0!==O?O:{},this._markerData,this._markAttributeContext)},animation:null!==(I=this._spec.animation)&&void 0!==I&&I,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},{visible:nt,line:rt={}}=D,at=p4(D,["visible","line"]);return st.itemLine=!1!==nt?Object.assign(Object.assign({},at),{visible:!0,lineStyle:$j(rt.style)}):{visible:!1},new $L(st)}_markerLayout(){var t,e,i,s,n,r,a,o,l,h,c,d,u;const g=this._spec,f=this._markerData,m=this._relativeSeries,{point:v}=this._computePointsAttr(),y=this._getRelativeDataView().latestData,_=f?f.latestData[0]&&f.latestData[0].latestData?f.latestData[0].latestData:f.latestData:y,{itemLine:b={},itemContent:x={}}=this._spec,S=this._relativeSeries.getRegion(),{visible:A,line:k={}}=b,C=p4(b,["visible","line"]),M=!1!==A?Object.assign(Object.assign({},C),{visible:!0,lineStyle:$j(k.style)}):{visible:!1},w=l5(Object.assign(Object.assign({},x.text),{style:j({dx:0,dy:0},null!==(e=null===(t=x.text)||void 0===t?void 0:t.style)&&void 0!==e?e:x.style)}),f,this._markAttributeContext);let T;if(g.clip||(null===(i=g.itemContent)||void 0===i?void 0:i.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=o5([m.getRegion()]);T={x:t,y:i,width:e-t,height:s-i}}if(this._markerComponent){const t=null!==(s=this._markerComponent.attribute)&&void 0!==s?s:{},e=null!==(r=null===(n=t.itemContent)||void 0===n?void 0:n.textStyle)&&void 0!==r?r:{},i=null===(a=this._spec.itemContent.text)||void 0===a?void 0:a.text,g=d5(x.offsetX,S),f=d5(x.offsetY,S);this._markerComponent.setAttributes({position:void 0===v?{x:null,y:null}:v,itemContent:Object.assign(Object.assign({},t.itemContent),{panel:null!==(o=w.panel)&&void 0!==o?o:null===(l=t.itemContent)||void 0===l?void 0:l.panel,padding:null!==(h=w.padding)&&void 0!==h?h:null===(c=t.itemContent)||void 0===c?void 0:c.padding,textStyle:Object.assign(Object.assign(Object.assign({},e),null!==(d=w.textStyle)&&void 0!==d?d:{}),{text:(null===(u=this._spec.itemContent.text)||void 0===u?void 0:u.formatMethod)?this._spec.itemContent.text.formatMethod(_,y):p(i)?i:e.text}),offsetX:u5(v,g,S),offsetY:u5(v,f,S)}),itemLine:M,limitRect:T,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}_initDataView(){const t=this._spec,{doXYProcess:e,doPolarProcess:i,doGeoProcess:s}=m5(t);(p(t.coordinate)||e||i||s)&&this._initCommonDataView()}}g4.specKey="markPoint";const f4={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}};class m4 extends g4{constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t,e,i;const s=this._spec,n=this._markerData,r=this._relativeSeries,a=p(s.x)&&p(s.y),o=p(s.coordinate),l=p(s.position),h=null!==(t=null==s?void 0:s.autoRange)&&void 0!==t&&t;let c;return a?c=null===(i=null===(e=Q3(n,r,r,r,h,!1,this._getAutoRangeExtendDomainKeyPrefix()))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:o?c=s5(n,r,h,s.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix())[0]:l&&(c=a5(s.position,r,s.regionRelative)[0]),{point:c}}_computeOptions(){const t=this._spec,{doXYProcess:e}=m5(t),i=p(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}m4.type=r.markPoint,m4.coordinateType="cartesian",m4.builtInTheme={markPoint:f4};const v4=()=>{Fz.registerComponent(m4.type,m4),KL()};class y4 extends g4{constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=e5(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e,this._getAutoRangeExtendDomainKeyPrefix())[0][0];return{point:ce({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}y4.type=r.polarMarkPoint,y4.coordinateType="polar",y4.builtInTheme={polarMarkPoint:f4};const _4=()=>{Fz.registerComponent(y4.type,y4),KL()};class b4 extends g4{constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){return{point:i5(this._markerData,this._relativeSeries)[0][0]}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}b4.type=r.geoMarkPoint,b4.coordinateType="geo",b4.builtInTheme={geoMarkPoint:f4};const x4=()=>{Fz.registerComponent(b4.type,b4),KL()},S4={style:!0,inBrush:!0,outOfBrush:!0};let A4=class extends jW{constructor(){super(...arguments),this.layoutType="none",this.type=r.brush,this.name=r.brush,this.specKey="brush",this.layoutZIndex=oN.Brush,this._linkedSeries=[],this._itemMap={},this._linkedItemMap={},this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._cacheInteractiveRangeAttrs=[],this._releatedAxes=[],this._regionAxisMap={},this._axisDataZoomMap={},this._zoomRecord=[]}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>!1!==t.visible))}init(){const t=this._transformBrushedMarkAttr(this._spec.inBrush),e=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((i=>{i.getActiveMarks().forEach((s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",hN.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",hN.Series))}))}))}reInit(t){super.reInit(t),this.init()}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Y(t).includes(n.userId.toString())||e&&Y(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_bindRegions(){p(this._spec.regionId)||p(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}_bindLinkedSeries(){(p(this._spec.brushLinkSeriesId)||p(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(Y(this._spec.brushLinkSeriesId),Y(this._spec.brushLinkSeriesIndex)))}_initRegionAxisMap(){p(this._spec.axisId)?Y(this._spec.axisId).forEach((t=>{this._releatedAxes.push(this._option.getComponentByUserId(t))})):p(this._spec.axisIndex)?Y(this._spec.axisIndex).forEach((t=>{this._releatedAxes.push(this._option.getComponentByIndex("axes",t))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((t=>{null==t||t.getRegions().forEach((e=>{this._regionAxisMap["region_"+e.id]?this._regionAxisMap["region_"+e.id].push(t):this._regionAxisMap["region_"+e.id]=[t]}))}))}_initAxisDataZoomMap(){this._option.getComponentsByKey("dataZoom").forEach((t=>{t.relatedAxisComponent&&(this._axisDataZoomMap[t.relatedAxisComponent.id]=t)}))}initEvent(){}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)}));const i=super._compareSpec(t,e);return U(e,t)||(i.change=!0,i.reRender=!0,i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}_isComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((i=>U(null==e?void 0:e[i],null==t?void 0:t[i])||S4[i]))}onLayoutEnd(){var t;super.onLayoutEnd(),this._option.disableTriggerEvent||(null===(t=this._spec.visible)||void 0===t||t)&&(this._brushComponents?this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)})):(this._brushComponents=[],this._relativeRegions.forEach(((t,e)=>{this._createBrushComponent(t,e)}))))}_updateBrushComponent(t,e){var i;const s=this._getBrushInteractiveAttr(t),n=this._brushComponents[e];n.setAttributes(Object.assign({brushStyle:$j(null===(i=this._spec)||void 0===i?void 0:i.style)},s)),this._initMarkBrushState(e,""),n.children[0].removeAllChild()}_shouldEnableInteractive(){return!1!==this.getOption().getCompiler().getOption().interactive}_createBrushComponent(t,e){var i,s;const n=this._getBrushInteractiveAttr(t),r=new HF(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:$j(null===(i=this._spec)||void 0===i?void 0:i.style)},n),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));r.id=null!==(s=this._spec.id)&&void 0!==s?s:`brush-${this.id}`,this.getContainer().add(r),this._brushComponents.push(r),this._cacheInteractiveRangeAttrs.push(n),r.addEventListener(RF.brushActive,(i=>{this._initMarkBrushState(e,"outOfBrush"),this._emitEvent(tH.brushActive,t,i)})),r.addEventListener(RF.drawStart,(e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!0),this._setRegionMarkPickable(t,!0),this._emitEvent(tH.brushStart,t,e)})),r.addEventListener(RF.moveStart,(e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!0),this._setRegionMarkPickable(t,!0),this._emitEvent(tH.brushStart,t,e)})),r.addEventListener(RF.drawing,(e=>{this._setRegionMarkPickable(t,!1),this._handleBrushChange(t,e),this._emitEvent(tH.brushChange,t,e)})),r.addEventListener(RF.moving,(e=>{this._setRegionMarkPickable(t,!1),this._handleBrushChange(t,e),this._emitEvent(tH.brushChange,t,e)})),r.addEventListener(RF.brushClear,(i=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0),this._initMarkBrushState(e,""),this._emitEvent(tH.brushClear,t,i)})),r.addEventListener(RF.drawEnd,(i=>{var s;this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0);const{operateMask:n}=i.detail,{updateElementsState:r=!0}=this._spec;if(null===(s=this._spec)||void 0===s?void 0:s.onBrushEnd)!0===this._spec.onBrushEnd(i)?(this.clearGraphic(),this._initMarkBrushState(e,""),this._emitEvent(tH.brushClear,t,i)):(this._spec.onBrushEnd(i),this._emitEvent(tH.brushEnd,t,i));else{const e=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&e.length>0||!r)&&this._setAxisAndDataZoom(n,t),this._emitEvent(tH.brushEnd,t,i)}})),r.addEventListener(RF.moveEnd,(e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0);const{operateMask:i}=e.detail,{updateElementsState:s=!0}=this._spec,n=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&n.length>0||s)&&this._setAxisAndDataZoom(i,t),this._emitEvent(tH.brushEnd,t,e)}))}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a],interactive:this._shouldEnableInteractive()}}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},$j(t)),e)}_handleBrushChange(t,e){const{operateMask:i}=e.detail;this._operateMask=i;const{updateElementsState:s=!0}=this._spec;s&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}_extendDataInBrush(t){var e,i;const s=[];for(const n in t)for(const r in t[n])s.push(Object.assign({},null===(i=null===(e=t[n][r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return s}_extendDatumOutOfBrush(t){var e,i;const s=[];for(const n in t)s.push(null===(i=null===(e=t[n].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return s}_emitEvent(t,e,i){var s;this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap,zoomRecord:this._zoomRecord},vchart:null===(s=this._option)||void 0===s?void 0:s.globalInstance,event:i})}_reconfigItem(t,e){var i,s,n;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const r=null!==(n=null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points)&&void 0!==n?n:[],{a:a,b:o,c:l,d:h,e:c,f:d}=t.globalTransMatrix,u=r.map((t=>({x:a*t.x+l*t.y+c,y:o*t.x+h*t.y+d}))),{markTypeFilter:p=[]}=this._spec;this._itemMap[e.id].forEach((e=>{if(p.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;const a=e.id+"_"+i.context.key,o=this._isBrushContainItem(t.globalAABBBounds,u,i);(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[a])&&o?(UN(i,"inBrush",!0),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][a]=i,delete this._outOfBrushElementsMap[a]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!o&&(WN(i,"inBrush"),UN(i,"outOfBrush",!0),this._outOfBrushElementsMap[a]=i,delete this._inBrushElementsMap[t.name][a])}))}))}_reconfigLinkedItem(t,e){var i;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const s=e.getLayoutStartPoint(),n=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{var i,r;if(!n.includes(e.id)){const n=e.getRegion().getLayoutStartPoint(),a=n.x-s.x,o=n.y-s.y,l=null!==(r=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==r?r:[],{a:h,b:c,c:d,d:u,e:p,f:g}=t.globalTransMatrix,f=a||0,m=o||0,v=l.map((t=>({x:h*t.x+d*t.y+p+f,y:c*t.x+u*t.y+g+m})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+f,t.globalAABBBounds.y1+m,t.globalAABBBounds.x2+f,t.globalAABBBounds.y2+m);const{markTypeFilter:y=[]}=this._spec;this._linkedItemMap[e.id].forEach((e=>{if(y.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;i.context;const a=e.id+"_"+i.context.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[a])&&this._isBrushContainItem(t.globalAABBBounds,v,i)?(UN(i,"inBrush",!0),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][a]=i,delete this._linkedOutOfBrushElementsMap[a]):(null===(r=null===(n=this._linkedInBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!this._isBrushContainItem(t.globalAABBBounds,v,i)&&(WN(i,"inBrush"),UN(i,"outOfBrush",!0),this._linkedOutOfBrushElementsMap[a]=i)}))}))}}))}_isBrushContainItem(t,e,i){let s=[];if(["symbol","rect"].includes(i.type)){const{x1:t,x2:n,y1:r,y2:a}=null==i?void 0:i.globalAABBBounds;return s=[{x:t,y:r},{x:n,y:r},{x:n,y:a},{x:t,y:a}],function(t,e){for(let i=0;i<e.length;i++){if(Fe(t,e[i].x,e[i].y))return!0;if(i>0&&Le(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,s)}return t.intersects(i.globalAABBBounds)}_initItemMap(t,e,i){const{markTypeFilter:s=[]}=this._spec;Object.entries(t).forEach((([t,n])=>{n.forEach((t=>{if(s.includes(t.type))return;const n=t.getGraphics();n&&n.length&&n.forEach((s=>{const n=t.id+"_"+s.context.key;WN(s,["inBrush","outOfBrush"]),i&&UN(s,i,!0),e[n]=s}))}))}))}_initMarkBrushState(t,e){this._brushComponents.forEach(((e,i)=>{i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._initItemMap(this._itemMap,this._outOfBrushElementsMap,e),this._initItemMap(this._linkedItemMap,this._linkedOutOfBrushElementsMap,e)}_setRegionMarkPickable(t,e){t.getGroupMark().getGraphics().forEach((t=>t.setAttribute("childrenPickable",e)))}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:c}=s,d=r?"x":"y",u=r?o:h,p=r?l:c,g=t.getScale().range(),f=null!==(n=t.scaleRangeFactor())&&void 0!==n?n:[0,1],m=K(g)<g[0],v=u-e.getLayoutStartPoint()[d],y=p-e.getLayoutStartPoint()[d],_=m?Math.min(v,y):Math.max(v,y),b=m?Math.max(v,y):Math.min(v,y),x=(b-g[0])/(K(g)-g[0])*(f[1]-f[0])+f[0],S=(_-g[0])/(K(g)-g[0])*(f[1]-f[0])+f[0],A=this._stateClamp(x-a),k=this._stateClamp(S+a);if(this._axisDataZoomMap[t.id]){const e=this._axisDataZoomMap[t.id],i=m?1-A:A,s=m?1-k:k;e.setStartAndEnd(Math.min(i,s),Math.max(i,s),["percent","percent"]),this._zoomRecord.push({operateComponent:e,start:i,end:s,startValue:_3(i,e.stateScale,x3(e.relatedAxisComponent,e.isHorizontal)),endValue:_3(s,e.stateScale,x3(e.relatedAxisComponent,e.isHorizontal))})}else t.scaleRangeFactor([A,k]),t.effect.scaleUpdate(),this._zoomRecord.push({operateComponent:t,start:A,end:k,startValue:t.getScale().invert(b),endValue:t.getScale().invert(_)})}))}}_getNeedClearVRenderComponents(){return this._brushComponents}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach(((e,i)=>{this._initMarkBrushState(i,""),e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}clearBrushStateAndMask(){this._relativeRegions.forEach(((t,e)=>{this._initMarkBrushState(e,""),this._brushComponents[e].children[0].removeAllChild()}))}};A4.type=r.brush,A4.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},A4.specKey="brush";const k4=()=>{Fz.registerComponent(A4.type,A4)},C4={style:!0,state:!0};class M4 extends jW{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=oN.CustomMark,this.layoutLevel=lN.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;let t=null;if(this._spec.parent){const e=this.getChart().getAllMarks().find((t=>t.getUserId()===this._spec.parent));"group"===e.type&&(t=e)}this._createExtensionMark(this._spec,t,`${rj}_series_${this.id}_extensionMark`,0)}_createExtensionMark(t,e,i,s=0){var n,r;const a=this._createMark({type:t.type,name:p(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(p(t.id)&&a.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){const e=cU({},dU(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(u(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e)}))),p(t.dataId)||k(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(a.setDataView(e),e.target.addListener("change",(()=>{a.getData().updateData()})))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(e,t)||(i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i.change=!0,i.reRender=!0,i}_isComponentOnlySpecChange(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((i=>U(null==e?void 0:e[i],null==t?void 0:t[i])||C4[i]))}reInit(t){super.reInit(t),this._updateMarkStyleWithSpec(this._spec,this.getMarks()[0]),this.getMarks().forEach((t=>{t.commit(!1,!0)}))}_updateMarkStyleWithSpec(t,e){var i,s,n,r;if(t&&e&&(this.initMarkStyleWithSpec(e,t),"group"===t.type)){const a=null!==(n=null===(s=(i=e).getMarks)||void 0===s?void 0:s.call(i))&&void 0!==n?n:[];null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._updateMarkStyleWithSpec(t,a[e])}))}}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Ke).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Ke;return this.getMarks().forEach((e=>{const i=e.getProduct();i&&t.union(i.AABBBounds)})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}getVRenderComponents(){const t=[],e=i=>{if(i&&"group"===i.type)i.getMarks().forEach((t=>{e(t)}));else if("component"===i.type){const e=null==i?void 0:i.getComponent();e&&t.push(e)}};return this.getMarks().forEach((t=>{e(t)})),t}}M4.type=r.customMark,M4.specKey="customMark";const w4=()=>{Fz.registerComponent(M4.type,M4)};class T4{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(k(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:d(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&p(e.modelId)){if(p(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&p(e.modelKey)&&"modelIndex"in e&&p(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r<t[e]+(null!==(i=t[`${e}Span`])&&void 0!==i?i:1);r++)n+=s[r].value;return n}getSizeFromUser(t,e){var i,s;const n="col"===e?this._colSize:this._rowSize;if(!(null===(i=n[t[e]])||void 0===i?void 0:i.isUserSetting))return;let r=0;for(let i=t[e];i<t[e]+(null!==(s=t[`${e}Span`])&&void 0!==s?s:1);i++){if(!n[i].isUserSetting)return;r+=n[i].value}return r}setItemLayoutSizeToGrid(t,e){if(B4(t)){if(e.colSpan&&e.colSpan>1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;t<e.col;t++)i.x+=this._colSize[t].value;for(let t=0;t<e.row;t++)i.y+=this._rowSize[t].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}getItemLayoutRect(t){var e,i;const s=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(s,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(s,"row"))&&void 0!==i?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}layoutItems(t,e,i,s){this._chartLayoutRect=i,this._chartViewBox=s,this.clearLayoutSize(),e.sort(((t,e)=>e.layoutLevel-t.layoutLevel));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>B4(t))),a=n.filter((t=>!B4(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>B4(t))),h=o.filter((t=>!B4(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);k(h.width)||(h.width=l.width),k(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function B4(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}T4.type="grid";const E4=()=>{RB()},P4="vchart-tooltip",O4=`${P4}-container`,I4=`${P4}-title`,R4=`${P4}-content-box`,D4={offsetX:10,offsetY:10},L4="99999999999999";function F4(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\(/g,"&#40;").replace(/ /g," &nbsp;")}const z4=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1,j4=t=>y(t)&&""!==(null==t?void 0:t.trim())||S(t)?F4(t):"",H4=(t,e)=>{let i;if(p(t))if(S(t))i=t;else if(d(t)){const s=t(e);S(s)&&(i=s)}return i},N4={left:[-2,0],right:[2,0],top:[0,-2],bottom:[0,2],insideTop:[0,-1.5],insideBottom:[0,1.5],insideLeft:[-1.5,0],insideRight:[1.5,0],insideTopLeft:[-1.5,-1.5],insideTopRight:[1.5,-1.5],insideBottomLeft:[-1.5,1.5],insideBottomRight:[1.5,1.5],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-2],bl:[-2,2],lb:[-2,2],br:[2,2],rb:[2,2],inside:[0,0],center:[0,0],centerBottom:[0,1],centerTop:[0,-1],centerLeft:[-1,0],centerRight:[1,0]},V4=(t,e,i=2)=>{var s,n;return null!==(n=null===(s=N4[t])||void 0===s?void 0:s["x"===e?0:1])&&void 0!==n?n:i};class U4 extends cW{constructor(){super(...arguments),this._visible=!0,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this.changeTooltip=(t,e,i)=>this._isReleased?1:t?this.changeTooltipPosition(e,i):(this._updateTooltip(!1,e),0),this.changeTooltipPosition=(t,e)=>{var i,s,n,r,a;if(this._isReleased)return 1;const o=t.event,{tooltipSpec:l,activeTooltipSpec:h,changePositionOnly:c}=t;if(!h)return 1;const d=h.activeType;if(h.handler)return null!==(n=null===(s=(i=h.handler).showTooltip)||void 0===s?void 0:s.call(i,d,e,t))&&void 0!==n?n:0;const u=h,p=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,c));h.position=p;const g=null!==(r=h.updatePosition)&&void 0!==r?r:null===(a=l[d])||void 0===a?void 0:a.updatePosition;g&&(h.position=g(h.position,e,t));let f=!1!==(null==u?void 0:u.visible);return e&&"pointerout"!==o.type&&h.visible&&(h.title||h.content)||(f=!1),this._updateTooltip(f,Object.assign(Object.assign({},t),{changePositionOnly:c})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,h,c,u;const f=this._chartOption.getRectByDimensionData,{tooltipSpec:m}=e,v={x:1/0,y:1/0};if(!m)return v;const y=e.event,{activeType:_,data:b}=t,x="dimension"===_?null===(n=null===(s=b[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==b?void 0:b[0],{offsetX:A,offsetY:C}=this._option,M=m[_],w=zV(null==M?void 0:M.position,b,e),T=null!==(r=zV(null==M?void 0:M.positionMode,b,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:B=0,height:E=0}=null!=i?i:{},P="canvas"===m.renderMode,O=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),I=null!==(o=null==O?void 0:O.width)&&void 0!==o?o:aj,R=null!==(l=null==O?void 0:O.height)&&void 0!==l?l:oj;let D=!1;const L={width:0,height:0};let F,z={x:0,y:0},j={x:0,y:0},H=1,N=1;const V=ek(this._env);if(V&&!m.confine?(L.width=window.innerWidth,L.height=window.innerHeight):(L.width=I,L.height=R),V&&!P){const t=this._getParentElement(m);j=null!==(c=null===(h=null==t?void 0:t.getBoundingClientRect)||void 0===h?void 0:h.call(t))&&void 0!==c?c:v;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer;F=null==e?void 0:e.getBoundingClientRect(),z={x:F.x-j.x,y:F.y-j.y},H=z4(e,F),N=z4(t,j)}const U=N/H,W={},G={x:w,y:w},Y={x:["left","right"],y:["top","bottom"]},K=({orient:t,mode:i,offset:s},n)=>{var r;let a,o;const l=e.model,h=null==l?void 0:l.getLayoutStartPoint(),c=null!=s?s:"x"===n?A:C;if("mark"===i){D=!0;const t=e.item,i=null==t?void 0:t.AABBBounds;i&&h&&(a=("x"===n?i.x1:i.y1)+h[n],o=("x"===n?i.x2:i.y2)+h[n])}else if(f&&"crosshair"===i&&"cartesian"===(null===(r=null==x?void 0:x.series)||void 0===r?void 0:r.coordinate)&&x.datum&&x.datum.length){D=!0;const t=f(x,h);t&&(a=t.start[n],o=t.end[n])}else G[n]=t;if(D){const e=Y[n][0],i="x"===n?B:E;switch(V4(t,n)){case-2:W[e]=a-i*U-c;break;case-1.5:W[e]=a+c;break;case 0:W[e]=(a+o)/2-i*U/2;break;case-1:W[e]=(a+o)/2-i*U-c;break;case 1:W[e]=(a+o)/2+c;break;case 1.5:W[e]=o-i*U-c;break;case 2:W[e]=o+c}}},$=["x","y"];if(g(w))if((t=>g(t)&&(p(t.left)||p(t.right)||p(t.top)||p(t.bottom)))(w)){const{left:t,right:e,top:i,bottom:s}=w;W.left=H4(t,y),W.top=H4(i,y),W.right=H4(e,y),W.bottom=H4(s,y)}else(t=>g(t)&&(p(t.x)||p(t.y)))(w)&&$.forEach((t=>{const e=w[t];S(e)||d(e)?W[Y[t][0]]=H4(e,y):K(e,t)}));else p(w)&&(K({orient:w,mode:T},"x"),K({orient:w,mode:T},"y"));const X={x:null,y:null};return $.forEach((t=>{var e;const i="x"===t?B:E,s="x"===t?I:R,n="x"===t?A:C,r=V4(G[t],t);if(k(W[Y[t][0]]))X[t]=W[Y[t][0]];else if(k(W[Y[t][1]]))X[t]=s-i*U-W[Y[t][1]];else{const e="x"===t?y.canvasX:y.canvasY;X[t]=r>0?e+n:0===r?e-i*U/2:e-i*U-n}X[t]*=H,V&&(X[t]+=z[t]),X[t]/=N;const a="x"===t?L.width:L.height,o=m.confine?-(j[t]-(null!==(e=null==F?void 0:F[t])&&void 0!==e?e:0)/H)/N:-j[t]/N,l=a/N+o-i;2!==r&&X[t]<o?D?X[t]=o:(X[t]+=0===r?n+i/2:2*n+i,X[t]>l&&(X[t]=l)):-2!==r&&X[t]>l&&(D?X[t]=l:(X[t]-=0===r?n+i/2:2*n+i,X[t]<o&&(X[t]=o)))})),X}}get env(){return this._env}onAdd(t){super.onAdd(t);const e=t.component;this._component=e,this._chartOption=e.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=e.getCompiler(),this._initFromSpec()}hideTooltip(t){return this.changeTooltip(!1,t)}release(){var t,e,i,s;const n=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};n.handler?null===(s=(i=n.handler).release)||void 0===s||s.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:D4.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:D4.offsetY}:D4}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption()}reInit(){this._initFromSpec()}}U4.specKey="tooltip";const W4=(t,e)=>p(t)?_(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",G4=(t={},e={})=>{var i,s;p(t.fontFamily)&&(e.fontFamily=t.fontFamily);const n=null!==(i=t.fill)&&void 0!==i?i:t.fontColor;return p(n)&&(e.color=n),p(t.fontWeight)&&(e.fontWeight=t.fontWeight),p(t.textAlign)&&(e.textAlign=t.textAlign),p(t.fontSize)&&(e.fontSize=W4(t.fontSize)),p(t.maxWidth)&&(e.maxWidth=W4(t.maxWidth)),t.multiLine||p(t.maxWidth)&&!1!==t.multiLine?(e.whiteSpace="initial",e.wordBreak=null!==(s=t.wordBreak)&&void 0!==s?s:"break-word"):(e.wordBreak="normal",e.whiteSpace="nowrap"),e},Y4=(t={})=>{const{lineHeight:e}=t;return t.fontSize?Mz(e,t.fontSize):0},K4=t=>{var e;const{backgroundColor:i,border:s,shadow:n,padding:r}=t,a={borderWidth:`${null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0}px`};let o=null;(null==s?void 0:s.color)&&(a.borderColor=s.color),i&&(a.backgroundColor=i),a.boxShadow=n?`${n.x}px ${n.y}px ${n.blur}px ${n.spread}px ${n.color}`:"initial";const{radius:l}=null!=s?s:{};return p(l)&&(a.borderRadius=k(l)?`${l}px`:`${l}`),p(r)&&(o=ui(r),a.padding=W4(o)),{panelStyle:a,panelPadding:o}};function $4(t,e){t&&t.style&&e&&Object.keys(e).forEach((i=>{t.style[i]=e[i]}))}const X4=t=>{Fz.registerComponentPlugin(t.type,t)};class q4 extends U4{getVisibility(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}setVisibility(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}getRootDom(){return this._rootDom}constructor(){super(q4.type),this.type=_Y.dom,this._tooltipContainer=null==tk?void 0:tk.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec().parentElement;if(tk&&t&&t.children&&t.children.length){for(let e=0;e<t.children.length;e++)if(t.children[e].classList.contains(O4)){this._container=t.children[e];break}this._container||(this._container=tk.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=L4,this._container.classList.add(O4),t.appendChild(this._container))}}initRootDom(){var t;const e=this._component.getSpec(),i=document.createElement("div"),s=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");$4(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:L4,fontFamily:null!=s?s:Oz.fontFamily,fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh",visibility:"hidden"},this._domStyle.panel)),i.classList.add(e.className),i.setAttribute("vchart-tooltip-id",`${this.id}`),this._container.appendChild(i),this._rootDom=i}_getTooltipBoxSize(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);const s=null===(i=this._rootDom)||void 0===i?void 0:i.getBoundingClientRect();return{width:null==s?void 0:s.width,height:null==s?void 0:s.height}}_removeTooltip(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}_updateTooltip(t,e){var i,s;if(t&&this._rootDom){const{tooltipSpec:n,activeTooltipSpec:r}=e;e.changePositionOnly||(this._tooltipActual=r);const a=this._rootDom;if(a){const{x:o=0,y:l=0}=null!==(i=r.position)&&void 0!==i?i:{};let h={x:o,y:l};const c=this.getVisibility();n.updateElement&&(this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:o,y:l}),n.updateElement(a,r,e),h=this._getActualTooltipPosition(r,e,{width:a.offsetWidth,height:a.offsetHeight}),this._cacheCustomTooltipPosition=h),!c&&t&&(this._rootDom.style.transition="none",this._updatePosition(h,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(h)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){const t=this._component.getSpec();this._domStyle=((t={})=>{var e,i,s,n;const{style:r={},enterable:a,transitionDuration:o}=t,{panel:l={},titleLabel:h,shape:c,keyLabel:d,valueLabel:p,spaceRow:g,align:f}=r,{panelStyle:m,panelPadding:v}=K4(l),y={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=a?"auto":"none",o&&(m.transitionDuration=o?`${o}ms`:"initial",m.transitionProperty=o?"transform":"initial",m.transitionTimingFunction=o?"ease-out":"initial"),k(g)&&(y.marginBottom=`${g}px`);const _={width:W4(null!==(e=null==c?void 0:c.size)&&void 0!==e?e:8)},b=G4(h),x=G4(d),S=G4(p),A="right"===f?"marginLeft":"marginRight";"right"===f&&(m.direction="rtl"),u(b.textAlign)&&(b.textAlign="right"===f?"right":"left"),u(x.textAlign)&&(x.textAlign="right"===f?"right":"left"),u(S.textAlign)&&(S.textAlign="right"===f?"left":"right"),_[A]=W4(null!==(i=c.spacing)&&void 0!==i?i:8),x[A]=W4(null!==(s=d.spacing)&&void 0!==s?s:26),S[A]=W4(null!==(n=p.spacing)&&void 0!==n?n:0);const C=Math.max(Y4(p),Y4(d));return y.lineHeight=C>0?`${C}px`:"20px",{panelPadding:v,row:y,panel:m,title:b,shape:_,key:x,value:S}})(t)}_updateDomStringByCol(t){var e;const{title:i={},content:s}=t,n=s&&s.length,r=this._domStyle.row,a=[...this._rootDom.children];let o=a.find((t=>t.className.includes(I4))),l=a.find((t=>t.className.includes(R4)));if(!o&&!1!==i.visible){o=document.createElement("h2");const t=document.createElement("span");o.appendChild(t),o.classList.add(I4),this._rootDom.firstChild?this._rootDom.insertBefore(o,this._rootDom.firstChild):this._rootDom.appendChild(o)}o&&!1!==i.visible?($4(o,Object.assign(Object.assign(Object.assign({},this._domStyle.title),n?r:{marginBottom:"0px"}),{marginTop:"0px"})),o.firstChild.innerHTML=`${null!==(e=i.value)&&void 0!==e?e:""}`):o&&!1===i.visible&&o.parentNode.removeChild(o);const h=["shape","key","value"];if(!l&&n&&(l=document.createElement("div"),h.forEach((t=>{const e=document.createElement("div");e.classList.add(`${P4}-column`),e.classList.add(`${P4}-${t}-column`),e.setAttribute("data-col",t),l.appendChild(e)})),l.classList.add(R4),this._rootDom.appendChild(l)),l&&n){const t=[...l.children];$4(l,{whiteSpace:"nowrap"}),t.forEach(((t,e)=>{const i=t.getAttribute("data-col");if(i&&h.includes(i)){const e="shape"===i&&s.every((t=>!t.hasShape||!t.shapeType));$4(t,Object.assign(Object.assign({},this._domStyle[i]),{display:e?"none":"inline-block",verticalAlign:"top"}));const n=[...t.children];n.slice(s.length).forEach((t=>{t.parentNode.removeChild(t)})),s.forEach(((e,a)=>{let o=n[a];o||(o=document.createElement("div"),o.classList.add(`${P4}-${i}`),t.appendChild(o));const l=Object.assign({},r);a===s.length-1&&(l.marginBottom="0px"),l.display=!1===e.visible?"none":"block",l.height="initial","key"===i?(o.innerHTML=j4(e.key),e.keyStyle&&G4(e.keyStyle,l)):"value"===i?(o.innerHTML=j4(e.value),e.valueStyle&&G4(e.valueStyle,l)):"shape"===i&&(o.innerHTML=function(t,e){var i,s,n,r,a,o;if(!t||!t.hasShape||!t.shapeType)return"";const l='style="display:inline-block;vertical-align:middle;"',{shapeType:h,shapeStroke:c,shapeHollow:d=!1,shapeFill:u}=t,p=null!==(i=t.shapeSize)&&void 0!==i?i:8,f=t.shapeLineWidth?F4(t.shapeLineWidth)+"px":"0px";let m="currentColor";const v=()=>c?F4(c):m,_=p,b=t=>new Ng({symbolType:t,size:_,fill:!0});let x=b(h);const S=x.getParsedPath();let A,k;if(!S.path&&S.pathStr&&(x=b(S.pathStr)),x.getParsedPath().path){const t=x.getParsedPath().path;k=t.toString(),A=t.bounds}else S.isSvg&&S.svgCache&&(k=S.svgCache.map((t=>t.path.toString())).join(),A=S.svgCache.reduce(((t,e)=>t.union(e.path.bounds)),new Ke));let C=`${A.x1} ${A.y1} ${A.width()} ${A.height()}`;if("0px"!==f){const[t,e,i,s]=C.split(" ").map((t=>Number(t))),n=Number(f.slice(0,-2));C=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}const M=Tu.IsGradientStr(u);if(!u||y(u)&&!M||d)return m=d?"none":u?F4(u):"currentColor",`\n <svg ${l} width="${p}" height="${p}" viewBox="${C}">\n <path\n d="${k}"\n style="fill: ${m}; stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`;const w=M?Tu.Parse(u):g(u)?u:null;if(w){m="gradientColor"+(null!=e?e:"");let t="";const i=(null!==(s=w.stops)&&void 0!==s?s:[]).map((t=>`<stop offset="${F4(t.offset.toString())}" stop-color="${F4(t.color)}"/>`)).join("");return"radial"===w.gradient?t=`<radialGradient id="${m}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${i}\n </radialGradient>`:"linear"===w.gradient&&(t=`<linearGradient id="${m}" x1="${100*(null!==(n=w.x0)&&void 0!==n?n:0)}%" y1="${100*(null!==(r=w.y0)&&void 0!==r?r:0)}%" x2="${100*(null!==(a=w.x1)&&void 0!==a?a:0)}%" y2="${100*(null!==(o=w.y1)&&void 0!==o?o:0)}%">\n ${i}\n </linearGradient>`),`\n <svg ${l} width="${p}" height="${p}" viewBox="-0.5 -0.5 1 1">\n ${t}\n <path\n d="${k}"\n style="fill: url(#${m}); stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`}return""}(e,`${this.id}_${a}`)),$4(o,l)}))}}))}else l&&!n&&l.parentNode.removeChild(l)}_updateDomStyle(t="width",e){var i,s,n,r,a;const o=this._rootDom,l=[...o.children].find((t=>t.className.includes(R4))),h=[...o.children].find((t=>t.className.includes(I4)));if(l){const o=this._component.getSpec(),c={},d=null===(i=o.style)||void 0===i?void 0:i.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&h){const e=[...l.children].reduce(((e,i)=>"height"===t?e+i.getBoundingClientRect().width:Math.max(e,i.getBoundingClientRect().width)),0);e>0&&(h.style.maxWidth=`${e}px`,h.style.maxWidth=`${Math.ceil(l.getBoundingClientRect().width)}px`)}if(p(null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.maxContentHeight)){const t=h&&h.className.includes(I4)?h.getBoundingClientRect().height+(null!==(n=o.style.spaceRow)&&void 0!==n?n:0):0,e=this._chartOption.getChartViewRect(),i=Mz(o.style.maxContentHeight,Math.min(e.height,document.body.clientHeight)-t-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));i>0&&(c.maxHeight=`${i}px`,c.overflowY="auto",c.width=`calc(100% + ${this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px"})`,$4(l,c))}const u=l.children,g=[];if(u){for(let i=0;i<u.length;i++){const s=null!==(r=u[i].children)&&void 0!==r?r:[];for(let i=0;i<s.length;i++){e&&(s[i].style[t]="initial");const n=s[i].getBoundingClientRect()[t];(void 0===g[i]||g[i]<n)&&(g[i]=n)}}for(let e=0;e<u.length;e++){const i=null!==(a=u[e].children)&&void 0!==a?a:[];for(let e=0;e<i.length;e++)i[e].style[t]=`${g[e]}px`}}}}_getParentElement(t){var e;return null!==(e=this._container)&&void 0!==e?e:super._getParentElement(t)}isTooltipShown(){return this.getVisibility()}reInit(){super.reInit(),this._initStyle(),this._rootDom&&$4(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}_updatePosition({x:t,y:e},i=!0){this._rootDom&&(this._rootDom.style.transform=`translate3d(${t}px, ${e}px, 0)`,i&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}q4.type=_Y.dom;const Z4=()=>{X4(q4)},J4={fontFamily:Oz.fontFamily,spacing:10,wordBreak:"break-word"},Q4=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>e<s.length-1?t+"\n":t))):s=[t],n=s.map((t=>Object.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=hm({wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n});return{width:r.width(),height:r.height(),text:s}};function t8(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:J4),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:e,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:p(t.maxWidth)?!1!==t.multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const e8=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return p(a)&&(r.cornerRadius=[a,a,a,a]),r};class i8 extends U4{constructor(){super(i8.type),this.type=_Y.canvas,this._attributes=null}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new GF({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_getTooltipBoxSize(t,e){var i,s;if(!e||u(this._attributes)){const e=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=((t,e,i)=>{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:c}=e,{panel:d={},titleLabel:u,shape:g,keyLabel:f,valueLabel:m,spaceRow:v,align:y}=l,_=ui(d.padding),b=Tz(d.padding),x=t8(Object.assign({textAlign:"right"===y?"right":"left"},u),i),S=t8(Object.assign({textAlign:"right"===y?"right":"left"},f),i),A=t8(m,i),k={fill:!0,size:null!==(s=null==g?void 0:g.size)&&void 0!==s?s:8,spacing:null!==(n=null==g?void 0:g.spacing)&&void 0!==n?n:6},C={panel:e8(d),padding:_,title:{},content:[],titleStyle:{value:x,spaceRow:v},contentStyle:{shape:k,key:S,value:A,spaceRow:v},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:c,align:y},{title:M={},content:w=[]}=t;let T=b.left+b.right,B=b.top+b.bottom,E=0;const P=!!w.length;let O=0,I=0,R=0,D=0;if(P){const t=[],e=[],i=[],s=[];let n=0;C.content=w.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:c="",shapeFill:d,shapeStroke:u,shapeLineWidth:g,shapeSize:f,value:m,isKeyAdaptive:y,spaceRow:_,keyStyle:b,valueStyle:x,shapeHollow:C}=r,M={height:0,spaceRow:null!=_?_:v};if(p(h)){const i=Lz({},S,t8(b,void 0,{})),{width:s,height:n,text:r}=Q4(h,i);M.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),y?e.push(s):t.push(s),o=Math.max(o,n)}if(p(m)){const t=Lz({},A,t8(x,void 0,{})),{width:e,height:s,text:n}=Q4(m,t);M.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:c};C?t.stroke=d:t.fill=d,t.stroke=null!=u?u:d,t.lineWidth=g,M.shape=t;const e=null!=f?f:k.size;o=Math.max(e,o),s.push(e)}else M.shape={visible:!1};return M.height=o,n+=o,a<w.length-1&&(n+=M.spaceRow),M})),B+=n,O=t.length?$(t):0,I=e.length?$(e):0,R=i.length?$(i):0,D=s.length?$(s)+k.spacing:0,E=Math.max(D+O+S.spacing+R+A.spacing,D+I,E),C.hasContentShape=!!s.length,C.keyWidth=O,C.valueWidth=R}let L=0,F=0,z=0;const{visible:j=!0,value:H="",valueStyle:N,spaceRow:V}=M;C.title.visible=j,C.title.spaceRow=null!=V?V:v;let U={};const W=()=>U.autoWidth&&!1!==U.multiLine;if(j){U=Lz({},x,t8(N,void 0,{})),W()&&(U.multiLine=null===(r=U.multiLine)||void 0===r||r,U.maxWidth=null!==(a=U.maxWidth)&&void 0!==a?a:P?Math.ceil(E):void 0);const{text:t,width:e,height:i}=Q4(H,U);C.title.value=Object.assign(Object.assign({width:W()?Math.min(e,null!==(o=U.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},U),{text:t}),L=C.title.value.width,F=C.title.value.height,z=F+(P?C.title.spaceRow:0)}return B+=z,C.title.width=L,C.title.height=F,W()?T+=E||L:T+=Math.max(L,E),P&&C.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=T-b.left-b.right-D-O-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),C.valueWidth=Math.max(C.valueWidth,i.width))})),C.panel.width=T,C.panel.height=B,C})(t,this._component.getSpec(),e)}const{panel:n}=null!==(s=this._attributes)&&void 0!==s?s:{};return{width:n.width+n.lineWidth,height:n.height+n.lineWidth}}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{activeTooltipSpec:s}=e,n=s.position;e.changePositionOnly?p(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}i8.type=_Y.canvas;const s8=()=>{X4(i8)},n8=t=>{Fz.registerChartPlugin(t.type,t)},r8=/\{([^}]+)\}/,a8=/\{([^}]+)\}/g,o8=/:/;class l8 extends cW{constructor(){super(l8.type),this.type="formatterPlugin",this._timeModeFormat={utc:Ti.getInstance().timeUTCFormat,local:Ti.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=Li.getInstance().format,this._numericSpecifier=Li.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[l8.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;d(r)?this._formatter=r:(this._formatter=this._format.bind(this),d(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),Fz.registerFormatter(this._formatter)}_format(t,e,i){return _(t)?t.map(((t,s)=>{const n=_(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):_(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=r8.test(i),this._isNumericFormatterCache.set(i,s))),s?i.replace(a8,((t,i)=>{if(!o8.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)})):this._formatSingleText(t,i)}_formatSingleText(t,e){if(Ii.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):e.startsWith("calc(")?this._calcFormatter(e,t):t}_calcFormatter(t,e){try{const i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}_calculateMathExpression(t,e){const i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{const t=new Function("return ("+i+")")();if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Invalid calculation result");return t}catch(t){return e}}_isValidMathExpression(t){return/^[0-9+\-*/().]+$/.test(t)}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}l8.pluginType="chart",l8.specKey="formatter",l8.type="formatterPlugin";const h8={state:BN.STATE_ACTIVE,trigger:"pointerover",triggerOff:"pointerout"};class c8 extends yV{constructor(t){super(t),this.type="element-active",this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{this.reset(t.item)},this.options=Object.assign({},h8,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(t){const{state:e,interaction:i}=this.options;this.isGraphicInStateMark(t,e)&&(UN(t,e,!0),i.setStatedGraphics(this,[t]))}}reset(t){const{interaction:e,state:i}=this.options,s=e.getStatedGraphics(this),n=null!=t?t:null==s?void 0:s[0];n&&(null==s?void 0:s.includes(n))&&(WN(n,i),e.setStatedGraphics(this,s.filter((t=>t!==n))))}}c8.type="element-active",c8.defaultOptions=h8;const d8="element-active-by-legend",u8={state:BN.STATE_ACTIVE,filterType:"groupKey"};class p8 extends yV{constructor(t){super(t),this.type=d8,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},u8,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:tH.legendItemHover,handler:this.handleStart},{type:tH.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(u(t))return;const{interaction:e,state:i}=this.options,s=mV(this.options),n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{s(e)===t&&r.push(e)}))})),e.updateStates(this,r,n,i),e.setStatedGraphics(this,r)}resetAll(){const{interaction:t,state:e}=this.options;t.clearAllStatesOfTrigger(this,e),t.setStatedGraphics(this,[])}reset(t){const{state:e,interaction:i}=this.options;if(t){const s=i.getStatedGraphics(this);s&&s.includes(t)&&(WN(t,e),i.setStatedGraphics(this,s.filter((e=>e!==t))))}else this.resetAll()}}p8.type=d8,p8.defaultOptions=u8;const g8="element-highlight-by-group";class f8 extends yV{constructor(t){super(t),this.type=g8,this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{const e=t.item;e&&this.isGraphicInMark(e)&&this.resetAll()},this.options=Object.assign({},vV,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}_getHightlightKey(t){var e;return null===(e=t.context)||void 0===e?void 0:e.groupKey}start(t){if(t&&this.isGraphicInMark(t)){const e=this._getHightlightKey(t);if(u(e))return;const{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{this._getHightlightKey(t)===e&&a.push(t)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}reset(t){if(t){if(this.isGraphicInMark(t)){const{interaction:e}=this.options,i=e.getStatedGraphics(this);WN(t,[this.options.highlightState,this.options.blurState]),e.setStatedGraphics(this,i.filter((e=>e!==t)))}}else this.resetAll()}}f8.type=g8,f8.defaultOptions=vV;const m8="element-highlight-by-key";class v8 extends f8{constructor(){super(...arguments),this.type=m8}_getHightlightKey(t){var e;return null===(e=t.context)||void 0===e?void 0:e.key}}v8.type=m8;const y8="element-highlight-by-legend",_8={highlightState:BN.STATE_HIGHLIGHT,blurState:BN.STATE_BLUR,filterType:"groupKey"};class b8 extends yV{constructor(t){super(t),this.type=y8,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},_8,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:tH.legendItemHover,handler:this.handleStart},{type:tH.legendItemUnHover,handler:this.handleReset}]}start(t){if(t){const e=mV(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(WN(t,[e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}b8.type=y8,b8.defaultOptions=_8;const x8="element-highlight-by-name",S8={highlightState:BN.STATE_HIGHLIGHT,blurState:BN.STATE_BLUR,filterType:"groupKey"};class A8 extends yV{constructor(t){super(t),this.type=x8,this.handleStart=t=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.resetAll()},this.options=Object.assign({},S8,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;const i=Y(this.options.graphicName);return(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)&&i.includes(t.node.name)}_parseTargetKey(t){return this.options.parseData?this.options.parseData(t):"text"===t.node.type?t.node.attribute.text:null}start(t){if(t){const e=mV(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(WN(t,[e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}A8.type=x8,A8.defaultOptions=S8;class k8 extends KN{constructor(){super(...arguments),this.type=k8.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}k8.type="image";const C8=()=>{XN(),QU(),eW(),$K(),z$(),IY(),qY(),CK(),dX(),qJ(),Fz.registerMark(k8.type,k8),kT(),lT(),Fz.registerGraphicComponent("image",xf),E0(),NW()};BV.useRegisters([EY,VY,aK,bK,p1,v1,b1,O1,a1,z1,V1,U1,Y1,c2,p2,D1,X1,J1,_2,e2,n2,o2,m2,S2,w1,C2,A1,dG,fG,vG,_G,xG,FX,DX,I2,K2,s3,p3,f3,O3,D3,N3,RK,H5,$5,v4,V5,q5,_4,x4,W5,s4,h4,u4,k4,w4,E4,()=>{Fz.registerLayout(T4.type,T4)},C8,Z4,s8,()=>{n8(l8)},()=>{Fz.registerInteractionTrigger(c8.type,c8)},()=>{Fz.registerInteractionTrigger(d8,p8)},()=>{Fz.registerInteractionTrigger(y8,b8)},()=>{Fz.registerInteractionTrigger(x8,A8)},()=>{Fz.registerInteractionTrigger(g8,f8)},()=>{Fz.registerInteractionTrigger(m8,v8)},gV,HA,zA]);class M8 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","maskShape","reverse","outlineMargin","outlinePadding","indicatorSmartInvert","liquidBackground","liquidOutline"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let w8=class extends UG{constructor(){super(...arguments),this.transformerConstructor=M8,this.type="liquid",this.seriesType=az.liquid}};w8.type="liquid",w8.seriesType=az.liquid,w8.transformerConstructor=M8;const T8=()=>{MY(),G0(),Fz.registerChart(w8.type,w8)};class B8 extends YG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","circle","overlap","overlapLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let E8=class extends UG{constructor(){super(...arguments),this.transformerConstructor=B8,this.type="venn",this.seriesType=az.venn}};E8.type="venn",E8.seriesType=az.venn,E8.transformerConstructor=B8;const P8=()=>{MY(),e1(),Fz.registerChart(E8.type,E8)};class O8 extends KG{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar","bandWidthField"])}transformSpec(t){super.transformSpec(t),tN(t)}_setDefaultXAxisSpec(t){return{orient:"bottom",type:"linear",label:{visible:!1}}}_setDefaultYAxisSpec(t){return{orient:"left",type:"linear"}}}let I8=class extends UG{constructor(){super(...arguments),this.transformerConstructor=O8,this.type="mosaic",this.seriesType=az.mosaic,this.handleAfterStackRegion=(t,e)=>{t.getSeries().forEach((t=>{const i=t.getStackData(),s=t.getStackValue(),n=t.getStackValueField();i&&n&&(Fj(e[s],n),zj(t,e[s]))}))}}_beforeInit(){this._dataSet&&oH(this._dataSet,"stackSplit",XG)}_initStack(){this._stack=new qG(this,{afterStackRegion:this.handleAfterStackRegion}),this._stack.init()}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};I8.type="mosaic",I8.seriesType=az.mosaic,I8.transformerConstructor=O8;const R8=()=>{kY(),MY(),TY(),eY(),tY(),s1(),Fz.registerChart(I8.type,I8)};class D8 extends cW{constructor(){super(D8.type),this.type="ChartResizeZoomPlugin",this._zoom=1,this._onWheel=t=>{t.preventDefault(),t.stopImmediatePropagation();const e=Math.pow(1.005,-t.deltaY*Math.pow(16,t.deltaMode)*.2*this._rate),i={x:t.offsetX,y:t.offsetY};this.zoom(e,i)}}onAfterInitChart(t,e){var i,s,n,r,a;const o=t.globalInstance,l=null!==(s=null===(i=o.getSpec())||void 0===i?void 0:i[D8.specKey])&&void 0!==s?s:{enabled:!1};!0===l.enabled&&(this._minZoom=null!==(n=l.min)&&void 0!==n?n:.1,this._maxZoom=null!==(r=l.max)&&void 0!==r?r:10,this._rate=null!==(a=l.rate)&&void 0!==a?a:.1,this._container=o.getContainer(),this._triggerEvent=EK(t.globalInstance.getChart().getOption().mode).zoom,this._container&&this._triggerEvent&&this._container.addEventListener(this._triggerEvent,this._onWheel))}zoom(t,e){const i=this.service.globalInstance;if(!i)return;const s=this._zoom;let n=this._zoom*t;if(n<=this._minZoom&&t<1||n>=this._maxZoom&&t>1)if(n<=this._minZoom&&this._zoom>this._minZoom)n=this._minZoom;else{if(!(n>=this._maxZoom&&this._zoom<this._maxZoom))return;n=this._maxZoom}if(n===s)return;const r=n/s;if(this._zoom=n,i.resize(i.getCurrentSize().width*this._zoom,i.getCurrentSize().height*this._zoom),e&&this._container){const{scrollLeft:t,scrollTop:i}=this._container;this._container.scrollLeft=t+e.x*(r-1),this._container.scrollTop=i+e.y*(r-1)}}release(){this._container&&this._triggerEvent&&this._container.removeEventListener(this._triggerEvent,this._onWheel)}}D8.specKey="resizeZoom",D8.type="ChartResizeZoomPlugin";function L8(t,i="ChartContainer",s){const n=e.forwardRef(((i,n)=>{const r=e.useRef(null),[a,o]=e.useState(!1),{className:l,style:h,width:c,height:d,id:u}=i,p=
10
10
  /*! *****************************************************************************
11
11
  Copyright (c) Microsoft Corporation.
12
12
 
@@ -21,4 +21,4 @@ let sJ=class t extends VZ{constructor(e){super(j({},t.defaultOptions,e)),this.fi
21
21
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
22
  PERFORMANCE OF THIS SOFTWARE.
23
23
  ***************************************************************************** */
24
- function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i}(i,["className","style","width","height","id"]);return e.useLayoutEffect((()=>{o(!0)}),[]),e.createElement("div",{ref:r,id:null==u?void 0:u.toString(),className:l,style:Object.assign({position:"relative",height:d||"100%",width:c||"100%"},h)},a?e.createElement(t,Object.assign({ref:n,container:r.current},s?s(p):p)):e.createElement(e.Fragment,null))}));return n.displayName=i||t.name,n}const L8=e.createContext(null);L8.displayName="ChartContext";var F8,z8={exports:{}},j8={};z8.exports=function(){if(F8)return j8;F8=1;var t,e=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function f(t){if("object"==typeof t&&null!==t){var g=t.$$typeof;switch(g){case e:switch(t=t.type){case s:case r:case n:case c:case d:return t;default:switch(t=t&&t.$$typeof){case l:case o:case h:case p:case u:case a:return t;default:return g}}case i:return g}}}return t=Symbol.for("react.module.reference"),j8.ContextConsumer=o,j8.ContextProvider=a,j8.Element=e,j8.ForwardRef=h,j8.Fragment=s,j8.Lazy=p,j8.Memo=u,j8.Portal=i,j8.Profiler=r,j8.StrictMode=n,j8.Suspense=c,j8.SuspenseList=d,j8.isAsyncMode=function(){return!1},j8.isConcurrentMode=function(){return!1},j8.isContextConsumer=function(t){return f(t)===o},j8.isContextProvider=function(t){return f(t)===a},j8.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},j8.isForwardRef=function(t){return f(t)===h},j8.isFragment=function(t){return f(t)===s},j8.isLazy=function(t){return f(t)===p},j8.isMemo=function(t){return f(t)===u},j8.isPortal=function(t){return f(t)===i},j8.isProfiler=function(t){return f(t)===r},j8.isStrictMode=function(t){return f(t)===n},j8.isSuspense=function(t){return f(t)===c},j8.isSuspenseList=function(t){return f(t)===d},j8.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===r||e===n||e===c||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===h||e.$$typeof===t||void 0!==e.getModuleId)},j8.typeOf=f,j8}();var H8=z8.exports;const N8=t=>{let i=[];return e.Children.forEach(t,(t=>{u(t)||(H8.isFragment(t)?i=i.concat(N8(t.props.children)):i.push(t))})),i},V8={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},U8={onLegendItemHover:"legendItemHover",onLegendItemUnHover:"legendItemUnHover",onLegendItemClick:"legendItemClick",onLegendFilter:"legendFilter",onLegendSelectedDataChange:"legendSelectedDataChange"},W8={onBrushStart:"brushStart",onBrushChange:"brushChange",onBrushEnd:"brushEnd",onBrushClear:"brushClear"},G8={onDataZoomChange:"dataZoomChange"},Y8={onPlayerPlay:"playerPlay",onPlayerPause:"playerPause",onPlayerEnd:"playerEnd",onPlayerChange:"playerChange",onPlayerForward:"playerForward",onPlayerBackward:"playerBackward"},K8={onScrollBarChange:"scrollBarChange"},$8=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},U8),W8),Y8),G8),K8),{onDimensionHover:"dimensionHover",onDimensionClick:"dimensionClick"}),{onInitialized:"initialized",onRendered:"rendered",onRenderFinished:"renderFinished",onAnimationFinished:"animationFinished",onLayoutStart:"layoutStart",onLayoutEnd:"layoutEnd"}),{onDrill:"drill"}),V8),X8=Object.keys($8).concat(Object.keys(V8).map((t=>`${t}Filter`))),q8=Object.keys(V8),Z8=Object.keys(V8).reduce(((t,e)=>(t[V8[e]]=e,t)),{}),J8=(t,e=V8)=>{const i={};return Object.keys(t).forEach((s=>{e[s]&&t[s]&&(i[s]=t[s])})),i},Q8=(t,e,i,s=V8)=>{if(!e&&!i||!t)return!1;const n=i?J8(i,s):null,r=e?J8(e,s):null;return n&&Object.keys(n).forEach((e=>{r&&r[e]&&r[e]===n[e]||t.off(s[e],n[e])})),r&&Object.keys(r).forEach((i=>{if(!n||!n[i]||n[i]!==r[i]){const n=e[`${i}Filter`];n?t.on(s[i],n,r[i]):t.on(s[i],r[i])}})),!0},t7=`${rj}_REACT_TOOLTIP`,e7=["children","hooks","ref",...X8,"vchartConstructor","vchartConstrouctor","useSyncRender","skipFunctionDiff","onError","onReady","spec","container","options","morphConfig"],i7={morph:!1,enableExitAnimation:!1},s7=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,n7=e.forwardRef(((t,s)=>{const[n,r]=e.useState(0),a=e.useRef({});e.useImperativeHandle(s,(()=>{var t;return null===(t=a.current)||void 0===t?void 0:t.chart}));const o=!!t.spec,l=e.useRef(!1),h=e.useRef(H(t,e7)),c=e.useRef(null),d=e.useRef(null),g=!!t.skipFunctionDiff,[f,m]=e.useState(null),v=t=>{let s;o&&t.spec?(s=t.spec,p(t.data)&&(s=Object.assign(Object.assign({},t.spec),{data:t.data}))):s=Object.assign(Object.assign({},h.current),c.current);const n=((t,s,n)=>{var r,a,o;const l=Object.assign({},null!=n?n:{});let h;if((null==n?void 0:n.tooltipRender)?(h=n.tooltipRender,delete l.tooltipRender):s.tooltipRender&&(h=s.tooltipRender),h){let c;if((null==n?void 0:n.reserveDefaultTooltip)?(c=n.reserveDefaultTooltip,delete l.reserveDefaultTooltip):c=s.reserveDefaultTooltip,!c){const t=Object.assign({},null!==(a=null===(r=l.style)||void 0===r?void 0:r.panel)&&void 0!==a?a:{});t.padding=0,t.border=Object.assign(Object.assign({},t.border),{radius:0}),t.backgroundColor="unset",l.style=Object.assign(Object.assign({},null!==(o=l.style)&&void 0!==o?o:{}),{panel:t})}return Object.assign(Object.assign({},l),{updateElement:(s,n,r)=>{const{changePositionOnly:a}=r;if(!a){if(!c){s.style.width="auto",s.style.height="auto",s.style.minHeight="auto";for(let t=0;t<s.children.length;t++){const e=s.children[t];e.className!==t7&&"none"!==e.style.display&&(e.style.display="none")}}t(i.createPortal(e.createElement("div",{className:t7},h(s,n,r)),s))}}})}return n})(m,t,s.tooltip);return n&&(s.tooltip=n),s},y=e=>{if(!l.current){if(!a.current||!a.current.chart)return;e&&Q8(a.current.chart,t,d.current,$8),r(n+1),t.onReady&&t.onReady(a.current.chart,0===n)}};return e.useEffect((()=>{var e,i,s;const n=o?null:(t=>{const e={};return N8(t.children).map(((t,i)=>{const s=t&&t.type&&t.type.parseSpec;if(s&&t.props){const n=s(u(t.props.componentId)?Object.assign(Object.assign({},t.props),{componentId:s7(t,i)}):t.props);n.isSingle?e[n.specName]=n.spec:(e[n.specName]||(e[n.specName]=[]),e[n.specName].push(n.spec))}})),e})(t);if(!(null===(e=a.current)||void 0===e?void 0:e.chart))return o||(c.current=n),(t=>{var e;const i=new(null!==(e=t.vchartConstructor)&&void 0!==e?e:t.vchartConstrouctor)(v(t),Object.assign(Object.assign({},t.options),{onError:t.onError,autoFit:!0,dom:t.container}));a.current=Object.assign(Object.assign({},a.current),{chart:i}),l.current=!1})(t),a.current.chart&&(Q8(a.current.chart,t,d.current,$8),a.current.chart.renderSync({reuse:!1}),y()),void(d.current=t);if(o)return void(U(d.current.spec,t.spec,{skipFunction:g})?d.current.data!==t.data&&(a.current.chart.updateFullDataSync(t.data),y(!0),d.current=t):(a.current.chart.updateSpecSync(v(t),void 0,null!==(i=t.morphConfig)&&void 0!==i?i:i7),y(!0),d.current=t));const r=H(t,e7);U(r,h.current,{skipFunction:g})&&U(n,c.current,{skipFunction:g})||(h.current=r,c.current=n,a.current.chart.updateSpecSync(v(t),void 0,null!==(s=t.morphConfig)&&void 0!==s?s:i7),y(!0),d.current=t)}),[t]),e.useEffect((()=>()=>{a&&a.current&&a.current.chart&&(a.current.chart.release(),a.current.chart=null),d.current=null,l.current=!0}),[]),e.createElement(L8.Provider,{value:a.current},N8(t.children).map(((t,i)=>{if("string"==typeof t)return null;const s=s7(t,i);return e.createElement(e.Fragment,{key:s},e.cloneElement(t,{updateId:n,componentId:s}))})),f)})),r7=(t,e,i)=>{i&&i.length&&e.vchartConstructor&&e.vchartConstructor.useRegisters(i);const s=D8(n7,t,(t=>e?Object.assign(t,e):t));return s.displayName=t,s},a7=[gV,HA,s3,q4,dG,fG,vG,_G,p3,A4,K2,O3,I2,M4,k8,K5,j5,m4,D3,U5],o7=r7("AreaChart",{type:"area",vchartConstructor:BV},[VY,l4,d4,...a7]),l7=r7("BarChart",{type:"bar",vchartConstructor:BV},[aK,l4,d4,...a7]);class h7 extends nK{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var c7,d7,u7,p7,g7;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(c7||(c7={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(d7||(d7={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(u7||(u7={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(p7||(p7={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(g7||(g7={}));const f7=t=>t.zField||t.series&&t.series.some((t=>t.zField));class m7 extends cW{constructor(){super(m7.type),this.type="VChart3dPlugin"}onInit(t,e){var i;if(this._is3d=(t=>{return!!t&&("bar3d"===(e=t.type)||"funnel3d"===e||"histogram3d"===e||"pie3d"===e||"rangeColumn3d"===e||"wordCloud3d"===e||f7(t),!0);var e})(e),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&f7(e)&&(e.layout={type:"layout3d"})}}m7.pluginType="chart",m7.type="VChart3dPlugin";const v7=()=>{s8(m7),Nb(),Ub(),VA()},y7={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class _7 extends tK{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}class b7 extends KN{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=b7.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}b7.type="rect3d";const x7=()=>{Fz.registerMark(b7.type,b7),kT(),bT(),cV(),Fz.registerGraphicComponent("rect3d",Jg)};class S7 extends iK{constructor(){super(...arguments),this.type=u7.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=_7}}S7.type=u7.bar3d,S7.mark=y7,S7.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},S7.transformerConstructor=_7;const A7=()=>{Fz.registerAnimation("bar3d",((t,e)=>({appear:$Y(t,e),enter:WY(t,!1),exit:GY(t,!1),disappear:GY(t)}))),x7(),fG(),dG(),Fz.registerSeries(S7.type,S7)};class k7 extends wN{layoutItems(t,e,i,s){this._layoutInit(t,e,i,s);const n={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(e,n);const r={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},a=e.filter((t=>"absolute"===t.layoutType)),o=a.filter((t=>"z"===t.layoutOrient));let l={width:0,height:0};o.length&&(l=o[0].getLayoutRect()),this.leftCurrent+=l.width/8,this.rightCurrent-=l.width/8,this.topCurrent+=l.height/8,this.bottomCurrent-=l.height/8;const{regionItems:h,relativeItems:c,relativeOverlapItems:d,allRelatives:u,overlapItems:p}=this._groupItems(e);this.layoutRegionItems(h,c,d,p,n),this._processAutoIndent(h,c,d,p,u,r,n);const g=a.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(g);const f=c.filter((t=>"axes"===t.model.specKey&&BU(t.layoutOrient)))[0],m=c.filter((t=>"axes"===t.model.specKey&&EU(t.layoutOrient)))[0];if(f&&o.length){const t=f.getLayoutStartPoint(),e=f.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};o[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const s=f.getLayoutRect(),n=m.getLayoutRect(),r={length:o[0].getLayoutRect().width,width:s.width,height:n.height};f.model.setLayout3dBox&&f.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),o[0].model.setLayout3dBox&&o[0].model.setLayout3dBox(r),this.layoutZAxisItems(o,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}k7.type="layout3d";const C7=()=>{Fz.registerLayout(k7.type,k7)};let M7=class extends rK{constructor(){super(...arguments),this.transformerConstructor=h7,this.type="bar3d",this.seriesType=u7.bar3d}};M7.type="bar3d",M7.seriesType=u7.bar3d,M7.transformerConstructor=h7;const w7=()=>{v7(),C7(),A7(),Fz.registerChart(M7.type,M7)},T7=Object.assign(Object.assign({},iU),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class B7 extends JJ{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class E7 extends $J{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=E7.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}E7.type="pyramid3d";const P7=Hz(!0);class O7 extends QJ{constructor(){super(...arguments),this.type=u7.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=B7}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},O7.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},O7.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(O7.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(O7.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",hN.Series)}initLabelMarkStyle(t){var e,i;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",hN.Series),this._labelMark=t,null===(e=this._funnelOuterLabelMark)||void 0===e||e.label,null===(i=this._funnelOuterLabelMark)||void 0===i||i.line}}O7.type=u7.funnel3d,O7.mark=T7,O7.builtInTheme={funnel3d:P7},O7.transformerConstructor=B7;const I7=()=>{Fz.registerMark(E7.type,E7),kT(),mT(),pV(),Fz.registerGraphicComponent("pyramid3d",Xf),z$(),$K(),Fz.registerSeries(O7.type,O7)};let R7=class extends UG{constructor(){super(...arguments),this.transformerConstructor=W1,this.type="funnel3d",this.seriesType=u7.funnel3d}};R7.type="funnel3d",R7.seriesType=u7.funnel3d,R7.transformerConstructor=W1;const D7=()=>{MY(),v7(),C7(),I7(),Fz.registerChart(R7.type,R7)};let L7=class extends B1{constructor(){super(...arguments),this.transformerConstructor=E1,this.type="histogram3d",this.seriesType=u7.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};L7.type="histogram3d",L7.seriesType=u7.bar3d,L7.transformerConstructor=E1;const F7=()=>{TY(),kY(),MY(),eY(),tY(),v7(),C7(),A7(),Fz.registerChart(L7.type,L7)};class z7 extends c1{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class j7 extends hX{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=j7.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}j7.type="arc3d";const H7=Object.assign(Object.assign({},iU),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class N7 extends pX{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class V7 extends vX{constructor(){super(...arguments),this.type=u7.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=N7}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",hN.Series)}initLabelMarkStyle(t,e={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,hN.Mark))}}V7.type=u7.pie3d,V7.mark=H7,V7.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},V7.transformerConstructor=N7;const U7=()=>{Fz.registerAnimation("pie3d",((t,e)=>({appear:lX(t,e),enter:rX(t),exit:aX(t),disappear:oX(t)}))),dV(),kT(),Jw(),Fz.registerGraphicComponent("arc3d",Nf),Fz.registerMark("arc3d",j7),Fz.registerSeries(V7.type,V7)};let W7=class extends d1{constructor(){super(...arguments),this.transformerConstructor=z7,this.type="pie3d",this.seriesType=u7.pie3d}};W7.type="pie3d",W7.seriesType=u7.pie3d,W7.transformerConstructor=z7;const G7=()=>{MY(),v7(),C7(),U7(),Fz.registerChart(W7.type,W7)},Y7=t=>({custom:WP,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class K7 extends Lq{constructor(){super(...arguments),this.type=u7.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(Lq.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",hN.Series)}initAnimation(){var t,e;const i=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("wordCloud3d"))||void 0===e?void 0:e((()=>{var t;const e=this.getCompiler().getStage(),s=e.width-i.left||0-i.right||0,n=e.height-i.top||0-i.bottom||0,r=Math.max(s,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),dU("word",this._spec,this._markAttributeContext)))}}K7.type=u7.wordCloud3d,K7.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const $7=()=>{z$(),Fz.registerAnimation("wordCloud3d",(t=>({appear:Y7(t)}))),Fz.registerSeries(K7.type,K7)};class X7 extends j1{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}let q7=class extends H1{constructor(){super(...arguments),this.transformerConstructor=X7,this.type="wordCloud3d",this.seriesType=u7.wordCloud3d}};q7.type="wordCloud3d",q7.seriesType=u7.wordCloud3d,q7.transformerConstructor=X7;const Z7=()=>{v7(),$7(),Fz.registerChart(q7.type,q7)},J7={label:{space:0}};class Q7{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,e){const i=PU(this._orient),s=BU(this._orient),n=EU(this._orient);let r=0,a=0;if(!e){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}r=Math.abs(n-i),a=Math.abs(s-e)}let o=0,l=0;const{width:h,height:c}=this.getLayoutRect();let d={x:0,y:0};s?(d={x:h,y:0},o=r,l=h):n&&(d={x:0,y:c},o=a,l=c);const u=this.layout3dBox?this.layout3dBox.length:0;if(!i){const e=this.getLabelItems(l);return t.grid={length:o},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(s),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:d,items:e[0],depth:u,length:o},t}return((t,e)=>{var i;const s=KW(t.getRegions()),{width:n}=t.getLayoutRect(),r=n,a=t.layout3dBox?t.layout3dBox.length:0,o=t.layout3dBox?t.layout3dBox.width:0,l={x:a,y:0},h=t.getLabelItems(r),c={start:{x:0,y:0},end:l,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:h,scale:t._scale.clone()},d=null!==(i=t.directionStr)&&void 0!==i?i:"r2l";let u=[0,0],p=-Math.PI/2,g=0;return"l2r"===d&&(g=t.layout3dBox.length,u=[0,0,0],p=Math.PI/2),c.z=g,c.alpha=p,c.anchor3d=u,e||(c.grid={type:"line",start:{x:0,y:0},end:l,items:h[0],verticalFactor:t._axisStyle.verticalFactor,depth:o,length:e?0:s.height,alpha:p,z:g,anchor3d:u}),c})(this,e)}}const t6=Object.assign(Object.assign({},y7),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class e6 extends Y${constructor(){super(...arguments),this.type=u7.rangeColumn3d,this._barMarkType="rect3d",this._barName=u7.bar3d}}e6.type=u7.rangeColumn3d,e6.mark=t6;const i6=()=>{x7(),fG(),dG(),Fz.registerSeries(e6.type,e6)};class s6 extends KG{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}let n6=class extends UG{constructor(){super(...arguments),this.transformerConstructor=s6,this.type="rangeColumn3d",this.seriesType=u7.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};n6.type="rangeColumn3d",n6.seriesType=u7.rangeColumn3d,n6.transformerConstructor=s6;const r6=()=>{kY(),MY(),eY(),tY(),v7(),C7(),i6(),Fz.registerChart(n6.type,n6)},a6="pictogram",o6="pictogram";var l6;!function(t){t.pictogram="pictogram"}(l6||(l6={}));const h6=Object.assign(Object.assign({},iU),{pictogram:{name:"pictogram",type:"group"}});class c6 extends YG{_isValidSeries(t){return t===o6}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const d6=new Map;let u6;function p6(t,e){d6.has(t)&&qA(`svg source key of '${t}' already exists, will be overwritten.`),u6||(u6=new io,lH(u6,"svg",Ka));const i=new so(u6);i.parse(e,{type:"svg"}),d6.set(t,i)}function g6(t){d6.has(t)?d6.delete(t):qA(`map type of '${t}' does not exists.`)}class f6 extends WV{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const m6="element-highlight-by-graphic-name";class v6 extends bV{constructor(){super(...arguments),this.type=m6,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)&&(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t))){const e=this._parseTargetKey(t);this.start(e)}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(u(t))return;const{interaction:e,highlightState:i,blurState:s}=this.options,n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,n,i,s),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}v6.type=m6;const y6="element-select-by-graphic-name";class _6 extends SV{constructor(){super(...arguments),this.type=y6}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}_6.type=y6;function b6(t){var e;return p(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const x6=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&b6(i)?1:0},S6=(t,e)=>{var i;const s=null!==(i=t.fill)&&void 0!==i?i:e;return s&&b6(s)?s:void 0},A6=(t,e)=>{var i;const s=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!s||!b6(s))&&s},k6=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:S6(t),lineWidth:x6(t),stroke:A6(t)}),C6={group:t=>{const e=k6(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},k6(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},k6(t)),{fill:S6(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},k6(t)),{fill:S6(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},k6(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},k6(t)),{path:t.d,fillStrokeOrder:!1,fill:S6(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},k6(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:S6(t,"#000")})},text:(t,e)=>{var i,s;return Object.assign(Object.assign({},k6(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(s=t.textAnchor)&&void 0!==s?s:"middle",anchor:[0,0],fill:S6(t,"#000")})}},M6=t=>{var e,i;if(!t||!t[0])return{};const{elements:s}=t[0].latestData;if(s&&s.length){s.forEach(((t,e)=>{var i;t[lj]=e,t._uniqueId=`${t.id}-${e}`,t.data=void 0;const{graphicType:s,transform:n}=t,r={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?j(r,t._inheritStyle,null===(i=t.parent)||void 0===i?void 0:i._textGroupStyle,t.attributes):"group"!==t.graphicType&&j(r,t._inheritStyle,t.attributes),C6[s]?t._finalAttributes=C6[s](r,t.value):t._finalAttributes=r,n&&(t._finalAttributes.postMatrix=Object.assign({},n))}));const t=s.filter((t=>"text"===t.tagName));for(let n=0;n<t.length;n++){const r=t[n]._uniqueId,a=s.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===r){e=!0;break}i=i.parent}return e}));if(a&&a.length){const s=null!==(i=null===(e=t[n]._textGroupStyle)||void 0===e?void 0:e.x)&&void 0!==i?i:0;let r=s;for(let t=0;t<a.length;t++){const e=a[t];if("group"===e.graphicType)r=s;else if(e.value&&void 0===e.parent._textGroupStyle.x){const i=a.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));i&&(r+=nj(i.value,i._finalAttributes).width),e._finalAttributes.x=r}}}}}return s};class w6 extends xK{constructor(){super(...arguments),this.type=o6,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=function(t){return d6.get(t)}(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:BN.STATE_HOVER_REVERSE,highlightState:BN.STATE_HOVER}}_defaultSelectConfig(t){const e="multiple"===t.mode,i=p(t.triggerOff)?t.triggerOff:e?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:i,reverseState:BN.STATE_SELECTED_REVERSE,state:BN.STATE_SELECTED,isMultiple:e}}initMark(){var t;if(this._pictogramMark=this._createMark(w6.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:gU(this._spec,w6.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(w6.mark.pictogram.name);for(const e of this._mapViewData.getDataView().latestData){const{graphicType:i,name:s,parent:n,id:r,_nameFromParent:a,_uniqueId:o}=e,l=this._createMark({type:i,name:null!=s?s:a},{groupKey:o,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==n?void 0:n._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:gU(this._spec,w6.mark.pictogram.name)});l&&(l.setData(this._mapViewData),l.setUserId(o),this._idToMark.set(o,l),"group"!==l.type&&l.setMarkConfig({graphicName:l.name}),l.setTransform([{type:"filter",callback:t=>t._uniqueId===o}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(w6.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},BN.STATE_NORMAL,hN.Series)}initMarkStyle(){const{root:t,viewBoxRect:e}=this._parsedSvgResult,i=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,C6.group(t.attributes),"normal",hN.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",hN.Built_In),e&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[Xg(Object.assign(Object.assign({},e),{fill:!0}))]}));for(const t of i){const{_uniqueId:e,_finalAttributes:i}=t,s=this._idToMark.get(e),n=this._validElement(t);s&&(this.setMarkStyle(s,{keepStrokeScale:!0},"normal",hN.Built_In),n?(this.initMarkStyleWithSpec(s,j({},this._spec.pictogram,this._spec[s.name])),this.setMarkStyle(s,i,"normal",hN.Series),s.setPostProcess("fill",((t,e)=>p(t)?t:this._spec.defaultFillColor))):(s.setMarkConfig({interactive:!1}),this.setMarkStyle(s,i,"normal",hN.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new f6(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const s=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!s||0===s.length)return null;let n=new Ke;e?s.forEach((t=>{n=n.union(t.getGraphics()[0].globalAABBBounds)})):s.forEach((t=>{n=n.union(t.getProduct().AABBBounds)}));const r={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,s=this.getRootMatrix();if(!s)return null;const n={};return s.getInverse().transformPoint({x:e,y:i},n),n}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,e;super.initData();const i=d6.get(this.svg);i||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new so(this._dataSet,{name:`pictogram_${this.id}_data`});oH(this._dataSet,"pictogram",M6),oH(this._dataSet,"lookup",DV),s.parse([i],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(e=this._data)||void 0===e||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new FN(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,s=e/2,n=this.getPictogramRootGraphic();if(n){const r=n.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=n.AABBBounds,c=(a+o)/2,d=(l+h)/2,u=t/r.width(),p=e/r.height(),g=Math.min(u,p);n.scale(g,g,{x:c,y:d}),n.translate(i-c,s-d)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(tH.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new qe}),s.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new qe}),i.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}w6.type=o6,w6.mark=h6,w6.transformerConstructor=class extends yU{_getDefaultSpecFromChart(t){var e,i,s;const n=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(s=null===(i=d6.get(r))||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.elements;return a&&a.length&&a.map((t=>t.name)).filter((t=>p(t))).forEach((e=>{t[e]&&(n[e]=t[e])})),n}};const T6=()=>{Fz.registerSeries(w6.type,w6),Fz.registerImplement("registerSVG",p6),Fz.registerImplement("unregisterSVG",g6),Fz.registerInteractionTrigger(v6.type,v6),Fz.registerInteractionTrigger(_6.type,_6)};let B6=class extends UG{constructor(){super(...arguments),this.transformerConstructor=c6,this.type=a6,this.seriesType=o6}};B6.type=o6,B6.seriesType=a6,B6.transformerConstructor=c6;const E6=()=>{MY(),T6(),Fz.registerChart(B6.type,B6)};function P6(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function O6(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function I6(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:O6(t.rect),anchorCandidates:j6(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>P6(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<n.anchorCandidates.length;t++){const e=n.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!s.some((t=>P6(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function R6(t,e,i){const s=t.map((t=>t.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=Re(s),l=i([(n+r)/2,(a+o)/2]);return l?I6(t.map((t=>{const s=t.rect,n=F6(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=xi(r,s,i);if(!F6(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],D6(L6(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=D6(L6(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=z6(t.rect,a,0),t}))):[]}function D6(t){return t>180?t-360:t}function L6(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function F6(t,e){for(let i=0;i<t.length;i++)if(bi(e,t[i]))return!0;return!1}function z6(t,e,i=0){const s=Object.assign({},t);return"top"===e?(s.x-=t.width/2,s.y-=i+t.height/2):"bottom"===e?(s.x-=t.width/2,s.y+=i-t.height/2):"left"===e?(s.x-=i+t.width,s.y-=t.height/2):"right"===e&&(s.x+=i,s.y-=t.height/2),s}function j6(t,e,i,s=0){const n=[];return t.forEach((t=>{const{x:r,y:a}=z6(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}const H6={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class N6 extends DW{_getDefaultSpecFromChart(){return H6}}class V6 extends jW{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=N6,this.layoutType="none",this.layoutZIndex=oN.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t.visible&&p(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),0!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const e=t.getViewData();if(e){const t=new so(this._option.dataSet,{name:`${this.name}_data`});t.parse([e],{type:"dataview"}),t.transform({type:"copyDataView",level:_H.copyDataView},!1),this._data=new FN(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const e=t.graphics[0];this._isRelativeSeries(e)&&this._updateDatum(Xj(e))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const e=t.graphics[0];this._isRelativeSeries(e)&&this._updateDatum(Xj(e))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const s=new $L({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s}))),this._markerComponents.forEach(((t,s)=>{const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,e){var i,s,n,r,a,o,l,h,c,d,u,g,f,m;let v=0,y=0,_=0,b=0,x=0;const S=this._spec.position||"top",A=this._spec.offset,k=Tz(null===(i=this._spec.background)||void 0===i?void 0:i.padding),C=this._spec.space||0;y+=((null==k?void 0:k.left)||0)+((null==k?void 0:k.right)||0),_+=((null==k?void 0:k.top)||0)+((null==k?void 0:k.bottom)||0);const M={},w=this.dataToPosition(t),T=tm.group({});if(T.name=`${this.name}_marker_itemContainer_${e}`,M.container=T,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=tm.rect($j(Object.assign({},this._spec.background.style)));t.setAttributes(w),M.labelBackground=t,T.appendChild(t)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const t=tm.symbol($j(Object.assign({},this._spec.icon.style)));t.setAttributes(w),t.setAttribute("symbolType",null!==(a=null===(r=this._spec.icon.style)||void 0===r?void 0:r.symbolType)&&void 0!==a?a:null===(o=this._spec.icon.style)||void 0===o?void 0:o.shape);const e=t.AABBBounds,i=null!==(l=(null==e?void 0:e.y2)-(null==e?void 0:e.y1))&&void 0!==l?l:0,s=null!==(h=(null==e?void 0:e.x2)-(null==e?void 0:e.x1))&&void 0!==h?h:0;M.icon=t,T.appendChild(t),x=i,b+=s,v++}if(null===(c=this._spec.nameLabel)||void 0===c?void 0:c.visible){const e=tm.text($j(Object.assign({},this._spec.nameLabel.style)));e.setAttributes(w),e.setAttribute("text",t[this.nameField]);const i=e.AABBBounds,s=null!==(d=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==d?d:0,n=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;M.nameLabel=e,T.appendChild(e),x=Math.max(x,s),b+=n,v++}if((null===(g=this._spec.valueLabel)||void 0===g?void 0:g.visible)&&p(t[this.valueField])){const e=tm.text($j(Object.assign({},this._spec.valueLabel.style)));e.setAttributes(w),e.setAttribute("text",t[this.valueField]);const i=e.AABBBounds,s=null!==(f=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==f?f:0,n=null!==(m=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==m?m:0;M.valueLabel=e,T.appendChild(e),x=Math.max(x,s),b+=n,v++}const B=Object.values(M).find((t=>!!t&&"group"!==t.type)),E={x:null==B?void 0:B.getComputedAttribute("x"),y:null==B?void 0:B.getComputedAttribute("y")},P={x:E.x,y:E.y,width:0,height:0};P.width=y+b+(v-1)*C,P.height=_+x;const O={rect:P,point:E,index:e};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));O.rect=z6(P,S,A),O.anchors=t,O.offset=A}else O.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:O,contentMarks:M}}_layoutMarkers(t,e){var i,s,n;for(let r=0;r<e.length;r++){if(!t[r]||!e[r])return;const{icon:a,nameLabel:o,valueLabel:l,labelBackground:h,container:c}=e[r],d=t[r],u=Tz(null===(i=this._spec.background)||void 0===i?void 0:i.padding),p=this._spec.space||0,g=d.height/2;let f=(null==u?void 0:u.left)||0;[a,o,l].forEach(((t,e)=>{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:f+r,y:g}),f+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(f+=p)}})),null==h||h.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==c||c.setAttributes({dx:-d.width/2,dy:-d.height/2});const m=this._data.getLatestData()[r],v=this.dataToPosition(m),y=this.getRegions()[0].getLayoutStartPoint(),_=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(a||o||l));this._markerComponents[r].setAttributes({x:y.x,y:y.y,position:v,visible:this._activeDatum.includes(m),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>c,autoRotate:!1,offsetX:d.x+d.width/2-v.x,offsetY:d.y+d.height/2-v.y},itemLine:{visible:_,type:"type-po",lineStyle:$j(Object.assign({},null===(n=this._spec.leader)||void 0===n?void 0:n.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?R6(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):I6(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}V6.type="mapLabel",V6.specKey="mapLabel",V6.transformerConstructor=N6;const U6=r7("Bar3dChart",{type:"bar3d",vchartConstructor:BV},[w7,l4,d4,...a7]),W6=r7("BoxPlotChart",{type:"boxPlot",vchartConstructor:BV},[p2,l4,...a7]),G6=[gV,HA,s3,q4,I2,K2,M4,k8,U5],Y6=r7("CirclePackingChart",{type:"circlePacking",vchartConstructor:BV},[n2,l4,...G6]),K6=[gV,HA,s3,q4,DX,FX,f3,A4,K2,O3,I2,M4,k8,D3,U5],$6=r7("CircularProgressChart",{type:"circularProgress",vchartConstructor:BV},[D1,l4,N3,...K6]),X6=r7("CommonChart",{type:"common",vchartConstructor:BV},[gV,HA,s3,q4,A1,dG,fG,vG,_G,p3,l4,d4,jY,sK,LG,vK,_X]),q6=r7("CorrelationChart",{type:"correlation",vchartConstructor:BV},[C2,...G6]),Z6=r7("FunnelChart",{type:"funnel",vchartConstructor:BV},[Y1,l4,...G6]),J6=r7("Funnel3dChart",{type:"funnel3d",vchartConstructor:BV},[D7,l4,...G6]),Q6=r7("GaugeChart",{type:"gauge",vchartConstructor:BV},[z1,...G6]),t9=r7("HeatmapChart",{type:"heatmap",vchartConstructor:BV},[S2,l4,...a7]),e9=r7("Histogram3dChart",{type:"histogram3d",vchartConstructor:BV},[F7,l4,...a7]),i9=r7("HistogramChart",{type:"histogram",vchartConstructor:BV},[O1,l4,...a7]),s9=r7("LinearProgressChart",{type:"linearProgress",vchartConstructor:BV},[X1,l4,...a7]),n9=r7("LineChart",{type:"line",vchartConstructor:BV},[EY,l4,...a7]),r9=r7("LiquidChart",{type:"liquid",vchartConstructor:BV},[w8,N3,...G6]),a9=r7("MapChart",{type:"map",vchartConstructor:BV},[a1,l4,...G6]),o9=r7("MosaicChart",{type:"mosaic",vchartConstructor:BV},[I8,l4,d4,...a7]),l9=r7("PictogramChart",{type:"pictogram",vchartConstructor:BV},[E6,l4,...G6]),h9=r7("PieChart",{type:"pie",vchartConstructor:BV},[p1,l4,N3,...G6]),c9=r7("Pie3dChart",{type:"pie3d",vchartConstructor:BV},[G7,l4,N3,...G6]),d9=r7("RadarChart",{type:"radar",vchartConstructor:BV},[b1,l4,...K6]),u9=r7("RangeAreaChart",{type:"rangeArea",vchartConstructor:BV},[_2,l4,...a7]),p9=r7("RangeColumnChart",{type:"rangeColumn",vchartConstructor:BV},[J1,l4,...a7]),g9=r7("RangeColumn3dChart",{type:"rangeColumn3d",vchartConstructor:BV},[r6,l4,...a7]),f9=r7("RoseChart",{type:"rose",vchartConstructor:BV},[v1,l4,...K6]),m9=r7("SankeyChart",{type:"sankey",vchartConstructor:BV},[m2,l4,...G6]),v9=r7("ScatterChart",{type:"scatter",vchartConstructor:BV},[bK,l4,...a7]),y9=r7("SequenceChart",{type:"sequence",vchartConstructor:BV},[w1,...a7]),_9=r7("SunburstChart",{type:"sunburst",vchartConstructor:BV},[e2,l4,...G6]),b9=r7("TreemapChart",{type:"treemap",vchartConstructor:BV},[o2,l4,...G6]),x9=r7("WordCloudChart",{type:"wordCloud",vchartConstructor:BV},[V1,...G6]),S9=r7("WordCloud3dChart",{type:"wordCloud3d",vchartConstructor:BV},[Z7,...G6]),A9=r7("VennChart",{type:"venn",vchartConstructor:BV},[E8,l4,...G6]),k9=r7("WaterfallChart",{type:"waterfall",vchartConstructor:BV},[c2,l4,d4,...a7]),C9=(t,i,s,n)=>{n&&n.length&&BV.useRegisters(n);const r=q8.concat(["updateId","componentId"]),a=t=>{var s;const n=e.useContext(L8),r=null!==(s=t.id)&&void 0!==s?s:t.componentId,a=e.useRef({}),o=e=>{const s=i.map((t=>`${r}-${t}`));(null==e?void 0:e.mark)&&s.includes(e.mark.getUserId())&&t[Z8[e.event.type]](e)},l=t=>{t&&n.chart&&(a.current&&Object.keys(a.current).forEach((t=>{n.chart.off(V8[t],a.current[t]),a.current[t]=null})),t&&Object.keys(t).forEach((t=>{var e;(null===(e=a.current)||void 0===e?void 0:e[t])||(n.chart.on(V8[t],o),a.current||(a.current={}),a.current[t]=o)})))};return l(J8(t)),e.useEffect((()=>()=>{l({}),a.current={}}),[]),null};return a.displayName=t,a.parseSpec=t=>{var e;const n=H(t,r);var a,o;return a=n,o=null!==(e=t.id)&&void 0!==e?e:t.componentId,i.forEach((t=>{const e=`${o}-${t}`;u(a[t])?a[t]={id:e}:u(a[t].id)&&(a[t].id=e)})),u(s)||(n.type=s),{spec:n,specName:"series"}},a},M9=C9("Series",["bar","line","area"]),w9=C9("Area",["area"],"area",[jY]),T9=C9("Bar",["bar"],"bar",[sK]),B9=C9("Bar3d",["bar"],"bar3d",[A7]),E9=C9("BoxPlot",["boxPlot"],"boxPlot",[L$]),P9=C9("CirclePacking",["circlePacking","label"],"circlePacking",[kQ]),O9=C9("CircularProgress",["circularProgress"],"circularProgress",[yq]),I9=C9("Correlation",["centerPoint","ripplePoint","centerLabel","nodePoint","label"],"correlation",[C2]),R9=C9("Dot",["dot"],"dot",[iq]),D9=C9("Funnel",["funnel"],"funnel",[tQ]),L9=C9("Funnel3d",["funnel"],"funnel3d",[I7]),F9=C9("Gauge",["segment","track","label"],"gauge",[c0]),z9=C9("GaugePointer",["pinBackground","pin","pointer"],"gaugePointer",[o0]),j9=C9("Heatmap",["cell","cellBackground","label"],"heatmap",[y0]),H9=C9("Line",["line"],"line",[LG]),N9=C9("LinearProgress",["linearProgress"],"linearProgress",[wq]),V9=C9("Link",["link"],"link",[oq]),U9=C9("Liquid",["node","link"],"liquid",[G0]),W9=C9("Map",["map"],"map",[FK]),G9=C9("Mosaic",["mosaic"],"mosaic",[s1]),Y9=C9("Pictogram",["pictogram"],"pictogram",[T6]),K9=C9("Pie",["pie"],"pie",[_X]),$9=C9("Pie3d",["pie"],"pie3d",[U7]),X9=C9("Radar",["radar"],"radar",[$X]),q9=C9("RangeArea",["rangeArea"],"rangeArea",[Z$]),Z9=C9("RangeColumn",["rangeColumn"],"rangeColumn",[K$]),J9=C9("RangeColumn3d",["rangeColumn"],"rangeColumn3d",[i6]),Q9=C9("Rose",["rose"],"rose",[jX]),ttt=C9("Sankey",["node","link"],"sankey",[UQ]),ett=C9("Scatter",["scatter"],"scatter",[vK]),itt=C9("Sunburst",["sunburst","label"],"sunburst",[yQ]),stt=C9("Treemap",["leaf","nonLeaf","label","nonLeafLabel"],"treemap",[ZQ]),ntt=C9("Venn",["circle","overlap","overlapLabel"],"venn",[e1]),rtt=C9("Waterfall",["leaderLine","stackLabel","label","bar"],"waterfall",[p$]),att=C9("WordCloud",["wordCloud"],"wordCloud",[IJ]),ott=C9("WordCloud3d",["wordCloud"],"wordCloud3d",[$7]),ltt=(t,i,s,n,r)=>{r&&r.length&&BV.useRegisters(r);const a=["updateId","componentId","children"],o=s?Object.keys(s).concat(a):a,l=t=>{const i=e.useContext(L8),n=e.useRef(null),r=e.useRef(t.updateId);if(t.updateId!==r.current){r.current=t.updateId;!!s&&Q8(i.chart,t,n.current,s)&&(n.current=t)}return e.useEffect((()=>()=>{s&&Q8(i.chart,null,n.current,s)}),[]),null};return l.displayName=t,l.parseSpec=t=>({spec:H(t,o),specName:i,isSingle:n}),l},htt=ltt("Axis","axes"),ctt=ltt("Mark","customMark",null,!1,[M4,k8]),dtt=ltt("Region","region"),utt=ltt("Legend","legends",U8,!1,[I2]),ptt=ltt("Brush","brush",W8,!0,[A4]),gtt=ltt("Crosshair","crosshair"),ftt=ltt("DataZoom","dataZoom",G8,!1,[O3]),mtt=ltt("MarkLine","markLine",null,!1,[j5]),vtt=ltt("MarkArea","markArea",null,!1,[K5]),ytt=ltt("MarkPoint","markPoint",null,!1,[m4]),_tt=ltt("ScrollBar","scrollBar",K8,!1,[D3]),btt=(t,i,s)=>{s&&s.length&&BV.useRegisters(s);const n=["updateId","componentId","children"],r=t=>{const i=e.useRef(t.updateId);return t.updateId!==i.current&&(i.current=t.updateId),null};return r.displayName=t,r.parseSpec=t=>{const s=H(t,n);return!t.tooltipRender&&t.children&&(s.tooltipRender=(i,s,n)=>e.Children.map(t.children,(t=>g(t)?e.cloneElement(t,{tooltipElement:i,actualTooltip:s,params:n}):t))),{spec:s,specName:i,isSingle:!0}},r},xtt=btt("Tooltip","tooltip",[s3,q4]),Stt=btt("CanvasTooltip","tooltip",[s3,i8]),Att=ltt("Player","player",Y8,!0,[i4]),ktt=ltt("Indicator","indicator",null,!0,[N3]),Ctt=ltt("Title","title",null,!0,[U5]),Mtt=ltt("ContinuousLegend","legends",U8,!1,[K2]),wtt=r7("VChart",{vchartConstructor:BV}),Ttt=r7("VChartSimple");t.Area=w9,t.AreaChart=o7,t.Axis=htt,t.Bar=T9,t.Bar3d=B9,t.Bar3dChart=U6,t.BarChart=l7,t.BoxPlot=E9,t.BoxPlotChart=W6,t.Brush=ptt,t.CanvasTooltip=Stt,t.CirclePacking=P9,t.CirclePackingChart=Y6,t.CircularProgress=O9,t.CircularProgressChart=$6,t.CommonChart=X6,t.ContinuousLegend=Mtt,t.Correlation=I9,t.CorrelationChart=q6,t.Crosshair=gtt,t.DataZoom=ftt,t.Dot=R9,t.Funnel=D9,t.Funnel3d=L9,t.Funnel3dChart=J6,t.FunnelChart=Z6,t.Gauge=F9,t.GaugeChart=Q6,t.GaugePointer=z9,t.Heatmap=j9,t.HeatmapChart=t9,t.Histogram3dChart=e9,t.HistogramChart=i9,t.Indicator=ktt,t.Legend=utt,t.Line=H9,t.LineChart=n9,t.LinearProgress=N9,t.LinearProgressChart=s9,t.Link=V9,t.Liquid=U9,t.LiquidChart=r9,t.Map=W9,t.MapChart=a9,t.Mark=ctt,t.MarkArea=vtt,t.MarkLine=mtt,t.MarkPoint=ytt,t.Mosaic=G9,t.MosaicChart=o9,t.Pictogram=Y9,t.PictogramChart=l9,t.Pie=K9,t.Pie3d=$9,t.Pie3dChart=c9,t.PieChart=h9,t.Player=Att,t.REACT_TOOLTIP_ClASS_NAME=t7,t.Radar=X9,t.RadarChart=d9,t.RangeArea=q9,t.RangeAreaChart=u9,t.RangeColumn=Z9,t.RangeColumn3d=J9,t.RangeColumn3dChart=g9,t.RangeColumnChart=p9,t.Region=dtt,t.Rose=Q9,t.RoseChart=f9,t.Sankey=ttt,t.SankeyChart=m9,t.Scatter=ett,t.ScatterChart=v9,t.ScrollBar=_tt,t.SequenceChart=y9,t.Series=M9,t.Sunburst=itt,t.SunburstChart=_9,t.Title=Ctt,t.Tooltip=xtt,t.Treemap=stt,t.TreemapChart=b9,t.VChart=wtt,t.VChartCore=BV,t.VChartSimple=Ttt,t.Venn=ntt,t.VennChart=A9,t.Waterfall=rtt,t.WaterfallChart=k9,t.WordCloud=att,t.WordCloud3d=ott,t.WordCloud3dChart=S9,t.WordCloudChart=x9,t.registerAreaChart=VY,t.registerAxis3dPlugin=()=>{v7(),C7(),(()=>{fG();const t=Fz.getComponentInKey(gG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},gG.builtInTheme.axisX),J7)}),G(t,Q7)})(),(()=>{dG();const t=Fz.getComponentInKey(cG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},cG.builtInTheme.axisX),J7)}),G(t,Q7)})(),(()=>{vG();const t=Fz.getComponentInKey(mG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),J7)}),G(t,Q7)})(),(()=>{_G();const t=Fz.getComponentInKey(bG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),J7)}),G(t,Q7)})(),(()=>{_G();const t=Fz.getComponentInKey(yG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},yG.builtInTheme.axisX),J7)}),G(t,Q7)})()},t.registerBar3dChart=w7,t.registerBarChart=aK,t.registerBoxplotChart=p2,t.registerBrush=A4,t.registerCartesianBandAxis=fG,t.registerCartesianCrossHair=p3,t.registerCartesianLinearAxis=dG,t.registerCartesianLogAxis=_G,t.registerCartesianSymlogAxis=xG,t.registerCartesianTimeAxis=vG,t.registerChartResizeZoomPlugin=()=>{s8(R8)},t.registerCirclePackingChart=n2,t.registerCircularProgressChart=D1,t.registerCommonChart=A1,t.registerContinuousLegend=K2,t.registerCorrelationChart=C2,t.registerCustomMark=M4,t.registerDataZoom=O3,t.registerDiscreteLegend=I2,t.registerFunnel3dChart=D7,t.registerFunnelChart=Y1,t.registerGaugeChart=z1,t.registerGeoCoordinate=RK,t.registerGeoMarkPoint=b4,t.registerHeatmapChart=S2,t.registerHistogram3dChart=F7,t.registerHistogramChart=O1,t.registerIndicator=N3,t.registerLabel=l4,t.registerLineChart=EY,t.registerLinearProgressChart=X1,t.registerLiquidChart=w8,t.registerMapChart=a1,t.registerMapLabel=t=>{const e=(null==t?void 0:t.VChart)||BV;e&&e.useComponent([V6])},t.registerMarkArea=K5,t.registerMarkLine=j5,t.registerMarkPoint=m4,t.registerMosaicChart=I8,t.registerPictogramChart=E6,t.registerPie3dChart=G7,t.registerPieChart=p1,t.registerPlayer=i4,t.registerPolarBandAxis=FX,t.registerPolarCrossHair=f3,t.registerPolarLinearAxis=DX,t.registerPolarMarkArea=X5,t.registerPolarMarkLine=N5,t.registerPolarMarkPoint=y4,t.registerPoptip=B4,t.registerRadarChart=b1,t.registerRangeAreaChart=_2,t.registerRangeColumn3dChart=r6,t.registerRangeColumnChart=J1,t.registerRoseChart=v1,t.registerSankeyChart=m2,t.registerScatterChart=bK,t.registerScrollBar=D3,t.registerSequenceChart=w1,t.registerSunburstChart=e2,t.registerTitle=U5,t.registerTooltip=s3,t.registerTotalLabel=d4,t.registerTreemapChart=o2,t.registerVennChart=E8,t.registerWaterfallChart=c2,t.registerWordCloud3dChart=Z7,t.registerWordCloudChart=V1,t.registerWordCloudShapeChart=U1,t.version="2.0.22"}));
24
+ function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i}(i,["className","style","width","height","id"]);return e.useLayoutEffect((()=>{o(!0)}),[]),e.createElement("div",{ref:r,id:null==u?void 0:u.toString(),className:l,style:Object.assign({position:"relative",height:d||"100%",width:c||"100%"},h)},a?e.createElement(t,Object.assign({ref:n,container:r.current},s?s(p):p)):e.createElement(e.Fragment,null))}));return n.displayName=i||t.name,n}const F8=e.createContext(null);F8.displayName="ChartContext";var z8,j8={exports:{}},H8={};j8.exports=function(){if(z8)return H8;z8=1;var t,e=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function f(t){if("object"==typeof t&&null!==t){var g=t.$$typeof;switch(g){case e:switch(t=t.type){case s:case r:case n:case c:case d:return t;default:switch(t=t&&t.$$typeof){case l:case o:case h:case p:case u:case a:return t;default:return g}}case i:return g}}}return t=Symbol.for("react.module.reference"),H8.ContextConsumer=o,H8.ContextProvider=a,H8.Element=e,H8.ForwardRef=h,H8.Fragment=s,H8.Lazy=p,H8.Memo=u,H8.Portal=i,H8.Profiler=r,H8.StrictMode=n,H8.Suspense=c,H8.SuspenseList=d,H8.isAsyncMode=function(){return!1},H8.isConcurrentMode=function(){return!1},H8.isContextConsumer=function(t){return f(t)===o},H8.isContextProvider=function(t){return f(t)===a},H8.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},H8.isForwardRef=function(t){return f(t)===h},H8.isFragment=function(t){return f(t)===s},H8.isLazy=function(t){return f(t)===p},H8.isMemo=function(t){return f(t)===u},H8.isPortal=function(t){return f(t)===i},H8.isProfiler=function(t){return f(t)===r},H8.isStrictMode=function(t){return f(t)===n},H8.isSuspense=function(t){return f(t)===c},H8.isSuspenseList=function(t){return f(t)===d},H8.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===r||e===n||e===c||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===h||e.$$typeof===t||void 0!==e.getModuleId)},H8.typeOf=f,H8}();var N8=j8.exports;const V8=t=>{let i=[];return e.Children.forEach(t,(t=>{u(t)||(N8.isFragment(t)?i=i.concat(V8(t.props.children)):i.push(t))})),i},U8={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},W8={onLegendItemHover:"legendItemHover",onLegendItemUnHover:"legendItemUnHover",onLegendItemClick:"legendItemClick",onLegendFilter:"legendFilter",onLegendSelectedDataChange:"legendSelectedDataChange"},G8={onBrushStart:"brushStart",onBrushChange:"brushChange",onBrushEnd:"brushEnd",onBrushClear:"brushClear"},Y8={onDataZoomChange:"dataZoomChange"},K8={onPlayerPlay:"playerPlay",onPlayerPause:"playerPause",onPlayerEnd:"playerEnd",onPlayerChange:"playerChange",onPlayerForward:"playerForward",onPlayerBackward:"playerBackward"},$8={onScrollBarChange:"scrollBarChange"},X8=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},W8),G8),K8),Y8),$8),{onDimensionHover:"dimensionHover",onDimensionClick:"dimensionClick"}),{onInitialized:"initialized",onRendered:"rendered",onRenderFinished:"renderFinished",onAnimationFinished:"animationFinished",onLayoutStart:"layoutStart",onLayoutEnd:"layoutEnd"}),{onDrill:"drill"}),U8),q8=Object.keys(X8).concat(Object.keys(U8).map((t=>`${t}Filter`))),Z8=Object.keys(U8),J8=Object.keys(U8).reduce(((t,e)=>(t[U8[e]]=e,t)),{}),Q8=(t,e=U8)=>{const i={};return Object.keys(t).forEach((s=>{e[s]&&t[s]&&(i[s]=t[s])})),i},t7=(t,e,i,s=U8)=>{if(!e&&!i||!t)return!1;const n=i?Q8(i,s):null,r=e?Q8(e,s):null;return n&&Object.keys(n).forEach((e=>{r&&r[e]&&r[e]===n[e]||t.off(s[e],n[e])})),r&&Object.keys(r).forEach((i=>{if(!n||!n[i]||n[i]!==r[i]){const n=e[`${i}Filter`];n?t.on(s[i],n,r[i]):t.on(s[i],r[i])}})),!0},e7=`${rj}_REACT_TOOLTIP`,i7=["children","hooks","ref",...q8,"vchartConstructor","vchartConstrouctor","useSyncRender","skipFunctionDiff","onError","onReady","spec","container","options","morphConfig"],s7={morph:!1,enableExitAnimation:!1},n7=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,r7=e.forwardRef(((t,s)=>{const[n,r]=e.useState(0),a=e.useRef({});e.useImperativeHandle(s,(()=>{var t;return null===(t=a.current)||void 0===t?void 0:t.chart}));const o=!!t.spec,l=e.useRef(!1),h=e.useRef(H(t,i7)),c=e.useRef(null),d=e.useRef(null),g=!!t.skipFunctionDiff,[f,m]=e.useState(null),v=t=>{let s;o&&t.spec?(s=t.spec,p(t.data)&&(s=Object.assign(Object.assign({},t.spec),{data:t.data}))):s=Object.assign(Object.assign({},h.current),c.current);const n=((t,s,n)=>{var r,a,o;const l=Object.assign({},null!=n?n:{});let h;if((null==n?void 0:n.tooltipRender)?(h=n.tooltipRender,delete l.tooltipRender):s.tooltipRender&&(h=s.tooltipRender),h){let c;if((null==n?void 0:n.reserveDefaultTooltip)?(c=n.reserveDefaultTooltip,delete l.reserveDefaultTooltip):c=s.reserveDefaultTooltip,!c){const t=Object.assign({},null!==(a=null===(r=l.style)||void 0===r?void 0:r.panel)&&void 0!==a?a:{});t.padding=0,t.border=Object.assign(Object.assign({},t.border),{radius:0}),t.backgroundColor="unset",l.style=Object.assign(Object.assign({},null!==(o=l.style)&&void 0!==o?o:{}),{panel:t})}return Object.assign(Object.assign({},l),{updateElement:(s,n,r)=>{const{changePositionOnly:a}=r;if(!a){if(!c){s.style.width="auto",s.style.height="auto",s.style.minHeight="auto";for(let t=0;t<s.children.length;t++){const e=s.children[t];e.className!==e7&&"none"!==e.style.display&&(e.style.display="none")}}t(i.createPortal(e.createElement("div",{className:e7},h(s,n,r)),s))}}})}return n})(m,t,s.tooltip);return n&&(s.tooltip=n),s},y=e=>{if(!l.current){if(!a.current||!a.current.chart)return;e&&t7(a.current.chart,t,d.current,X8),r(n+1),t.onReady&&t.onReady(a.current.chart,0===n)}};return e.useEffect((()=>{var e,i,s;const n=o?null:(t=>{const e={};return V8(t.children).map(((t,i)=>{const s=t&&t.type&&t.type.parseSpec;if(s&&t.props){const n=s(u(t.props.componentId)?Object.assign(Object.assign({},t.props),{componentId:n7(t,i)}):t.props);n.isSingle?e[n.specName]=n.spec:(e[n.specName]||(e[n.specName]=[]),e[n.specName].push(n.spec))}})),e})(t);if(!(null===(e=a.current)||void 0===e?void 0:e.chart))return o||(c.current=n),(t=>{var e;const i=new(null!==(e=t.vchartConstructor)&&void 0!==e?e:t.vchartConstrouctor)(v(t),Object.assign(Object.assign({},t.options),{onError:t.onError,autoFit:!0,dom:t.container}));a.current=Object.assign(Object.assign({},a.current),{chart:i}),l.current=!1})(t),a.current.chart&&(t7(a.current.chart,t,d.current,X8),a.current.chart.renderSync({reuse:!1}),y()),void(d.current=t);if(o)return void(U(d.current.spec,t.spec,{skipFunction:g})?d.current.data!==t.data&&(a.current.chart.updateFullDataSync(t.data),y(!0),d.current=t):(a.current.chart.updateSpecSync(v(t),void 0,null!==(i=t.morphConfig)&&void 0!==i?i:s7),y(!0),d.current=t));const r=H(t,i7);U(r,h.current,{skipFunction:g})&&U(n,c.current,{skipFunction:g})||(h.current=r,c.current=n,a.current.chart.updateSpecSync(v(t),void 0,null!==(s=t.morphConfig)&&void 0!==s?s:s7),y(!0),d.current=t)}),[t]),e.useEffect((()=>()=>{a&&a.current&&a.current.chart&&(a.current.chart.release(),a.current.chart=null),d.current=null,l.current=!0}),[]),e.createElement(F8.Provider,{value:a.current},V8(t.children).map(((t,i)=>{if("string"==typeof t)return null;const s=n7(t,i);return e.createElement(e.Fragment,{key:s},e.cloneElement(t,{updateId:n,componentId:s}))})),f)})),a7=(t,e,i)=>{i&&i.length&&e.vchartConstructor&&e.vchartConstructor.useRegisters(i);const s=L8(r7,t,(t=>e?Object.assign(t,e):t));return s.displayName=t,s},o7=[gV,HA,s3,Z4,dG,fG,vG,_G,p3,k4,K2,O3,I2,w4,C8,$5,H5,v4,D3,W5],l7=a7("AreaChart",{type:"area",vchartConstructor:BV},[VY,h4,u4,...o7]),h7=a7("BarChart",{type:"bar",vchartConstructor:BV},[aK,h4,u4,...o7]);class c7 extends nK{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var d7,u7,p7,g7,f7;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(d7||(d7={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(u7||(u7={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(p7||(p7={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(g7||(g7={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(f7||(f7={}));const m7=t=>t.zField||t.series&&t.series.some((t=>t.zField));class v7 extends cW{constructor(){super(v7.type),this.type="VChart3dPlugin"}onInit(t,e){var i;if(this._is3d=(t=>{return!!t&&("bar3d"===(e=t.type)||"funnel3d"===e||"histogram3d"===e||"pie3d"===e||"rangeColumn3d"===e||"wordCloud3d"===e||m7(t),!0);var e})(e),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&m7(e)&&(e.layout={type:"layout3d"})}}v7.pluginType="chart",v7.type="VChart3dPlugin";const y7=()=>{n8(v7),Nb(),Ub(),VA()},_7={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class b7 extends tK{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}class x7 extends KN{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=x7.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}x7.type="rect3d";const S7=()=>{Fz.registerMark(x7.type,x7),kT(),bT(),cV(),Fz.registerGraphicComponent("rect3d",Jg)};class A7 extends iK{constructor(){super(...arguments),this.type=p7.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=b7}}A7.type=p7.bar3d,A7.mark=_7,A7.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},A7.transformerConstructor=b7;const k7=()=>{Fz.registerAnimation("bar3d",((t,e)=>({appear:$Y(t,e),enter:WY(t,!1),exit:GY(t,!1),disappear:GY(t)}))),S7(),fG(),dG(),Fz.registerSeries(A7.type,A7)};class C7 extends wN{layoutItems(t,e,i,s){this._layoutInit(t,e,i,s);const n={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(e,n);const r={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},a=e.filter((t=>"absolute"===t.layoutType)),o=a.filter((t=>"z"===t.layoutOrient));let l={width:0,height:0};o.length&&(l=o[0].getLayoutRect()),this.leftCurrent+=l.width/8,this.rightCurrent-=l.width/8,this.topCurrent+=l.height/8,this.bottomCurrent-=l.height/8;const{regionItems:h,relativeItems:c,relativeOverlapItems:d,allRelatives:u,overlapItems:p}=this._groupItems(e);this.layoutRegionItems(h,c,d,p,n),this._processAutoIndent(h,c,d,p,u,r,n);const g=a.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(g);const f=c.filter((t=>"axes"===t.model.specKey&&BU(t.layoutOrient)))[0],m=c.filter((t=>"axes"===t.model.specKey&&EU(t.layoutOrient)))[0];if(f&&o.length){const t=f.getLayoutStartPoint(),e=f.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};o[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const s=f.getLayoutRect(),n=m.getLayoutRect(),r={length:o[0].getLayoutRect().width,width:s.width,height:n.height};f.model.setLayout3dBox&&f.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),o[0].model.setLayout3dBox&&o[0].model.setLayout3dBox(r),this.layoutZAxisItems(o,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}C7.type="layout3d";const M7=()=>{Fz.registerLayout(C7.type,C7)};let w7=class extends rK{constructor(){super(...arguments),this.transformerConstructor=c7,this.type="bar3d",this.seriesType=p7.bar3d}};w7.type="bar3d",w7.seriesType=p7.bar3d,w7.transformerConstructor=c7;const T7=()=>{y7(),M7(),k7(),Fz.registerChart(w7.type,w7)},B7=Object.assign(Object.assign({},iU),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class E7 extends JJ{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class P7 extends $J{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=P7.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}P7.type="pyramid3d";const O7=Hz(!0);class I7 extends QJ{constructor(){super(...arguments),this.type=p7.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=E7}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},I7.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},I7.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(I7.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(I7.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",hN.Series)}initLabelMarkStyle(t){var e,i;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",hN.Series),this._labelMark=t,null===(e=this._funnelOuterLabelMark)||void 0===e||e.label,null===(i=this._funnelOuterLabelMark)||void 0===i||i.line}}I7.type=p7.funnel3d,I7.mark=B7,I7.builtInTheme={funnel3d:O7},I7.transformerConstructor=E7;const R7=()=>{Fz.registerMark(P7.type,P7),kT(),mT(),pV(),Fz.registerGraphicComponent("pyramid3d",Xf),z$(),$K(),Fz.registerSeries(I7.type,I7)};let D7=class extends UG{constructor(){super(...arguments),this.transformerConstructor=W1,this.type="funnel3d",this.seriesType=p7.funnel3d}};D7.type="funnel3d",D7.seriesType=p7.funnel3d,D7.transformerConstructor=W1;const L7=()=>{MY(),y7(),M7(),R7(),Fz.registerChart(D7.type,D7)};let F7=class extends B1{constructor(){super(...arguments),this.transformerConstructor=E1,this.type="histogram3d",this.seriesType=p7.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};F7.type="histogram3d",F7.seriesType=p7.bar3d,F7.transformerConstructor=E1;const z7=()=>{TY(),kY(),MY(),eY(),tY(),y7(),M7(),k7(),Fz.registerChart(F7.type,F7)};class j7 extends c1{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class H7 extends hX{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=H7.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}H7.type="arc3d";const N7=Object.assign(Object.assign({},iU),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class V7 extends pX{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class U7 extends vX{constructor(){super(...arguments),this.type=p7.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=V7}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",hN.Series)}initLabelMarkStyle(t,e={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,hN.Mark))}}U7.type=p7.pie3d,U7.mark=N7,U7.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},U7.transformerConstructor=V7;const W7=()=>{Fz.registerAnimation("pie3d",((t,e)=>({appear:lX(t,e),enter:rX(t),exit:aX(t),disappear:oX(t)}))),dV(),kT(),Jw(),Fz.registerGraphicComponent("arc3d",Nf),Fz.registerMark("arc3d",H7),Fz.registerSeries(U7.type,U7)};let G7=class extends d1{constructor(){super(...arguments),this.transformerConstructor=j7,this.type="pie3d",this.seriesType=p7.pie3d}};G7.type="pie3d",G7.seriesType=p7.pie3d,G7.transformerConstructor=j7;const Y7=()=>{MY(),y7(),M7(),W7(),Fz.registerChart(G7.type,G7)},K7=t=>({custom:WP,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class $7 extends Lq{constructor(){super(...arguments),this.type=p7.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(Lq.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",hN.Series)}initAnimation(){var t,e;const i=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(cU(null===(e=Fz.getAnimationInKey("wordCloud3d"))||void 0===e?void 0:e((()=>{var t;const e=this.getCompiler().getStage(),s=e.width-i.left||0-i.right||0,n=e.height-i.top||0-i.bottom||0,r=Math.max(s,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),dU("word",this._spec,this._markAttributeContext)))}}$7.type=p7.wordCloud3d,$7.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const X7=()=>{z$(),Fz.registerAnimation("wordCloud3d",(t=>({appear:K7(t)}))),Fz.registerSeries($7.type,$7)};class q7 extends j1{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}let Z7=class extends H1{constructor(){super(...arguments),this.transformerConstructor=q7,this.type="wordCloud3d",this.seriesType=p7.wordCloud3d}};Z7.type="wordCloud3d",Z7.seriesType=p7.wordCloud3d,Z7.transformerConstructor=q7;const J7=()=>{y7(),X7(),Fz.registerChart(Z7.type,Z7)},Q7={label:{space:0}};class t6{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,e){const i=PU(this._orient),s=BU(this._orient),n=EU(this._orient);let r=0,a=0;if(!e){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}r=Math.abs(n-i),a=Math.abs(s-e)}let o=0,l=0;const{width:h,height:c}=this.getLayoutRect();let d={x:0,y:0};s?(d={x:h,y:0},o=r,l=h):n&&(d={x:0,y:c},o=a,l=c);const u=this.layout3dBox?this.layout3dBox.length:0;if(!i){const e=this.getLabelItems(l);return t.grid={length:o},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(s),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:d,items:e[0],depth:u,length:o},t}return((t,e)=>{var i;const s=KW(t.getRegions()),{width:n}=t.getLayoutRect(),r=n,a=t.layout3dBox?t.layout3dBox.length:0,o=t.layout3dBox?t.layout3dBox.width:0,l={x:a,y:0},h=t.getLabelItems(r),c={start:{x:0,y:0},end:l,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:h,scale:t._scale.clone()},d=null!==(i=t.directionStr)&&void 0!==i?i:"r2l";let u=[0,0],p=-Math.PI/2,g=0;return"l2r"===d&&(g=t.layout3dBox.length,u=[0,0,0],p=Math.PI/2),c.z=g,c.alpha=p,c.anchor3d=u,e||(c.grid={type:"line",start:{x:0,y:0},end:l,items:h[0],verticalFactor:t._axisStyle.verticalFactor,depth:o,length:e?0:s.height,alpha:p,z:g,anchor3d:u}),c})(this,e)}}const e6=Object.assign(Object.assign({},_7),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class i6 extends Y${constructor(){super(...arguments),this.type=p7.rangeColumn3d,this._barMarkType="rect3d",this._barName=p7.bar3d}}i6.type=p7.rangeColumn3d,i6.mark=e6;const s6=()=>{S7(),fG(),dG(),Fz.registerSeries(i6.type,i6)};class n6 extends KG{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}let r6=class extends UG{constructor(){super(...arguments),this.transformerConstructor=n6,this.type="rangeColumn3d",this.seriesType=p7.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=oY,this._modelOption.getDimensionInfoByValue=hY,this._modelOption.getRectByDimensionData=fY}};r6.type="rangeColumn3d",r6.seriesType=p7.rangeColumn3d,r6.transformerConstructor=n6;const a6=()=>{kY(),MY(),eY(),tY(),y7(),M7(),s6(),Fz.registerChart(r6.type,r6)},o6="pictogram",l6="pictogram";var h6;!function(t){t.pictogram="pictogram"}(h6||(h6={}));const c6=Object.assign(Object.assign({},iU),{pictogram:{name:"pictogram",type:"group"}});class d6 extends YG{_isValidSeries(t){return t===l6}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const u6=new Map;let p6;function g6(t,e){u6.has(t)&&qA(`svg source key of '${t}' already exists, will be overwritten.`),p6||(p6=new io,lH(p6,"svg",Ka));const i=new so(p6);i.parse(e,{type:"svg"}),u6.set(t,i)}function f6(t){u6.has(t)?u6.delete(t):qA(`map type of '${t}' does not exists.`)}class m6 extends WV{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const v6="element-highlight-by-graphic-name";class y6 extends bV{constructor(){super(...arguments),this.type=v6,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)&&(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t))){const e=this._parseTargetKey(t);this.start(e)}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(u(t))return;const{interaction:e,highlightState:i,blurState:s}=this.options,n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,n,i,s),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}y6.type=v6;const _6="element-select-by-graphic-name";class b6 extends SV{constructor(){super(...arguments),this.type=_6}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}b6.type=_6;function x6(t){var e;return p(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const S6=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&x6(i)?1:0},A6=(t,e)=>{var i;const s=null!==(i=t.fill)&&void 0!==i?i:e;return s&&x6(s)?s:void 0},k6=(t,e)=>{var i;const s=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!s||!x6(s))&&s},C6=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:A6(t),lineWidth:S6(t),stroke:k6(t)}),M6={group:t=>{const e=C6(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},C6(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},C6(t)),{fill:A6(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},C6(t)),{fill:A6(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},C6(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},C6(t)),{path:t.d,fillStrokeOrder:!1,fill:A6(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},C6(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:A6(t,"#000")})},text:(t,e)=>{var i,s;return Object.assign(Object.assign({},C6(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(s=t.textAnchor)&&void 0!==s?s:"middle",anchor:[0,0],fill:A6(t,"#000")})}},w6=t=>{var e,i;if(!t||!t[0])return{};const{elements:s}=t[0].latestData;if(s&&s.length){s.forEach(((t,e)=>{var i;t[lj]=e,t._uniqueId=`${t.id}-${e}`,t.data=void 0;const{graphicType:s,transform:n}=t,r={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?j(r,t._inheritStyle,null===(i=t.parent)||void 0===i?void 0:i._textGroupStyle,t.attributes):"group"!==t.graphicType&&j(r,t._inheritStyle,t.attributes),M6[s]?t._finalAttributes=M6[s](r,t.value):t._finalAttributes=r,n&&(t._finalAttributes.postMatrix=Object.assign({},n))}));const t=s.filter((t=>"text"===t.tagName));for(let n=0;n<t.length;n++){const r=t[n]._uniqueId,a=s.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===r){e=!0;break}i=i.parent}return e}));if(a&&a.length){const s=null!==(i=null===(e=t[n]._textGroupStyle)||void 0===e?void 0:e.x)&&void 0!==i?i:0;let r=s;for(let t=0;t<a.length;t++){const e=a[t];if("group"===e.graphicType)r=s;else if(e.value&&void 0===e.parent._textGroupStyle.x){const i=a.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));i&&(r+=nj(i.value,i._finalAttributes).width),e._finalAttributes.x=r}}}}}return s};class T6 extends xK{constructor(){super(...arguments),this.type=l6,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=function(t){return u6.get(t)}(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:BN.STATE_HOVER_REVERSE,highlightState:BN.STATE_HOVER}}_defaultSelectConfig(t){const e="multiple"===t.mode,i=p(t.triggerOff)?t.triggerOff:e?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:i,reverseState:BN.STATE_SELECTED_REVERSE,state:BN.STATE_SELECTED,isMultiple:e}}initMark(){var t;if(this._pictogramMark=this._createMark(T6.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:gU(this._spec,T6.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(T6.mark.pictogram.name);for(const e of this._mapViewData.getDataView().latestData){const{graphicType:i,name:s,parent:n,id:r,_nameFromParent:a,_uniqueId:o}=e,l=this._createMark({type:i,name:null!=s?s:a},{groupKey:o,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==n?void 0:n._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:gU(this._spec,T6.mark.pictogram.name)});l&&(l.setData(this._mapViewData),l.setUserId(o),this._idToMark.set(o,l),"group"!==l.type&&l.setMarkConfig({graphicName:l.name}),l.setTransform([{type:"filter",callback:t=>t._uniqueId===o}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(T6.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},BN.STATE_NORMAL,hN.Series)}initMarkStyle(){const{root:t,viewBoxRect:e}=this._parsedSvgResult,i=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,M6.group(t.attributes),"normal",hN.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",hN.Built_In),e&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[Xg(Object.assign(Object.assign({},e),{fill:!0}))]}));for(const t of i){const{_uniqueId:e,_finalAttributes:i}=t,s=this._idToMark.get(e),n=this._validElement(t);s&&(this.setMarkStyle(s,{keepStrokeScale:!0},"normal",hN.Built_In),n?(this.initMarkStyleWithSpec(s,j({},this._spec.pictogram,this._spec[s.name])),this.setMarkStyle(s,i,"normal",hN.Series),s.setPostProcess("fill",((t,e)=>p(t)?t:this._spec.defaultFillColor))):(s.setMarkConfig({interactive:!1}),this.setMarkStyle(s,i,"normal",hN.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new m6(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const s=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!s||0===s.length)return null;let n=new Ke;e?s.forEach((t=>{n=n.union(t.getGraphics()[0].globalAABBBounds)})):s.forEach((t=>{n=n.union(t.getProduct().AABBBounds)}));const r={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,s=this.getRootMatrix();if(!s)return null;const n={};return s.getInverse().transformPoint({x:e,y:i},n),n}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,e;super.initData();const i=u6.get(this.svg);i||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new so(this._dataSet,{name:`pictogram_${this.id}_data`});oH(this._dataSet,"pictogram",w6),oH(this._dataSet,"lookup",DV),s.parse([i],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(e=this._data)||void 0===e||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new FN(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,s=e/2,n=this.getPictogramRootGraphic();if(n){const r=n.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=n.AABBBounds,c=(a+o)/2,d=(l+h)/2,u=t/r.width(),p=e/r.height(),g=Math.min(u,p);n.scale(g,g,{x:c,y:d}),n.translate(i-c,s-d)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(tH.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new qe}),s.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new qe}),i.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}T6.type=l6,T6.mark=c6,T6.transformerConstructor=class extends yU{_getDefaultSpecFromChart(t){var e,i,s;const n=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(s=null===(i=u6.get(r))||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.elements;return a&&a.length&&a.map((t=>t.name)).filter((t=>p(t))).forEach((e=>{t[e]&&(n[e]=t[e])})),n}};const B6=()=>{Fz.registerSeries(T6.type,T6),Fz.registerImplement("registerSVG",g6),Fz.registerImplement("unregisterSVG",f6),Fz.registerInteractionTrigger(y6.type,y6),Fz.registerInteractionTrigger(b6.type,b6)};let E6=class extends UG{constructor(){super(...arguments),this.transformerConstructor=d6,this.type=o6,this.seriesType=l6}};E6.type=l6,E6.seriesType=o6,E6.transformerConstructor=d6;const P6=()=>{MY(),B6(),Fz.registerChart(E6.type,E6)};function O6(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function I6(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function R6(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:I6(t.rect),anchorCandidates:H6(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>O6(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<n.anchorCandidates.length;t++){const e=n.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!s.some((t=>O6(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function D6(t,e,i){const s=t.map((t=>t.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=Re(s),l=i([(n+r)/2,(a+o)/2]);return l?R6(t.map((t=>{const s=t.rect,n=z6(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=xi(r,s,i);if(!z6(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],L6(F6(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=L6(F6(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=j6(t.rect,a,0),t}))):[]}function L6(t){return t>180?t-360:t}function F6(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function z6(t,e){for(let i=0;i<t.length;i++)if(bi(e,t[i]))return!0;return!1}function j6(t,e,i=0){const s=Object.assign({},t);return"top"===e?(s.x-=t.width/2,s.y-=i+t.height/2):"bottom"===e?(s.x-=t.width/2,s.y+=i-t.height/2):"left"===e?(s.x-=i+t.width,s.y-=t.height/2):"right"===e&&(s.x+=i,s.y-=t.height/2),s}function H6(t,e,i,s=0){const n=[];return t.forEach((t=>{const{x:r,y:a}=j6(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}const N6={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class V6 extends DW{_getDefaultSpecFromChart(){return N6}}class U6 extends jW{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=V6,this.layoutType="none",this.layoutZIndex=oN.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return RV(t,this.specKey,this.type,(t=>t.visible&&p(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),0!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const e=t.getViewData();if(e){const t=new so(this._option.dataSet,{name:`${this.name}_data`});t.parse([e],{type:"dataview"}),t.transform({type:"copyDataView",level:_H.copyDataView},!1),this._data=new FN(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const e=t.graphics[0];this._isRelativeSeries(e)&&this._updateDatum(Xj(e))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const e=t.graphics[0];this._isRelativeSeries(e)&&this._updateDatum(Xj(e))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const s=new $L({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s}))),this._markerComponents.forEach(((t,s)=>{const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,e){var i,s,n,r,a,o,l,h,c,d,u,g,f,m;let v=0,y=0,_=0,b=0,x=0;const S=this._spec.position||"top",A=this._spec.offset,k=Tz(null===(i=this._spec.background)||void 0===i?void 0:i.padding),C=this._spec.space||0;y+=((null==k?void 0:k.left)||0)+((null==k?void 0:k.right)||0),_+=((null==k?void 0:k.top)||0)+((null==k?void 0:k.bottom)||0);const M={},w=this.dataToPosition(t),T=tm.group({});if(T.name=`${this.name}_marker_itemContainer_${e}`,M.container=T,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=tm.rect($j(Object.assign({},this._spec.background.style)));t.setAttributes(w),M.labelBackground=t,T.appendChild(t)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const t=tm.symbol($j(Object.assign({},this._spec.icon.style)));t.setAttributes(w),t.setAttribute("symbolType",null!==(a=null===(r=this._spec.icon.style)||void 0===r?void 0:r.symbolType)&&void 0!==a?a:null===(o=this._spec.icon.style)||void 0===o?void 0:o.shape);const e=t.AABBBounds,i=null!==(l=(null==e?void 0:e.y2)-(null==e?void 0:e.y1))&&void 0!==l?l:0,s=null!==(h=(null==e?void 0:e.x2)-(null==e?void 0:e.x1))&&void 0!==h?h:0;M.icon=t,T.appendChild(t),x=i,b+=s,v++}if(null===(c=this._spec.nameLabel)||void 0===c?void 0:c.visible){const e=tm.text($j(Object.assign({},this._spec.nameLabel.style)));e.setAttributes(w),e.setAttribute("text",t[this.nameField]);const i=e.AABBBounds,s=null!==(d=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==d?d:0,n=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;M.nameLabel=e,T.appendChild(e),x=Math.max(x,s),b+=n,v++}if((null===(g=this._spec.valueLabel)||void 0===g?void 0:g.visible)&&p(t[this.valueField])){const e=tm.text($j(Object.assign({},this._spec.valueLabel.style)));e.setAttributes(w),e.setAttribute("text",t[this.valueField]);const i=e.AABBBounds,s=null!==(f=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==f?f:0,n=null!==(m=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==m?m:0;M.valueLabel=e,T.appendChild(e),x=Math.max(x,s),b+=n,v++}const B=Object.values(M).find((t=>!!t&&"group"!==t.type)),E={x:null==B?void 0:B.getComputedAttribute("x"),y:null==B?void 0:B.getComputedAttribute("y")},P={x:E.x,y:E.y,width:0,height:0};P.width=y+b+(v-1)*C,P.height=_+x;const O={rect:P,point:E,index:e};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));O.rect=j6(P,S,A),O.anchors=t,O.offset=A}else O.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:O,contentMarks:M}}_layoutMarkers(t,e){var i,s,n;for(let r=0;r<e.length;r++){if(!t[r]||!e[r])return;const{icon:a,nameLabel:o,valueLabel:l,labelBackground:h,container:c}=e[r],d=t[r],u=Tz(null===(i=this._spec.background)||void 0===i?void 0:i.padding),p=this._spec.space||0,g=d.height/2;let f=(null==u?void 0:u.left)||0;[a,o,l].forEach(((t,e)=>{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:f+r,y:g}),f+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(f+=p)}})),null==h||h.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==c||c.setAttributes({dx:-d.width/2,dy:-d.height/2});const m=this._data.getLatestData()[r],v=this.dataToPosition(m),y=this.getRegions()[0].getLayoutStartPoint(),_=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(a||o||l));this._markerComponents[r].setAttributes({x:y.x,y:y.y,position:v,visible:this._activeDatum.includes(m),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>c,autoRotate:!1,offsetX:d.x+d.width/2-v.x,offsetY:d.y+d.height/2-v.y},itemLine:{visible:_,type:"type-po",lineStyle:$j(Object.assign({},null===(n=this._spec.leader)||void 0===n?void 0:n.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?D6(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):R6(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}U6.type="mapLabel",U6.specKey="mapLabel",U6.transformerConstructor=V6;const W6=a7("Bar3dChart",{type:"bar3d",vchartConstructor:BV},[T7,h4,u4,...o7]),G6=a7("BoxPlotChart",{type:"boxPlot",vchartConstructor:BV},[p2,h4,...o7]),Y6=[gV,HA,s3,Z4,I2,K2,w4,C8,W5],K6=a7("CirclePackingChart",{type:"circlePacking",vchartConstructor:BV},[n2,h4,...Y6]),$6=[gV,HA,s3,Z4,DX,FX,f3,k4,K2,O3,I2,w4,C8,D3,W5],X6=a7("CircularProgressChart",{type:"circularProgress",vchartConstructor:BV},[D1,h4,N3,...$6]),q6=a7("CommonChart",{type:"common",vchartConstructor:BV},[gV,HA,s3,Z4,A1,dG,fG,vG,_G,p3,h4,u4,jY,sK,LG,vK,_X]),Z6=a7("CorrelationChart",{type:"correlation",vchartConstructor:BV},[C2,...Y6]),J6=a7("FunnelChart",{type:"funnel",vchartConstructor:BV},[Y1,h4,...Y6]),Q6=a7("Funnel3dChart",{type:"funnel3d",vchartConstructor:BV},[L7,h4,...Y6]),t9=a7("GaugeChart",{type:"gauge",vchartConstructor:BV},[z1,...Y6]),e9=a7("HeatmapChart",{type:"heatmap",vchartConstructor:BV},[S2,h4,...o7]),i9=a7("Histogram3dChart",{type:"histogram3d",vchartConstructor:BV},[z7,h4,...o7]),s9=a7("HistogramChart",{type:"histogram",vchartConstructor:BV},[O1,h4,...o7]),n9=a7("LinearProgressChart",{type:"linearProgress",vchartConstructor:BV},[X1,h4,...o7]),r9=a7("LineChart",{type:"line",vchartConstructor:BV},[EY,h4,...o7]),a9=a7("LiquidChart",{type:"liquid",vchartConstructor:BV},[T8,N3,...Y6]),o9=a7("MapChart",{type:"map",vchartConstructor:BV},[a1,h4,...Y6]),l9=a7("MosaicChart",{type:"mosaic",vchartConstructor:BV},[R8,h4,u4,...o7]),h9=a7("PictogramChart",{type:"pictogram",vchartConstructor:BV},[P6,h4,...Y6]),c9=a7("PieChart",{type:"pie",vchartConstructor:BV},[p1,h4,N3,...Y6]),d9=a7("Pie3dChart",{type:"pie3d",vchartConstructor:BV},[Y7,h4,N3,...Y6]),u9=a7("RadarChart",{type:"radar",vchartConstructor:BV},[b1,h4,...$6]),p9=a7("RangeAreaChart",{type:"rangeArea",vchartConstructor:BV},[_2,h4,...o7]),g9=a7("RangeColumnChart",{type:"rangeColumn",vchartConstructor:BV},[J1,h4,...o7]),f9=a7("RangeColumn3dChart",{type:"rangeColumn3d",vchartConstructor:BV},[a6,h4,...o7]),m9=a7("RoseChart",{type:"rose",vchartConstructor:BV},[v1,h4,...$6]),v9=a7("SankeyChart",{type:"sankey",vchartConstructor:BV},[m2,h4,...Y6]),y9=a7("ScatterChart",{type:"scatter",vchartConstructor:BV},[bK,h4,...o7]),_9=a7("SequenceChart",{type:"sequence",vchartConstructor:BV},[w1,...o7]),b9=a7("SunburstChart",{type:"sunburst",vchartConstructor:BV},[e2,h4,...Y6]),x9=a7("TreemapChart",{type:"treemap",vchartConstructor:BV},[o2,h4,...Y6]),S9=a7("WordCloudChart",{type:"wordCloud",vchartConstructor:BV},[V1,...Y6]),A9=a7("WordCloud3dChart",{type:"wordCloud3d",vchartConstructor:BV},[J7,...Y6]),k9=a7("VennChart",{type:"venn",vchartConstructor:BV},[P8,h4,...Y6]),C9=a7("WaterfallChart",{type:"waterfall",vchartConstructor:BV},[c2,h4,u4,...o7]),M9=(t,i,s,n)=>{n&&n.length&&BV.useRegisters(n);const r=Z8.concat(["updateId","componentId"]),a=t=>{var s;const n=e.useContext(F8),r=null!==(s=t.id)&&void 0!==s?s:t.componentId,a=e.useRef({}),o=e=>{const s=i.map((t=>`${r}-${t}`));(null==e?void 0:e.mark)&&s.includes(e.mark.getUserId())&&t[J8[e.event.type]](e)},l=t=>{t&&n.chart&&(a.current&&Object.keys(a.current).forEach((t=>{n.chart.off(U8[t],a.current[t]),a.current[t]=null})),t&&Object.keys(t).forEach((t=>{var e;(null===(e=a.current)||void 0===e?void 0:e[t])||(n.chart.on(U8[t],o),a.current||(a.current={}),a.current[t]=o)})))};return l(Q8(t)),e.useEffect((()=>()=>{l({}),a.current={}}),[]),null};return a.displayName=t,a.parseSpec=t=>{var e;const n=H(t,r);var a,o;return a=n,o=null!==(e=t.id)&&void 0!==e?e:t.componentId,i.forEach((t=>{const e=`${o}-${t}`;u(a[t])?a[t]={id:e}:u(a[t].id)&&(a[t].id=e)})),u(s)||(n.type=s),{spec:n,specName:"series"}},a},w9=M9("Series",["bar","line","area"]),T9=M9("Area",["area"],"area",[jY]),B9=M9("Bar",["bar"],"bar",[sK]),E9=M9("Bar3d",["bar"],"bar3d",[k7]),P9=M9("BoxPlot",["boxPlot"],"boxPlot",[L$]),O9=M9("CirclePacking",["circlePacking","label"],"circlePacking",[kQ]),I9=M9("CircularProgress",["circularProgress"],"circularProgress",[yq]),R9=M9("Correlation",["centerPoint","ripplePoint","centerLabel","nodePoint","label"],"correlation",[C2]),D9=M9("Dot",["dot"],"dot",[iq]),L9=M9("Funnel",["funnel"],"funnel",[tQ]),F9=M9("Funnel3d",["funnel"],"funnel3d",[R7]),z9=M9("Gauge",["segment","track","label"],"gauge",[c0]),j9=M9("GaugePointer",["pinBackground","pin","pointer"],"gaugePointer",[o0]),H9=M9("Heatmap",["cell","cellBackground","label"],"heatmap",[y0]),N9=M9("Line",["line"],"line",[LG]),V9=M9("LinearProgress",["linearProgress"],"linearProgress",[wq]),U9=M9("Link",["link"],"link",[oq]),W9=M9("Liquid",["node","link"],"liquid",[G0]),G9=M9("Map",["map"],"map",[FK]),Y9=M9("Mosaic",["mosaic"],"mosaic",[s1]),K9=M9("Pictogram",["pictogram"],"pictogram",[B6]),$9=M9("Pie",["pie"],"pie",[_X]),X9=M9("Pie3d",["pie"],"pie3d",[W7]),q9=M9("Radar",["radar"],"radar",[$X]),Z9=M9("RangeArea",["rangeArea"],"rangeArea",[Z$]),J9=M9("RangeColumn",["rangeColumn"],"rangeColumn",[K$]),Q9=M9("RangeColumn3d",["rangeColumn"],"rangeColumn3d",[s6]),ttt=M9("Rose",["rose"],"rose",[jX]),ett=M9("Sankey",["node","link"],"sankey",[UQ]),itt=M9("Scatter",["scatter"],"scatter",[vK]),stt=M9("Sunburst",["sunburst","label"],"sunburst",[yQ]),ntt=M9("Treemap",["leaf","nonLeaf","label","nonLeafLabel"],"treemap",[ZQ]),rtt=M9("Venn",["circle","overlap","overlapLabel"],"venn",[e1]),att=M9("Waterfall",["leaderLine","stackLabel","label","bar"],"waterfall",[p$]),ott=M9("WordCloud",["wordCloud"],"wordCloud",[IJ]),ltt=M9("WordCloud3d",["wordCloud"],"wordCloud3d",[X7]),htt=(t,i,s,n,r)=>{r&&r.length&&BV.useRegisters(r);const a=["updateId","componentId","children"],o=s?Object.keys(s).concat(a):a,l=t=>{const i=e.useContext(F8),n=e.useRef(null),r=e.useRef(t.updateId);if(t.updateId!==r.current){r.current=t.updateId;!!s&&t7(i.chart,t,n.current,s)&&(n.current=t)}return e.useEffect((()=>()=>{s&&t7(i.chart,null,n.current,s)}),[]),null};return l.displayName=t,l.parseSpec=t=>({spec:H(t,o),specName:i,isSingle:n}),l},ctt=htt("Axis","axes"),dtt=htt("Mark","customMark",null,!1,[w4,C8]),utt=htt("Region","region"),ptt=htt("Legend","legends",W8,!1,[I2]),gtt=htt("Brush","brush",G8,!0,[k4]),ftt=htt("Crosshair","crosshair"),mtt=htt("DataZoom","dataZoom",Y8,!1,[O3]),vtt=htt("MarkLine","markLine",null,!1,[H5]),ytt=htt("MarkArea","markArea",null,!1,[$5]),_tt=htt("MarkPoint","markPoint",null,!1,[v4]),btt=htt("ScrollBar","scrollBar",$8,!1,[D3]),xtt=(t,i,s)=>{s&&s.length&&BV.useRegisters(s);const n=["updateId","componentId","children"],r=t=>{const i=e.useRef(t.updateId);return t.updateId!==i.current&&(i.current=t.updateId),null};return r.displayName=t,r.parseSpec=t=>{const s=H(t,n);return!t.tooltipRender&&t.children&&(s.tooltipRender=(i,s,n)=>e.Children.map(t.children,(t=>g(t)?e.cloneElement(t,{tooltipElement:i,actualTooltip:s,params:n}):t))),{spec:s,specName:i,isSingle:!0}},r},Stt=xtt("Tooltip","tooltip",[s3,Z4]),Att=xtt("CanvasTooltip","tooltip",[s3,s8]),ktt=htt("Player","player",K8,!0,[s4]),Ctt=htt("Indicator","indicator",null,!0,[N3]),Mtt=htt("Title","title",null,!0,[W5]),wtt=htt("ContinuousLegend","legends",W8,!1,[K2]),Ttt=a7("VChart",{vchartConstructor:BV}),Btt=a7("VChartSimple");t.Area=T9,t.AreaChart=l7,t.Axis=ctt,t.Bar=B9,t.Bar3d=E9,t.Bar3dChart=W6,t.BarChart=h7,t.BoxPlot=P9,t.BoxPlotChart=G6,t.Brush=gtt,t.CanvasTooltip=Att,t.CirclePacking=O9,t.CirclePackingChart=K6,t.CircularProgress=I9,t.CircularProgressChart=X6,t.CommonChart=q6,t.ContinuousLegend=wtt,t.Correlation=R9,t.CorrelationChart=Z6,t.Crosshair=ftt,t.DataZoom=mtt,t.Dot=D9,t.Funnel=L9,t.Funnel3d=F9,t.Funnel3dChart=Q6,t.FunnelChart=J6,t.Gauge=z9,t.GaugeChart=t9,t.GaugePointer=j9,t.Heatmap=H9,t.HeatmapChart=e9,t.Histogram3dChart=i9,t.HistogramChart=s9,t.Indicator=Ctt,t.Legend=ptt,t.Line=N9,t.LineChart=r9,t.LinearProgress=V9,t.LinearProgressChart=n9,t.Link=U9,t.Liquid=W9,t.LiquidChart=a9,t.Map=G9,t.MapChart=o9,t.Mark=dtt,t.MarkArea=ytt,t.MarkLine=vtt,t.MarkPoint=_tt,t.Mosaic=Y9,t.MosaicChart=l9,t.Pictogram=K9,t.PictogramChart=h9,t.Pie=$9,t.Pie3d=X9,t.Pie3dChart=d9,t.PieChart=c9,t.Player=ktt,t.REACT_TOOLTIP_ClASS_NAME=e7,t.Radar=q9,t.RadarChart=u9,t.RangeArea=Z9,t.RangeAreaChart=p9,t.RangeColumn=J9,t.RangeColumn3d=Q9,t.RangeColumn3dChart=f9,t.RangeColumnChart=g9,t.Region=utt,t.Rose=ttt,t.RoseChart=m9,t.Sankey=ett,t.SankeyChart=v9,t.Scatter=itt,t.ScatterChart=y9,t.ScrollBar=btt,t.SequenceChart=_9,t.Series=w9,t.Sunburst=stt,t.SunburstChart=b9,t.Title=Mtt,t.Tooltip=Stt,t.Treemap=ntt,t.TreemapChart=x9,t.VChart=Ttt,t.VChartCore=BV,t.VChartSimple=Btt,t.Venn=rtt,t.VennChart=k9,t.Waterfall=att,t.WaterfallChart=C9,t.WordCloud=ott,t.WordCloud3d=ltt,t.WordCloud3dChart=A9,t.WordCloudChart=S9,t.registerAreaChart=VY,t.registerAxis3dPlugin=()=>{y7(),M7(),(()=>{fG();const t=Fz.getComponentInKey(gG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},gG.builtInTheme.axisX),Q7)}),G(t,t6)})(),(()=>{dG();const t=Fz.getComponentInKey(cG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},cG.builtInTheme.axisX),Q7)}),G(t,t6)})(),(()=>{vG();const t=Fz.getComponentInKey(mG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),Q7)}),G(t,t6)})(),(()=>{_G();const t=Fz.getComponentInKey(bG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),Q7)}),G(t,t6)})(),(()=>{_G();const t=Fz.getComponentInKey(yG.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},yG.builtInTheme.axisX),Q7)}),G(t,t6)})()},t.registerBar3dChart=T7,t.registerBarChart=aK,t.registerBoxplotChart=p2,t.registerBrush=k4,t.registerCartesianBandAxis=fG,t.registerCartesianCrossHair=p3,t.registerCartesianLinearAxis=dG,t.registerCartesianLogAxis=_G,t.registerCartesianSymlogAxis=xG,t.registerCartesianTimeAxis=vG,t.registerChartResizeZoomPlugin=()=>{n8(D8)},t.registerCirclePackingChart=n2,t.registerCircularProgressChart=D1,t.registerCommonChart=A1,t.registerContinuousLegend=K2,t.registerCorrelationChart=C2,t.registerCustomMark=w4,t.registerDataZoom=O3,t.registerDiscreteLegend=I2,t.registerFunnel3dChart=L7,t.registerFunnelChart=Y1,t.registerGaugeChart=z1,t.registerGeoCoordinate=RK,t.registerGeoMarkPoint=x4,t.registerHeatmapChart=S2,t.registerHistogram3dChart=z7,t.registerHistogramChart=O1,t.registerIndicator=N3,t.registerLabel=h4,t.registerLineChart=EY,t.registerLinearProgressChart=X1,t.registerLiquidChart=T8,t.registerMapChart=a1,t.registerMapLabel=t=>{const e=(null==t?void 0:t.VChart)||BV;e&&e.useComponent([U6])},t.registerMarkArea=$5,t.registerMarkLine=H5,t.registerMarkPoint=v4,t.registerMosaicChart=R8,t.registerPictogramChart=P6,t.registerPie3dChart=Y7,t.registerPieChart=p1,t.registerPlayer=s4,t.registerPolarBandAxis=FX,t.registerPolarCrossHair=f3,t.registerPolarLinearAxis=DX,t.registerPolarMarkArea=q5,t.registerPolarMarkLine=V5,t.registerPolarMarkPoint=_4,t.registerPoptip=E4,t.registerRadarChart=b1,t.registerRangeAreaChart=_2,t.registerRangeColumn3dChart=a6,t.registerRangeColumnChart=J1,t.registerRoseChart=v1,t.registerSankeyChart=m2,t.registerScatterChart=bK,t.registerScrollBar=D3,t.registerSequenceChart=w1,t.registerSunburstChart=e2,t.registerTitle=W5,t.registerTooltip=s3,t.registerTotalLabel=u4,t.registerTreemapChart=o2,t.registerVennChart=P8,t.registerWaterfallChart=c2,t.registerWordCloud3dChart=J7,t.registerWordCloudChart=V1,t.registerWordCloudShapeChart=U1,t.version="2.0.22"}));