@visactor/vrender-components 0.14.1 → 0.14.2-alpha.0

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.
package/cjs/brush/type.js CHANGED
@@ -8,4 +8,5 @@ Object.defineProperty(exports, "__esModule", {
8
8
  IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
9
9
  IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
10
10
  IOperateType.brushClear = "brushClear";
11
- }(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
11
+ }(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
12
+ //# sourceMappingURL=type.js.map
package/cjs/core/type.js CHANGED
@@ -2,5 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- });
6
- //# sourceMappingURL=type.js.map
5
+ });
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.14.1";
1
+ export declare const version = "0.14.2-alpha.0";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "0.14.1", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.14.2-alpha.0", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./scrollbar"), exports), __exportStar(require("./tag"), exports),
22
22
  __exportStar(require("./poptip"), exports), __exportStar(require("./crosshair"), exports),
23
23
  __exportStar(require("./label"), exports), __exportStar(require("./axis"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.1\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.2-alpha.0\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
package/dist/index.js CHANGED
@@ -10581,7 +10581,7 @@
10581
10581
  }
10582
10582
  Tooltip.defaultAttributes = defaultAttributes;
10583
10583
 
10584
- const version = "0.14.1";
10584
+ const version = "0.14.2-alpha.0";
10585
10585
 
10586
10586
  exports.AbstractComponent = AbstractComponent;
10587
10587
  exports.ArcInfo = ArcInfo;
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vrender"),require("@visactor/vutils"),require("@visactor/vscale")):"function"==typeof define&&define.amd?define(["exports","@visactor/vrender","@visactor/vutils","@visactor/vscale"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VRender=t.VRender||{},t.VRender.Components={}),t.VRender,t.VUtils,t.VScale)}(this,(function(t,e,i,s){"use strict";const a=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex"];class n extends e.Group{constructor(t,e="2d"){super(t),this.mode=e,this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,s){i.isPlainObject(this.attribute[t])?i.merge(this.attribute[t],e):this.attribute[t]=e,a.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!s&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>a.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){i.isNil(e)&&(e=Object.keys(t));for(let s=0;s<e.length;s++){const a=e[s];i.isPlainObject(this.attribute[a])?i.merge(this.attribute[a],t[a]):this.attribute[a]=t[a]}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}}class r extends n{constructor(t){super(i.merge({},r.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{var e,s;const{viewX:a,viewY:n}=t,{direction:r,width:l,height:o,range:d}=this.attribute,h=this._sliderSize,[u,c]=this._getScrollRange();let p;if("vertical"===r){const t=n-this._viewPosition.y,e=i.clamp(t-h/2,u,c);p=t/o,this._slider.setAttribute("y",e,!0)}else{const t=a-this._viewPosition.x,e=i.clamp(t-h/2,u,c);p=t/l,this._slider.setAttribute("x",e,!0)}this.setScrollRange([p-(d[1]-d[0])/2,p+(d[1]-d[0])/2],!1),(null===(e=this.stage)||void 0===e?void 0:e.autoRender)||null===(s=this.stage)||void 0===s||s.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();const{direction:i}=this.attribute;this._prePos="horizontal"===i?t.clientX:t.clientY,"browser"===e.vglobal.env?(e.vglobal.addEventListener("pointermove",this._onSliderPointerMove),e.vglobal.addEventListener("pointerup",this._onSliderPointerUp)):(this._slider.addEventListener("pointermove",this._onSliderPointerMove),this._slider.addEventListener("pointerup",this._onSliderPointerUp),this._slider.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._onSliderPointerMove=t=>{t.stopPropagation();const{direction:e}=this.attribute;let i,s,a=0;const n=this.getScrollRange(),{width:r,height:l}=this._getSliderRenderBounds();"vertical"===e?(s=t.clientY,a=s-this._prePos,i=a/l):(s=t.clientX,a=s-this._prePos,i=a/r),this.setScrollRange([n[0]+i,n[1]+i],!0),this._prePos=s},this._onSliderPointerUp=t=>{t.preventDefault(),"browser"===e.vglobal.env?(e.vglobal.removeEventListener("pointermove",this._onSliderPointerMove),e.vglobal.removeEventListener("pointerup",this._onSliderPointerUp)):(this._slider.removeEventListener("pointermove",this._onSliderPointerMove),this._slider.removeEventListener("pointerup",this._onSliderPointerUp),this._slider.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){var s,a;const{direction:n="horizontal",limitRange:r=[0,1],range:l}=this.attribute,o=i.clampRange(t,r[0],r[1]);if(e){const t=this._getSliderPos(o);this._slider&&("horizontal"===n?this._slider.setAttribute("x",t[0],!0):this._slider.setAttribute("y",t[0],!0),(null===(s=this.stage)||void 0===s?void 0:s.autoRender)||null===(a=this.stage)||void 0===a||a.renderNextFrame())}this.attribute.range=o,this._onChange({pre:l,value:o})}getScrollRange(){return this.attribute.range}bindEvents(){this._rail&&this._rail.addEventListener("pointerdown",this._onRailPointerDown),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:s,range:a,limitRange:n=[0,1],railStyle:r,sliderStyle:l,padding:o=2}=this.attribute,d=this.createOrUpdateChild("scrollbar-container",{},"group"),h=d.createOrUpdateChild("scrollbar-rail",{x:0,y:0,width:e,height:s,...r},"rect");this._rail=h;const u=this._getSliderRenderBounds(),c=this._getSliderPos(i.clampRange(a,n[0],n[1])),p=c[1]-c[0];let b;this._sliderSize=p,b="horizontal"===t?{x:c[0],y:u.y1,width:p,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:p};const v=d.createOrUpdateChild("slider",{...b,cornerRadius:this._getDefaultSliderCornerRadius(),...l,boundsPadding:i.normalizePadding(o),pickMode:"imprecise"},"rect");this._slider=v,this._container=d;const g=this._container.AABBBounds;this._viewPosition={x:g.x1,y:g.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:s=2}=this.attribute,[a,n,r,l]=i.normalizePadding(s),o={x1:l,y1:a,x2:t-n,y2:e-r,width:t-(l+n),height:e-(a+r)};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:s,x1:a,y1:n}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+a,i*t[1]+a]:[s*t[0]+n,s*t[1]+n]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[s,a]=i.clampRange(t,0,1),{width:n,height:r,x1:l,y1:o}=this._getSliderRenderBounds(),d=this._sliderSize;return"horizontal"===e?i.clampRange([l+s*n,l+a*n],l,n-d):i.clampRange([o+s*r,o+a*r],o,r-d)}_onChange(t){var i;const s=new e.CustomEvent("scroll",t);s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(s)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function l(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&l(t,e)}))}r.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1]};const o=t=>!i.isNil(t)&&!1!==t.visible;const d=["#ffffff","#000000"];function h(t,e,i,s,a){const n=b(t),r=b(e);return u(n,r,i,s)?n:function(t,e,i,s,a){const n=[];a&&(a instanceof Array?n.push(...a):n.push(a));n.push(...d);for(const a of n)if(t!==a&&u(a,e,i,s))return a;return}(n,r,i,s,a)}function u(t,e,i,s){return s?c(t,e)>s:"largeText"===i?c(t,e)>3:c(t,e)>4.5}function c(t,e){const i=p(t),s=p(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function p(t){const e=i.ColorUtil.hexToRgb(t),s=e[0]/255,a=e[1]/255,n=e[2]/255;let r,l,o;r=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),l=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),o=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return.2126*r+.7152*l+.0722*o}function b(t){if(null==t?void 0:t.includes("#"))return t;const e=new i.ColorUtil.Color(t),{r:s,g:a,b:n}=e.color;return"#"+i.ColorUtil.rgbToHex(s,a,n)}function v(t,e){return[t[0]*e,t[1]*e]}function g(t,e,i){const s=function(t,e){const[i,s]=t,[a,n]=e,r=Math.sqrt((i*i+s*s)*(a*a+n*n)),l=r&&(i*a+s*n)/r;return Math.acos(Math.min(Math.max(l,-1),1))}(t,e),a=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return i?a?2*Math.PI-s:s:a?s:2*Math.PI-s}const _=-.5*Math.PI,y=1.5*Math.PI,m="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";var x;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(x||(x={}));const f={[x.selectedReverse]:{},[x.selected]:{},[x.hover]:{},[x.hoverReverse]:{}},A=(t,s,a)=>new i.TextMeasure({defaultFontParams:{fontFamily:m,fontSize:11},getTextBounds:a?void 0:e.getTextBounds,specialCharSet:"-/: .,@%'\"~"+i.TextMeasure.ALPHABET_CHAR_SET+i.TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),...null!=s?s:{}},t);function S(t,i){var s,a;if(!t)return{width:0,height:0};const n=e.getTextBounds({text:t,fontFamily:null!==(s=i.fontFamily)&&void 0!==s?s:"",fontSize:i.fontSize||12,fontWeight:i.fontWeight,textAlign:null!==(a=i.textAlign)&&void 0!==a?a:"center",textBaseline:i.textBaseline,ellipsis:!!i.ellipsis,maxLineWidth:i.maxLineWidth||1/0,lineHeight:i.fontSize||12});return{width:n.width(),height:n.height()}}class E extends n{constructor(t){super(i.merge({},E.defaultAttributes,t)),this.name="tag"}render(){var t;const{text:e="",textStyle:s={},shape:a={},panel:n={},space:r=4,minWidth:l,maxWidth:o,padding:d=4,visible:h,state:u}=this.attribute,c=i.normalizePadding(d),p=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let b,v=c[1]+c[3],g=c[0]+c[2],_=0,y=0;const{visible:m,...x}=a;if(i.isBoolean(m)){const t=(null==x?void 0:x.size)||10,e=i.isNumber(t)?t:Math.max(t[0],t[1]);b=p.createOrUpdateChild("tag-shape",{symbolType:"circle",size:t,strokeBoundsBuffer:0,...x,visible:m,x:e/2,y:e/2},"symbol"),i.isEmpty(null==u?void 0:u.shape)||(b.states=u.shape),m&&(y=e+r)}v+=y,_+=y;const f={text:e,visible:i.isValid(e)&&!1!==h,lineHeight:null==s?void 0:s.fontSize,...s,x:_,y:0};i.isNil(f.lineHeight)&&(f.lineHeight=f.fontSize);const A=p.createOrUpdateChild("tag-text",f,"text");i.isEmpty(null==u?void 0:u.text)||(A.states=u.text);const E=S(f.text,s),L=E.width,k=E.height;v+=L;const B=null!==(t=a.size)&&void 0!==t?t:10,M=i.isNumber(B)?B:Math.max(B[0],B[1]);g+=Math.max(k,(null==a?void 0:a.visible)?M:0);const{textAlign:w,textBaseline:T}=s;(i.isValid(l)||i.isValid(o))&&(i.isValid(l)&&v<l&&(v=l),i.isValid(o)&&v>o&&(v=o,A.setAttribute("maxLineWidth",o-c[1]-c[2])));let C=0,P=0;"center"===w?(C-=v/2,b&&b.setAttribute("x",(b.attribute.x||0)-L/2),p.setAttribute("x",-y/2)):"right"===w||"end"===w?(C-=v,b&&b.setAttribute("x",(b.attribute.x||0)-L),p.setAttribute("x",-c[1]-y)):"left"!==w&&"start"!==w||p.setAttribute("x",c[3]),"middle"===T?(P-=g/2,b&&b.setAttribute("y",0)):"bottom"===T?(P-=g,b&&b.setAttribute("y",-k/2),p.setAttribute("y",-c[2])):"top"===T&&(p.setAttribute("y",c[0]),b&&b.setAttribute("y",k/2));const{visible:I,...H}=n;if(h&&i.isBoolean(I)){const t=this.createOrUpdateChild("tag-panel",{...H,visible:I&&!!e,x:C,y:P,width:v,height:g},"rect");i.isEmpty(null==u?void 0:u.panel)||(t.states=u.panel)}}}E.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};class L extends n{constructor(t){super(i.merge({},L.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,s,a,n;const{title:r="",titleStyle:l={},position:o,content:d="",contentStyle:h={},panel:u={},space:c=4,minWidth:p=0,maxWidth:b=1/0,padding:v=4,visible:g,state:_,dx:y=0,dy:m=0}=this.attribute,x=i.normalizePadding(v),f=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),A=b-x[1]-x[3],S=i.isValid(r)&&!1!==g,E={text:r,visible:S,...l,x:x[3],y:x[0],maxLineWidth:A,textAlign:"left",textBaseline:"top"},L=f.createOrUpdateChild("poptip-title",E,"text");i.isEmpty(null==_?void 0:_.title)||(L.states=_.title);const k=L.AABBBounds,B=k.height(),M=k.width();let w=B+c;S||(w=0);const T=i.isValid(d)&&!1!==g,C={text:d,visible:T,...h,x:x[3],y:x[0]+w,maxLineWidth:A,textAlign:"left",textBaseline:"top"},P=f.createOrUpdateChild("poptip-content",C,"text");i.isEmpty(null==_?void 0:_.content)||(P.states=_.content);const I=P.AABBBounds,H=I.height(),z=I.width();T&&(w+=H);let V=i.max(M+x[1]+x[3],z+x[1]+x[3]);V>b?V=b:V<p&&(V=p);const R=x[0]+x[2]+w,{visible:N,...D}=u,O=null!==(t=D.size)&&void 0!==t?t:12,$=i.isArray(O)?[O[0]+(null!==(e=D.space)&&void 0!==e?e:0),O[1]+(null!==(s=D.space)&&void 0!==s?s:0)]:O+(null!==(a=D.space)&&void 0!==a?a:0),U=null!==(n=D.lineWidth)&&void 0!==n?n:1,W=this.stage?[this.stage.width,this.stage.height]:void 0,F="auto"===o;let G,Y=1/0;for(let t=0;t<this.positionList.length+1;t++){const e=F?this.positionList[t===this.positionList.length?G:t]:o,{angle:s,offset:a,rectOffset:n}=this.getAngleAndOffset(e,V,R,i.isArray($)?$:[$,$-U]);if(i.isBoolean(N)){const t=(i.isArray(O)?O[0]:O)/4,e=f.createOrUpdateChild("poptip-symbol-panel",{...D,visible:N&&(T||S),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:s,dx:a[0],dy:a[1],size:O,zIndex:-9},"symbol");i.isEmpty(null==_?void 0:_.panel)||(e.states=_.panel);const n=f.createOrUpdateChild("poptip-rect-panel",{...D,visible:N&&(T||S),x:0,y:0,width:V,height:R,zIndex:-8},"rect");i.isEmpty(null==_?void 0:_.panel)||(n.states=_.panel)}if(f.setAttributes({x:-a[0]+y,y:-a[1]+m}),!F||!W)break;{const e=this.AABBBounds,s=(new i.Bounds).setValue(0,0,W[0],W[1]);if(i.rectInsideAnotherRect(e,s,!1))break;{const a=i.getRectIntersect(e,s,!1),n=(a.x2-a.x1)*(a.y2-a.y1);n<Y&&(Y=n,G=t)}}}}getAngleAndOffset(t,e,s,a){const n=a[1]/2;switch(t){case"tl":return{angle:i.pi/2*3,offset:[e/4,s+n],rectOffset:[-e/4,-s-a[1]]};case"top":return{angle:i.pi/2*3,offset:[e/2,s+n],rectOffset:[0,-s-a[1]]};case"tr":return{angle:i.pi/2*3,offset:[e/4*3,s+n],rectOffset:[e/4*3,-s-a[1]]};case"rt":return{angle:0,offset:[-n,s/5],rectOffset:[e/4*3,-s-a[1]]};case"right":return{angle:0,offset:[-n,s/2],rectOffset:[e/4*3,-s-a[1]]};case"rb":return{angle:0,offset:[-n,s/5*4],rectOffset:[e/4*3,-s-a[1]]};case"bl":return{angle:i.pi/2,offset:[e/4,-n],rectOffset:[-e/4,-s-a[1]]};case"bottom":return{angle:i.pi/2,offset:[e/2,-n],rectOffset:[0,-s-a[1]]};case"br":return{angle:i.pi/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-s-a[1]]};case"lt":return{angle:i.pi,offset:[e+n,s/5],rectOffset:[-e/4,-s-a[1]]};case"left":return{angle:i.pi,offset:[e+n,s/2],rectOffset:[0,-s-a[1]]};case"lb":return{angle:i.pi,offset:[e+n,s/5*4],rectOffset:[e/4*3,-s-a[1]]}}}}L.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:8,padding:10};var k="inversify:paramtypes";function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}var M=0;var w=function(t){this.id=M++,this.registry=t};function T(){return function(t){if(Reflect.hasOwnMetadata(k,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(k,e,t),t}}function C(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"===("undefined"==typeof Reflect?"undefined":B(Reflect))&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}"function"==typeof SuppressedError&&SuppressedError;const P={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},I={poptip:i.merge({},P)};let H=class{render(t,e,s,a,n,r,l,o,d,h,u,c,p){var b,v,g;if(1===t._showPoptip){const{visible:e,visibleCb:s}=t.attribute.poptip||{};if(!1===e||s&&!1===s(t))return;this.poptipComponent||(this.poptipComponent=new L(t.attribute.poptip));let a=t.attribute.poptip||{};if("text"===t.type&&null==a.title&&null==a.content){const e={};v=e,g=a,i.merge(v,I.poptip,g),a=e,a.content=null!==(b=a.content)&&void 0!==b?b:t.attribute.text}const n=t.globalTransMatrix;this.poptipComponent.setAttributes({visibleAll:!0,pickable:!1,childrenPickable:!1,...a,x:n.e,y:n.f}),h.stage.tryInitInteractiveLayer();const r=h.stage.getLayer("_builtin_interactive");r&&r.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};H=C([T()],H);let z=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=e.Generator.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if(e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};z=C([T()],z);let V=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=e.Generator.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if("text"!==e.type||!e.cliped||e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i={}}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};V=C([T()],V);const R=new w((t=>{t(H).toSelf().inSingletonScope(),t(e.InteractiveSubRenderContribution).toService(H),t(z).toSelf().inSingletonScope(),t(e.AutoEnablePlugins).toService(z),t(V).toSelf().inSingletonScope(),t(e.AutoEnablePlugins).toService(V)}));class N extends n{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}class D extends N{constructor(t){super(i.merge({},D.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",{points:[e,i],...s},"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}D.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};class O extends N{constructor(t){super(i.merge({},O.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",{x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y,...s},"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}O.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};class $ extends N{constructor(t){super(i.merge({},$.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",{...e,outerRadius:i,...this.attribute,...s},"arc")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}$.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class U extends N{constructor(t){super(i.merge({},U.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:s=0,sectorStyle:a}=this.attribute,{startAngle:n,endAngle:r}=this.attribute;return t.createOrUpdateChild("crosshair-sector",{...e,outerRadius:i,innerRadius:s,startAngle:n,endAngle:r,...a},"arc")}setLocation(t){const{center:e,startAngle:s=_,endAngle:a=y}=this.attribute,n=a-s,r=i.radianToDegree(i.getAngleByPoint(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}U.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};class W extends N{constructor(t){super(i.merge({},W.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:s,sides:a=6,lineStyle:n}=this.attribute,{startAngle:r,endAngle:l}=this.attribute,o=(l-r)%(2*Math.PI)==0,d=(l-r)/a;let h;for(let t=0;t<=a;t++){const n=r+d*t,l=i.polarToCartesian(e,s,n);0===t?h=`M${l.x},${l.y}`:h+=`L${l.x},${l.y}`,t===a&&o&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",{path:h,...n},"path")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}W.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const F=5,G=31,Y=32,X=new Uint32Array(Y+1),q=new Uint32Array(Y+1);q[0]=0,X[0]=~q[0];for(let t=1;t<=Y;++t)q[t]=q[t-1]<<1|1,X[t]=~q[t];function Z(t,e,i=0){const s=Math.max(1,Math.sqrt(t*e/1e6)),a=~~((t+2*i+s)/s),n=~~((e+2*i+s)/s),r=t=>~~((t+i)/s);return r.invert=t=>t*s-i,r.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+Y)/Y));function s(t,e){i[t]|=e}function a(t,e){i[t]&=e}return{array:i,get:(e,s)=>{const a=s*t+e;return i[a>>>F]&1<<(a&G)},set:(e,i)=>{const a=i*t+e;s(a>>>F,1<<(a&G))},clear:(e,i)=>{const s=i*t+e;a(s>>>F,~(1<<(s&G)))},getRange:({x1:s,y1:a,x2:n,y2:r})=>{if(n<0||r<0||s>t||a>e)return!0;let l,o,d,h,u=r;for(;u>=a;--u)if(l=u*t+s,o=u*t+n,d=l>>>F,h=o>>>F,d===h){if(i[d]&X[l&G]&q[1+(o&G)])return!0}else{if(i[d]&X[l&G])return!0;if(i[h]&q[1+(o&G)])return!0;for(let t=d+1;t<h;++t)if(i[t])return!0}return!1},setRange:({x1:i,y1:a,x2:n,y2:r})=>{if(n<0||r<0||i>t||a>e)return;let l,o,d,h,u;for(;a<=r;++a)if(l=a*t+i,o=a*t+n,d=l>>>F,h=o>>>F,d===h)s(d,X[l&G]&q[1+(o&G)]);else for(s(d,X[l&G]),s(h,q[1+(o&G)]),u=d+1;u<h;++u)s(u,4294967295)},clearRange:({x1:e,y1:i,x2:s,y2:n})=>{let r,l,o,d,h;for(;i<=n;++i)if(r=i*t+e,l=i*t+s,o=r>>>F,d=l>>>F,o===d)a(o,q[r&G]|X[1+(l&G)]);else for(a(o,q[r&G]),a(d,X[1+(l&G)]),h=o+1;h<d;++h)a(h,0)},outOfBounds:({x1:i,y1:s,x2:a,y2:n})=>i<0||s<0||n>=e||a>=t,toImageData:s=>{const a=s.createImageData(t,e),n=a.data;for(let s=0;s<e;++s)for(let e=0;e<t;++e){const a=s*t+e,r=4*a,l=i[a>>>F]&1<<(a&G);n[r+0]=255*l,n[r+1]=255*l,n[r+2]=255*l,n[r+3]=31}return a}}}(a,n),r.ratio=s,r.padding=i,r.width=t,r.height=e,r}function j(t,e,s=!1){if(s){const{x1:s,x2:a,y1:n,y2:r}=e,l=i.clamp(s,0,t.width),o=i.clamp(a,0,t.width),d=i.clamp(n,0,t.height),h=i.clamp(r,0,t.height);return{x1:t(l),x2:t(o),y1:t(d),y2:t(h)}}return{x1:t(e.x1),x2:t(e.x2),y1:t(e.y1),y2:t(e.y2)}}function J(t,e,i,s=!0){const a=j(t,i);return!(s&&e.outOfBounds(a))&&!e.getRange(a)}function K(t,e){return!(!t||!e)&&e.encloses(t)}function Q(t,e,i,s=[],a=!0){for(let n=0;n<s.length;n++){const r=i.clone();if(r.setAttributes(s[n]),r.update(),J(t,e,j(t,r.AABBBounds),a))return e.setRange(j(t,r.AABBBounds,!0)),s[n]}return!1}function tt(t,e,s,a,n,r,l){var o,d,h;if("bound"===s.type||"position"===s.type){if(i.isFunction(l)){const d=((i.isFunction(s.position)?s.position(n.attribute):s.position)||function(t){if("rect"===t)return it;return et}(a.type)).map((t=>l(n.AABBBounds,r,t,a.offset)));return Q(t,e,n,d,null===(o=a.overlap)||void 0===o?void 0:o.clampForce)}return!1}if("moveY"===s.type){const r=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return Q(t,e,n,r,null===(d=a.overlap)||void 0===d?void 0:d.clampForce)}if("moveX"===s.type){const r=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return Q(t,e,n,r,null===(h=a.overlap)||void 0===h?void 0:h.clampForce)}return!1}const et=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],it=["top","inside-top","inside"];function st(t,e,i){const{x1:s,x2:a,y1:n,y2:r}=t.AABBBounds,l=Math.min(s,a),o=Math.max(s,a),d=Math.min(n,r),h=Math.max(n,r);let u=0,c=0;return l<0&&o-l<=e?u=-l:o>e&&l-(o-e)>=0&&(u=e-o),d<0&&h-d<=i?c=-d:h>i&&d-(h-i)>=0&&(c=i-h),{dx:u,dy:c}}const at={fadeIn:(t={})=>{var e,i,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1}}},fadeOut:(t={})=>{var e,i,s;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function nt(t,e){var i,s;return null!==(s=null===(i=at[e])||void 0===i?void 0:i.call(at,t))&&void 0!==s?s:{from:{},to:{}}}const rt="same-time",lt=300,ot="linear";class dt extends n{constructor(){super(...arguments),this.name="label",this._onHover=t=>{const e=t.target;e===this._lastHover||i.isEmpty(e.states)||(e.addState(x.hover,!0),l(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(x.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(l(this,(t=>{i.isEmpty(t.states)||(t.removeState(x.hoverReverse),t.removeState(x.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void l(this,(t=>{i.isEmpty(t.states)||(t.removeState(x.selectedReverse),t.removeState(x.selected))}));i.isEmpty(e.states)||(e.addState(x.selected,!0),l(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(x.selectedReverse,!0)})),this._lastSelect=e)}}setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}layoutArcLabels(t,e,i,s,a){return[]}render(){this._prepare();const{overlap:t,smartInvert:e,dataFilter:s,customLayoutFunc:a,customOverlapFunc:n}=this.attribute;let r,l=this.attribute.data;i.isFunction(s)&&(l=s(l)),i.isFunction(a)?r=a(l,(t=>this._idToGraphic.get(t.id))):(r=this.layout(l),i.isFunction(n)?r=n(r,(t=>this._idToGraphic.get(t.id))):!1!==t&&(r=this._overlapping(r))),!1!==e&&this._smartInvert(r),this._renderLabels(r)}_bindEvent(t){if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStates(t){if(!t)return;const e=this.attribute.state;e&&!i.isEmpty(e)&&(t.states=e)}_createLabelText(t){const i=e.createText(t);return this._bindEvent(i),this._setStates(i),i}_prepare(){var t;const e=function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),s=[];if(e.forEach((t=>{"willRelease"!==t.releaseStatus&&s.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),this._baseMarks=s,!s||0===s.length)return;const{data:a}=this.attribute;if(a&&0!==a.length){this._idToGraphic||(this._idToGraphic=new Map);for(let t=0;t<s.length;t++){const e=a[t],n=s[t];e&&n&&(i.isValid(e.id)||(e.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(e.id,n))}}}layout(t=[]){var e;const{textStyle:s={},position:a,offset:n}=this.attribute,r=[],l=[];for(let e=0;e<t.length;e++){const o=t[e],d=this._idToGraphic.get(o.id),h={fill:d.attribute.fill,...s,...o},u=this._createLabelText(h),c=this.getGraphicBounds(u);l.push(c);const p=this.getGraphicBounds(d,{x:o.x,y:o.y}),b=this.labeling(c,p,i.isFunction(a)?a(o):a,n);b&&(h.x=b.x,h.y=b.y,u.setAttributes(b),r.push(u))}if("arc"===this.attribute.type){const i=this.layoutArcLabels(a,this.attribute,Array.from(this._idToGraphic.values()),t,l);for(let s=0;s<t.length;s++){const a=t[s],n=i.find((t=>t.labelText===a.text)),l={x:n.labelPosition.x,y:n.labelPosition.y,angle:null!==(e=this.attribute.angle)&&void 0!==e?e:n.angle,labelLinePath:n.labelLinePath};r[s].setAttributes(l)}}return r}_overlapping(t){var e,s,a,n;if(0===t.length)return[];const r=this.attribute.overlap,l=[],o=this.getBaseMarkGroup(),d=null!==(e=r.size)&&void 0!==e?e:{width:null!==(s=null==o?void 0:o.AABBBounds.width())&&void 0!==s?s:0,height:null!==(a=null==o?void 0:o.AABBBounds.height())&&void 0!==a?a:0};if(0===d.width||0===d.height)return t;const{avoidBaseMark:h,strategy:u=[],hideOnHit:c=!0,clampForce:p=!0,avoidMarks:b=[]}=r,v=this._bmpTool||Z(d.width,d.height),g=this._bitmap||v.bitmap(),_=u.some((t=>"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&g.setRange(j(v,t.AABBBounds,!0))}))),b.length>0&&b.forEach((t=>{i.isString(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&g.setRange(j(v,t.AABBBounds,!0))})):t.AABBBounds&&g.setRange(j(v,t.AABBBounds,!0))}));for(let e=0;e<t.length;e++){if(!1===t[e].visible)continue;const i=t[e],s=this._idToGraphic.get(i.attribute.id);if(i.update(),J(v,g,i.AABBBounds,p)){if(!_){g.setRange(j(v,i.AABBBounds,!0)),l.push(i);continue}if(_&&(null==s?void 0:s.AABBBounds)&&K(i.AABBBounds,null==s?void 0:s.AABBBounds)){g.setRange(j(v,i.AABBBounds,!0)),l.push(i);continue}}if(p){const{dx:t=0,dy:e=0}=st(i,v.width,v.height);if((0!==t||0!==e)&&J(v,g,{x1:i.AABBBounds.x1+t,x2:i.AABBBounds.x2+t,y1:i.AABBBounds.y1+e,y2:i.AABBBounds.y2+e})){i.setAttributes({x:i.attribute.x+t,y:i.attribute.y+e}),l.push(i);continue}}let a=!1;for(let n=0;n<u.length;n++)if(a=tt(v,g,u[n],this.attribute,i,this.getGraphicBounds(s,t[e]),this.labeling),!1!==a){i.setAttributes({x:a.x,y:a.y}),l.push(i);break}if(!a&&p){const{dx:t=0,dy:e=0}=st(i,v.width,v.height);if((0!==t||0!==e)&&J(v,g,{x1:i.AABBBounds.x1+t,x2:i.AABBBounds.x2+t,y1:i.AABBBounds.y1+e,y2:i.AABBBounds.y2+e})){i.setAttributes({x:i.attribute.x+t,y:i.attribute.y+e}),g.setRange(j(v,i.AABBBounds,!0)),l.push(i);continue}}!a&&!c&&l.push(i)}return i.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(g),l}getBaseMarkGroup(){const{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find((e=>e.name===t),!0)}getGraphicBounds(t,e={}){return(null==t?void 0:t.AABBBounds)||{x1:e.x,x2:e.x,y1:e.y,y2:e.y}}_renderLabels(t){var s,a,n,r,l;const o=null!==(s=this.attribute.animation)&&void 0!==s?s:{},d=!1===this._enableAnimation||!1===o,h=null!==(a=o.mode)&&void 0!==a?a:rt,u=null!==(n=o.duration)&&void 0!==n?n:lt,c=null!==(r=o.easing)&&void 0!==r?r:ot,p=null!==(l=o.delay)&&void 0!==l?l:0,b=new Map,v=this._graphicToText||new Map,g=[];t.forEach(((t,s)=>{var a,n,r,l,_,y,m,x;const f=(null===(a=t.attribute)||void 0===a?void 0:a.labelLinePath)?e.createPath({visible:null===(r=null===(n=t.attribute)||void 0===n?void 0:n.visible)||void 0===r||r,stroke:null!==(y=null===(_=null===(l=t.attribute)||void 0===l?void 0:l.line)||void 0===_?void 0:_.stroke)&&void 0!==y?y:null===(m=t.attribute)||void 0===m?void 0:m.fill,lineWidth:1,path:null===(x=t.attribute)||void 0===x?void 0:x.labelLinePath}):void 0,A=this._idToGraphic.get(t.attribute.id),S=(null==v?void 0:v.get(A))?"update":"enter";if("enter"===S)if(g.push(t),b.set(A,t),!d&&A){const{from:e,to:i}=nt(t.attribute,"fadeIn");this.add(t),f&&this.add(f),A.onAnimateBind=()=>{t.setAttributes(e);const a=this._afterRelatedGraphicAttributeUpdate(t,g,s,A,{mode:h,duration:u,easing:c,to:i,delay:p});A.on("afterAttributeUpdate",a)}}else this.add(t),f&&this.add(f);if("update"===S){const s=v.get(A);v.delete(A),b.set(A,s),d?s.setAttributes(t.attribute):(s.animate().to(t.attribute,u,c),!1!==o.increaseEffect&&s.attribute.text!==t.attribute.text&&i.isValidNumber(Number(s.attribute.text)*Number(t.attribute.text))&&s.animate().play(new e.IncreaseCount({text:s.attribute.text},{text:t.attribute.text},u,c)))}})),v.forEach((t=>{d?this.removeChild(t):null==t||t.animate().to(nt(t.attribute,"fadeOut").to,u,c).onEnd((()=>{this.removeChild(t)}))})),this._graphicToText=b}_afterRelatedGraphicAttributeUpdate(t,i,s,a,{mode:n,duration:r,easing:l,to:o,delay:d}){const h=u=>{var c;const{detail:p}=u;if(!p)return{};if(!(p&&p.type===e.AttributeUpdateType.ANIMATE_UPDATE&&p.animationState&&"wait"!==(null===(c=p.animationState.step)||void 0===c?void 0:c.type)))return{};if(p.type===e.AttributeUpdateType.ANIMATE_END)return void t.setAttributes(o);const b=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",h))};switch(n){case"after":p.animationState.end&&t.animate({onEnd:b}).wait(d).to(o,r,l);break;case"after-all":s===i.length-1&&p.animationState.end&&i.forEach((t=>{t.animate({onEnd:b}).wait(d).to(o,r,l)}));break;default:p.animationState.isFirstFrameOfStep&&t.animate({onEnd:b}).wait(d).to(o,r,l)}};return h}_smartInvert(t){const e=this.attribute.smartInvert||{},{textType:i,contrastRatiosThreshold:s,alternativeColors:a}=e;for(let e=0;e<t.length;e++){const n=t[e];if(!n)continue;const r=this._idToGraphic.get(n.attribute.id);let l=K(n.AABBBounds,null==r?void 0:r.AABBBounds);if("arc"===this.attribute.type&&(l="inside"===this.attribute.position),n.attribute.stroke&&n.attribute.lineWidth>0)n.setAttributes({fill:h(n.attribute.fill,n.attribute.stroke,i,s,a)});else if(l){const t=r.attribute.fill,e=n.attribute.fill;n.setAttributes({fill:h(e,t,i,s,a)})}else if(n.attribute.lineWidth>0){const t=n.attribute.stroke,e=n.attribute.fill;n.setAttributes({stroke:r.attribute.fill,fill:h(e,t,i,s,a)})}}}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}class ht extends dt{constructor(t){super(i.merge({},ht.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",s=0){if(!t)return;const{x1:a,y1:n,x2:r,y2:l}=t,o=Math.abs(r-a),d=Math.abs(l-n),h=(e.x1+e.x2)/2,u=(e.y1+e.y2)/2;let c=0,p=0,b=0,v=0;e&&(b=Math.abs(e.x1-e.x2)/2,v=Math.abs(e.y1-e.y2)/2);const g={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(g[i]*(Math.PI/180)),p=Math.cos(g[i]*(Math.PI/180));break;case"center":c=0,p=0}return{x:h+c*(s+b)+Math.sign(c)*(o/2),y:u+p*(s+v)+Math.sign(p)*(d/2)}}}ht.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class ut extends dt{constructor(t){super(i.merge({},ut.defaultAttributes,t))}labeling(t,e,i="top",s=0){if(!t||!e)return;const{x1:a,y1:n,x2:r,y2:l}=t,o=Math.abs(r-a),d=Math.abs(l-n),h=Math.abs(e.x2-e.x1),u=Math.abs(e.y2-e.y1);let c=(e.x1+e.x2)/2,p=(e.y1+e.y2)/2,b=0,v=0;switch(i){case"top":case"inside-top":v=-.5;break;case"bottom":case"inside-bottom":v=.5;break;case"left":case"inside-left":b=-.5;break;case"right":case"inside-right":b=.5}c+=b*h,p+=v*u;let g=0,_=0;const y=i.includes("inside");i.includes("top")?_=y?1:-1:i.includes("bottom")?_=y?-1:1:i.includes("left")?g=y?1:-1:i.includes("right")&&(g=y?-1:1);return{x:c+g*s+g*o/2,y:p+_*s+_*d/2}}}ut.tag="rect-label",ut.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class ct extends dt{constructor(t){super(i.merge({},ct.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={}){var i;if("line"!==t.type)return super.getGraphicBounds(t,e);const{position:s="end"}=this.attribute,a=(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)||[e],n="start"===s?0:a.length-1;return{x1:a[n].x,x2:a[n].x,y1:a[n].y,y2:a[n].y}}labeling(t,e,i="end",s=0){if(!t||!e)return;const{x1:a,x2:n}=t,r=Math.abs(n-a),l=e.x1;let o=l;return"end"===i?o=l+r/2+s:"start"===i&&(o=l-r/2-s),{x:o,y:e.y1}}}function pt(t,e,i,s){const a=(n={radius:i,angle:s}).radius?{x:Math.cos(n.angle)*n.radius,y:Math.sin(n.angle)*n.radius}:{x:0,y:0};var n;return{x:t+a.x,y:e+a.y}}function bt(t){return(t=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function vt(t){return 3===t||4===t}function gt(t,e){const{x1:i,y1:s,x2:a,y2:n}=t,{x1:r,y1:l,x2:o,y2:d}=e;return!(i<=r&&a<=r||i>=o&&a>=o||s<=l&&n<=l||s>=d&&n>=d)}ct.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class _t{constructor(t,e,i,s,a,n){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=a,this.middleAngle=n,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class yt extends dt{constructor(t){super(i.merge({},yt.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",s=0){if(t&&e)return{x:0,y:0}}layoutArcLabels(t,e,i,s,a){this._arcLeft.clear(),this._arcRight.clear();const{width:n,height:r}=e;i.forEach(((t,i)=>{var l,o;const d=t.attribute,h=this.computeLayoutOuterRadius(d.outerRadius,n,r),u=this.computeRadius(h,n,r),c={x:null!==(l=null==d?void 0:d.x)&&void 0!==l?l:0,y:null!==(o=null==d?void 0:d.y)&&void 0!==o?o:0},p=s[i],b=a[i],v=(d.startAngle+d.endAngle)/2,g=d.endAngle-d.startAngle,_=bt(d.endAngle-g/2),y=pt(c.x,c.y,d.outerRadius,v),m=pt(c.x,c.y,u+e.line.line1MinLength,v),x=new _t(p,y,m,_,g,v);var f;x.pointA=pt(c.x,c.y,this.computeDatumRadius(2*c.x,2*c.y,d.outerRadius),x.middleAngle),x.labelSize={width:b.x2-b.x1,height:b.y2-b.y1},1===(f=x.quadrant)||2===f?this._arcRight.set(x.refDatum,x):vt(x.quadrant)&&this._arcLeft.set(x.refDatum,x)}));const l=Array.from(this._arcLeft.values()),o=Array.from(this._arcRight.values()),d=[];return"inside"===t?(d.push(...this._layoutInsideLabels(o,e,i)),d.push(...this._layoutInsideLabels(l,e,i))):(d.push(...this._layoutOutsideLabels(o,e,i)),d.push(...this._layoutOutsideLabels(l,e,i))),d}_layoutInsideLabels(t,e,s){var a,n,r,l;const o={x:null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,y:null!==(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y)&&void 0!==l?l:0},d=this.computeLayoutOuterRadius(s[0].attribute.innerRadius,e.width,e.height),h=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),u=e,c=u.spaceWidth;return t.forEach((t=>{const{labelSize:s,radian:a}=t,n=this.computeRadius(d,e.width,e.height,1),r=this.computeRadius(h,e.width,e.height,1),l=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(r,s.height);let p;if(a<l)p=0;else{let t;t=a>=Math.PI?n:Math.max(n,s.height/2/Math.tan(a/2)),p=r-t-c}!0!==(null==u?void 0:u.rotate)&&(p=r-c);const b=this._getFormatLabelText(t.refDatum,p);t.labelText=b;const v=Math.min(p,t.labelSize.width),g=this._computeAlign(t,e),_=r-c-("left"===g?v:"right"===g?0:v/2);t.labelPosition=pt(o.x,o.y,_,t.middleAngle),t.labelLimit=v,i.isGreater(v,0)||(t.labelVisible=!1),t.angle=t.middleAngle})),t}_layoutOutsideLabels(t,e,s){var a,n,r,l,o;const d=null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,h=2*(null!==(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y)&&void 0!==l?l:0),u=e.line.line2MinLength,c=e.layout,p=e.spaceWidth;if(t.forEach((t=>{const e=vt(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+u+p),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==e.coverEnable||"none"===c.strategy){for(const i of t){const{labelPosition:t,labelSize:a}=i;i.labelLimit=a.width,i.pointB=vt(i.quadrant)?{x:t.x+a.width/2+u+p,y:t.y}:{x:t.x-a.width/2-u-p,y:t.y},this._computeX(i,e,s)}!1===e.coverEnable&&"none"===c.strategy&&this._coverLabels(t)}else{const i=h/((null===(o=e.textStyle)||void 0===o?void 0:o.fontSize)||16);this._adjustY(t,i,e,s);const{minY:a,maxY:n}=t.reduce(((t,e)=>{const{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(h,Math.max(s,t.maxY)),t}),{minY:1/0,maxY:-1/0}),r=Math.max(Math.abs(h/2-a),Math.abs(n-h/2)),l=this._computeLayoutRadius(r,e,s);for(const i of t)this._computePointB(i,l,e,s),this._computeX(i,e,s)}const b=2*d;return t.forEach((t=>{t.labelVisible&&(i.isLess(t.pointB.x,u+p)||i.isGreater(t.pointB.x,b-u-p))&&(t.labelVisible=!1),t.angle=0,t.labelLinePath=`M${Math.round(t.pointA.x)},${Math.round(t.pointA.y)} L${Math.round(t.pointB.x)},${Math.round(t.pointB.y)} L${Math.round(t.pointC.x)},${Math.round(t.pointC.y)}`})),t}_computeX(t,e,s){var a,n,r,l,o;const d=null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,h=2*d,u=(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y,this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height)),c=e.line.line1MinLength,p=e.line.line2MinLength,b=null===(o=e.layout)||void 0===o?void 0:o.align,v=e.spaceWidth;this._computeAlign(t,e);const{labelPosition:g,quadrant:_,pointB:y}=t;i.isValidNumber(y.x*y.y)||(t.pointC={x:NaN,y:NaN},g.x=NaN,t.labelLimit=0);const m=this.computeRadius(u,e.width,e.height),x=vt(_)?-1:1;let f=0;let A=(x>0?h-y.x:y.x)-p-v;"labelLine"===b&&(f=(m+c+p)*x+d,A=(x>0?h-f:f)-v);const S=this._getFormatLabelText(t.refDatum,A);t.labelText=S;let E=Math.min(A,t.labelSize.width);switch(b){case"labelLine":break;case"edge":f=x>0?h-E-v:E+v;break;default:f=y.x+x*p}if(E=Math.max(this._ellipsisWidth,E),t.pointC={x:f,y:g.y},"edge"===b){const t=0;g.x=x>0?h+t:t}else{const e=0;g.x=f+e+x*(v+.5*t.labelSize.width)}t.labelLimit=E}_computeAlignOffset(t,e,i){switch(t){case"left":return i<0?-e:0;case"right":return i<0?0:e;default:return e/2*i}}_computeAlign(t,e){var s,a,n,r,l,o;const d=e,h=null!==(a=null===(s=d.textStyle)||void 0===s?void 0:s.textAlign)&&void 0!==a?a:null===(n=d.textStyle)||void 0===n?void 0:n.align,u=null!==(l=null===(r=d.layout)||void 0===r?void 0:r.textAlign)&&void 0!==l?l:null===(o=d.layout)||void 0===o?void 0:o.align;return"inside"!==d.position?i.isNil(h)||"auto"===h?"edge"===u?vt(t.quadrant)?"left":"right":vt(t.quadrant)?"right":"left":h:i.isNil(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){return t.text}_adjustY(t,e,s,a){var n,r,l,o;r=null===(n=a[0].attribute)||void 0===n?void 0:n.x;const d=2*(null!==(o=null===(l=a[0].attribute)||void 0===l?void 0:l.y)&&void 0!==o?o:0),h=s.layout;if("vertical"===h.strategy){let e,s=0;const a=t.length;if(a<=0)return;for(let n=0;n<a;n++){const{y1:r}=t[n].getLabelBounds();if(e=r-s,i.isLess(e,0)){const i=this._shiftY(t,n,a-1,-e);this._shiftY(t,i,0,e/2)}const{y2:l}=t[n].getLabelBounds();s=l}const{y1:n}=t[0].getLabelBounds();e=n-0,i.isLess(e,0)&&this._shiftY(t,0,a-1,-e);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>d;e--)t[e].labelVisible=!1}else if("none"!==h.strategy){const n=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));n.sort(((t,e)=>e.arc.radian-t.arc.radian)),n.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let r=1/0,l=-1/0;for(let o=0;o<e&&o<t.length;o++){this._storeY(t);const e=n[o].arc;this._computeYRange(e,s,a),e.labelVisible=!0;const u=e.labelPosition.y,{lastIndex:c,nextIndex:p}=this._findNeighborIndex(t,n[o]),b=t[c],v=t[p];if(-1===c&&-1!==p){const i=v.labelPosition.y;u>i?e.labelPosition.y=i-v.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,v,p)}else if(-1!==c&&-1===p){const i=b.labelPosition.y;u<i?e.labelPosition.y=i+b.labelSize.height/2+e.labelSize.height/2:this._twoWayShift(t,b,e,n[o].originIndex)}else if(-1!==c&&-1!==p){const i=b.labelPosition.y,s=v.labelPosition.y;u>s?(e.labelPosition.y=s-v.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,b,e,n[o].originIndex)):u<i?(e.labelPosition.y=i+b.labelSize.height/2+e.labelSize.height/2,this._twoWayShift(t,e,v,p)):(this._twoWayShift(t,b,e,n[o].originIndex),this._twoWayShift(t,e,v,p))}const g=Math.min(r,n[o].originIndex),_=Math.max(l,n[o].originIndex);let y;if(y=t[_].getLabelBounds().y2-d,i.isGreater(y,0)&&this._shiftY(t,_,0,-y),y=t[g].getLabelBounds().y1-0,i.isLess(y,0)&&this._shiftY(t,g,t.length-1,-y),y=t[_].getLabelBounds().y2-d,i.isGreater(y,0)){e.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(e.labelVisible=!1,this._restoreY(t)):(r=g,l=_)}}}_shiftY(t,e,i,s){const a=e<i?1:-1;let n=e;for(;-1!==n;){t[n].labelPosition.y+=s;const e=this._findNextVisibleIndex(t,n,i,a);if(e>=0&&e<t.length){const{y1:i,y2:s}=t[n].getLabelBounds(),{y1:r,y2:l}=t[e].getLabelBounds();if(a>0&&s<r||a<0&&i>l)return n}n=e}return i}_findNextVisibleIndex(t,e,i,s){const a=(i-e)*s;for(let i=1;i<=a;i++){const a=e+i*s;if(t[a].labelVisible)return a}return-1}_computePointB(t,e,s,a){var n,r,l,o;const d=s,h=this.computeLayoutOuterRadius(a[0].attribute.outerRadius,s.width,s.height),u=d.line.line1MinLength;if("none"===d.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const d={x:null!==(r=null===(n=a[0].attribute)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(o=null===(l=a[0].attribute)||void 0===l?void 0:l.y)&&void 0!==o?o:0},c=this.computeRadius(h,s.width,s.height),{labelPosition:p,quadrant:b}=t,v=e-Math.max(c+u,a[0].attribute.outerRadius),g=Math.sqrt(e**2-Math.abs(d.y-p.y)**2)-v;i.isValidNumber(g)?t.pointB={x:d.x+g*(vt(b)?-1:1),y:p.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,s){var a,n,r,l;const o={width:2*(null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0),height:2*(null!==(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y)&&void 0!==l?l:0)},d=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),h=e.line.line1MinLength,{width:u,height:c}=o,p=this.computeRadius(d,e.width,e.height),b=this._computeLayoutRadius(c/2,e,s),v=Math.abs(t.center.x-u/2),g=t.center.y-c/2;let _,y,m;if(i.isNumberClose(u/2,v))_=0,y=1,m=-g;else if(i.isNumberClose(c/2,g))_=1,y=0,m=-v;else{const t=-1/(g/v);_=t,y=-1,m=g-t*v}const x=function(t,e,i,s,a,n){if(0===t&&0===e||n<=0)return[];if(0===t){const t=-i/e,r=n**2-(t-a)**2;return r<0?[]:0===r?[{x:s,y:t}]:[{x:Math.sqrt(r)+s,y:t},{x:-Math.sqrt(r)+s,y:t}]}if(0===e){const e=-i/t,r=n**2-(e-s)**2;return r<0?[]:0===r?[{x:e,y:a}]:[{x:e,y:Math.sqrt(r)+a},{x:e,y:-Math.sqrt(r)+a}]}const r=(e/t)**2+1,l=2*((i/t+s)*(e/t)-a),o=l**2-4*r*((i/t+s)**2+a**2-n**2);if(o<0)return[];const d=(-l+Math.sqrt(o))/(2*r),h=(-l-Math.sqrt(o))/(2*r),u=-(e*d+i)/t;return 0===o?[{x:u,y:d}]:[{x:u,y:d},{x:-(e*h+i)/t,y:h}]}(_,y,m,h+p-b,0,b);if(x.length<2)return;let f,A;x[0].x>x[1].x&&x.reverse(),x[0].x<0?i.isNumberClose(x[0].y,x[1].y)?Math.abs(t.middleAngle)<Math.PI/2?(f=0,A=x[1].y+c/2):(f=x[1].y+c/2,A=c):x[0].y<x[1].y?(f=0,A=x[1].y+c/2):(f=x[1].y+c/2,A=o.height):(f=Math.min(x[0].y,x[1].y)+c/2,A=Math.max(x[0].y,x[1].y)+c/2),t.labelYRange=[f,A]}_computeLayoutRadius(t,e,i){const s=e,a=s.layoutArcGap,n=s.line.line1MinLength,r=this.computeLayoutOuterRadius(i[0].attribute.outerRadius,e.width,e.height),l=this.computeRadius(r,e.width,e.height)+n,o=l-a;return Math.max((o**2+t**2)/(2*o),l)}_findNeighborIndex(t,e){const i=e.originIndex;let s=-1,a=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){a=e;break}return{lastIndex:s,nextIndex:a}}_twoWayShift(t,e,s,a){const n=s.getLabelBounds().y1-e.getLabelBounds().y2;if(i.isLess(n,0)){const e=this._shiftY(t,a,t.length-1,-n);this._shiftY(t,e,0,n/2)}}_restoreY(t){for(const e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(const e of t){const{labelYRange:t,labelPosition:s}=e;if(e.labelVisible&&t&&(i.isLess(s.y,t[0])||i.isGreater(s.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){const s=t[i].getLabelBounds();gt(e,s)?t[i].labelVisible=!1:e=s}}computeRadius(t,e,s,a){return this.computeLayoutRadius(e||0,s||0)*t*(i.isNil(a)?1:a)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){const s=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*s}}yt.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,textAlign:"center",textBaseline:"middle"},position:"outside",offset:0,line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0}};const mt={rect:ut,symbol:ht,arc:yt};class xt extends n{constructor(t){super(i.merge({},xt.defaultAttributes,t)),this.name="data-label"}render(){const{dataLabels:t,size:e}=this.attribute;if(!t||0===t.length)return;const{width:s=0,height:a=0}=e||{};if(!s||!a||!i.isValidNumber(a*s))return;this._componentMap||(this._componentMap=new Map);const n=Z(s,a),r=n.bitmap(),l=new Map,o=this._componentMap;for(let e=0;e<t.length;e++){const i=t[e];if(mt[i.type]){const{baseMarkGroupName:t}=i;let e=this._componentMap.get(t);e?(e.setBitmapTool(n),e.setBitmap(r),e.setAttributes(i),l.set(t,e)):(e=new mt[i.type](i),e.setBitmap(r),e.setBitmapTool(n),this.add(e),l.set(t,e))}}o.forEach(((t,e)=>{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}function ft(t,e){let i="";return 0===t.length||(t.forEach(((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function At(t,e,s,a){let n="";if(!t||0===e.length)return n;const r=e[0],l=i.PointService.distancePP(t,r),o=s?0:1;return a?n+=`M${t.x},${t.y-l}A${l},${l},0,0,${o},${t.x},${t.y+l}A${l},${l},0,0,${o},${t.x},${t.y-l}Z`:e.forEach(((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${l},${l},0,0,${o},${t.x},${t.y}`})),n}function St(t,e,s){const{type:a,closed:n}=s,r=e.slice(0).reverse();let l="",o="";if("line"===a&&s.smoothLink&&s.center){const e=t[0],a=r[0],d=s.center;l=ft(t,!!n),o=ft(r,!!n);const h=i.PointService.distancePP(a,d),u=i.PointService.distancePP(e,d);l+=`A${h},${h},0,0,1,${a.x},${a.y}L${a.x},${a.y}`,o+=`A${u},${u},0,0,0,${e.x},${e.y}`}else if("circle"===a){const{center:e}=s;l=At(e,t,!1,!!n),o=At(e,r,!0,!!n)}else"line"!==a&&"polygon"!==a||(l=ft(t,!!n),o=ft(r,!!n));return n?l+=o:(o="L"+o.substring(1),l+=o,l+="Z"),l}xt.defaultAttributes={pickable:!1};class Et extends n{constructor(t){super(i.merge({},Et.defaultAttributes,t)),this.name="grid"}render(){this.removeAllChild();const{type:t,items:s,style:a,closed:n,alternateColor:r,depth:l=0}=this.attribute;if(!i.isEmpty(s)&&(s.forEach(((s,r)=>{const{id:o,points:d}=s;let h="";if("line"===t||"polygon"===t)h=ft(d,!!n);else if("circle"===t){const{center:t}=this.attribute;h=At(t,d,!1,!!n)}const u=e.createPath({path:h,z:l,...i.isFunction(a)?i.merge({},Et.defaultAttributes.style,a(s,r)):a});u.name=`${this.name}-line`,u.id=this._getNodeId(`path-${o}`),this.add(u)})),l&&"line"===t&&s.forEach(((t,s)=>{const{id:r,points:o}=t,d=[];d.push(o[0]);const h=o[1].x-o[0].x,u=o[1].y-o[0].y,c=Math.sqrt(h*h+u*u),p=l/c;d.push({x:o[0].x+h*p,y:o[0].y+u*p});const b=ft(d,!!n),v=i.abs(d[0].x-d[1].x),g=i.abs(d[0].y-d[1].y),_=e.createPath({path:b,z:0,alpha:v>g?(o[1].x-o[0].x>0?-1:1)*i.pi/2:0,beta:v<g?-i.pi/2:0,anchor3d:v>g?[d[0].x,0]:[0,d[0].y],...i.isFunction(a)?i.merge({},Et.defaultAttributes.style,a(t,s)):a});_.name=`${this.name}-line`,_.id=this._getNodeId(`path-${r}`),this.add(_)})),s.length>1&&r)){const t=i.isArray(r)?r:[r,"transparent"],a=e=>t[e%t.length];for(let t=0;t<s.length-1;t++){const[i,n]=[s[t].points,s[t+1].points],r=St(i,n,this.attribute),l=e.createPath({path:r,fill:a(t)});l.name=`${this.name}-region`,l.id=this._getNodeId(`region-${t}`),this.add(l)}}}_getNodeId(t){return`${this.id}-${t}`}}Et.defaultAttributes={style:{lineWidth:1,stroke:"#416180"},zIndex:0};class Lt extends n{constructor(t){super(i.merge({},Lt.defaultAttributes,t)),this.name="segment"}computeLineAngle(){const{points:t}=this.attribute,e=t[0],i=t[1],s=t[t.length-2],a=t[t.length-1],n=[e.x-i.x,e.y-i.y],r=Math.atan2(n[1],n[0]),l=[a.x-s.x,a.y-s.y],o=Math.atan2(l[1],l[0]);this._startAngle=r,this._endAngle=o}render(){this.removeAllChild();const{points:t,startSymbol:s,endSymbol:a,lineStyle:n,state:r,visible:l=!0}=this.attribute;if(!l)return;t.length>1&&this.computeLineAngle();const o=this.renderSymbol(s,"start"),d=this.renderSymbol(a,"end");this.startSymbol=o,this.endSymbol=d;let h=t;if(null==s?void 0:s.visible){const e=(null==s?void 0:s.clip)?(null==s?void 0:s.size)||10:0;h=[{x:t[0].x-e/2*(Math.cos(this._startAngle)||0),y:t[0].y-e/2*(Math.sin(this._startAngle)||0)},...h.slice(1)]}if(null==a?void 0:a.visible){const e=(null==a?void 0:a.clip)?(null==a?void 0:a.size)||10:0,i={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};h=[...h.slice(0,h.length-1),i]}const u=e.createLine({points:h,fill:!1,...n});u.name="line",u.id=this._getNodeId("line"),i.isEmpty(null==r?void 0:r.line)||(u.states=r.line),this.line=u,this.add(u)}renderSymbol(t,s){const{autoRotate:a=!0}=t;let n;if(null==t?void 0:t.visible){const r=this._startAngle,l=this._endAngle,{points:o,state:d}=this.attribute,h=o[0],u=o[o.length-1],{refX:c=0,refY:p=0,refAngle:b=0,style:v,symbolType:g,size:_=12}=t;let y,m;"start"===s?(y={x:h.x+(r?c*Math.cos(r)+p*Math.cos(r-Math.PI/2):0),y:h.y+(r?c*Math.sin(r)+p*Math.sin(r-Math.PI/2):0)},m=r+Math.PI/2):(y={x:u.x+(l?c*Math.cos(l)+p*Math.cos(l-Math.PI/2):0),y:u.y+(l?c*Math.sin(l)+p*Math.sin(l-Math.PI/2):0)},m=l+Math.PI/2),n=e.createSymbol({...y,symbolType:g,size:_,angle:a?m+b:0,strokeBoundsBuffer:0,...v}),n.name=`${s}-symbol`,n.id=this._getNodeId(`${s}-symbol`),i.isEmpty(null==d?void 0:d.symbol)||(n.states=d.symbol),this.add(n)}return n}getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}}var kt,Bt;Lt.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},t.AXIS_ELEMENT_NAME=void 0,(kt=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",kt.axisContainer="axis-container",kt.labelContainer="axis-label-container",kt.tickContainer="axis-tick-container",kt.tick="axis-tick",kt.subTick="axis-sub-tick",kt.label="axis-label",kt.title="axis-title",kt.gridContainer="axis-grid-container",kt.grid="axis-grid",kt.gridRegion="axis-grid-region",kt.line="axis-line",kt.background="axis-background",kt.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(Bt=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",Bt.selectedReverse="selected_reverse",Bt.hover="hover",Bt.hoverReverse="hover_reverse";const Mt={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},wt={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},grid:{style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};class Tt extends n{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{const e=t.target;e!==this._lastHover&&e.name&&!i.isEmpty(e.states)&&(e.addState(x.hover,!0),l(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(x.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(l(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(x.hoverReverse),t.removeState(x.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState(x.selected))return this._lastSelect=null,void l(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(x.selectedReverse),t.removeState(x.selected))}));e.name&&!i.isEmpty(e.states)&&(e.addState(x.selected,!0),l(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(x.selectedReverse,!0)})),this._lastSelect=e)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const s=i.cloneDeep(this.attribute);i.merge(this.attribute,t);const a=e.createGroup({x:this.attribute.x,y:this.attribute.y});return this.add(a),this._renderInner(a),this.removeChild(a),this.attribute=s,a.AABBBounds}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=e.createGroup({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(i){const{title:s,label:a,tick:n,line:r,grid:l,items:o}=this.attribute,d=e.createGroup({x:0,y:0,zIndex:1});if(d.name=t.AXIS_ELEMENT_NAME.axisContainer,d.id=this._getNodeId("container"),d.setMode(this.mode),this.axisContainer=d,i.add(d),(null==r?void 0:r.visible)&&this.renderLine(d),o&&o.length){if(this.data=this._transformItems(o[0]),(null==n?void 0:n.visible)&&this.renderTicks(d),null==a?void 0:a.visible){const i=e.createGroup({x:0,y:0,pickable:!1});i.name=t.AXIS_ELEMENT_NAME.labelContainer,i.id=this._getNodeId("label-container"),this.axisLabelsContainer=i,d.add(i),o.forEach(((t,e)=>{const s=this.renderLabels(i,t,e),a=s.getChildren();this.beforeLabelsOverlap(a,t,s,e,o.length),this.handleLabelsOverlap(a,t,s,e,o.length),this.afterLabelsOverlap(a,t,s,e,o.length)}))}(null==l?void 0:l.visible)&&this.renderGrid(i)}(null==s?void 0:s.visible)&&this.renderTitle(d)}renderTicks(s){const a=this.getTickLineItems(),n=e.createGroup({x:0,y:0,pickable:!1});n.name=t.AXIS_ELEMENT_NAME.tickContainer,n.id=this._getNodeId("tick-container"),s.add(n),a.forEach(((s,r)=>{var l;const o=e.createLine({...this._getTickLineAttribute("tick",s,r,a)});if(o.name=t.AXIS_ELEMENT_NAME.tick,o.id=this._getNodeId(s.id),i.isEmpty(null===(l=this.attribute.tick)||void 0===l?void 0:l.state))o.states=f;else{const t=this.data[r],e=i.merge({},f,this.attribute.tick.state);Object.keys(e).forEach((s=>{i.isFunction(e[s])&&(e[s]=e[s](t.rawValue,r,t,this.data))})),o.states=e}n.add(o)})),this.tickLineItems=a;const{subTick:r}=this.attribute;if(null==r?void 0:r.visible){const s=this.getSubTickLineItems();s.length&&s.forEach(((s,l)=>{const o=e.createLine({...this._getTickLineAttribute("subTick",s,l,a)});if(o.name=t.AXIS_ELEMENT_NAME.subTick,o.id=this._getNodeId(`${l}`),i.isEmpty(r.state))o.states=f;else{const t=i.merge({},f,r.state);Object.keys(t).forEach((e=>{i.isFunction(t[e])&&(t[e]=t[e](s.value,l,s,a))})),o.states=t}n.add(o)})),this.subTickLineItems=s}}renderLabels(s,a,n){const{dataFilter:r}=this.attribute.label;r&&i.isFunction(r)&&(a=r(a,n));const l=this._transformItems(a),o=e.createGroup({x:0,y:0,pickable:!1});o.name=`${t.AXIS_ELEMENT_NAME.labelContainer}-layer-${n}`,o.id=this._getNodeId(`label-container-layer-${n}`),s.add(o);let d=0,h=0,u="center",c="middle";return l.forEach(((s,a)=>{var r,p;const b=this._getLabelAttribute(s,a,l,n),v=e.createText(b);if(v.name=t.AXIS_ELEMENT_NAME.label,v.id=this._getNodeId(`layer${n}-label-${s.id}`),i.isEmpty(null===(r=this.attribute.label)||void 0===r?void 0:r.state))v.states=f;else{const t=i.merge({},f,this.attribute.label.state);Object.keys(t).forEach((e=>{i.isFunction(t[e])&&(t[e]=t[e](s,a,l,n))})),v.states=t}o.add(v);const g=null!==(p=b.angle)&&void 0!==p?p:0;d=Math.max(d,v.AABBBounds.width()),h=Math.max(h,v.AABBBounds.height()),g&&(d=Math.abs(d*Math.cos(g)),h=Math.abs(h*Math.sin(g))),u=b.textAlign,c=b.textBaseline})),this.axisLabelLayerSize[n]={width:d,height:h,textAlign:u,textBaseline:c},o}renderTitle(e){const i=this.getTitleAttribute(),s=new E({...i});s.name=t.AXIS_ELEMENT_NAME.title,s.id=this._getNodeId("title"),e.add(s)}renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType("subGrid",t),this._renderGridByType("grid",t)}getVerticalCoord(t,e,i){const s=this.getVerticalVector(e,i,t);return{x:t.x+s[0],y:t.y+s[1]}}getTextAlign(t){let e="center";return i.isNumberClose(t[0],0)?i.isNumberClose(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,s=[],{alignWithLabel:a,inside:n=!1,length:r,dataFilter:l}=t;let o=1;return e.length>=2&&(o=e[1].value-e[0].value),(l&&i.isFunction(l)?l(e):e).forEach((t=>{let e=t.point,l=t.value;if(!a){const i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),l=i}const d=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const a=this.getVerticalVector(r,n,e);let o=0,h=0;i.abs(a[0])>i.abs(a[1])?o=i.pi/2*(d.x>e.x?1:-1):h=i.pi/2*(d.y>e.y?-1:1),s.push({start:e,end:d,value:l,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else s.push({start:e,end:d,value:l,id:`tick-${t.id}`})})),s}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:a=2}=t,n=this.tickLineItems,r=n.length;if(r>=2)for(let t=0;t<r-1;t++){const r=n[t],l=n[t+1];for(let t=0;t<i;t++){const n=(t+1)/(i+1),o=(1-n)*r.value+n*l.value,d=this.getTickCoord(o),h=this.getVerticalCoord(d,a,s);e.push({start:d,end:h,value:o,id:`sub-tick-${o}`})}}return e}_getTickLineAttribute(t,e,s,a){let n=i.get(this.attribute,`${t}.style`);const r=this.data[s];n=i.isFunction(n)?i.merge({},i.get(wt,`${t}.style`),"tick"===t?n(r.rawValue,s,r,this.data):n(e.value,s,e,a)):n;const{start:l,end:o,anchor:d,alpha:h,beta:u}=e;return{points:[l,o],anchor:d,alpha:h,beta:u,...n}}_getLabelAttribute(t,e,s,a){var n,r,l,o,d,h;const{space:u=4,inside:c=!1,formatMethod:p,...b}=this.attribute.label;let v=u,g=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&(null===(r=this.attribute.tick)||void 0===r?void 0:r.inside)===c&&(g=(null===(l=this.attribute.tick)||void 0===l?void 0:l.length)||4),(null===(o=this.attribute.subTick)||void 0===o?void 0:o.visible)&&(null===(d=this.attribute.subTick)||void 0===d?void 0:d.inside)===c&&(g=Math.max(g,(null===(h=this.attribute.subTick)||void 0===h?void 0:h.length)||2)),v+=g;const _=this.getRelativeVector(t.point);a>0&&(0===_[1]?v+=(this.axisLabelLayerSize[a-1].height+i.get(this.attribute,"label.space",4))*a:v+=(this.axisLabelLayerSize[a-1].width+i.get(this.attribute,"label.space",4))*a);const y=this.getVerticalCoord(t.point,v,c),m=this.getVerticalVector(v,c,y),x=p?p(`${t.label}`,t,e,s,a):t.label;let{style:f}=b;return f=i.isFunction(f)?i.merge({},wt.label.style,f(t,e,s,a)):f,f=i.merge({textAlign:this.getTextAlign(m),textBaseline:this.getTextBaseline(m,c)},f),i.isFunction(f.text)&&(f.text=f.text({label:t.label,value:t.rawValue,index:t.index,layer:a})),{...y,text:x,lineHeight:null==f?void 0:f.fontSize,...f}}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push({...t,point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label})})),e}_renderGridByType(e,i){const s=this.getGridAttribute(e),a=new Et({pickable:!1,...s,zIndex:0});a.name="subGrid"===e?`${t.AXIS_ELEMENT_NAME.grid}-sub`:`${t.AXIS_ELEMENT_NAME.grid}`,a.id=this._getNodeId(e),i.add(a)}}const Ct={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,s)=>s&&Pt(i.AABBBounds,t.AABBBounds,e)?t.setAttribute("opacity",0):(i=t,1)))}};function Pt(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function It(t,e){for(let i,s=1,a=t.length,n=t[0].AABBBounds;s<a;n=i,++s)if(Pt(n,i=t[s].AABBBounds,e))return!0}function Ht(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function zt(t){for(let a=1;a<t.length;a++)if(e=t[a-1],s=t[a],i.isRotateAABBIntersect(e.rotatedBounds,s.rotatedBounds,!0))return!0;var e,s;return!1}function Vt(t,e){"bottom"!==t&&"top"!==t||Nt(t,e),"left"!==t&&"right"!==t||Rt(t,e),function(t){t.forEach((t=>{const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(s=e.centerX,a=e.centerY,n=e.angle,r=t.attribute.x,l=t.attribute.y,{x:(s-r)*Math.cos(n)+(a-l)*Math.sin(n)+r,y:(s-r)*Math.sin(n)+(l-a)*Math.cos(n)+l});var s,a,n,r,l;const o=i.x-e.centerX,d=i.y-e.centerY;e.x1+=o,e.x2+=o,e.y1+=d,e.y2+=d,e.centerX+=o,e.centerY+=d,t.rotatedBounds=e}))}(e)}function Rt(t,e){let i=["right","right","center","left","center","left","center","right","right"],s=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","right","right","right","left","left","left","left","right"],s=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]),e.forEach(((t,e)=>{let a=t.attribute.angle||0;if(a<0)for(;a<0;)a+=2*Math.PI;if(a>0)for(;a>=2*Math.PI;)a-=2*Math.PI;const n=a/(.5*Math.PI);let r;r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,t.setAttributes({textAlign:i[r],textBaseline:s[r],angle:a})}))}function Nt(t,e){let i=["center","left","left","left","center","right","right","right","left"],s=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],s=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]),e.forEach((t=>{let e=t.attribute.angle||0;if(e<0)for(;e<0;)e+=2*Math.PI;if(e>0)for(;e>=2*Math.PI;)e-=2*Math.PI;const a=e/(.5*Math.PI);let n;n=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1,t.setAttributes({textAlign:i[n],textBaseline:s[n],angle:e})}))}class Dt extends Tt{constructor(t,e){super(i.merge({},Dt.defaultAttributes,t),e),"3d"===e&&this.setMode(e)}_renderInner(s){var a;super._renderInner(s);const{panel:n}=this.attribute;if(n&&n.visible){const s=this.axisContainer,r=s.AABBBounds,l=e.createRect({x:r.x1,y:r.y1,width:r.width(),height:r.height(),...n.style});l.name=t.AXIS_ELEMENT_NAME.background,l.id=this._getNodeId("background"),l.states=i.merge({},Mt,null!==(a=n.state)&&void 0!==a?a:{}),s.insertBefore(l,s.firstChild)}}renderLine(e){const{start:s,end:a,line:n}=this.attribute,{startSymbol:r,endSymbol:l,style:o,breakRange:d,breakShape:h,breakShapeStyle:u,state:c,...p}=n,b={points:[s,a],startSymbol:r,endSymbol:l,lineStyle:o,...p};i.isEmpty(c)||(b.state={line:i.merge({},Mt,c),symbol:i.merge({},Mt,c)});const v=new Lt(b);v.name=t.AXIS_ELEMENT_NAME.line,v.id=this._getNodeId("line"),e.add(v)}isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(){const{start:t,end:e}=this.attribute;return[e.x-t.x,e.y-t.y]}getVerticalVector(t,e=!1){const{verticalFactor:i=1}=this.attribute,s=function(t){const[e,i]=t;let s=e*e+i*i;return s>0&&(s=1/Math.sqrt(s)),[t[0]*s,t[1]*s]}(this.getRelativeVector());return v([s[1],-1*s[0]],t*(e?1:-1)*i)}getTitleAttribute(){var t,e,s,a,n,r,l,o;const{position:d="middle",space:h=4,textStyle:u={},autoRotate:c=!0,shape:p,background:b,state:v,..._}=this.attribute.title;let y=.5;"start"===d?y=0:"end"===d&&(y=1);const{verticalFactor:m=1}=this.attribute,x=-1*m,f=this.getTickCoord(y),A=this.getRelativeVector();let S=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(e=this.attribute.label)||void 0===e?void 0:e.inside)){const t=+i.get(this.attribute,"label.space",4);S+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===A[1]){const i=this.axisLabelsContainer.AABBBounds.height();isFinite(i)?S+=i+(e-1)*t:S=0}else{if(0===A[0]){const i=this.axisLabelsContainer.AABBBounds.width();isFinite(i)?S+=i+(e-1)*t:S=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{S+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const i=this.axisLabelLayerSize[0].textAlign,s="start"===i||"left"===i,a="center"===i,n=A[1]>0;S=1===x?n?s?S:a?S/2:t:s?t:a?S/2:S:n?s?t:a?S/2:S:s?S:a?S/2:t}}let E=0;(null===(s=this.attribute.tick)||void 0===s?void 0:s.visible)&&!1===(null===(a=this.attribute.tick)||void 0===a?void 0:a.inside)&&(E=(null===(n=this.attribute.tick)||void 0===n?void 0:n.length)||4),(null===(r=this.attribute.subTick)||void 0===r?void 0:r.visible)&&!1===(null===(l=this.attribute.subTick)||void 0===l?void 0:l.inside)&&(E=Math.max(E,(null===(o=this.attribute.subTick)||void 0===o?void 0:o.length)||2));const L=E+S+h,k=this.getVerticalCoord(f,L,!1),B=this.getVerticalVector(L,!1);let M,w,{angle:T}=_;if(M="start"===d?"start":"end"===d?"end":"center",i.isNil(T)&&c){T=g(A,[1,0],!0);const{verticalFactor:t=1}=this.attribute;w=1===-1*t?"bottom":"top"}else M=this.getTextAlign(B),w=this.getTextBaseline(B,!1);const C={...k,..._,textStyle:{textAlign:M,textBaseline:w,...u},state:{text:i.merge({},Mt,null==v?void 0:v.text),shape:i.merge({},Mt,null==v?void 0:v.shape),panel:i.merge({},Mt,null==v?void 0:v.background)}};return C.angle=T,p&&p.visible&&(C.shape={visible:!0,...p.style},p.space&&(C.space=p.space)),b&&b.visible&&(C.panel={visible:!0,...b.style}),C}_getGridPoint(t,e){let s;if("line"===t){const{length:t}=this.attribute.grid;s=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:a,startAngle:n=_,endAngle:r=y}=this.attribute.grid;s=function(t,e,s,a,n){const r=[],l=n-a;for(let n=0;n<e;n++){const o=a+n*l/e;r.push(i.polarToCartesian(t,s,o))}return r}(t,a,i.PointService.distancePP(t,e),n,r)}return s}getGridAttribute(t){const{type:e,alignWithLabel:s=!0}=this.attribute.grid;let a=1;let n;this.data.length>=2&&(a=this.data[1].value-this.data[0].value);let r=[];if("grid"===t){n=this.attribute.grid;const t=[];this.data.forEach((i=>{let{point:n}=i;if(!s){const t=i.value-a/2;if(this.isInValidValue(t))return;n=this.getTickCoord(t)}t.push({id:i.label,datum:i,points:this._getGridPoint(e,n)})})),r=t}else{n=i.merge({},this.attribute.grid,this.attribute.subGrid);const t=[],{count:l=4}=this.attribute.subTick||{};if(this.data.length>=2){const i=[];this.data.forEach((t=>{let e=t.value;if(!s){const i=t.value-a/2;if(this.isInValidValue(i))return;e=i}i.push({value:e})}));for(let s=0;s<i.length-1;s++){const a=i[s],n=i[s+1];t.push({id:`sub-${s}-0`,points:this._getGridPoint(e,this.getTickCoord(a.value)),datum:{}});for(let i=0;i<l;i++){const r=(i+1)/(l+1),o=(1-r)*a.value+r*n.value,d=this.getTickCoord(o);t.push({id:`sub-${s}-${i+1}`,points:this._getGridPoint(e,d),datum:{}})}s===i.length-2&&t.push({id:`sub-${s}-${l+1}`,points:this._getGridPoint(e,this.getTickCoord(n.value)),datum:{}})}r=t}}return{...n,items:r}}getTextBaseline(t,e){let s="middle";const{verticalFactor:a=1}=this.attribute,n=(e?1:-1)*a;return i.isNumberClose(t[1],0)?s=!i.isNumberClose(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?s="top":t[1]<0&&(s="bottom"),s}beforeLabelsOverlap(t,e,i,s,a){const n=this.attribute.orient;"left"===n||"right"===n?Rt(n,t):"bottom"!==n&&"top"!==n||Nt(n,t)}handleLabelsOverlap(t,e,s,a,n){if(i.isEmpty(t))return;const{verticalLimitSize:r,label:l,orient:o}=this.attribute,d=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:u,autoRotateAngle:c,autoLimit:p,limitEllipsis:b,autoHide:v,autoHideMethod:g,autoHideSeparation:_}=l;i.isFunction(h)?h(t,e,a,this):(u&&function(t,e){if(i.isEmpty(t))return;const{orient:s,labelRotateAngle:a=[0,45,90]}=e;if(0===a.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(a&&a.length>0&&(r=a.length);n<r;){const e=a[n++];if(t.forEach((t=>{t.attribute.angle=i.degreeToRadian(e)})),Vt(s,t),!zt(t))break}}(t,{labelRotateAngle:c,orient:o}),p&&i.isValidNumber(d)&&d>0&&function(t,e){const{limitLength:s,ellipsis:a="...",orient:n}=e;!i.isEmpty(t)&&i.isValidNumber(s)&&t.forEach((t=>{if(("top"===n||"bottom"===n)&&Math.floor(t.AABBBounds.height())<=s)return;if(("left"===n||"right"===n)&&Math.floor(t.AABBBounds.width())<=s)return;let e=0===t.attribute.angle||i.isNil(t.attribute.angle)?"top"===n||"bottom"===n?null:s:Math.abs(s/Math.sin(t.attribute.angle));i.isValidNumber(t.attribute.maxLineWidth)&&(e=i.isValidNumber(e)?Math.min(t.attribute.maxLineWidth,e):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:e,ellipsis:t.attribute.ellipsis||a})}))}(t,{limitLength:d,ellipsis:b,orient:o}),v&&function(t,e){if(i.isEmpty(t))return;const s=t.filter(Ht);if(i.isEmpty(s))return;let a;a=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(s);const{method:n="parity",separation:r=0}=e,l=i.isFunction(n)?n:Ct[n]||Ct.parity;if(a.length>=3&&It(a,r)){do{a=l(a,r)}while(a.length>=3&&It(a,r));a.length<3&&!i.last(s).attribute.opacity&&(a.length>1&&i.last(a).setAttribute("opacity",0),i.last(s).setAttribute("opacity",1))}s.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:o,method:g,separation:_}))}afterLabelsOverlap(s,a,n,r,l){const{verticalLimitSize:o,orient:d}=this.attribute,h="bottom"===d||"top"===d,u=n.AABBBounds;let c=h?u.height():u.width();const{verticalMinSize:p}=this.attribute;if(i.isValidNumber(p)&&(!i.isValidNumber(o)||p<=o)){const i=this._getAxisLabelLimitLength(p,l);let s,a;c=Math.max(c,i),"left"===d?(s=u.x2-c,a=u.y1):"right"===d?(s=u.x1,a=u.y1):"top"===d?(s=u.x1,a=u.y2-c):"bottom"===d&&(s=u.x1,a=u.y1);const r=e.createRect({x:s,y:a,width:h?u.width():c,height:h?c:u.height(),pickable:!1});r.name=t.AXIS_ELEMENT_NAME.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),n.insertBefore(r,n.firstChild)}if(i.isValid(this.attribute.label.containerAlign)){let t;"left"===d?t=u.x2:"right"===d?t=u.x1:"top"===d?t=u.y2:"bottom"===d&&(t=u.y1),function(t,e,i,s,a){if("right"===s||"left"===s){if("left"===a){const a="right"===s?0:-1;t.forEach((t=>{t.setAttributes({x:e+i*a,textAlign:"left"})}))}else if("right"===a){const a="right"===s?1:0;t.forEach((t=>{t.setAttributes({x:e+i*a,textAlign:"right"})}))}else if("center"===a){const a="right"===s?1:-1;t.forEach((t=>{t.setAttributes({x:e+.5*i*a,textAlign:"center"})}))}}else if("bottom"===s||"top"===s)if("top"===a){const a="bottom"===s?0:-1;t.forEach((t=>{t.setAttributes({y:e+i*a,textBaseline:"top"})}))}else if("bottom"===a){const a="bottom"===s?1:0;t.forEach((t=>{t.setAttributes({y:e+i*a,textBaseline:"bottom"})}))}else if("middle"===a){const a="bottom"===s?1:-1;t.forEach((t=>{t.setAttributes({y:e+.5*i*a,textBaseline:"middle"})}))}}(s,t,c,d,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var s,a,n;const{label:r,title:l,line:o,tick:d}=this.attribute,h=null!==(s=r.space)&&void 0!==s?s:4;let u=t,c=0,p=0;const b=(null==o?void 0:o.visible)?null!==(a=o.style.lineWidth)&&void 0!==a?a:1:0,v=(null==d?void 0:d.visible)?null!==(n=d.length)&&void 0!==n?n:4:0;if(null==l?void 0:l.visible){c=S(l.text,l.textStyle).height;const t=i.normalizePadding(l.padding);p=l.space+t[0]+t[2]}return u&&(u=(u-h-p-c-b-v)/e),u}}Dt.defaultAttributes=wt;class Ot extends Tt{constructor(t){super(i.merge({},Ot.defaultAttributes,t))}renderLine(s){const{startAngle:a=_,endAngle:n=y,radius:r,center:l,innerRadius:o=0,line:d,inside:h=!1}=this.attribute;let u=r,c=o;h&&o>0&&(u=o,c=0);const p={...l,startAngle:a,endAngle:n,radius:u,innerRadius:c,...null==d?void 0:d.style},b=e.createCircle(p);b.name=t.AXIS_ELEMENT_NAME.line,b.id=this._getNodeId("line"),i.isEmpty(null==d?void 0:d.state)||(b.states=i.merge({},Mt,d.state)),s.add(b)}isInValidValue(t){const{startAngle:e=_,endAngle:i=y}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=_,endAngle:s=y,center:a,radius:n,inside:r=!1,innerRadius:l=0}=this.attribute,o=e+(s-e)*t;return i.polarToCartesian(a,r&&l>0?l:n,o)}getVerticalVector(t,e=!1,i){const{inside:s=!1}=this.attribute,{center:a}=this.attribute,n=[i.x-a.x,i.y-a.y];return v(n,(e?-1:1)*(s?-1:1)*t/function(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}(n))}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}getTitleAttribute(){var t,e,s,a,n,r,l,o;const{center:d,radius:h,innerRadius:u=0}=this.attribute,{space:c=4,textStyle:p={},shape:b,background:v,state:g,..._}=this.attribute.title;let y=d,m=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(e=this.attribute.label)||void 0===e?void 0:e.inside)&&(m=i.get(this.attribute.label,"style.fontSize",12)+i.get(this.attribute.label,"space",4));let x=0;(null===(s=this.attribute.tick)||void 0===s?void 0:s.visible)&&!1===(null===(a=this.attribute.tick)||void 0===a?void 0:a.inside)&&(x=(null===(n=this.attribute.tick)||void 0===n?void 0:n.length)||4),(null===(r=this.attribute.subTick)||void 0===r?void 0:r.visible)&&!1===(null===(l=this.attribute.subTick)||void 0===l?void 0:l.inside)&&(x=Math.max(x,(null===(o=this.attribute.subTick)||void 0===o?void 0:o.length)||2));const f=h+x+m+c;let A="middle",{position:S}=this.attribute.title;i.isNil(S)&&(S=0===u?"end":"middle"),"start"===S?(A="bottom",y={x:d.x,y:d.y-f}):"end"===S&&(A="top",y={x:d.x,y:d.y+f});const E={...y,..._,textStyle:{textBaseline:A,textAlign:"center",...p},state:{text:i.merge({},Mt,null==g?void 0:g.text),shape:i.merge({},Mt,null==g?void 0:g.shape),panel:i.merge({},Mt,null==g?void 0:g.background)}},{angle:L}=_;return E.angle=L,b&&b.visible&&(E.shape={visible:!0,...b.style},b.space&&(E.space=b.space)),v&&v.visible&&(E.panel={visible:!0,...v.style}),E}getSubTickLineItems(){var t,e;const{subTick:i}=this.attribute,s=[],{count:a=4,inside:n=!1,length:r=2}=i,l=this.tickLineItems,o=l.length;if(o>=2){const i=this.data[1].value-this.data[0].value,d=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t<o;t++){const e=l[t],o=l[t+1];for(let t=0;t<a;t++){const l=(t+1)/(a+1),h=(1-l)*e.value+l*(o?o.value:d?1:e.value+i),u=this.getTickCoord(h),c=this.getVerticalCoord(u,r,n);s.push({start:u,end:c,value:h})}}}return s}getGridAttribute(t){let e,s=[];const{radius:a,innerRadius:n=0,startAngle:r=_,endAngle:l=y,center:o,grid:d}=this.attribute,{alignWithLabel:h=!0}=d||{},u=a-n;let c=1;if(this.data.length>=2&&(c=this.data[1].value-this.data[0].value),"grid"===t){e=this.attribute.grid;const t=[];let i;i=Math.abs(l-r)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,i.forEach((e=>{let{point:i}=e;if(!h){const t=e.value-c/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,u,!0);t.push({id:e.id,points:[i,s],datum:e})})),s=t}else{e=i.merge({},this.attribute.grid,this.attribute.subGrid);const t=[],{count:a=4}=this.attribute.subTick||{},n=this.data.length;if(n>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!h){const e=t.value-c/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let i=0;i<n;i++){const s=e[i],n=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(s.value),this.getVerticalCoord(this.getTickCoord(s.value),u,!0)],datum:{}});for(let e=0;e<a;e++){const r=(e+1)/(a+1),l=(1-r)*s.value+r*(n?n.value:h?1:s.value+c),o=this.getTickCoord(l),d=this.getVerticalCoord(o,u,!0);t.push({id:`sub-${i}-${e+1}`,points:[o,d],datum:{}})}}Math.abs(l-r)%(2*Math.PI)==0&&t.push(t[0]),s=t}}return{...e,items:s,center:o}}getTextBaseline(t){let e="middle";return i.isNumberClose(t[1],0)?e="middle":t[1]>0&&t[1]>Math.abs(t[0])?e="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(e="bottom"),e}beforeLabelsOverlap(t,e,i,s,a){}handleLabelsOverlap(t,e,i,s,a){}afterLabelsOverlap(t,e,i,s,a){}}Ot.defaultAttributes=wt;class $t extends e.ACustomAnimate{constructor(){super(...arguments),this.mode=e.AnimateMode.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._oldElementMap=function(t){const e={};return l(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(e),this._newElementAttrMap={},l(t,(t=>{var e,s,a,n,r,l;if("group"!==t.type&&t.id){const o=this._oldElementMap[t.id];if(o){if(!i.isEqual(t.attribute,o.attribute)){const n=i.cloneDeep(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:{...n,opacity:null!==(e=n.opacity)&&void 0!==e?e:1,fillOpacity:null!==(s=n.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(a=n.strokeOpacity)&&void 0!==a?a:1}},t.setAttributes(o.attribute)}}else{const e={opacity:null!==(n=t.attribute.opacity)&&void 0!==n?n:1,fillOpacity:null!==(r=t.attribute.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(l=t.attribute.strokeOpacity)&&void 0!==l?l:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,e=this.easing;Object.keys(this._newElementAttrMap).forEach((s=>{var a,n,r;const{node:l,attrs:o,state:d}=this._newElementAttrMap[s];"enter"===d&&(t=i.isValidNumber(null===(a=this.params.enter)||void 0===a?void 0:a.duration)?this.params.enter.duration:t,e=(null===(n=this.params.enter)||void 0===n?void 0:n.easing)?null===(r=this.params.enter)||void 0===r?void 0:r.easing:e),"path"===l.type?l.animate({interpolate:(t,e,s,a,n)=>"path"===t&&(n.path=i.interpolateString(s,a)(e),!0)}).to(o,t,e):l.animate().to(o,t,e)}))}onUpdate(t,e,i){}}class Ut extends e.ACustomAnimate{constructor(t,e,i,s){super(null,null,i,s)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}}class Wt extends e.ACustomAnimate{constructor(t,e,i,s){super(null,null,i,s)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}}var Ft;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(Ft||(Ft={}));class Gt extends n{constructor(t){super(i.merge({},Gt.defaultAttributes,t)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=t=>t,this._onHandlerPointerDown=(t,e)=>{"start"===e?(this._activeTag=Ft.startHandler,this._activeItem=this._startHandler):"end"===e?(this._activeTag=Ft.endHandler,this._activeItem=this._endHandler):"middleRect"===e?(this._activeTag=Ft.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=Ft.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=Ft.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t)},this._onHandlerPointerMove=t=>{const{start:e,end:i,brushSelect:s}=this.attribute,a=this.eventPosToStagePos(t),{attPos:n,max:r}=this._layoutCache,l=(a[n]-this._activeCache.lastPos[n])/r;this._activeState&&(this._activeTag===Ft.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===Ft.startHandler?this.state.start+l>this.state.end?(this.state.start=this.state.end,this.state.end=this.state.start+l,this._activeTag=Ft.endHandler):this.state.start=this.state.start+l:this._activeTag===Ft.endHandler&&(this.state.end+l<this.state.start?(this.state.end=this.state.start,this.state.start=this.state.end+l,this._activeTag=Ft.startHandler):this.state.end=this.state.end+l),this._activeCache.lastPos=a,s&&this.renderDragMask()),this.state.start=Math.min(Math.max(this.state.start,0),1),this.state.end=Math.min(Math.max(this.state.end,0),1),e===this.state.start&&i===this.state.end||(this.setAttributes({start:this.state.start,end:this.state.end}),this._updateStateCallback&&this._updateStateCallback(this.state.start,this.state.end))};const{start:e,end:s,size:a,orient:n,showDetail:r,position:l,previewData:o,previewCallbackX:d,previewCallbackY:h,previewCallbackX1:u,previewCallbackY1:c,updateStateCallback:p}=this.attribute,{width:b,height:v}=a;e&&(this.state.start=e),s&&(this.state.end=s),this._isHorizontal="top"===n||"bottom"===n,this._layoutCache.max=this._isHorizontal?b:v,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",this._activeCache.startPos=l,this._activeCache.lastPos=l,this._showText="auto"!==r&&r,o&&(this._previewData=o),i.isFunction(d)&&(this._previewCallbackX=d),i.isFunction(h)&&(this._previewCallbackY=h),i.isFunction(u)&&(this._previewCallbackX1=u),i.isFunction(c)&&(this._previewCallbackY1=c),i.isFunction(p)&&(this._updateStateCallback=p)}bindEvents(){const{showDetail:t,brushSelect:i}=this.attribute;this._startHandler&&this._startHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandler&&this._endHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const s=i?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,s))),i&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),i&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,s))),"browser"===e.vglobal.env&&(e.vglobal.addEventListener("pointermove",this._onHandlerPointerMove.bind(this)),e.vglobal.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",this._onHandlerPointerMove),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}eventPosToStagePos(t){var e,i,s;const a=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==a?void 0:a.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==a?void 0:a.top)||0)-((null===(s=this.stage)||void 0===s?void 0:s.y)||0)}}_onHandlerPointerUp(t){const{start:e,end:i,brushSelect:s}=this.attribute;if(this._activeState&&this._activeTag===Ft.background){const e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,s&&this.renderDragMask(),e===this.state.start&&i===this.state.end||(this.setAttributes({start:this.state.start,end:this.state.end}),this._updateStateCallback&&this._updateStateCallback(this.state.start,this.state.end))}_onHandlerPointerEnter(t){this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:s}=this._layoutCache,{position:a}=this.attribute,n=t[i]-a[i],r=e[i]-a[i],l=Math.min(Math.max(Math.min(n,r)/s,0),1),o=Math.min(Math.max(Math.max(n,r)/s,0),1);Math.abs(l-o)<.01?this.moveZoomWithMiddle(l):(this.state.start=l,this.state.end=o)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.state.start=this.state.start+e,this.state.end=this.state.end+e)}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:s,height:a}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",{x:i.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+s),y:e.y,width:this._activeState&&this._activeTag===Ft.background&&Math.abs(this.dragMaskSize())||0,height:a,...t},"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",{x:e.x,y:i.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+a),width:s,height:this._activeState&&this._activeTag===Ft.background&&Math.abs(this.dragMaskSize())||0,...t},"rect")}renderText(){const{startTextStyle:t,endTextStyle:e}=this.attribute,{formatMethod:s,...a}=t,{formatMethod:n,...r}=e,{start:l,end:o}=this.state;this._startValue=this._statePointToData(l),this._endValue=this._statePointToData(o);const{position:d,width:h,height:u}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:d.x+l*h,y:d.y+u/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${d}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:d.x+o*h,y:d.y+u/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${d}`)):(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:d.x+h/2,y:d.y+l*u,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${d}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:d.x+h/2,y:d.y+o*u,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${d}`))}getLayoutAttrFromConfig(){var t,e,i,s;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:a,size:n,orient:r,middleHandlerStyle:l,startHandlerStyle:o,endHandlerStyle:d}=this.attribute,{width:h,height:u}=n,c=null!==(e=null===(t=null==l?void 0:l.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let p,b,v;(null==l?void 0:l.visible)?this._isHorizontal?(p=h,b=u-c,v={x:a.x,y:a.y+c}):(p=h-c,b=u,v={x:a.x+("left"===r?c:0),y:a.y}):(p=h,b=u,v=a);const g=null!==(i=null==o?void 0:o.size)&&void 0!==i?i:this._isHorizontal?b:p,_=null!==(s=null==d?void 0:d.size)&&void 0!==s?s:this._isHorizontal?b:p;return(null==o?void 0:o.visible)&&(this._isHorizontal?(p-=(g+_)/2,v={x:v.x+g/2,y:v.y}):(b-=(g+_)/2,v={x:v.x,y:v.y+g})),this._layoutAttrFromConfig={position:v,width:p,height:b},this._layoutAttrFromConfig}render(){var t,e,i,s,a,n,r,l,o,d,h,u,c,p,b,v,g,_,y,m,x;this._layoutAttrFromConfig=null;const{orient:f,backgroundStyle:A,backgroundChartStyle:S,selectedBackgroundStyle:E,selectedBackgroundChartStyle:L,middleHandlerStyle:k,startHandlerStyle:B,endHandlerStyle:M,brushSelect:w}=this.attribute,{start:T,end:C}=this.state,{position:P,width:I,height:H}=this.getLayoutAttrFromConfig(),z=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=z,this._background=z.createOrUpdateChild("background",{x:P.x,y:P.y,width:I,height:H,cursor:w?"crosshair":"auto",...A},"rect"),(null===(t=null==S?void 0:S.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",z),(null===(e=null==S?void 0:S.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",z),w&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=z.createOrUpdateChild("selectedBackground",{x:P.x+T*I,y:P.y,width:(C-T)*I,height:H,cursor:w?"crosshair":"move",...E},"rect"):this._selectedBackground=z.createOrUpdateChild("selectedBackground",{x:P.x,y:P.y+T*H,width:I,height:(C-T)*H,cursor:w?"crosshair":"move",...E},"rect"),(null===(i=null==L?void 0:L.line)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("line",z),(null===(s=null==L?void 0:L.area)||void 0===s?void 0:s.visible)&&this.setSelectedPreviewAttributes("area",z),this.renderText(),this._isHorizontal?(this._startHandler=z.createOrUpdateChild("startHandler",{x:P.x+T*I,y:P.y+H/2,size:H,angle:0,symbolType:null!==(a=null==B?void 0:B.symbolType)&&void 0!==a?a:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",...B},"symbol"),this._endHandler=z.createOrUpdateChild("endHandler",{x:P.x+C*I,y:P.y+H/2,size:H,angle:0,symbolType:null!==(n=null==M?void 0:M.symbolType)&&void 0!==n?n:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",...M},"symbol"),(null==k?void 0:k.visible)&&(this._middleHandlerRect=z.createOrUpdateChild("middleHandlerRect",{x:P.x+T*I,y:P.y-((null===(r=null==k?void 0:k.background)||void 0===r?void 0:r.size)||10),width:(C-T)*I,height:(null===(l=null==k?void 0:k.background)||void 0===l?void 0:l.size)||10,...null===(o=null==k?void 0:k.background)||void 0===o?void 0:o.style},"rect"),this._middleHandlerSymbol=z.createOrUpdateChild("middleHandlerSymbol",{x:P.x+(T+C)/2*I,y:P.y-((null===(d=null==k?void 0:k.background)||void 0===d?void 0:d.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(u=null===(h=null==k?void 0:k.icon)||void 0===h?void 0:h.symbolType)&&void 0!==u?u:"square",...null==k?void 0:k.icon},"symbol"))):(this._startHandler=z.createOrUpdateChild("startHandler",{x:P.x+I/2,y:P.y+T*H,size:I,angle:Math.PI/180*90,symbolType:null!==(c=null==B?void 0:B.symbolType)&&void 0!==c?c:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0,...B},"symbol"),(null==k?void 0:k.visible)&&(this._middleHandlerRect=z.createOrUpdateChild("middleHandlerRect",{x:"left"===f?P.x-((null===(p=null==k?void 0:k.background)||void 0===p?void 0:p.size)||10):P.x+I,y:P.y+T*H,width:(null===(b=null==k?void 0:k.background)||void 0===b?void 0:b.size)||10,height:(C-T)*H,...null===(v=null==k?void 0:k.background)||void 0===v?void 0:v.style},"rect"),this._middleHandlerSymbol=z.createOrUpdateChild("middleHandlerSymbol",{x:"left"===f?P.x-((null===(g=null==k?void 0:k.background)||void 0===g?void 0:g.size)||10)/2:P.x+I+((null===(_=null==k?void 0:k.background)||void 0===_?void 0:_.size)||10)/2,y:P.y+(T+C)/2*H,angle:Math.PI/180*90,symbolType:null!==(m=null===(y=null==k?void 0:k.icon)||void 0===y?void 0:y.symbolType)&&void 0!==m?m:"square",strokeBoundsBuffer:0,...null==k?void 0:k.icon},"symbol")),this._endHandler=z.createOrUpdateChild("endHandler",{x:P.x+I/2,y:P.y+C*H,size:I,angle:Math.PI/180*90,symbolType:null!==(x=null==M?void 0:M.symbolType)&&void 0!==x?x:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0,...M},"symbol"))}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();let a,n;return this._isHorizontal?(a=[{x:e.x,y:e.y+s}],n=[{x:e.x+i,y:e.y+s}]):"left"===t?(a=[{x:e.x+i,y:e.y}],n=[{x:e.x+i,y:e.y+s}]):(a=[{x:e.x,y:e.y+s}],n=[{x:e.x,y:e.y}]),{basePointStart:a,basePointEnd:n}}getPreviewLinePoints(){const t=this._previewData.map((t=>({x:this._previewCallbackX&&this._previewCallbackX(t),y:this._previewCallbackY&&this._previewCallbackY(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){const t=this._previewData.map((t=>({x:this._previewCallbackX&&this._previewCallbackX(t),y:this._previewCallbackY&&this._previewCallbackY(t),x1:this._previewCallbackX1&&this._previewCallbackX1(t),y1:this._previewCallbackY1&&this._previewCallbackY1(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i}=this.attribute;"line"===t&&this._previewLine.setAttributes({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.line}),"area"===t&&this._previewArea.setAttributes({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.area})}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i}=this.attribute,{start:s,end:a}=this.state,{position:n,width:r,height:l}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?n.x+s*r:n.x,y:this._isHorizontal?n.y:n.y+s*l,width:this._isHorizontal?(a-s)*r:r,height:this._isHorizontal?l:(a-s)*l,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?n.x+s*r:n.x),y:-(this._isHorizontal?n.y:n.y+s*l),width:this._isHorizontal?(a-s)*r:r,height:this._isHorizontal?l:(a-s)*l,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.line}),"area"===t&&this._selectedPreviewArea.setAttributes({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.area})}maybeAddLabel(t,e,i){let s=this.find((t=>t.name===i),!0);return s?s.setAttributes(e):(s=new E(e),s.name=i),t.add(s),s}setStartAndEnd(t,e){const{start:s,end:a}=this.attribute;i.isValid(t)&&i.isValid(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,s===this.state.start&&a===this.state.end||(this.setAttributes({start:t,end:e}),this._updateStateCallback&&this._updateStateCallback(t,e)))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,s,a;const{middleHandlerStyle:n}=this.attribute,r=null!==(e=null===(t=null==n?void 0:n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,l=null!==(a=null===(s=null==n?void 0:n.icon)||void 0===s?void 0:s.size)&&void 0!==a?a:10;return Math.max(r,...i.array(l))}setUpdateStateCallback(t){i.isFunction(t)&&(this._updateStateCallback=t)}setPreviewCallbackX(t){i.isFunction(t)&&(this._previewCallbackX=t)}setPreviewCallbackY(t){i.isFunction(t)&&(this._previewCallbackY=t)}setPreviewCallbackX1(t){i.isFunction(t)&&(this._previewCallbackX1=t)}setPreviewCallbackY1(t){i.isFunction(t)&&(this._previewCallbackY1=t)}setStatePointToData(t){i.isFunction(t)&&(this._statePointToData=t)}}var Yt,Xt,qt;Gt.defaultAttributes={orient:"bottom",showDetail:"auto",brushSelect:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",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}},startHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},t.IMarkLineLabelPosition=void 0,(Yt=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",Yt.middle="middle",Yt.end="end",Yt.insideStartTop="insideStartTop",Yt.insideStartBottom="insideStartBottom",Yt.insideMiddleTop="insideMiddleTop",Yt.insideMiddleBottom="insideMiddleBottom",Yt.insideEndTop="insideEndTop",Yt.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(Xt=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",Xt.right="right",Xt.top="top",Xt.bottom="bottom",Xt.middle="middle",Xt.insideLeft="insideLeft",Xt.insideRight="insideRight",Xt.insideTop="insideTop",Xt.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(qt=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",qt.bottom="bottom",qt.middle="middle",qt.insideTop="insideTop",qt.insideBottom="insideBottom",qt.insideMiddle="insideMiddle";class Zt extends n{render(){var t,i;const s=null===(t=this.attribute.visible)||void 0===t||t;if(null!==(i=this.attribute.interactive)&&void 0!==i&&i||(this.setAttribute("pickable",!1),this.setAttribute("childrenPickable",!1)),s)if(this._container)this.updateMarker();else{const t=e.createGroup({});t.name="marker-container",this.add(t),this._container=t,this.initMarker(t)}}}const jt={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:t.IMarkLineLabelPosition.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},Jt={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},Kt={label:{position:t.IMarkAreaLabelPosition.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},Qt={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},te={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};class ee extends Zt{constructor(t){super(i.merge({},ee.defaultAttributes,t))}setLabelPos(){var t,e,i,s,a;const{points:n,label:r}=this.attribute,l=null!==(t=null==r?void 0:r.position)&&void 0!==t?t:"end",o=this._line.getEndAngle(),d=(null==r?void 0:r.refX)*Math.cos(o)+r.refY*Math.cos(o-Math.PI/2),h=(null==r?void 0:r.refX)*Math.sin(o)+r.refY*Math.sin(o-Math.PI/2);l.includes("start")||l.includes("Start")?null===(e=this._label)||void 0===e||e.setAttributes({x:n[0].x+d,y:n[0].y+h}):l.includes("middle")||l.includes("Middle")?null===(i=this._label)||void 0===i||i.setAttributes({x:(n[0].x+n[n.length-1].x)/2+d,y:(n[0].y+n[n.length-1].y)/2+h}):null===(s=this._label)||void 0===s||s.setAttributes({x:n[n.length-1].x+d,y:n[n.length-1].y+h}),this._label.setAttributes({angle:r.autoRotate&&o+(null!==(a=null==r?void 0:r.refAngle)&&void 0!==a?a:0),textStyle:{...Jt[l],...r.textStyle}})}initMarker(t){const{points:e,startSymbol:i,endSymbol:s,label:a,lineStyle:n}=this.attribute,r=new Lt({points:e,startSymbol:i,endSymbol:s,lineStyle:n});r.name="mark-line-line",this._line=r,t.add(r);const l=new E({...a});l.name="mark-line-label",this._label=l,t.add(l),this.setLabelPos()}updateMarker(){var t,e;const{points:i,startSymbol:s,endSymbol:a,label:n,lineStyle:r}=this.attribute;null===(t=this._line)||void 0===t||t.setAttributes({points:i,startSymbol:s,endSymbol:a,lineStyle:r}),null===(e=this._label)||void 0===e||e.setAttributes({...n}),this.setLabelPos()}}ee.defaultAttributes=jt;class ie extends Zt{constructor(t){super(i.merge({},ie.defaultAttributes,t))}getLeftPos(){return{x:this._area.AABBBounds.x1,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}getRightPos(){return{x:this._area.AABBBounds.x2,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}getTopPos(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:this._area.AABBBounds.y1}}getBottomPos(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:this._area.AABBBounds.y2}}getMiddlePos(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}setLabelPos(){var t,e,i,s,a,n,r;const{label:l}=this.attribute,o=null!==(t=null==l?void 0:l.position)&&void 0!==t?t:"middle";o.includes("left")||o.includes("Left")?null===(e=this._label)||void 0===e||e.setAttributes({...this.getLeftPos()}):o.includes("right")||o.includes("Right")?null===(i=this._label)||void 0===i||i.setAttributes({...this.getRightPos()}):o.includes("top")||o.includes("Top")?null===(s=this._label)||void 0===s||s.setAttributes({...this.getTopPos()}):o.includes("bottom")||o.includes("Bottom")?null===(a=this._label)||void 0===a||a.setAttributes({...this.getBottomPos()}):null===(n=this._label)||void 0===n||n.setAttributes({...this.getMiddlePos()}),null===(r=this._label)||void 0===r||r.setAttributes({textStyle:{...Qt[o],...l.textStyle}})}initMarker(t){const{points:i,label:s,areaStyle:a}=this.attribute,n=e.createPolygon({points:i,...a});n.name="mark-area-area",this._area=n,t.add(n);const r=new E({...s});r.name="mark-area-label",this._label=r,t.add(r),this.setLabelPos()}updateMarker(){var t,e;const{points:i,label:s,areaStyle:a}=this.attribute;null===(t=this._area)||void 0===t||t.setAttributes({points:i,...a}),null===(e=this._label)||void 0===e||e.setAttributes({...s}),this.setLabelPos()}}ie.defaultAttributes=Kt;class se extends Zt{constructor(t){super(i.merge({},se.defaultAttributes,t))}setLabelPos(){}setItemAttributes(e,i,s,a){var n;const{autoRotate:r=!0,refX:l=0,refY:o=0,refAngle:d=0,textStyle:h,richTextStyle:u,imageStyle:c,position:p=t.IMarkPointItemPosition.middle}=i,b=(null===(n=this._line)||void 0===n?void 0:n.getEndAngle())||0,v=l*Math.cos(b)+o*Math.cos(b-Math.PI/2),g=l*Math.sin(b)+o*Math.sin(b-Math.PI/2);"text"===a?null==e||e.setAttributes({...h,textStyle:{...te[(null==i?void 0:i.position)||"end"],...null==h?void 0:h.textStyle}}):"richText"===a?null==e||e.setAttributes({dx:this.getItemDx(e,p,u)+((null==u?void 0:u.dx)||0),dy:this.getItemDy(e,p,u)+((null==u?void 0:u.dy)||0)}):"image"===a&&(null==e||e.setAttributes({dx:this.getItemDx(e,p,c)+((null==c?void 0:c.dx)||0),dy:this.getItemDy(e,p,c)+((null==c?void 0:c.dy)||0)})),null==e||e.setAttributes({x:s.x+(v||0),y:s.y+(g||0),angle:r&&b+d})}getItemDx(t,e,i){var s,a;const n=null!==(a=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==a?a:(null==i?void 0:i.width)||0;return e.includes("inside")?-n:0}getItemDy(t,e,i){var s,a;const n=null!==(a=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==a?a:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-n:e.includes("middle")||e.includes("Middle")?-n/2:0}initItem(t,i){const{type:s="text",symbolStyle:a,richTextStyle:n,imageStyle:r,renderCustomCallback:l}=t;let o;return"symbol"===s?o=e.createSymbol({...i,...a}):"text"===s?o=new E({...i}):"richText"===s?o=e.createRichText({...i,...n}):"image"===s?o=e.createImage({...i,...r}):"custom"===s&&l&&(o=l()),this.setItemAttributes(o,t,i,s),o}getItemLineAttr(t,e,i){let s=[];const{type:a="type-s"}=t;return s="type-do"===a?[e,{x:(e.x+i.x)/2,y:i.y},i]:"type-po"===a?[e,{x:i.x,y:e.y},i]:"type-op"===a?[e,{x:e.x,y:i.y},i]:[e,i],s}setItemLineAttr(t,e,i,s){var a;const{startSymbol:n,endSymbol:r,lineStyle:l}=t,o=this.getItemLineAttr(t,e,i);null===(a=this._line)||void 0===a||a.setAttributes({points:o,startSymbol:n,endSymbol:r,lineStyle:l,visible:s})}getDecorativeLineAttr(t,e){var i;const s=(null===(i=null==t?void 0:t.decorativeLine)||void 0===i?void 0:i.length)||10,a=this._line.getEndAngle()||0;return{startPointOffsetX:s/2*Math.cos(a-Math.PI/2),startPointOffsetY:s/2*Math.sin(a-Math.PI/2),endPointOffsetX:-s/2*Math.cos(a-Math.PI/2),endPointOffsetY:-s/2*Math.sin(a-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var s;const{lineStyle:a}=t,{startPointOffsetX:n,startPointOffsetY:r,endPointOffsetX:l,endPointOffsetY:o}=this.getDecorativeLineAttr(t,e);null===(s=this._decorativeLine)||void 0===s||s.setAttributes({points:[{x:e.x+n,y:e.y+r},{x:e.x+l,y:e.y+o}],...a,visible:i})}initMarker(t){var i;const{position:s,itemLine:a,itemContent:n}=this.attribute,r={x:s.x+((null==n?void 0:n.offsetX)||0),y:s.y+((null==n?void 0:n.offsetY)||0)},l=new Lt({points:[]});l.name="mark-point-line",this._line=l,t.add(l);const o=e.createLine({points:[]});o.name="mark-point-decorativeLine",this._decorativeLine=o,t.add(o),this.setItemLineAttr(a,s,r,null==a?void 0:a.visible),this.setDecorativeLineAttr(a,r,null===(i=null==a?void 0:a.decorativeLine)||void 0===i?void 0:i.visible);const d=this.initItem(n,r);this._item=d,t.add(d)}updateMarker(){var t;const{position:e,itemLine:i,itemContent:s}=this.attribute,{type:a="text"}=s,n={x:e.x+((null==s?void 0:s.offsetX)||0),y:e.y+((null==s?void 0:s.offsetY)||0)};this.setItemLineAttr(i,e,n,null==i?void 0:i.visible),this.setDecorativeLineAttr(i,n,null===(t=null==i?void 0:i.decorativeLine)||void 0===t?void 0:t.visible),this.setItemAttributes(this._item,s,n,a)}}se.defaultAttributes={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}};const ae={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};class ne extends n{getCurrent(){return this._current}constructor(t){super(i.merge({},ne.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{var i,s;const a=t.target;if("preHandler"===a.name){if(1===this._current)return;this._current-=1,1===this._current?a.addState("disable"):a.removeState("disable");const t=new e.CustomEvent("toPrev",{current:this._current,total:this._total,direction:"pre"});t.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(t)}if("nextHandler"===a.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?a.addState("disable"):a.removeState("disable");const t=new e.CustomEvent("toNext",{current:this._current,total:this._total,direction:"next"});t.manager=null===(s=this.stage)||void 0===s?void 0:s.eventSystem.manager,this.dispatchEvent(t)}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",`${this._current}/${this._total}`)}}render(){var t;this._reset();const{layout:s="horizontal",handler:a=ae,total:n,defaultCurrent:r=1,textStyle:l,padding:o=0}=this.attribute;this._current=r;const d=i.normalizePadding(o),h="horizontal"===s,u=e.createGroup({x:0,y:0}),c=a.style||{},p=c.size||15,b=null!==(t=a.space)&&void 0!==t?t:8,v=a.state||{};let{preShape:g,nextShape:_}=a;g||(g=h?"triangleLeft":"triangleUp"),_||(_=h?"triangleRight":"triangleDown");const y=e.createSymbol({strokeBoundsBuffer:0,pickMode:"imprecise",...c,x:0,y:0,symbolType:g,size:p});y.states=v,y.name="preHandler",this.preHandler=y,u.add(y);const{width:m,height:x}=S(`${n}/${n}`,{textAlign:"center",textBaseline:"middle",...l}),f=i.isNumber(p)?p:p[0],A=i.isNumber(p)?p:p[1],E=e.createText({x:h?f/2+b+m/2:0,y:h?0:A/2+b+x/2,text:`${r}/${n}`,textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize,...l});this.text=E,u.add(E);const L=e.createSymbol({strokeBoundsBuffer:0,pickMode:"imprecise",...c,x:h?f+2*b+m:0,y:h?0:A+2*b+x,symbolType:_,size:p});L.name="nextHandler",L.states=v,this.nextHandler=L,u.add(L),1===this._total?(y.addState("disable"),L.addState("disable")):1===this._current?y.addState("disable"):this._current===n&&L.addState("disable");const k=u.AABBBounds,B=k.width(),M=k.height();u.translateTo(0-k.x1+d[3],0-k.y1+d[0]),this.add(u),this.attribute.width=B+d[1]+d[3],this.attribute.height=M+d[0]+d[2],this._bindEvents()}_bindEvents(){this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick))}_reset(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}}ne.defaultAttributes={handler:ae,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const re=16,le=8,oe=12,de=12;var he,ue,ce;t.LegendStateValue=void 0,(he=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",he.unSelected="unSelected",he.selectedHover="selectedHover",he.unSelectedHover="unSelectedHover",he.focus="focus",t.LegendEvent=void 0,(ue=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",ue.legendItemUnHover="legendItemUnHover",ue.legendItemClick="legendItemClick",t.LEGEND_ELEMENT_NAME=void 0,(ce=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",ce.title="legendTitle",ce.item="legendItem",ce.itemShape="legendItemShape",ce.itemLabel="legendItemLabel",ce.itemValue="legendItemValue",ce.focus="legendItemFocus";class pe extends n{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild();const{interactive:s=!0,title:a,padding:n=0}=this.attribute,r=i.normalizePadding(n),l=e.createGroup({x:r[3],y:r[0],pickable:s,childrenPickable:s});l.name=t.LEGEND_ELEMENT_NAME.innerView,this.add(l),this._innerView=l,(null==a?void 0:a.visible)&&this._renderTitle(a),this._renderContent(),this._adjustLayout(),s&&this._bindEvents();const o=this._innerView.AABBBounds;this.attribute.width=o.width()+r[1]+r[3],this.attribute.height=o.height()+r[0]+r[2]}_renderTitle(e){const{text:s="",textStyle:a,padding:n=0,background:r,minWidth:l,maxWidth:o,shape:d}=e,h={x:0,y:0,text:s,textStyle:a,padding:i.normalizePadding(n),minWidth:l,maxWidth:o};d&&d.visible&&(h.shape={visible:!0,...d.style},i.isValid(d.space)&&(h.space=d.space)),r&&r.visible&&(h.panel={visible:!0,...r.style});const u=new E(h);u.name=t.LEGEND_ELEMENT_NAME.title,this._title=u,this._innerView.add(u)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}const be={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};class ve extends pe{constructor(e){super(i.merge({},ve.defaultAttributes,e)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=e=>{var i;const s=e.target;if(null===(i=null==s?void 0:s.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const e=s.delegate;e.hasState(t.LegendStateValue.selected)?this._setLegendItemState(e,t.LegendStateValue.selectedHover):this._setLegendItemState(e,t.LegendStateValue.unSelectedHover);const i=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchEvent(t.LegendEvent.legendItemHover,e)}},this._onUnHover=e=>{var i;const s=e.target;if(null===(i=null==s?void 0:s.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const e=s.delegate;e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const i=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);i&&i.setAttribute("visible",!1),this._dispatchEvent(t.LegendEvent.legendItemUnHover,e)}},this._onClick=e=>{var i,s,a,n,r;const l=e.target;if(null===(i=null==l?void 0:l.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const e=l.delegate;if(l.name===t.LEGEND_ELEMENT_NAME.focus){const i=e.hasState(t.LegendStateValue.focus);e.toggleState(t.LegendStateValue.focus),i?null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((e=>{this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover,t.LegendStateValue.focus]),this._setLegendItemState(e,t.LegendStateValue.selected)})):(this._setLegendItemState(e,t.LegendStateValue.selected),this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover]),null===(a=this._itemsContainer)||void 0===a||a.getChildren().forEach((i=>{e!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover,t.LegendStateValue.focus]),this._setLegendItemState(i,t.LegendStateValue.unSelected))})))}else{null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{e.removeState(t.LegendStateValue.focus)}));const{selectMode:i="multiple",allowAllCanceled:s=!0}=this.attribute,a=e.hasState(t.LegendStateValue.selected),l=this._getSelectedLegends();if("multiple"===i){if(!1===s&&a&&1===l.length)return void this._dispatchEvent(t.LegendEvent.legendItemClick,e);a?(this._removeLegendItemState(e,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(e,t.LegendStateValue.unSelected)):(this._setLegendItemState(e,t.LegendStateValue.selected),this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover]))}else this._setLegendItemState(e,t.LegendStateValue.selected),this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover]),null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach((i=>{e!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}this._dispatchEvent(t.LegendEvent.legendItemClick,e)}}}setSelected(e){var i;(null===(i=this._itemsContainer)||void 0===i?void 0:i.getChildren()).forEach((i=>{const s=i.data;e.includes(s.label)?(this._setLegendItemState(i,t.LegendStateValue.selected),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover])):(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}_renderContent(){const{item:t={},items:s,reversed:a,maxCol:n=1,maxRow:r=2}=this.attribute;if(!1===t.visible||i.isEmpty(s))return;let l=s;a&&(l=null==s?void 0:s.reverse());const o=e.createGroup({x:0,y:0});this._itemsContainer=o;const{layout:d,maxWidth:h,maxHeight:u,defaultSelected:c=[],autoPage:p}=this.attribute,b="horizontal"===d,{spaceCol:v=re,spaceRow:g=le,maxWidth:_,width:y,height:m}=t;i.isValid(_)?i.isValid(y)?this._itemWidthByUser=Math.min(_,y):this._itemWidthByUser=_:i.isValid(y)&&(this._itemWidthByUser=y),i.isValid(m)&&(this._itemHeightByUser=m);let x=!1,f=0,A=0,S=0,E=1,L=1;l.forEach(((t,e)=>{t.id||(t.id=t.label),t.index=e;const s=this._renderEachItem(t,!!i.isEmpty(c)||(null==c?void 0:c.includes(t.label)),e,l),a=s.attribute.width,d=s.attribute.height;this._itemHeight=Math.max(this._itemHeight,d),f=Math.max(a,f),this._itemMaxWidth=Math.max(a,this._itemMaxWidth),b?(E=r,i.isValid(h)&&(a>=h?(x=!0,e>0&&(A=0,S+=d+g,L+=1)):h<A+a&&(x=!0,A=0,S+=d+g,L+=1)),e>0&&s.setAttributes({x:A,y:S}),A+=v+a):(E=n,i.isValid(u)&&u<S+d&&(x=!0,S=0,A+=f+v,f=0,L+=1),e>0&&s.setAttributes({x:A,y:S}),S+=g+d),o.add(s)}));let k=!1;x&&p&&L>E&&(k=this._renderPager(b)),k||(o.setAttribute("y",this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",8):0),this._innerView.add(o))}_bindEvents(){if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerout",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_renderEachItem(s,a,n,r){const{id:l,label:o,value:d,shape:h}=s,{padding:u=0,focus:c,focusIconStyle:p={}}=this.attribute.item;let{shape:b={},label:v={},value:g={},background:_={}}=this.attribute.item;b=this._handleStyle(b,s,a,n,r),v=this._handleStyle(v,s,a,n,r),g=this._handleStyle(g,s,a,n,r),_=this._handleStyle(_,s,a,n,r);const y=i.normalizePadding(u);let m;!1===_.visible?(m=e.createGroup({x:0,y:0,cursor:(null==_?void 0:_.style).cursor}),this._appendDataToShape(m,t.LEGEND_ELEMENT_NAME.item,s,m)):(m=e.createGroup({x:0,y:0,...null==_?void 0:_.style}),this._appendDataToShape(m,t.LEGEND_ELEMENT_NAME.item,s,m,null==_?void 0:_.state)),m.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const x=e.createGroup({x:0,y:0,pickable:!1});m.add(x);let f=0;const A=i.get(b,"style.size",10),S=i.get(b,"space",8),E=e.createSymbol({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0,...h,...b.style});let L;Object.keys(b.state||{}).forEach((t=>{const e=b.state[t].fill||b.state[t].stroke;h.fill&&i.isNil(b.state[t].fill)&&e&&(b.state[t].fill=e),h.stroke&&i.isNil(b.state[t].stroke)&&e&&(b.state[t].stroke=e)})),this._appendDataToShape(E,t.LEGEND_ELEMENT_NAME.itemShape,s,m,null==b?void 0:b.state),E.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(E);let k=0;if(c){const a=i.get(p,"size",10);L=e.createSymbol({x:0,y:-a/2-1,strokeBoundsBuffer:0,...p,visible:!1,pickMode:"imprecise",boundsPadding:y}),this._appendDataToShape(L,t.LEGEND_ELEMENT_NAME.focus,s,m),k=a}const B=e.createText({x:A/2+S,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==v?void 0:v.style).fontSize,...null==v?void 0:v.style,text:v.formatMethod?v.formatMethod(o,s,n):o});this._appendDataToShape(B,t.LEGEND_ELEMENT_NAME.itemLabel,s,m,null==v?void 0:v.state),B.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(B);const M=i.get(v,"space",8);if(f+=A/2+S+B.AABBBounds.width()+M,i.isValid(d)){const r=i.get(g,"space",c?8:0),l=e.createText({x:f+M,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==g?void 0:g.style).fontSize,...null==g?void 0:g.style,text:g.formatMethod?g.formatMethod(d,s,n):d});this._appendDataToShape(l,t.LEGEND_ELEMENT_NAME.itemValue,s,m,null==g?void 0:g.state),l.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser&&(l.setAttribute("maxLineWidth",this._itemWidthByUser-y[1]-y[3]-A-S-B.AABBBounds.width()-M-k-r),g.alignRight&&l.setAttributes({textAlign:"right",x:this._itemWidthByUser-A/2-y[1]-y[3]-k-r})),f=l.AABBBounds.x2+r,x.add(l)}else this._itemWidthByUser&&B.setAttribute("maxLineWidth",this._itemWidthByUser-y[1]-y[3]-A-S-k);L&&(L.setAttribute("x",f),x.add(L));const w=x.AABBBounds,T=w.width(),C=w.height(),P=i.isValid(this.attribute.item.width)?this.attribute.item.width:T+y[1]+y[3],I=this._itemHeightByUser||C+y[0]+y[2];return m.attribute.width=P,m.attribute.height=I,x.translateTo(-w.x1+y[3],-w.y1+y[0]),m}_renderPager(t){const s=this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",8):0,{maxWidth:a,maxHeight:n,maxCol:r=1,maxRow:l=2,item:o={},pager:d={}}=this.attribute,{spaceCol:h=re,spaceRow:u=le}=o,c=this._itemsContainer,{animation:p=!0,animationDuration:b=450,animationEasing:v="quadIn",space:g=de,..._}=d;let y,m=0,x=0,f=0,A=0,S=1;if(t){if(y=new ne({layout:1===l?"horizontal":"vertical",total:99,...i.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},_)}),this._pager=y,this._innerView.add(y),m=(l-1)*u+this._itemHeight*l,x=a-y.AABBBounds.width()-g,x<=0)return this._innerView.removeChild(y),!1;c.getChildren().forEach(((t,e)=>{const{width:i,height:s}=t.attribute;x<f+i&&(f=0,A+=s+u,S+=1),e>0&&t.setAttributes({x:f,y:A}),f+=h+i})),y.setAttributes({total:Math.ceil(S/l),x:x,y:s+m/2-y.AABBBounds.height()/2})}else{if(y=new ne({layout:"horizontal",total:99,..._}),this._pager=y,this._innerView.add(y),x=this._itemMaxWidth*r+(r-1)*h,m=n-y.AABBBounds.height()-g-s,m<=0)return this._innerView.removeChild(y),!1;c.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;m<A+i&&(A=0,f+=this._itemMaxWidth+h,S+=1),e>0&&t.setAttributes({x:f,y:A}),A+=u+i})),y.setAttributes({total:Math.ceil(S/r),x:(x-y.AABBBounds.width())/2,y:n-y.AABBBounds.height()})}d.defaultCurrent>1&&(t?c.setAttribute("y",-(d.defaultCurrent-1)*(m+u)):c.setAttribute("x",-(d.defaultCurrent-1)*(x+h)));const E=e.createGroup({x:0,y:s,width:x,height:m,clip:!0,pickable:!1});E.add(c),this._innerView.add(E);const L=e=>{const{current:i}=e.detail;p?c.animate().to(t?{y:-(i-1)*(m+u)}:{x:-(i-1)*(x+h)},b,v):t?c.setAttribute("y",-(i-1)*(m+u)):c.setAttribute("x",-(i-1)*(x+h))};return this._pager.addEventListener("toPrev",L),this._pager.addEventListener("toNext",L),!0}_setLegendItemState(e,i,s=!0){e.addState(i,s),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&e.addState(i,s)}))}_removeLegendItemState(e,i){i.forEach((t=>{e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{e.removeState(t)}))}))}_getSelectedLegends(){var e;const i=[];return null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{e.hasState(t.LegendStateValue.selected)&&i.push(e.data)})),i}_appendDataToShape(t,e,s,a,n={}){t.name=e,t.data=s,t.delegate=a,t.states=i.merge({},be,n)}_dispatchEvent(i,s){var a;const n=this._getSelectedLegends();n.sort(((t,e)=>t.index-e.index));const r=n.map((t=>t.label)),l=new e.CustomEvent(i,{item:s,data:s.data,selected:s.hasState(t.LegendStateValue.selected),currentSelectedItems:n,currentSelected:r});l.manager=null===(a=this.stage)||void 0===a?void 0:a.eventSystem.manager,this.dispatchEvent(l)}_handleStyle(t,e,s,a,n){const r=i.merge({},t);return t.style&&i.isFunction(t.style)&&(r.style=t.style(e,s,a,n)),t.state&&Object.keys(t.state).forEach((l=>{t.state[l]&&i.isFunction(t.state[l])&&(r.state[l]=t.state[l](e,s,a,n))})),r}}var ge;function _e(t){return i.isArray(t)?t:[t,t]}function ye(t){return t?"ew-resize":"ns-resize"}ve.defaultAttributes={layout:"horizontal",title:{align:"start",space:oe,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:re,spaceRow:le,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:de,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(ge=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",ge.railContainer="sliderRailContainer",ge.rail="sliderRail",ge.startText="sliderStartText",ge.endText="sliderEndText",ge.startHandler="sliderStartHandler",ge.startHandlerText="startHandlerText",ge.endHandler="sliderEndHandler",ge.endHandlerText="sliderEndHandlerText",ge.track="sliderTrack",ge.trackContainer="sliderTrackContainer";class me extends n{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}constructor(t){super(i.merge({},me.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._currentHandler=t.target,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===e.vglobal.env?(e.vglobal.addEventListener("pointermove",this._onHandlerPointerMove),e.vglobal.addEventListener("pointerup",this._onHandlerPointerUp)):(this._currentHandler.addEventListener("pointermove",this._onHandlerPointerMove),this._currentHandler.addEventListener("pointerup",this._onHandlerPointerUp),this._currentHandler.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,s;t.stopPropagation();const{railWidth:a,railHeight:n,min:r,max:l}=this.attribute;let o,d,h,u=0;this._isHorizontal?(o=t.clientX,u=o-this._prePos,d=null===(s=this._currentHandler)||void 0===s?void 0:s.attribute.x,h=a):(o=t.clientY,u=o-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,h=n);const c=i.clamp(d+u,0,h),p=c/h*(l-r)+r;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,p):this._updateHandler(this._currentHandler,c,p),this._updateTrack(),this._prePos=o,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{if(t.preventDefault(),this._currentHandler=null,"browser"===e.vglobal.env)e.vglobal.removeEventListener("pointermove",this._onHandlerPointerMove),e.vglobal.removeEventListener("pointerup",this._onHandlerPointerUp);else{const e=t.target;e.removeEventListener("pointermove",this._onHandlerPointerMove),e.removeEventListener("pointerup",this._onHandlerPointerUp),e.removeEventListener("pointerupoutside",this._onHandlerPointerUp)}},this._onTrackPointerdown=t=>{t.stopPropagation(),this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===e.vglobal.env?(e.vglobal.addEventListener("pointermove",this._onTrackPointerMove),e.vglobal.addEventListener("pointerup",this._onTrackPointerUp)):(this._track.addEventListener("pointermove",this._onTrackPointerMove),this._track.addEventListener("pointerup",this._onTrackPointerUp),this._track.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation();const{railWidth:e,railHeight:s,min:a,max:n}=this.attribute,{startHandler:r,endHandler:l}=this._getHandlers();let o,d,h;this._isHorizontal?(o=t.clientX,d=this._track.attribute.width,h=e):(o=t.clientY,d=this._track.attribute.height,h=s);const u=o-this._prePos;if(r){const t=this._isHorizontal?r.attribute.x:r.attribute.y,e=i.clamp(t+u,0,h-d),s=e/h*(n-a)+a;this._updateHandler(r,e,s)}if(l){const t=this._isHorizontal?l.attribute.x:l.attribute.y,e=i.clamp(t+u,d,h),s=e/h*(n-a)+a;this._updateHandler(l,e,s),this._track.setAttributes(this._isHorizontal?{x:Math.min(null==r?void 0:r.attribute.x,null==l?void 0:l.attribute.x),width:Math.abs((null==r?void 0:r.attribute.x)-(null==l?void 0:l.attribute.x))}:{y:Math.min(null==r?void 0:r.attribute.y,null==l?void 0:l.attribute.y),height:Math.abs((null==r?void 0:r.attribute.y)-(null==l?void 0:l.attribute.y))})}this._prePos=o,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),"browser"===e.vglobal.env?(e.vglobal.removeEventListener("pointermove",this._onTrackPointerMove),e.vglobal.removeEventListener("pointerup",this._onTrackPointerUp)):(this._track.removeEventListener("pointermove",this._onTrackPointerMove),this._track.removeEventListener("pointerup",this._onTrackPointerUp),this._track.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation();const{railWidth:e,railHeight:s,min:a,max:n}=this.attribute,r=this._startHandler,l=this._endHandler;let o,d,h,u;this._isHorizontal?(o=t.viewX-this._rail.globalAABBBounds.x1,d=null==r?void 0:r.attribute.x,h=null==l?void 0:l.attribute.x,u=e):(o=t.viewY-this._rail.globalAABBBounds.y1,d=null==r?void 0:r.attribute.y,h=null==l?void 0:l.attribute.y,u=s);const c=o/u*(n-a)+a;if(i.isValid(h)){const t=Math.abs(o-d)>Math.abs(o-h)?l:r;this._updateHandler(t,o,c)}else this._updateHandler(r,o,c);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){const[e,s]=i.array(t),{layout:a,railWidth:n,railHeight:r,min:l,max:o}=this.attribute,{startHandler:d,endHandler:h}=this._getHandlers(),u="vertical"===a?r:n,c=(e-l)/(o-l)*u;if(d&&this._updateHandler(d,c,e),h){const t=(s-l)/(o-l)*u;this._updateHandler(h,t,s)}this._updateTrack()}render(){var s,a;this.removeAllChild();const{layout:n="horizontal",railWidth:r,railHeight:l,startText:o,endText:d,min:h,max:u,showHandler:c=!0}=this.attribute;let{value:p}=this.attribute;i.isNil(p)&&(p=[h,u]),this._currentValue={startValue:_e(p)[0],endValue:_e(p)[1]};const b="horizontal"===n;this._isHorizontal=b;const v=e.createGroup({x:0,y:0});v.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(v),this._innerView=v;let g,_=0;if(o&&o.visible){g=e.createText({x:b?0:r/2,y:b?l/2:0,textAlign:b?"start":"center",textBaseline:b?"middle":"top",text:o.text,lineHeight:null===(s=o.style)||void 0===s?void 0:s.fontSize,...o.style}),g.name=t.SLIDER_ELEMENT_NAME.startText,v.add(g);const a=i.isValid(o.space)?o.space:0;_+=(b?g.AABBBounds.width():g.AABBBounds.height())+a}const y=e.createGroup({x:b?_:0,y:b?0:_});v.add(y);const m=e.createGroup({x:0,y:0});let x;if(m.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=m,y.add(m),this._renderRail(m),_+=b?r:l,d&&d.visible){const s=i.isValid(d.space)?d.space:0;x=e.createText({x:b?_+s:r/2,y:b?l/2:_+s,textAlign:b?"start":"center",textBaseline:b?"middle":"top",text:d.text,lineHeight:null===(a=d.style)||void 0===a?void 0:a.fontSize,...d.style}),x.name=t.SLIDER_ELEMENT_NAME.endText,v.add(x)}this._renderTrack(m),c&&(this._renderHandlers(y),this._bindEvents())}_renderRail(i){const{railWidth:s,railHeight:a,railStyle:n,slidable:r}=this.attribute;let l="default";!1!==r&&(l="pointer");const o=e.createRect({x:0,y:0,width:s,height:a,cursor:l,...n});return o.name=t.SLIDER_ELEMENT_NAME.rail,i.add(o),this._rail=o,o}_renderHandlers(e){const{range:s,min:a,max:n,handlerSize:r=14,handlerStyle:l,handlerText:o,railHeight:d,railWidth:h,slidable:u}=this.attribute;let{value:c}=this.attribute;i.isNil(c)&&(c=[a,n]);const p=o&&o.visible,b=this._isHorizontal,v=b?h:d,[g,_]=_e(c),y=(g-a)/(n-a)*v,m=this._renderHandler({x:b?y:h/2,y:b?d/2:y,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":ye(b),...l});if(m.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=m,e.add(m),this._currentValue.startPos=y,p){const i=this._renderHandlerText(g);i.name=t.SLIDER_ELEMENT_NAME.startHandlerText,e.add(i),this._startHandlerText=i}if(s){const i=(_-a)/(n-a)*v,s=this._renderHandler({x:b?i:h/2,y:b?d/2:i,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":ye(b),...l});if(s.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=s,e.add(s),this._currentValue.endPos=i,p){const i=this._renderHandlerText(_);i.name=t.SLIDER_ELEMENT_NAME.endHandlerText,e.add(i),this._endHandlerText=i}}}_renderTrack(s){const{range:a,min:n,max:r,railHeight:l,railWidth:o,trackStyle:d,railStyle:h,slidable:u}=this.attribute;let{value:c}=this.attribute;i.isNil(c)&&(c=[n,r]);const p=this._isHorizontal,b=p?o:l;let[v,g]=_e(c);a||(v=n);const _=e.createGroup({x:0,y:0,width:o,height:l,cornerRadius:null==h?void 0:h.cornerRadius,clip:!0,pickable:!1});_.name=t.SLIDER_ELEMENT_NAME.trackContainer;const y=i.isObject(a)&&!0===a.draggableTrack;let m;m=!1===u?"default":!1===a||!1===y?"pointer":ye(p);const x=(g-v)/(r-n)*b,f=e.createRect({x:p?(v-n)/(r-n)*b:0,y:p?0:(v-n)/(r-n)*b,width:p?x:o,height:p?l:x,cursor:m,...d});f.name=t.SLIDER_ELEMENT_NAME.track,this._track=f,_.add(f),s.add(_)}_renderHandler(t){return e.createSymbol(t)}_renderHandlerText(t){var i,s,a;const{align:n,min:r,max:l,handlerSize:o=14,handlerText:d={},railHeight:h,railWidth:u,slidable:c}=this.attribute,p=this._isHorizontal,b=(t-r)/(l-r)*(p?u:h),v=null!==(i=d.space)&&void 0!==i?i:4,g={text:(null==d?void 0:d.formatter)?d.formatter(t):t.toFixed(null!==(s=null==d?void 0:d.precision)&&void 0!==s?s:0),lineHeight:null===(a=d.style)||void 0===a?void 0:a.lineHeight,cursor:!1===c?"default":ye(p),...d.style};p?"top"===n?(g.textBaseline="bottom",g.textAlign="center",g.x=b,g.y=(h-o)/2-v):(g.textBaseline="top",g.textAlign="center",g.x=b,g.y=(h+o)/2+v):"left"===n?(g.textBaseline="middle",g.textAlign="end",g.x=(u-o)/2-v,g.y=b):(g.textBaseline="middle",g.textAlign="start",g.x=(u+o)/2+v,g.y=b);return e.createText(g)}_bindEvents(){const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),i.isObject(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_updateTrack(){const t=this._startHandler,e=this._endHandler;if(this._isHorizontal){const i=null==t?void 0:t.attribute.x;if(e){const t=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else this._track.setAttributes({width:i})}else{const i=null==t?void 0:t.attribute.y;if(e){const t=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,t),height:Math.abs(i-t)})}else this._track.setAttributes({height:i})}}_updateHandler(e,i,s){var a;const n=this._isHorizontal;e.setAttribute(n?"x":"y",i);const r=e.name===t.SLIDER_ELEMENT_NAME.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t}=this.attribute;null==r||r.setAttributes({text:(null==t?void 0:t.formatter)?t.formatter(s):s.toFixed(null!==(a=null==t?void 0:t.precision)&&void 0!==a?a:0),[n?"x":"y"]:i})}e.name===t.SLIDER_ELEMENT_NAME.startHandler?(this._currentValue.startValue=s,this._currentValue.startPos=i):(this._currentValue.endValue=s,this._currentValue.endPos=i)}_updateHandlerText(e,i,s){var a;const n=this._isHorizontal,{handlerText:r}=this.attribute;e.setAttributes({[n?"x":"y"]:i,text:(null==r?void 0:r.formatter)?r.formatter(s):s.toFixed(null!==(a=null==r?void 0:r.precision)&&void 0!==a?a:0)});const l=e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?this._startHandler:this._endHandler;l&&(null==l||l.setAttributes({[n?"x":"y"]:i})),e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?(this._currentValue.startValue=s,this._currentValue.startPos=i):(this._currentValue.endValue=s,this._currentValue.endPos=i)}_dispatchChangeEvent(){var t;const i=!!this.attribute.range,s=this._currentValue,a=new e.CustomEvent("change",{value:i?[Math.min(s.endValue,s.startValue),Math.max(s.endValue,s.startValue)]:s.startValue,position:i?[Math.min(s.endPos,s.startPos),Math.max(s.endPos,s.startPos)]:s.startPos});a.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(a)}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}me.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}};class xe extends pe{constructor(t){super(i.merge({},xe.defaultAttributes,t)),this.name="colorLegend",this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:a,align:n,min:r,max:l,value:o,railWidth:d,railHeight:h,showHandler:u=!0,handlerSize:c,handlerStyle:p,railStyle:b,trackStyle:v,startText:g,endText:_,handlerText:y,showTooltip:m,tooltip:x}=this.attribute,f=[],A=(l-r)/(t.length-1);for(let e=0;e<t.length;e++)f.push(r+A*e);this._colorScale=(new s.LinearScale).domain(f,!0).range(t),this._color=this._getTrackColor();const S=new me({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:a,align:n,min:r,max:l,value:o,railWidth:d,railHeight:h,showHandler:u,handlerSize:c,handlerStyle:p,railStyle:b,trackStyle:{fill:this._color,...v},startText:g,endText:_,handlerText:y,showTooltip:m,tooltip:x});this._innerView.add(S),this._slider=S,S.translateTo(0-S.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",oe):0)-S.AABBBounds.y1),this._updateColor()}_bindEvents(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}_getTrackColor(){const{colors:t,layout:e}=this.attribute;if(i.isEmpty(t))return;const s=t.length;if(1===s)return t[0];const a=[];for(let e=0;e<s;e++){const i=e/(s-1);a.push({offset:i,color:t[e]})}const n="horizontal"===e;return{gradient:"linear",stops:a,x0:0,y0:0,x1:n?1:0,y1:n?0:1}}_updateColor(){const{layout:t="horizontal",colors:e,railWidth:i,railHeight:s}=this.attribute,{startHandler:a,endHandler:n,track:r}=this._slider,{startValue:l,endValue:o,startPos:d,endPos:h}=this._slider.currentValue,u=this._colorScale.scale(l),c=this._colorScale.scale(o);null==a||a.setAttribute("fill",u),null==n||n.setAttribute("fill",c);const p="horizontal"===t?i:s;if(Math.abs(d-h)!==p&&e&&e.length>1){const t=this._color.stops,e=Math.min(d,h),i=Math.max(d,h),s=e/p,a=i/p,n=a-s,u=t.filter((t=>t.offset>s&&t.offset<a)),c=Math.min(l,o),b=Math.max(l,o),v=this._colorScale.scale(c),g=this._colorScale.scale(b),_=[{offset:0,color:v}];u.forEach((t=>{_.push({offset:(t.offset-s)/n,color:t.color})})),_.push({offset:1,color:g}),r.setAttribute("fill",{...this._color,stops:_})}}}function fe(t="bottom"){let e=0;const i=3.5,s=2.5;return"top"===t?`\n M${e},-6L${e-i},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+s},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-s},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-i},2.5\n v-5\n h7\n v5\n Z\n`}xe.defaultAttributes={layout:"horizontal",title:{align:"start",space:oe,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}}};class Ae extends pe{constructor(t){super(i.merge({},Ae.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:s,align:a,min:n,max:r,value:l,railWidth:o,railHeight:d,showHandler:h=!0,handlerSize:u,handlerStyle:c,railStyle:p,trackStyle:b,startText:v,endText:g,handlerText:_,showTooltip:y,tooltip:m,sizeBackground:x}=this.attribute,f=e.createGroup({x:0,y:0});this._innerView.add(f);const A=new me({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:s,align:a,min:n,max:r,value:l,railWidth:o,railHeight:d,showHandler:h,handlerSize:u,handlerStyle:{symbolType:fe(a),...c},railStyle:p,trackStyle:b,startText:v,endText:g,handlerText:_,showTooltip:y,tooltip:m});f.add(A);let S,E=0;const L=12;"horizontal"===s?"top"===a?(S=`M0,0L${o},0L${o},12Z`,E=d):(S=`M0,12L${o},12L${o},0Z`,A.setAttribute("y",L)):"left"===a?S=`M${o},0L${o},0L${o+L},${d}L${o},${d}Z`:(S=`M0,${d}L12,${d}L12,0Z`,A.setAttribute("x",L));const k=e.createPath({x:0,y:E,path:S,...x,zIndex:0});f.add(k);const B=this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",oe):0;f.translate(0-f.AABBBounds.x1,B-f.AABBBounds.y1),this._slider=A}_bindEvents(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}Ae.defaultAttributes={layout:"horizontal",title:{align:"start",space:oe,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};class Se extends n{constructor(t){super(i.merge({},Se.defaultAttributes,t)),this.name="title"}render(){var t,e,s,a,n,r,l,o,d,h,u,c,p,b,v,g,_,y,m,x,f,A,S,E,L,k,B,M,w,T,C,P,I,H,z,V,R,N,D,O,$,U,W,F,G,Y,X,q,Z,j,J,K,Q,tt,et,it,st,at,nt,rt,lt,ot;const{text:dt,textStyle:ht,subtext:ut,subtextStyle:ct,width:pt,height:bt,minWidth:vt,maxWidth:gt,minHeight:_t,maxHeight:yt,align:mt,verticalAlign:xt,padding:ft=0}=this.attribute,At=i.normalizePadding(ft),St=this.createOrUpdateChild("title-container",{x:At[3],y:At[0],zIndex:1},"group");if(!1!==(null===(t=this.attribute)||void 0===t?void 0:t.visible)&&!1!==(null==ht?void 0:ht.visible))if(ht&&i.isValid(null==ht?void 0:ht.character)){const t={x:null!==(e=ht.x)&&void 0!==e?e:0,y:null!==(s=ht.y)&&void 0!==s?s:0,width:null!==(n=null!==(a=ht.width)&&void 0!==a?a:pt)&&void 0!==n?n:0,height:null!==(l=null!==(r=ht.height)&&void 0!==r?r:bt)&&void 0!==l?l:0,ellipsis:null===(o=ht.ellipsis)||void 0===o||o,wordBreak:null!==(d=ht.wordBreak)&&void 0!==d?d:"break-word",maxHeight:ht.maxHeight,maxWidth:ht.maxWidth,textConfig:ht.character};this._mainTitle=St.createOrUpdateChild("mainTitle",t,"richtext")}else i.isValid(dt)&&(this._mainTitle=St.createOrUpdateChild("mainTitle",{text:[dt],...ht,maxLineWidth:null!==(h=null==ht?void 0:ht.maxLineWidth)&&void 0!==h?h:pt,heightLimit:null==ht?void 0:ht.heightLimit,lineClamp:null==ht?void 0:ht.lineClamp,ellipsis:null===(u=null==ht?void 0:ht.ellipsis)||void 0===u||u,x:0,y:0},"wrapText"));const Et=this._mainTitle?null===(c=this._mainTitle)||void 0===c?void 0:c.AABBBounds.height():0,Lt=this._mainTitle?null===(p=this._mainTitle)||void 0===p?void 0:p.AABBBounds.width():0;if(!1!==(null===(b=this.attribute)||void 0===b?void 0:b.visible)&&!1!==(null==ct?void 0:ct.visible))if(ct&&i.isValid(null==ct?void 0:ct.character)){const t={x:null!==(v=ct.x)&&void 0!==v?v:0,y:null!==(g=ct.y)&&void 0!==g?g:Et,width:null!==(y=null!==(_=ct.width)&&void 0!==_?_:pt)&&void 0!==y?y:0,height:null!==(x=null!==(m=ct.height)&&void 0!==m?m:bt)&&void 0!==x?x:0,ellipsis:null===(f=ct.ellipsis)||void 0===f||f,wordBreak:null!==(A=ct.wordBreak)&&void 0!==A?A:"break-word",maxHeight:ct.maxHeight,maxWidth:ct.maxWidth,textConfig:ct.character};this._subTitle=St.createOrUpdateChild("subTitle",t,"richtext")}else i.isValid(ut)&&(this._subTitle=St.createOrUpdateChild("subTitle",{text:[ut],...ct,maxLineWidth:null!==(S=null==ct?void 0:ct.maxLineWidth)&&void 0!==S?S:pt,heightLimit:null==ct?void 0:ct.heightLimit,lineClamp:null==ct?void 0:ct.lineClamp,ellipsis:null===(E=null==ct?void 0:ct.ellipsis)||void 0===E||E,x:0,y:Et},"wrapText"));const kt=this._subTitle?null===(L=this._subTitle)||void 0===L?void 0:L.AABBBounds.height():0,Bt=this._subTitle?null===(k=this._subTitle)||void 0===k?void 0:k.AABBBounds.width():0;let Mt=Math.max(Lt,Bt),wt=Et+(null!==(B=null==ct?void 0:ct.height)&&void 0!==B?B:kt);if(i.isValid(pt)&&(Mt=pt,null===(M=this._mainTitle)||void 0===M||M.setAttribute("maxLineWidth",pt),null===(w=this._subTitle)||void 0===w||w.setAttribute("maxLineWidth",pt)),i.isValid(bt)&&(wt=bt),i.isValid(vt)&&Mt<vt&&(Mt=vt),i.isValid(gt)&&(null===(T=this._mainTitle)||void 0===T||T.setAttribute("maxLineWidth",gt),null===(C=this._subTitle)||void 0===C||C.setAttribute("maxLineWidth",gt),null===(P=this._mainTitle)||void 0===P||P.setAttribute("maxWidth",gt),null===(I=this._subTitle)||void 0===I||I.setAttribute("maxWidth",gt),Mt>gt&&(Mt=gt)),i.isValid(_t)&&wt<_t&&(wt=_t),i.isValid(yt)&&(null===(H=this._mainTitle)||void 0===H||H.setAttribute("maxHeight",yt),null===(z=this._subTitle)||void 0===z||z.setAttribute("maxHeight",yt-Et),wt>yt&&(wt=yt)),St.attribute.width=Mt+At[1]+At[3],St.attribute.height=wt+At[0]+At[2],i.isValid(mt)||i.isValid(null==ht?void 0:ht.align)){const t=(null==ht?void 0:ht.align)?null==ht?void 0:ht.align:mt,e=null!==(V=null==ht?void 0:ht.width)&&void 0!==V?V:Lt;"left"===t?(null===(R=this._mainTitle)||void 0===R||R.setAttribute("x",0),null===(N=this._mainTitle)||void 0===N||N.setAttribute("textAlign","left")):"center"===t?(null===(D=this._mainTitle)||void 0===D||D.setAttribute("x",e/2),null===(O=this._mainTitle)||void 0===O||O.setAttribute("textAlign","center")):"right"===t&&(null===($=this._mainTitle)||void 0===$||$.setAttribute("x",e),null===(U=this._mainTitle)||void 0===U||U.setAttribute("textAlign","right"))}if(i.isValid(xt)||i.isValid(null==ht?void 0:ht.verticalAlign)){const t=(null==ht?void 0:ht.verticalAlign)?null==ht?void 0:ht.verticalAlign:xt,e=(null==ht?void 0:ht.height)?null==ht?void 0:ht.height:Mt;"top"===t?(null===(W=this._mainTitle)||void 0===W||W.setAttribute("y",0),null===(F=this._mainTitle)||void 0===F||F.setAttribute("textBaseline","top")):"middle"===t?(null===(G=this._mainTitle)||void 0===G||G.setAttribute("y",e/2),null===(Y=this._mainTitle)||void 0===Y||Y.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(X=this._mainTitle)||void 0===X||X.setAttribute("y",e),null===(q=this._mainTitle)||void 0===q||q.setAttribute("textBaseline","bottom"))}if(i.isValid(mt)||i.isValid(null==ct?void 0:ct.align)){const t=(null==ct?void 0:ct.align)?null==ct?void 0:ct.align:mt,e=null!==(Z=null==ct?void 0:ct.width)&&void 0!==Z?Z:Bt;"left"===t?(null===(j=this._subTitle)||void 0===j||j.setAttribute("x",0),null===(J=this._subTitle)||void 0===J||J.setAttribute("textAlign","left")):"center"===t?(null===(K=this._subTitle)||void 0===K||K.setAttribute("x",e/2),null===(Q=this._subTitle)||void 0===Q||Q.setAttribute("textAlign","center")):"right"===t&&(null===(tt=this._subTitle)||void 0===tt||tt.setAttribute("x",e),null===(et=this._subTitle)||void 0===et||et.setAttribute("textAlign","right"))}if(i.isValid(xt)||i.isValid(null==ht?void 0:ht.verticalAlign)){const t=(null==ct?void 0:ct.verticalAlign)?null==ct?void 0:ct.verticalAlign:xt,e=Et,i=null!==(it=null==ct?void 0:ct.height)&&void 0!==it?it:0;"top"===t?(null===(st=this._subTitle)||void 0===st||st.setAttribute("y",e),null===(at=this._subTitle)||void 0===at||at.setAttribute("textBaseline","top")):"middle"===t?(null===(nt=this._subTitle)||void 0===nt||nt.setAttribute("y",e+i/2),null===(rt=this._subTitle)||void 0===rt||rt.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(lt=this._subTitle)||void 0===lt||lt.setAttribute("y",e+i),null===(ot=this._subTitle)||void 0===ot||ot.setAttribute("textBaseline","bottom"))}}}Se.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};const Ee={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};const Le=(t,e)=>{let i=t.x0,s=t.x1;const a="number"==typeof e?t.thickness*e:t.thickness;let n=t.y0-t.thickness/2,r=t.y1-t.thickness/2;"center"===t.align?(n=t.y0-a/2,r=t.y1-a/2):"end"===t.align&&(n=t.y0+t.thickness/2-a,r=t.y1+t.thickness/2-a);let l=(i+s)/2,o=n+a,d=r+a;t.round&&(i=Math.round(i),s=Math.round(s),n=Math.round(n),r=Math.round(r),o=Math.round(o),d=Math.round(d),l=Math.round(l));const h=Math.abs(s-i)>1e-6,u=t.endArrow&&h?`L${s},${r-a/2}L${s+a},${(r+d)/2}L${s},${d+a/2}`:"",c=t.startArrow&&h?`L${i},${o+a/2}L${i-a},${(n+o)/2}L${i},${n-a/2}`:"";return!1===t.isSmooth?`M${i},${n}L${s},${r}${u}L${s},${d}L${i},${o}${c}Z`:`M${i},${n}\n C${l},${n},${l},${r},${s},${r}\n ${u}\n L${s},${d}\n C${l},${d},${l},${o},${i},${o}\n ${c}\n Z`},ke=(t,e)=>{let i=t.y0,s=t.y1,a=t.x0-t.thickness/2,n=t.x1-t.thickness/2;const r="number"==typeof e?t.thickness*e:t.thickness;"center"===t.align?(a=t.x0-r/2,n=t.x1-r/2):"end"===t.align&&(a=t.x0+t.thickness/2-r,n=t.x1+t.thickness/2-r);let l=(i+s)/2,o=a+r,d=n+r;t.round&&(i=Math.round(i),s=Math.round(s),a=Math.round(a),n=Math.round(n),o=Math.round(o),d=Math.round(d),l=Math.round(l));const h=Math.abs(s-i)>1e-6,u=t.endArrow&&h?`L${n-r/2},${s}L${(n+d)/2},${s+r}L${d+r/2},${s}`:"",c=t.startArrow&&h?`L${o+r/2},${i}L${(o+a)/2},${i-r}L${a-r/2},${i}`:"";return!1===t.isSmooth?`M${a},${i}L${n},${s}${u}L${d},${s}L${o},${i}${c}Z`:`M${a},${i}\n C${a},${l},${n},${l},${n},${s}\n ${u}\n L${d},${s}\n C${d},${l},${o},${l},${o},${i}\n ${c}\n Z`};class Be extends n{constructor(t){super(i.merge({},Be.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?ke:Le,i="number"==typeof this.attribute.ratio&&this.attribute.ratio>=0&&this.attribute.ratio<=1,s=["direction","x0","x1","y0","y1","thickness","round","ratio","align","isSmooth","backgroudStyle"],a={};if(Object.keys(this.attribute).forEach((t=>{s.includes(t)||(a[t]=this.attribute[t])})),i){const t=this.createOrUpdateChild("sankey-link-background",Object.assign({},a,this.attribute.backgroudStyle,{path:e(this.attribute,1),visible:!0,pickable:!1,zIndex:-1}),"path");this._backPath=t}else this._backPath&&this._backPath.setAttribute("visible",!1);const n=this.createOrUpdateChild("sankey-link-front",Object.assign({},a,{path:e(this.attribute,i?this.attribute.ratio:1),pickable:!1}),"path");this._frontPath=n}}Be.defaultAttributes={direction:"horizontal",align:"start"};class Me extends e.Symbol{constructor(t){super(t)}}var we,Te;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(we||(we={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(Te||(Te={}));class Ce extends n{constructor(t){super(i.merge({},Ce.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:{symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z",...Ce.defaultControllerAttr,...this.attribute.start.style}},this._pauseAttr={style:{symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z",...Ce.defaultControllerAttr,...this.attribute.pause.style}},this._forwardAttr={style:{...Ce.defaultControllerAttr,...this.attribute.forward.style}},this._backwardAttr={style:{...Ce.defaultControllerAttr,...this.attribute.backward.style}},this.updateLayout()},this.updateLayout=()=>{var t,e,i,s,a,n,r,l;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(e=null===(t=this._backwardAttr.style)||void 0===t?void 0:t.symbolType)&&void 0!==e?e:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(s=null===(i=this._forwardAttr.style)||void 0===i?void 0:i.symbolType)&&void 0!==s?s:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(n=null===(a=this._backwardAttr.style)||void 0===a?void 0:a.symbolType)&&void 0!==n?n:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(l=null===(r=this._forwardAttr.style)||void 0===r?void 0:r.symbolType)&&void 0!==l?l:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{i.isNil(this._playController)&&(this._playController=new Me({...this._startAttr.style}),this.add(this._playController))},this._initBackward=()=>{i.isNil(this._backwardController)&&(this._backwardController=new Me({...this._backwardAttr.style}),this.add(this._backwardController))},this._initForward=()=>{i.isNil(this._forwardController)&&(this._forwardController=new Me({...this._forwardAttr.style}),this.add(this._forwardController))},this._initEvents=()=>{this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()}))},this._createCustomEvent=t=>{var i;const s=new e.CustomEvent(t,{eventType:t});return s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,s},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes({symbolType:this._playController.getComputedAttribute("symbolType"),...this._startAttr.style}):this._playController.setAttributes({symbolType:this._playController.getComputedAttribute("symbolType"),...this._pauseAttr.style})},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{const t=this._createCustomEvent(we.OnPlay);this.dispatchEvent(t)},this.pause=()=>{const t=this._createCustomEvent(we.OnPause);this.dispatchEvent(t)},this.forward=()=>{const t=this._createCustomEvent(we.OnForward);this.dispatchEvent(t)},this.backward=()=>{const t=this._createCustomEvent(we.OnBackward);this.dispatchEvent(t)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}Ce.defaultControllerAttr={x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Ce.defaultAttributes={visible:!0,[Te.Start]:{},[Te.Pause]:{},[Te.Backward]:{},[Te.Forward]:{}};const Pe={style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},Ie=[200,10];var He,ze;t.DirectionEnum=void 0,(He=t.DirectionEnum||(t.DirectionEnum={})).Default="default",He.Reverse="reverse",t.PlayerEventEnum=void 0,(ze=t.PlayerEventEnum||(t.PlayerEventEnum={})).OnChange="onChange",ze.OnPlay="onPlay",ze.OnPause="onPause",ze.OnBackward="onBackward",ze.OnForward="onForward",ze.OnEnd="onEnd";const Ve=({direction:e,maxIndex:i,minIndex:s,dataIndex:a})=>(({direction:e,maxIndex:i,dataIndex:s})=>e===t.DirectionEnum.Default&&s===i)({direction:e,maxIndex:i,dataIndex:a})||(({direction:e,minIndex:i,dataIndex:s})=>e===t.DirectionEnum.Reverse&&s===i)({direction:e,minIndex:s,dataIndex:a}),Re=({direction:e,maxIndex:i,minIndex:s,dataIndex:a})=>(({direction:e,minIndex:i,dataIndex:s})=>e===t.DirectionEnum.Default&&s===i)({direction:e,minIndex:s,dataIndex:a})||(({direction:e,maxIndex:i,dataIndex:s})=>e===t.DirectionEnum.Reverse&&s===i)({direction:e,maxIndex:i,dataIndex:a}),Ne=t=>"top"===t||"bottom"===t;class De extends n{constructor(t){super(i.merge({},De.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e,s;let a;i.isValidNumber(this._handlerStyle.size)?a=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(a=i.max(this._handlerStyle.size[0],this._handlerStyle.size[1]));const n={min:this._minIndex,max:this._maxIndex,value:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:i.isValidNumber(a)?a:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,visible:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1}};if(Ne(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.height)&&void 0!==e?e:Ie[1];n.layout="horizontal",n.railHeight=i,n.railWidth=t,n.x=this._layoutInfo.slider.x,n.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(s=this._railStyle.width)&&void 0!==s?s:Ie[1];n.layout="vertical",n.railWidth=e,n.railHeight=t,n.x=this._layoutInfo.slider.x,n.y=this._layoutInfo.slider.y}return n},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new me(t),this.add(this._slider)},this._updateControllerAttrs=()=>{const t={visible:!0,start:this._start,pause:this._pause,forward:this._forward,backward:this._backward};return Ne(this._orient)?(t.layout="horizontal",t.start={style:{...t.start.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.pause={style:{...t.pause.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.backward={style:{...t.backward.style,x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y}},t.forward={style:{...t.forward.style,x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y}}):(t.layout="vertical",t.start={style:{...t.start.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.pause={style:{...t.pause.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.backward={style:{...t.backward.style,x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y}},t.forward={style:{...t.forward.style,x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y}}),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new Ce(t),this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){var t,e,i,s,a,n,r,l,o,d,h,u,c,p;this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1,this._railStyle={...null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.railStyle},this._trackStyle={...null===(s=null===(i=this.attribute)||void 0===i?void 0:i.slider)||void 0===s?void 0:s.trackStyle},this._handlerStyle={...null===(n=null===(a=this.attribute)||void 0===a?void 0:a.slider)||void 0===n?void 0:n.handlerStyle},this._start={...null===(l=null===(r=this.attribute)||void 0===r?void 0:r.controller)||void 0===l?void 0:l.start},this._pause={...null===(d=null===(o=this.attribute)||void 0===o?void 0:o.controller)||void 0===d?void 0:d.pause},this._forward={...null===(u=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===u?void 0:u.forward},this._backward={...null===(p=null===(c=this.attribute)||void 0===c?void 0:c.controller)||void 0===p?void 0:p.backward}}_initLayoutInfo(){var t,e,s;const a=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),n=a.filter((t=>"end"!==t.position)),r=a.filter((t=>"end"===t.position)),l=null!==(t=Ne(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:Ie[1],o=a.reduce(((t,e)=>{const s=e.style.size,a=i.isNumber(s)?s:i.max(s[0],s[1]);return t+e.space+a}),0),d=(Ne(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(s=this._size)||void 0===s?void 0:s.height)-o,h=d-this.attribute.slider.space,u=n.reduce(((t,e)=>{const{key:s,space:a,style:{size:n}}=e,r=i.isNumber(n)?n:i.max(n[0],n[1]);return this._layoutInfo[s]={...this._layoutInfo[s],size:r,x:Ne(this._orient)?t+a:(this._size.width-r)/2,y:Ne(this._orient)?(this._size.height-r)/2:t+a},t+a+r}),0);this._layoutInfo.slider={...this._layoutInfo.slider,size:h,x:Ne(this._orient)?u+this.attribute.slider.space:(this._size.width-l)/2,y:Ne(this._orient)?(this._size.height-l)/2:u+this.attribute.slider.space},r.reduce(((t,e)=>{const{key:s,space:a,style:{size:n}}=e,r=i.isNumber(n)?n:i.max(n[0],n[1]);return this._layoutInfo[s]={...this._layoutInfo[s],size:r,x:Ne(this._orient)?t+a:(this._size.width-r)/2,y:Ne(this._orient)?(this._size.height-r)/2:t+a},t+a+r}),u+d)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,i){var s;const a=new e.CustomEvent(t,{eventType:t,index:i,value:this._data[i]});a.manager=null===(s=this.stage)||void 0===s?void 0:s.eventSystem.manager,this.dispatchEvent(a)}}De.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{start:{...Pe,key:"start",position:"start",space:0},pause:{...Pe,key:"pause",position:"start"},forward:{...Pe,key:"forward",position:"end"},backward:{...Pe,key:"backward",position:"start"}}};var Oe;t.IOperateType=void 0,(Oe=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",Oe.drawEnd="drawEnd",Oe.drawing="drawing",Oe.moving="moving",Oe.moveStart="moveStart",Oe.moveEnd="moveEnd",Oe.brushClear="brushClear";const $e={brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},Ue=5,We={debounce:i.debounce,throttle:i.throttle};class Fe extends n{constructor(e){super(i.merge({},Fe.defaultAttributes,e)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e,i;if(this._outOfInteractiveRange(t))return;const s=null===(i=null===(e=this.attribute)||void 0===e?void 0:e.brushMoved)||void 0===i||i;this._activeMoveState=s&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||(this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushEnd=e=>{var i;const{removeOnClick:s=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&s?(this._container.incrementalClearChild(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.brushClear,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})):this._outOfInteractiveRange(e)||this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:this._activeDrawState?t.IOperateType.drawEnd:t.IOperateType.moveEnd,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict}),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,null===(i=this._operatingMask)||void 0===i||i.setAttribute("pickable",!1)}}bindBrushEvents(){const{delayType:t="throttle",delayTime:e=0}=this.attribute;this.stage.addEventListener("pointerdown",this._onBrushStart),this.stage.addEventListener("pointermove",We[t](this._onBrushing,e)),this.stage.addEventListener("pointerup",this._onBrushEnd),this.stage.addEventListener("pointerupoutside",this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),s=this._container.getChildren();for(let t=0;t<s.length;t++){const{points:a=[],dx:n=0,dy:r=0}=s[t].attribute,l=a.map((t=>({x:t.x+n,y:t.y+r})));if(i.polygonContainPoint(l,e.x,e.y))return this._operatingMask=s[t],!0}return!1}_initDraw(e){const{brushMode:i}=this.attribute,s=this.eventPosToStagePos(e);this._cacheDrawPoints=[s],this._isDrawedBeforeEnd=!1,"single"===i&&this._container.incrementalClearChild(),this._addBrushMask(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_initMove(e){var i,s;this._cacheMovePoint=this.eventPosToStagePos(e),this._operatingMaskMoveDx=null!==(i=this._operatingMask.attribute.dx)&&void 0!==i?i:0,this._operatingMaskMoveDy=null!==(s=this._operatingMask.attribute.dy)&&void 0!==s?s:0;const{interactiveRange:a}=this.attribute,{minY:n=-1/0,maxY:r=1/0,minX:l=-1/0,maxX:o=1/0}=a,{x1:d,x2:h,y1:u,y2:c}=this._operatingMask.globalAABBBounds,p=l-d,b=o-h,v=n-u,g=r-c;this._operatingMaskMoveRangeX=[p,b],this._operatingMaskMoveRangeY=[v,g],this._operatingMask.setAttribute("pickable",!0),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moveStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_drawing(e){var i;const s=this.eventPosToStagePos(e),{x1:a=0,x2:n=0,y1:r=0,y2:l=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds,{sizeThreshold:o=Ue}=this.attribute;if(this._isDrawedBeforeEnd=!!(Math.abs(n-a)>o||Math.abs(r-l)>o),this._cacheDrawPoints.length>0){const t=this._cacheDrawPoints[this._cacheDrawPoints.length-1];if(s.x===(null==t?void 0:t.x)&&s.y===(null==t?void 0:t.y))return}this._cacheDrawPoints.push(s);const d=this._computeMaskPoints();this._operatingMask.setAttribute("points",d),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawing,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_moving(e){const i=this._cacheMovePoint,s=this.eventPosToStagePos(e);if(s.x===(null==i?void 0:i.x)&&s.y===(null==i?void 0:i.y))return;const a=s.x-i.x,n=s.y-i.y,r=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],a))+this._operatingMaskMoveDx,l=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:r,dy:l}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moving,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:s=[0,0]}=this.attribute;let a=[];const n=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return a="rect"===t?[n,{x:r.x,y:n.y},r,{x:n.x,y:r.y}]:"x"===t?[{x:n.x,y:s[0]},{x:r.x,y:s[0]},{x:r.x,y:s[1]},{x:n.x,y:s[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:n.y}]:i.cloneDeep(this._cacheDrawPoints),a}_addBrushMask(){const{brushStyle:t}=this.attribute,s=e.createPolygon({points:i.cloneDeep(this._cacheDrawPoints),cursor:"move",pickable:!1,...t});s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:a=-1/0,maxX:n=1/0}=e,r=this.eventPosToStagePos(t);return r.x>n||r.x<a||r.y>s||r.y<i}eventPosToStagePos(t){var e,i,s;const a=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==a?void 0:a.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==a?void 0:a.top)||0)-((null===(s=this.stage)||void 0===s?void 0:s.y)||0)}}render(){this.bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}setUpdateDragMaskCallback(t){i.isFunction(t)&&(this._updateDragMaskCallback=t)}}Fe.defaultAttributes=$e;const Ge=(t,...e)=>{const s=[t.shape,...e.map((t=>null==t?void 0:t.shape))],a=[t.key,...e.map((t=>null==t?void 0:t.key))],n=[t.value,...e.map((t=>null==t?void 0:t.value))];return i.merge(t,...e,{shape:s.every(i.isNil)?void 0:i.merge({},...s),key:a.every(i.isNil)?void 0:i.merge({},...a),value:n.every(i.isNil)?void 0:i.merge({},...n)})},Ye=t=>{const{width:e,height:s,wordBreak:a="break-word",textAlign:n,textBaseline:r,text:l}=t;return{width:e,height:s,wordBreak:a,textAlign:n,textBaseline:r,singleLine:!1,textConfig:i.array(l).map((e=>({...t,text:e})))}},Xe={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:m,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:m,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:m,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new i.AABBBounds).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},qe=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"],Ze="tooltip-title",je="tooltip-content",Je="shape",Ke="value";class Qe extends n{constructor(t){super(i.merge({},Qe.defaultAttributes,t)),this.name="tooltip"}render(){const{visible:t,content:e,panel:s,keyWidth:a,valueWidth:n,hasContentShape:r,autoCalculatePosition:l,autoMeasure:d}=this.attribute;if(!t)return void this.hideAll();d&&Qe.measureTooltip(this.attribute),l&&Qe.calculateTooltipPosition(this.attribute);const h=i.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",{visible:!0,...s},"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(Ze,{visible:!0,x:h[3],y:h[0]},"group");const u=Qe.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${Ze}-${Je}`,i.merge({symbolType:"circle"},u.shape,{visible:o(u)&&o(u.shape)}),"symbol"),u.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ze}-${Ke}`,{visible:o(u)&&o(u.value),...Ye(u.value)},"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ze}-${Ke}`,{text:"",visible:o(u)&&o(u.value),...u.value},"text");const c=o(u.shape)?u.shape.size+u.shape.spacing:0,{textAlign:p,textBaseline:b}=u.value,v=s.width-h[3]-h[0]-c;"center"===p?this._tooltipTitle.setAttribute("x",c+v/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",c+v):this._tooltipTitle.setAttribute("x",c),"bottom"===b?this._tooltipTitle.setAttribute("y",u.height):"middle"===b?this._tooltipTitle.setAttribute("y",u.height/2):this._tooltipTitle.setAttribute("y",0);const g=o(u)?u.height+u.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(je,{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==e?void 0:e.length){this._tooltipContent.setAttribute("x",h[3]),this._tooltipContent.setAttribute("y",h[0]+g);let t=0;e.forEach(((e,s)=>{var l;const d=Qe.getContentAttr(this.attribute,s);if(!o(d))return;const h=`${je}-${s}`,u=this._tooltipContent.createOrUpdateChild(h,{visible:!0,x:0,y:t},"group");let c=0;if(o(d.shape)&&u.createOrUpdateChild(`${h}-${Je}`,{visible:!0,x:d.shape.size/2,y:d.shape.size/2+((null!==(l=d.key.lineHeight)&&void 0!==l?l:d.key.fontSize)-d.shape.size)/2,...d.shape},"symbol"),r&&(c+=d.shape.size+d.shape.spacing),o(d.key)){let t;t=d.key.multiLine?u.createOrUpdateChild(`${h}-key`,{visible:!0,...Ye(d.key),textBaseline:"top"},"richtext"):u.createOrUpdateChild(`${h}-key`,{visible:!0,...d.key,textBaseline:"top"},"text");const{textAlign:e}=d.key;"center"===e?t.setAttribute("x",c+a/2):"right"===e||"end"===e?t.setAttribute("x",c+a):t.setAttribute("x",c),t.setAttribute("y",0),c+=a+d.key.spacing}if(o(d.value)){let t;t=d.value.multiLine?u.createOrUpdateChild(`${h}-${Ke}`,{visible:!0,...Ye(d.value),textBaseline:"top"},"richtext"):u.createOrUpdateChild(`${h}-${Ke}`,{visible:!0,...d.value,textBaseline:"top"},"text");let e="right";i.isValid(d.value.textAlign)?e=d.value.textAlign:o(d.key)||(e="left"),t.setAttribute("textAlign",e),"center"===e?t.setAttribute("x",c+n/2):"right"===e||"end"===e?t.setAttribute("x",c+n):t.setAttribute("x",c),c+=n,t.setAttribute("y",0),u.add(t)}t+=d.height+d.spaceRow}))}}setAttributes(t,e){const s=Object.keys(t);this.attribute.autoCalculatePosition&&s.every((t=>qe.includes(t)))?(this._mergeAttributes(t,s),i.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&Qe.measureTooltip(this.attribute),Qe.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:a,pointerX:n,pointerY:r,positionX:l,positionY:o,parentBounds:d}=t;let h=n,u=r;return"left"===l?h-=e+s:"center"===l?h-=e/2:h+=s,"top"===o?u-=i+a:"middle"===o?u-=i/2:u+=a,h+e>d.x2&&(h-=e+s),u+i>d.y2&&(u-=i+a),h<d.x1&&(h=d.x1),u<d.y1&&(u=d.y1),t.x=h,t.y=u,t}static measureTooltip(t){const{content:s,contentStyle:a}=t,n=i.normalizePadding(t.padding),r=Qe.getTitleAttr(t);let l=0,d=n[0]+n[2],h=0;const{value:u,shape:c}=r,{visible:p=!1,symbolType:b=""}=null!=c?c:{};if(i.isValid(u)){const{width:t,height:e}=A(u).quickMeasure(u.text);l=t,h=e}if(p&&e.builtinSymbolsMap[b]&&(l+=c.size+c.spacing,h=Math.max(c.size,h)),t.title&&(t.title.width=l,t.title.height=h),o(r)&&(d+=h+r.spaceRow),null==s?void 0:s.length){const i=[];if(s.forEach(((e,s)=>{const a=Qe.getContentAttr(t,s);(e.key||e.value)&&o(a)&&i.push([e,a])})),i.length){let n=!1;const r=[],h=[],u=[];i.forEach((([t,s],l)=>{var c;const{key:p,value:b,shape:v,spaceRow:g}=s,_=o(v),y=null!==(c=null==v?void 0:v.symbolType)&&void 0!==c?c:"",m=A(p),x=A(b);let f=0;if(o(p)){const{width:t,height:e}=m.quickMeasure(p.text);h.push(t),f=Math.max(f,e)}if(o(b)){const{width:t,height:e}=x.quickMeasure(b.text);u.push(t),f=Math.max(f,e)}_&&e.builtinSymbolsMap[y]&&(n=!0,r.push(v.size),f=Math.max(v.size,f)),t.height=f,d+=f,l<i.length-1&&(d+=null!=g?g:a.spaceRow)}));const c=r.length?Math.max(...r):0,p=h.length?Math.max(...h):0,b=u.length?Math.max(...u):0;l=Math.max(p+b+a.key.spacing+a.value.spacing+(n?c+a.shape.spacing:0),l),s.forEach((t=>{t.width=l})),t.hasContentShape=n,t.keyWidth=p,t.valueWidth=b}}return t.panel.width=l+n[1]+n[3],t.panel.height=d,t}static getTitleAttr(t){return Ge({},Qe.defaultAttributes.titleStyle,Qe.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return Ge({},Qe.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}Qe.defaultAttributes=Xe;t.AbstractComponent=n,t.ArcInfo=_t,t.ArcLabel=yt,t.BasePlayer=De,t.Brush=Fe,t.CircleAxis=Ot,t.CircleCrosshair=$,t.ColorContinuousLegend=xe,t.ContinuousPlayer=class extends De{constructor(i){super(i),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t,e;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3,this._dataIndex=null!==(e=this.attribute.dataIndex)&&void 0!==e?e:this._minIndex;const i=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=i?i:1)):(this._totalDuration=this._interval*i,this._interval=this.attribute.interval)},this._initEvents=()=>{this._controller.addEventListener(we.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(we.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(we.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(we.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)}))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=e=>{const i=Math.floor(e);i!==this._activeIndex&&(this._dataIndex=i,this._activeIndex=i,i!==this._maxIndex&&this.dispatchCustomEvent(t.PlayerEventEnum.OnChange))},this.play=async()=>{this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(t.PlayerEventEnum.OnPlay),this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this)))},this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.OnEnd)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.OnPause))},this.backward=()=>{const e=Date.now(),i=1*this._interval,s=this._elapsed-i;s<=0?(this._elapsed=0,this._startTime=e):(this._elapsed=s,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.OnBackward)},this.forward=()=>{const e=Date.now(),i=1*this._interval,s=this._elapsed+i;s>=this._totalDuration?(this._startTime=e-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-i,this._elapsed=s),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.OnForward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=re,t.DEFAULT_ITEM_SPACE_ROW=le,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=de,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=Mt,t.DEFAULT_TITLE_SPACE=oe,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=xt,t.DataZoom=Gt,t.DiscreteLegend=ve,t.DiscretePlayer=class extends De{constructor(s){super(i.merge({},s)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var e,s,a,n;super._initAttributes(),this._alternate=null!==(e=this.attribute.alternate)&&void 0!==e&&e,this._interval=null!==(s=this.attribute.interval)&&void 0!==s?s:1e3,this._direction=null!==(a=this.attribute.direction)&&void 0!==a?a:t.DirectionEnum.Default,this._dataIndex=i.isNil(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(n=this.attribute.dataIndex)&&void 0!==n?n:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this._controller.addEventListener(we.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(we.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(we.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(we.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(e=>{const i=Math.floor(e.detail.value)+.5;this._dataIndex=e.detail.value>=i?Math.ceil(e.detail.value):Math.floor(e.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(t.PlayerEventEnum.OnChange)}))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(Ve({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||Re({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===t.DirectionEnum.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(t.PlayerEventEnum.OnPlay),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=i=>{const s=Date.now();if(this._isReachEnd&&s-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();i&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(t.PlayerEventEnum.OnChange),this._activeIndex=this._dataIndex):s-this._tickTime>=this._interval&&(this._tickTime=s,this._updateDataIndex(((t,e,i,s)=>"default"===t?Math.min(e+1,s):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(t.PlayerEventEnum.OnChange)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),e.vglobal.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(t.PlayerEventEnum.OnEnd)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.OnPause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.OnChange),this.dispatchCustomEvent(t.PlayerEventEnum.OnBackward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.OnChange),this.dispatchCustomEvent(t.PlayerEventEnum.OnForward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.Grid=Et,t.GroupFadeIn=Ut,t.GroupFadeOut=Wt,t.GroupTransition=$t,t.Indicator=class extends n{constructor(){super(...arguments),this.name="indicator"}render(){var t;const{visible:e,title:s,content:a,size:n,limitRatio:r=1/0}=this.attribute,l=Math.min(n.width,n.height)*r,o=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1},"group");if(!0!==e)return void(o&&o.hideAll());if(i.isValid(s))if(!1!==s.visible){const t=i.merge({},i.get(Ee,"title.style"),s.style);this._title=o.createOrUpdateChild("indicator-title",{...t,lineHeight:i.isValid(t.lineHeight)?t.lineHeight:t.fontSize,visible:s.visible,x:0,y:0},"text"),s.autoFit&&i.isValidNumber(l)&&this._setAutoFit(l,this._title,s),s.autoLimit&&i.isValidNumber(r)&&this._title.setAttribute("maxLineWidth",l)}else{const t=o.find((t=>"indicator-title"===t.name),!1);t&&o.removeChild(t),this._title=void 0}const d=this._title?this._title.AABBBounds.height():0;if(i.isValid(a)){const t=this._title&&(null==s?void 0:s.space)?s.space:0,e=i.array(a),n=[];let h=0;e.forEach(((e,s)=>{if(!1!==e.visible){const a=i.merge({},i.get(Ee,"content.style"),e.style),u=o.createOrUpdateChild("indicator-content-"+s,{...a,lineHeight:i.isValid(a.lineHeight)?a.lineHeight:a.fontSize,visible:e.visible,x:0,y:d+t+h},"text");e.autoFit&&i.isValidNumber(l)&&this._setAutoFit(l,u,e),e.autoLimit&&i.isValidNumber(r)&&u.setAttribute("maxLineWidth",l),n.push(u);const c=(null==e?void 0:e.space)?e.space:0;h+=u.AABBBounds.height()+c}else{const t=o.find((t=>t.name==="indicator-content-"+s),!1);t&&o.removeChild(t)}})),this._content=n}const h=null!==(t=null==o?void 0:o.AABBBounds.height())&&void 0!==t?t:0;o.setAttribute("y",n.height/2-h/2),o.setAttribute("x",n.width/2)}_setAutoFit(t,e,s){var a,n,r,l,o,d;const h=S(null!==(n=null===(a=s.style)||void 0===a?void 0:a.text)&&void 0!==n?n:"",null!==(r=s.style)&&void 0!==r?r:{}).width;if(h>0){const a=t*(null!==(l=s.fitPercent)&&void 0!==l?l:.5)/h,n=Math.floor((null!==(d=null===(o=s.style)||void 0===o?void 0:o.fontSize)&&void 0!==d?d:20)*a);e.setAttribute("fontSize",n),e.setAttribute("lineHeight",i.isValid(s.style.lineHeight)?s.style.lineHeight:n)}}},t.LabelBase=dt,t.LineAxis=Dt,t.LineCrosshair=D,t.LineLabel=ct,t.LinkPath=Be,t.MarkArea=ie,t.MarkLine=ee,t.MarkPoint=se,t.Pager=ne,t.PolygonCrosshair=W,t.PopTip=L,t.RectCrosshair=O,t.RectLabel=ut,t.ScrollBar=r,t.SectorCrosshair=U,t.Segment=Lt,t.SizeContinuousLegend=Ae,t.Slider=me,t.SymbolLabel=ht,t.Tag=E,t.Title=Se,t.Tooltip=Qe,t.getHorizontalPath=Le,t.getSizeHandlerPath=fe,t.getVerticalPath=ke,t.loadPoptip=function(t){i.merge(I.poptip,t),e.container.load(R)},t.popTipModule=R,t.setPoptipTheme=function(t){i.merge(I.poptip,P,t)},t.version="0.14.1"}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vrender"),require("@visactor/vutils"),require("@visactor/vscale")):"function"==typeof define&&define.amd?define(["exports","@visactor/vrender","@visactor/vutils","@visactor/vscale"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VRender=t.VRender||{},t.VRender.Components={}),t.VRender,t.VUtils,t.VScale)}(this,(function(t,e,i,s){"use strict";const a=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex"];class n extends e.Group{constructor(t,e="2d"){super(t),this.mode=e,this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,s){i.isPlainObject(this.attribute[t])?i.merge(this.attribute[t],e):this.attribute[t]=e,a.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!s&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>a.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){i.isNil(e)&&(e=Object.keys(t));for(let s=0;s<e.length;s++){const a=e[s];i.isPlainObject(this.attribute[a])?i.merge(this.attribute[a],t[a]):this.attribute[a]=t[a]}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}}class r extends n{constructor(t){super(i.merge({},r.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{var e,s;const{viewX:a,viewY:n}=t,{direction:r,width:l,height:o,range:d}=this.attribute,h=this._sliderSize,[u,c]=this._getScrollRange();let p;if("vertical"===r){const t=n-this._viewPosition.y,e=i.clamp(t-h/2,u,c);p=t/o,this._slider.setAttribute("y",e,!0)}else{const t=a-this._viewPosition.x,e=i.clamp(t-h/2,u,c);p=t/l,this._slider.setAttribute("x",e,!0)}this.setScrollRange([p-(d[1]-d[0])/2,p+(d[1]-d[0])/2],!1),(null===(e=this.stage)||void 0===e?void 0:e.autoRender)||null===(s=this.stage)||void 0===s||s.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();const{direction:i}=this.attribute;this._prePos="horizontal"===i?t.clientX:t.clientY,"browser"===e.vglobal.env?(e.vglobal.addEventListener("pointermove",this._onSliderPointerMove),e.vglobal.addEventListener("pointerup",this._onSliderPointerUp)):(this._slider.addEventListener("pointermove",this._onSliderPointerMove),this._slider.addEventListener("pointerup",this._onSliderPointerUp),this._slider.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._onSliderPointerMove=t=>{t.stopPropagation();const{direction:e}=this.attribute;let i,s,a=0;const n=this.getScrollRange(),{width:r,height:l}=this._getSliderRenderBounds();"vertical"===e?(s=t.clientY,a=s-this._prePos,i=a/l):(s=t.clientX,a=s-this._prePos,i=a/r),this.setScrollRange([n[0]+i,n[1]+i],!0),this._prePos=s},this._onSliderPointerUp=t=>{t.preventDefault(),"browser"===e.vglobal.env?(e.vglobal.removeEventListener("pointermove",this._onSliderPointerMove),e.vglobal.removeEventListener("pointerup",this._onSliderPointerUp)):(this._slider.removeEventListener("pointermove",this._onSliderPointerMove),this._slider.removeEventListener("pointerup",this._onSliderPointerUp),this._slider.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){var s,a;const{direction:n="horizontal",limitRange:r=[0,1],range:l}=this.attribute,o=i.clampRange(t,r[0],r[1]);if(e){const t=this._getSliderPos(o);this._slider&&("horizontal"===n?this._slider.setAttribute("x",t[0],!0):this._slider.setAttribute("y",t[0],!0),(null===(s=this.stage)||void 0===s?void 0:s.autoRender)||null===(a=this.stage)||void 0===a||a.renderNextFrame())}this.attribute.range=o,this._onChange({pre:l,value:o})}getScrollRange(){return this.attribute.range}bindEvents(){this._rail&&this._rail.addEventListener("pointerdown",this._onRailPointerDown),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:s,range:a,limitRange:n=[0,1],railStyle:r,sliderStyle:l,padding:o=2}=this.attribute,d=this.createOrUpdateChild("scrollbar-container",{},"group"),h=d.createOrUpdateChild("scrollbar-rail",{x:0,y:0,width:e,height:s,...r},"rect");this._rail=h;const u=this._getSliderRenderBounds(),c=this._getSliderPos(i.clampRange(a,n[0],n[1])),p=c[1]-c[0];let b;this._sliderSize=p,b="horizontal"===t?{x:c[0],y:u.y1,width:p,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:p};const v=d.createOrUpdateChild("slider",{...b,cornerRadius:this._getDefaultSliderCornerRadius(),...l,boundsPadding:i.normalizePadding(o),pickMode:"imprecise"},"rect");this._slider=v,this._container=d;const g=this._container.AABBBounds;this._viewPosition={x:g.x1,y:g.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:s=2}=this.attribute,[a,n,r,l]=i.normalizePadding(s),o={x1:l,y1:a,x2:t-n,y2:e-r,width:t-(l+n),height:e-(a+r)};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:s,x1:a,y1:n}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+a,i*t[1]+a]:[s*t[0]+n,s*t[1]+n]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[s,a]=i.clampRange(t,0,1),{width:n,height:r,x1:l,y1:o}=this._getSliderRenderBounds(),d=this._sliderSize;return"horizontal"===e?i.clampRange([l+s*n,l+a*n],l,n-d):i.clampRange([o+s*r,o+a*r],o,r-d)}_onChange(t){var i;const s=new e.CustomEvent("scroll",t);s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(s)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function l(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&l(t,e)}))}r.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1]};const o=t=>!i.isNil(t)&&!1!==t.visible;const d=["#ffffff","#000000"];function h(t,e,i,s,a){const n=b(t),r=b(e);return u(n,r,i,s)?n:function(t,e,i,s,a){const n=[];a&&(a instanceof Array?n.push(...a):n.push(a));n.push(...d);for(const a of n)if(t!==a&&u(a,e,i,s))return a;return}(n,r,i,s,a)}function u(t,e,i,s){return s?c(t,e)>s:"largeText"===i?c(t,e)>3:c(t,e)>4.5}function c(t,e){const i=p(t),s=p(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function p(t){const e=i.ColorUtil.hexToRgb(t),s=e[0]/255,a=e[1]/255,n=e[2]/255;let r,l,o;r=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),l=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),o=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return.2126*r+.7152*l+.0722*o}function b(t){if(null==t?void 0:t.includes("#"))return t;const e=new i.ColorUtil.Color(t),{r:s,g:a,b:n}=e.color;return"#"+i.ColorUtil.rgbToHex(s,a,n)}function v(t,e){return[t[0]*e,t[1]*e]}function g(t,e,i){const s=function(t,e){const[i,s]=t,[a,n]=e,r=Math.sqrt((i*i+s*s)*(a*a+n*n)),l=r&&(i*a+s*n)/r;return Math.acos(Math.min(Math.max(l,-1),1))}(t,e),a=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return i?a?2*Math.PI-s:s:a?s:2*Math.PI-s}const _=-.5*Math.PI,y=1.5*Math.PI,m="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";var x;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(x||(x={}));const f={[x.selectedReverse]:{},[x.selected]:{},[x.hover]:{},[x.hoverReverse]:{}},A=(t,s,a)=>new i.TextMeasure({defaultFontParams:{fontFamily:m,fontSize:11},getTextBounds:a?void 0:e.getTextBounds,specialCharSet:"-/: .,@%'\"~"+i.TextMeasure.ALPHABET_CHAR_SET+i.TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),...null!=s?s:{}},t);function S(t,i){var s,a;if(!t)return{width:0,height:0};const n=e.getTextBounds({text:t,fontFamily:null!==(s=i.fontFamily)&&void 0!==s?s:"",fontSize:i.fontSize||12,fontWeight:i.fontWeight,textAlign:null!==(a=i.textAlign)&&void 0!==a?a:"center",textBaseline:i.textBaseline,ellipsis:!!i.ellipsis,maxLineWidth:i.maxLineWidth||1/0,lineHeight:i.fontSize||12});return{width:n.width(),height:n.height()}}class E extends n{constructor(t){super(i.merge({},E.defaultAttributes,t)),this.name="tag"}render(){var t;const{text:e="",textStyle:s={},shape:a={},panel:n={},space:r=4,minWidth:l,maxWidth:o,padding:d=4,visible:h,state:u}=this.attribute,c=i.normalizePadding(d),p=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let b,v=c[1]+c[3],g=c[0]+c[2],_=0,y=0;const{visible:m,...x}=a;if(i.isBoolean(m)){const t=(null==x?void 0:x.size)||10,e=i.isNumber(t)?t:Math.max(t[0],t[1]);b=p.createOrUpdateChild("tag-shape",{symbolType:"circle",size:t,strokeBoundsBuffer:0,...x,visible:m,x:e/2,y:e/2},"symbol"),i.isEmpty(null==u?void 0:u.shape)||(b.states=u.shape),m&&(y=e+r)}v+=y,_+=y;const f={text:e,visible:i.isValid(e)&&!1!==h,lineHeight:null==s?void 0:s.fontSize,...s,x:_,y:0};i.isNil(f.lineHeight)&&(f.lineHeight=f.fontSize);const A=p.createOrUpdateChild("tag-text",f,"text");i.isEmpty(null==u?void 0:u.text)||(A.states=u.text);const E=S(f.text,s),L=E.width,k=E.height;v+=L;const B=null!==(t=a.size)&&void 0!==t?t:10,M=i.isNumber(B)?B:Math.max(B[0],B[1]);g+=Math.max(k,(null==a?void 0:a.visible)?M:0);const{textAlign:w,textBaseline:T}=s;(i.isValid(l)||i.isValid(o))&&(i.isValid(l)&&v<l&&(v=l),i.isValid(o)&&v>o&&(v=o,A.setAttribute("maxLineWidth",o-c[1]-c[2])));let C=0,P=0;"center"===w?(C-=v/2,b&&b.setAttribute("x",(b.attribute.x||0)-L/2),p.setAttribute("x",-y/2)):"right"===w||"end"===w?(C-=v,b&&b.setAttribute("x",(b.attribute.x||0)-L),p.setAttribute("x",-c[1]-y)):"left"!==w&&"start"!==w||p.setAttribute("x",c[3]),"middle"===T?(P-=g/2,b&&b.setAttribute("y",0)):"bottom"===T?(P-=g,b&&b.setAttribute("y",-k/2),p.setAttribute("y",-c[2])):"top"===T&&(p.setAttribute("y",c[0]),b&&b.setAttribute("y",k/2));const{visible:I,...H}=n;if(h&&i.isBoolean(I)){const t=this.createOrUpdateChild("tag-panel",{...H,visible:I&&!!e,x:C,y:P,width:v,height:g},"rect");i.isEmpty(null==u?void 0:u.panel)||(t.states=u.panel)}}}E.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};class L extends n{constructor(t){super(i.merge({},L.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,s,a,n;const{title:r="",titleStyle:l={},position:o,content:d="",contentStyle:h={},panel:u={},space:c=4,minWidth:p=0,maxWidth:b=1/0,padding:v=4,visible:g,state:_,dx:y=0,dy:m=0}=this.attribute,x=i.normalizePadding(v),f=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),A=b-x[1]-x[3],S=i.isValid(r)&&!1!==g,E={text:r,visible:S,...l,x:x[3],y:x[0],maxLineWidth:A,textAlign:"left",textBaseline:"top"},L=f.createOrUpdateChild("poptip-title",E,"text");i.isEmpty(null==_?void 0:_.title)||(L.states=_.title);const k=L.AABBBounds,B=k.height(),M=k.width();let w=B+c;S||(w=0);const T=i.isValid(d)&&!1!==g,C={text:d,visible:T,...h,x:x[3],y:x[0]+w,maxLineWidth:A,textAlign:"left",textBaseline:"top"},P=f.createOrUpdateChild("poptip-content",C,"text");i.isEmpty(null==_?void 0:_.content)||(P.states=_.content);const I=P.AABBBounds,H=I.height(),z=I.width();T&&(w+=H);let V=i.max(M+x[1]+x[3],z+x[1]+x[3]);V>b?V=b:V<p&&(V=p);const R=x[0]+x[2]+w,{visible:N,...D}=u,O=null!==(t=D.size)&&void 0!==t?t:12,$=i.isArray(O)?[O[0]+(null!==(e=D.space)&&void 0!==e?e:0),O[1]+(null!==(s=D.space)&&void 0!==s?s:0)]:O+(null!==(a=D.space)&&void 0!==a?a:0),U=null!==(n=D.lineWidth)&&void 0!==n?n:1,W=this.stage?[this.stage.width,this.stage.height]:void 0,F="auto"===o;let G,Y=1/0;for(let t=0;t<this.positionList.length+1;t++){const e=F?this.positionList[t===this.positionList.length?G:t]:o,{angle:s,offset:a,rectOffset:n}=this.getAngleAndOffset(e,V,R,i.isArray($)?$:[$,$-U]);if(i.isBoolean(N)){const t=(i.isArray(O)?O[0]:O)/4,e=f.createOrUpdateChild("poptip-symbol-panel",{...D,visible:N&&(T||S),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:s,dx:a[0],dy:a[1],size:O,zIndex:-9},"symbol");i.isEmpty(null==_?void 0:_.panel)||(e.states=_.panel);const n=f.createOrUpdateChild("poptip-rect-panel",{...D,visible:N&&(T||S),x:0,y:0,width:V,height:R,zIndex:-8},"rect");i.isEmpty(null==_?void 0:_.panel)||(n.states=_.panel)}if(f.setAttributes({x:-a[0]+y,y:-a[1]+m}),!F||!W)break;{const e=this.AABBBounds,s=(new i.Bounds).setValue(0,0,W[0],W[1]);if(i.rectInsideAnotherRect(e,s,!1))break;{const a=i.getRectIntersect(e,s,!1),n=(a.x2-a.x1)*(a.y2-a.y1);n<Y&&(Y=n,G=t)}}}}getAngleAndOffset(t,e,s,a){const n=a[1]/2;switch(t){case"tl":return{angle:i.pi/2*3,offset:[e/4,s+n],rectOffset:[-e/4,-s-a[1]]};case"top":return{angle:i.pi/2*3,offset:[e/2,s+n],rectOffset:[0,-s-a[1]]};case"tr":return{angle:i.pi/2*3,offset:[e/4*3,s+n],rectOffset:[e/4*3,-s-a[1]]};case"rt":return{angle:0,offset:[-n,s/5],rectOffset:[e/4*3,-s-a[1]]};case"right":return{angle:0,offset:[-n,s/2],rectOffset:[e/4*3,-s-a[1]]};case"rb":return{angle:0,offset:[-n,s/5*4],rectOffset:[e/4*3,-s-a[1]]};case"bl":return{angle:i.pi/2,offset:[e/4,-n],rectOffset:[-e/4,-s-a[1]]};case"bottom":return{angle:i.pi/2,offset:[e/2,-n],rectOffset:[0,-s-a[1]]};case"br":return{angle:i.pi/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-s-a[1]]};case"lt":return{angle:i.pi,offset:[e+n,s/5],rectOffset:[-e/4,-s-a[1]]};case"left":return{angle:i.pi,offset:[e+n,s/2],rectOffset:[0,-s-a[1]]};case"lb":return{angle:i.pi,offset:[e+n,s/5*4],rectOffset:[e/4*3,-s-a[1]]}}}}L.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:8,padding:10};var k="inversify:paramtypes";function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}var M=0;var w=function(t){this.id=M++,this.registry=t};function T(){return function(t){if(Reflect.hasOwnMetadata(k,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(k,e,t),t}}function C(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"===("undefined"==typeof Reflect?"undefined":B(Reflect))&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}"function"==typeof SuppressedError&&SuppressedError;const P={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},I={poptip:i.merge({},P)};let H=class{render(t,e,s,a,n,r,l,o,d,h,u,c,p){var b,v,g;if(1===t._showPoptip){const{visible:e,visibleCb:s}=t.attribute.poptip||{};if(!1===e||s&&!1===s(t))return;this.poptipComponent||(this.poptipComponent=new L(t.attribute.poptip));let a=t.attribute.poptip||{};if("text"===t.type&&null==a.title&&null==a.content){const e={};v=e,g=a,i.merge(v,I.poptip,g),a=e,a.content=null!==(b=a.content)&&void 0!==b?b:t.attribute.text}const n=t.globalTransMatrix;this.poptipComponent.setAttributes({visibleAll:!0,pickable:!1,childrenPickable:!1,...a,x:n.e,y:n.f}),h.stage.tryInitInteractiveLayer();const r=h.stage.getLayer("_builtin_interactive");r&&r.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};H=C([T()],H);let z=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=e.Generator.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if(e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};z=C([T()],z);let V=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=e.Generator.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if("text"!==e.type||!e.cliped||e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i={}}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};V=C([T()],V);const R=new w((t=>{t(H).toSelf().inSingletonScope(),t(e.InteractiveSubRenderContribution).toService(H),t(z).toSelf().inSingletonScope(),t(e.AutoEnablePlugins).toService(z),t(V).toSelf().inSingletonScope(),t(e.AutoEnablePlugins).toService(V)}));class N extends n{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}class D extends N{constructor(t){super(i.merge({},D.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",{points:[e,i],...s},"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}D.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};class O extends N{constructor(t){super(i.merge({},O.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",{x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y,...s},"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}O.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};class $ extends N{constructor(t){super(i.merge({},$.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",{...e,outerRadius:i,...this.attribute,...s},"arc")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}$.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class U extends N{constructor(t){super(i.merge({},U.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:s=0,sectorStyle:a}=this.attribute,{startAngle:n,endAngle:r}=this.attribute;return t.createOrUpdateChild("crosshair-sector",{...e,outerRadius:i,innerRadius:s,startAngle:n,endAngle:r,...a},"arc")}setLocation(t){const{center:e,startAngle:s=_,endAngle:a=y}=this.attribute,n=a-s,r=i.radianToDegree(i.getAngleByPoint(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}U.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};class W extends N{constructor(t){super(i.merge({},W.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:s,sides:a=6,lineStyle:n}=this.attribute,{startAngle:r,endAngle:l}=this.attribute,o=(l-r)%(2*Math.PI)==0,d=(l-r)/a;let h;for(let t=0;t<=a;t++){const n=r+d*t,l=i.polarToCartesian(e,s,n);0===t?h=`M${l.x},${l.y}`:h+=`L${l.x},${l.y}`,t===a&&o&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",{path:h,...n},"path")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}W.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const F=5,G=31,Y=32,X=new Uint32Array(Y+1),q=new Uint32Array(Y+1);q[0]=0,X[0]=~q[0];for(let t=1;t<=Y;++t)q[t]=q[t-1]<<1|1,X[t]=~q[t];function Z(t,e,i=0){const s=Math.max(1,Math.sqrt(t*e/1e6)),a=~~((t+2*i+s)/s),n=~~((e+2*i+s)/s),r=t=>~~((t+i)/s);return r.invert=t=>t*s-i,r.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+Y)/Y));function s(t,e){i[t]|=e}function a(t,e){i[t]&=e}return{array:i,get:(e,s)=>{const a=s*t+e;return i[a>>>F]&1<<(a&G)},set:(e,i)=>{const a=i*t+e;s(a>>>F,1<<(a&G))},clear:(e,i)=>{const s=i*t+e;a(s>>>F,~(1<<(s&G)))},getRange:({x1:s,y1:a,x2:n,y2:r})=>{if(n<0||r<0||s>t||a>e)return!0;let l,o,d,h,u=r;for(;u>=a;--u)if(l=u*t+s,o=u*t+n,d=l>>>F,h=o>>>F,d===h){if(i[d]&X[l&G]&q[1+(o&G)])return!0}else{if(i[d]&X[l&G])return!0;if(i[h]&q[1+(o&G)])return!0;for(let t=d+1;t<h;++t)if(i[t])return!0}return!1},setRange:({x1:i,y1:a,x2:n,y2:r})=>{if(n<0||r<0||i>t||a>e)return;let l,o,d,h,u;for(;a<=r;++a)if(l=a*t+i,o=a*t+n,d=l>>>F,h=o>>>F,d===h)s(d,X[l&G]&q[1+(o&G)]);else for(s(d,X[l&G]),s(h,q[1+(o&G)]),u=d+1;u<h;++u)s(u,4294967295)},clearRange:({x1:e,y1:i,x2:s,y2:n})=>{let r,l,o,d,h;for(;i<=n;++i)if(r=i*t+e,l=i*t+s,o=r>>>F,d=l>>>F,o===d)a(o,q[r&G]|X[1+(l&G)]);else for(a(o,q[r&G]),a(d,X[1+(l&G)]),h=o+1;h<d;++h)a(h,0)},outOfBounds:({x1:i,y1:s,x2:a,y2:n})=>i<0||s<0||n>=e||a>=t,toImageData:s=>{const a=s.createImageData(t,e),n=a.data;for(let s=0;s<e;++s)for(let e=0;e<t;++e){const a=s*t+e,r=4*a,l=i[a>>>F]&1<<(a&G);n[r+0]=255*l,n[r+1]=255*l,n[r+2]=255*l,n[r+3]=31}return a}}}(a,n),r.ratio=s,r.padding=i,r.width=t,r.height=e,r}function j(t,e,s=!1){if(s){const{x1:s,x2:a,y1:n,y2:r}=e,l=i.clamp(s,0,t.width),o=i.clamp(a,0,t.width),d=i.clamp(n,0,t.height),h=i.clamp(r,0,t.height);return{x1:t(l),x2:t(o),y1:t(d),y2:t(h)}}return{x1:t(e.x1),x2:t(e.x2),y1:t(e.y1),y2:t(e.y2)}}function J(t,e,i,s=!0){const a=j(t,i);return!(s&&e.outOfBounds(a))&&!e.getRange(a)}function K(t,e){return!(!t||!e)&&e.encloses(t)}function Q(t,e,i,s=[],a=!0){for(let n=0;n<s.length;n++){const r=i.clone();if(r.setAttributes(s[n]),r.update(),J(t,e,j(t,r.AABBBounds),a))return e.setRange(j(t,r.AABBBounds,!0)),s[n]}return!1}function tt(t,e,s,a,n,r,l){var o,d,h;if("bound"===s.type||"position"===s.type){if(i.isFunction(l)){const d=((i.isFunction(s.position)?s.position(n.attribute):s.position)||function(t){if("rect"===t)return it;return et}(a.type)).map((t=>l(n.AABBBounds,r,t,a.offset)));return Q(t,e,n,d,null===(o=a.overlap)||void 0===o?void 0:o.clampForce)}return!1}if("moveY"===s.type){const r=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return Q(t,e,n,r,null===(d=a.overlap)||void 0===d?void 0:d.clampForce)}if("moveX"===s.type){const r=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return Q(t,e,n,r,null===(h=a.overlap)||void 0===h?void 0:h.clampForce)}return!1}const et=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],it=["top","inside-top","inside"];function st(t,e,i){const{x1:s,x2:a,y1:n,y2:r}=t.AABBBounds,l=Math.min(s,a),o=Math.max(s,a),d=Math.min(n,r),h=Math.max(n,r);let u=0,c=0;return l<0&&o-l<=e?u=-l:o>e&&l-(o-e)>=0&&(u=e-o),d<0&&h-d<=i?c=-d:h>i&&d-(h-i)>=0&&(c=i-h),{dx:u,dy:c}}const at={fadeIn:(t={})=>{var e,i,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1}}},fadeOut:(t={})=>{var e,i,s;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function nt(t,e){var i,s;return null!==(s=null===(i=at[e])||void 0===i?void 0:i.call(at,t))&&void 0!==s?s:{from:{},to:{}}}const rt="same-time",lt=300,ot="linear";class dt extends n{constructor(){super(...arguments),this.name="label",this._onHover=t=>{const e=t.target;e===this._lastHover||i.isEmpty(e.states)||(e.addState(x.hover,!0),l(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(x.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(l(this,(t=>{i.isEmpty(t.states)||(t.removeState(x.hoverReverse),t.removeState(x.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void l(this,(t=>{i.isEmpty(t.states)||(t.removeState(x.selectedReverse),t.removeState(x.selected))}));i.isEmpty(e.states)||(e.addState(x.selected,!0),l(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(x.selectedReverse,!0)})),this._lastSelect=e)}}setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}layoutArcLabels(t,e,i,s,a){return[]}render(){this._prepare();const{overlap:t,smartInvert:e,dataFilter:s,customLayoutFunc:a,customOverlapFunc:n}=this.attribute;let r,l=this.attribute.data;i.isFunction(s)&&(l=s(l)),i.isFunction(a)?r=a(l,(t=>this._idToGraphic.get(t.id))):(r=this.layout(l),i.isFunction(n)?r=n(r,(t=>this._idToGraphic.get(t.id))):!1!==t&&(r=this._overlapping(r))),!1!==e&&this._smartInvert(r),this._renderLabels(r)}_bindEvent(t){if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStates(t){if(!t)return;const e=this.attribute.state;e&&!i.isEmpty(e)&&(t.states=e)}_createLabelText(t){const i=e.createText(t);return this._bindEvent(i),this._setStates(i),i}_prepare(){var t;const e=function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),s=[];if(e.forEach((t=>{"willRelease"!==t.releaseStatus&&s.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),this._baseMarks=s,!s||0===s.length)return;const{data:a}=this.attribute;if(a&&0!==a.length){this._idToGraphic||(this._idToGraphic=new Map);for(let t=0;t<s.length;t++){const e=a[t],n=s[t];e&&n&&(i.isValid(e.id)||(e.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(e.id,n))}}}layout(t=[]){var e;const{textStyle:s={},position:a,offset:n}=this.attribute,r=[],l=[];for(let e=0;e<t.length;e++){const o=t[e],d=this._idToGraphic.get(o.id),h={fill:d.attribute.fill,...s,...o},u=this._createLabelText(h),c=this.getGraphicBounds(u);l.push(c);const p=this.getGraphicBounds(d,{x:o.x,y:o.y}),b=this.labeling(c,p,i.isFunction(a)?a(o):a,n);b&&(h.x=b.x,h.y=b.y,u.setAttributes(b),r.push(u))}if("arc"===this.attribute.type){const i=this.layoutArcLabels(a,this.attribute,Array.from(this._idToGraphic.values()),t,l);for(let s=0;s<t.length;s++){const a=t[s],n=i.find((t=>t.labelText===a.text)),l={x:n.labelPosition.x,y:n.labelPosition.y,angle:null!==(e=this.attribute.angle)&&void 0!==e?e:n.angle,labelLinePath:n.labelLinePath};r[s].setAttributes(l)}}return r}_overlapping(t){var e,s,a,n;if(0===t.length)return[];const r=this.attribute.overlap,l=[],o=this.getBaseMarkGroup(),d=null!==(e=r.size)&&void 0!==e?e:{width:null!==(s=null==o?void 0:o.AABBBounds.width())&&void 0!==s?s:0,height:null!==(a=null==o?void 0:o.AABBBounds.height())&&void 0!==a?a:0};if(0===d.width||0===d.height)return t;const{avoidBaseMark:h,strategy:u=[],hideOnHit:c=!0,clampForce:p=!0,avoidMarks:b=[]}=r,v=this._bmpTool||Z(d.width,d.height),g=this._bitmap||v.bitmap(),_=u.some((t=>"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&g.setRange(j(v,t.AABBBounds,!0))}))),b.length>0&&b.forEach((t=>{i.isString(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&g.setRange(j(v,t.AABBBounds,!0))})):t.AABBBounds&&g.setRange(j(v,t.AABBBounds,!0))}));for(let e=0;e<t.length;e++){if(!1===t[e].visible)continue;const i=t[e],s=this._idToGraphic.get(i.attribute.id);if(i.update(),J(v,g,i.AABBBounds,p)){if(!_){g.setRange(j(v,i.AABBBounds,!0)),l.push(i);continue}if(_&&(null==s?void 0:s.AABBBounds)&&K(i.AABBBounds,null==s?void 0:s.AABBBounds)){g.setRange(j(v,i.AABBBounds,!0)),l.push(i);continue}}if(p){const{dx:t=0,dy:e=0}=st(i,v.width,v.height);if((0!==t||0!==e)&&J(v,g,{x1:i.AABBBounds.x1+t,x2:i.AABBBounds.x2+t,y1:i.AABBBounds.y1+e,y2:i.AABBBounds.y2+e})){i.setAttributes({x:i.attribute.x+t,y:i.attribute.y+e}),l.push(i);continue}}let a=!1;for(let n=0;n<u.length;n++)if(a=tt(v,g,u[n],this.attribute,i,this.getGraphicBounds(s,t[e]),this.labeling),!1!==a){i.setAttributes({x:a.x,y:a.y}),l.push(i);break}if(!a&&p){const{dx:t=0,dy:e=0}=st(i,v.width,v.height);if((0!==t||0!==e)&&J(v,g,{x1:i.AABBBounds.x1+t,x2:i.AABBBounds.x2+t,y1:i.AABBBounds.y1+e,y2:i.AABBBounds.y2+e})){i.setAttributes({x:i.attribute.x+t,y:i.attribute.y+e}),g.setRange(j(v,i.AABBBounds,!0)),l.push(i);continue}}!a&&!c&&l.push(i)}return i.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(g),l}getBaseMarkGroup(){const{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find((e=>e.name===t),!0)}getGraphicBounds(t,e={}){return(null==t?void 0:t.AABBBounds)||{x1:e.x,x2:e.x,y1:e.y,y2:e.y}}_renderLabels(t){var s,a,n,r,l;const o=null!==(s=this.attribute.animation)&&void 0!==s?s:{},d=!1===this._enableAnimation||!1===o,h=null!==(a=o.mode)&&void 0!==a?a:rt,u=null!==(n=o.duration)&&void 0!==n?n:lt,c=null!==(r=o.easing)&&void 0!==r?r:ot,p=null!==(l=o.delay)&&void 0!==l?l:0,b=new Map,v=this._graphicToText||new Map,g=[];t.forEach(((t,s)=>{var a,n,r,l,_,y,m,x;const f=(null===(a=t.attribute)||void 0===a?void 0:a.labelLinePath)?e.createPath({visible:null===(r=null===(n=t.attribute)||void 0===n?void 0:n.visible)||void 0===r||r,stroke:null!==(y=null===(_=null===(l=t.attribute)||void 0===l?void 0:l.line)||void 0===_?void 0:_.stroke)&&void 0!==y?y:null===(m=t.attribute)||void 0===m?void 0:m.fill,lineWidth:1,path:null===(x=t.attribute)||void 0===x?void 0:x.labelLinePath}):void 0,A=this._idToGraphic.get(t.attribute.id),S=(null==v?void 0:v.get(A))?"update":"enter";if("enter"===S)if(g.push(t),b.set(A,t),!d&&A){const{from:e,to:i}=nt(t.attribute,"fadeIn");this.add(t),f&&this.add(f),A.onAnimateBind=()=>{t.setAttributes(e);const a=this._afterRelatedGraphicAttributeUpdate(t,g,s,A,{mode:h,duration:u,easing:c,to:i,delay:p});A.on("afterAttributeUpdate",a)}}else this.add(t),f&&this.add(f);if("update"===S){const s=v.get(A);v.delete(A),b.set(A,s),d?s.setAttributes(t.attribute):(s.animate().to(t.attribute,u,c),!1!==o.increaseEffect&&s.attribute.text!==t.attribute.text&&i.isValidNumber(Number(s.attribute.text)*Number(t.attribute.text))&&s.animate().play(new e.IncreaseCount({text:s.attribute.text},{text:t.attribute.text},u,c)))}})),v.forEach((t=>{d?this.removeChild(t):null==t||t.animate().to(nt(t.attribute,"fadeOut").to,u,c).onEnd((()=>{this.removeChild(t)}))})),this._graphicToText=b}_afterRelatedGraphicAttributeUpdate(t,i,s,a,{mode:n,duration:r,easing:l,to:o,delay:d}){const h=u=>{var c;const{detail:p}=u;if(!p)return{};if(!(p&&p.type===e.AttributeUpdateType.ANIMATE_UPDATE&&p.animationState&&"wait"!==(null===(c=p.animationState.step)||void 0===c?void 0:c.type)))return{};if(p.type===e.AttributeUpdateType.ANIMATE_END)return void t.setAttributes(o);const b=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",h))};switch(n){case"after":p.animationState.end&&t.animate({onEnd:b}).wait(d).to(o,r,l);break;case"after-all":s===i.length-1&&p.animationState.end&&i.forEach((t=>{t.animate({onEnd:b}).wait(d).to(o,r,l)}));break;default:p.animationState.isFirstFrameOfStep&&t.animate({onEnd:b}).wait(d).to(o,r,l)}};return h}_smartInvert(t){const e=this.attribute.smartInvert||{},{textType:i,contrastRatiosThreshold:s,alternativeColors:a}=e;for(let e=0;e<t.length;e++){const n=t[e];if(!n)continue;const r=this._idToGraphic.get(n.attribute.id);let l=K(n.AABBBounds,null==r?void 0:r.AABBBounds);if("arc"===this.attribute.type&&(l="inside"===this.attribute.position),n.attribute.stroke&&n.attribute.lineWidth>0)n.setAttributes({fill:h(n.attribute.fill,n.attribute.stroke,i,s,a)});else if(l){const t=r.attribute.fill,e=n.attribute.fill;n.setAttributes({fill:h(e,t,i,s,a)})}else if(n.attribute.lineWidth>0){const t=n.attribute.stroke,e=n.attribute.fill;n.setAttributes({stroke:r.attribute.fill,fill:h(e,t,i,s,a)})}}}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}class ht extends dt{constructor(t){super(i.merge({},ht.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",s=0){if(!t)return;const{x1:a,y1:n,x2:r,y2:l}=t,o=Math.abs(r-a),d=Math.abs(l-n),h=(e.x1+e.x2)/2,u=(e.y1+e.y2)/2;let c=0,p=0,b=0,v=0;e&&(b=Math.abs(e.x1-e.x2)/2,v=Math.abs(e.y1-e.y2)/2);const g={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(g[i]*(Math.PI/180)),p=Math.cos(g[i]*(Math.PI/180));break;case"center":c=0,p=0}return{x:h+c*(s+b)+Math.sign(c)*(o/2),y:u+p*(s+v)+Math.sign(p)*(d/2)}}}ht.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class ut extends dt{constructor(t){super(i.merge({},ut.defaultAttributes,t))}labeling(t,e,i="top",s=0){if(!t||!e)return;const{x1:a,y1:n,x2:r,y2:l}=t,o=Math.abs(r-a),d=Math.abs(l-n),h=Math.abs(e.x2-e.x1),u=Math.abs(e.y2-e.y1);let c=(e.x1+e.x2)/2,p=(e.y1+e.y2)/2,b=0,v=0;switch(i){case"top":case"inside-top":v=-.5;break;case"bottom":case"inside-bottom":v=.5;break;case"left":case"inside-left":b=-.5;break;case"right":case"inside-right":b=.5}c+=b*h,p+=v*u;let g=0,_=0;const y=i.includes("inside");i.includes("top")?_=y?1:-1:i.includes("bottom")?_=y?-1:1:i.includes("left")?g=y?1:-1:i.includes("right")&&(g=y?-1:1);return{x:c+g*s+g*o/2,y:p+_*s+_*d/2}}}ut.tag="rect-label",ut.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class ct extends dt{constructor(t){super(i.merge({},ct.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={}){var i;if("line"!==t.type)return super.getGraphicBounds(t,e);const{position:s="end"}=this.attribute,a=(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)||[e],n="start"===s?0:a.length-1;return{x1:a[n].x,x2:a[n].x,y1:a[n].y,y2:a[n].y}}labeling(t,e,i="end",s=0){if(!t||!e)return;const{x1:a,x2:n}=t,r=Math.abs(n-a),l=e.x1;let o=l;return"end"===i?o=l+r/2+s:"start"===i&&(o=l-r/2-s),{x:o,y:e.y1}}}function pt(t,e,i,s){const a=(n={radius:i,angle:s}).radius?{x:Math.cos(n.angle)*n.radius,y:Math.sin(n.angle)*n.radius}:{x:0,y:0};var n;return{x:t+a.x,y:e+a.y}}function bt(t){return(t=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function vt(t){return 3===t||4===t}function gt(t,e){const{x1:i,y1:s,x2:a,y2:n}=t,{x1:r,y1:l,x2:o,y2:d}=e;return!(i<=r&&a<=r||i>=o&&a>=o||s<=l&&n<=l||s>=d&&n>=d)}ct.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class _t{constructor(t,e,i,s,a,n){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=a,this.middleAngle=n,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class yt extends dt{constructor(t){super(i.merge({},yt.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",s=0){if(t&&e)return{x:0,y:0}}layoutArcLabels(t,e,i,s,a){this._arcLeft.clear(),this._arcRight.clear();const{width:n,height:r}=e;i.forEach(((t,i)=>{var l,o;const d=t.attribute,h=this.computeLayoutOuterRadius(d.outerRadius,n,r),u=this.computeRadius(h,n,r),c={x:null!==(l=null==d?void 0:d.x)&&void 0!==l?l:0,y:null!==(o=null==d?void 0:d.y)&&void 0!==o?o:0},p=s[i],b=a[i],v=(d.startAngle+d.endAngle)/2,g=d.endAngle-d.startAngle,_=bt(d.endAngle-g/2),y=pt(c.x,c.y,d.outerRadius,v),m=pt(c.x,c.y,u+e.line.line1MinLength,v),x=new _t(p,y,m,_,g,v);var f;x.pointA=pt(c.x,c.y,this.computeDatumRadius(2*c.x,2*c.y,d.outerRadius),x.middleAngle),x.labelSize={width:b.x2-b.x1,height:b.y2-b.y1},1===(f=x.quadrant)||2===f?this._arcRight.set(x.refDatum,x):vt(x.quadrant)&&this._arcLeft.set(x.refDatum,x)}));const l=Array.from(this._arcLeft.values()),o=Array.from(this._arcRight.values()),d=[];return"inside"===t?(d.push(...this._layoutInsideLabels(o,e,i)),d.push(...this._layoutInsideLabels(l,e,i))):(d.push(...this._layoutOutsideLabels(o,e,i)),d.push(...this._layoutOutsideLabels(l,e,i))),d}_layoutInsideLabels(t,e,s){var a,n,r,l;const o={x:null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,y:null!==(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y)&&void 0!==l?l:0},d=this.computeLayoutOuterRadius(s[0].attribute.innerRadius,e.width,e.height),h=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),u=e,c=u.spaceWidth;return t.forEach((t=>{const{labelSize:s,radian:a}=t,n=this.computeRadius(d,e.width,e.height,1),r=this.computeRadius(h,e.width,e.height,1),l=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(r,s.height);let p;if(a<l)p=0;else{let t;t=a>=Math.PI?n:Math.max(n,s.height/2/Math.tan(a/2)),p=r-t-c}!0!==(null==u?void 0:u.rotate)&&(p=r-c);const b=this._getFormatLabelText(t.refDatum,p);t.labelText=b;const v=Math.min(p,t.labelSize.width),g=this._computeAlign(t,e),_=r-c-("left"===g?v:"right"===g?0:v/2);t.labelPosition=pt(o.x,o.y,_,t.middleAngle),t.labelLimit=v,i.isGreater(v,0)||(t.labelVisible=!1),t.angle=t.middleAngle})),t}_layoutOutsideLabels(t,e,s){var a,n,r,l,o;const d=null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,h=2*(null!==(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y)&&void 0!==l?l:0),u=e.line.line2MinLength,c=e.layout,p=e.spaceWidth;if(t.forEach((t=>{const e=vt(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+u+p),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==e.coverEnable||"none"===c.strategy){for(const i of t){const{labelPosition:t,labelSize:a}=i;i.labelLimit=a.width,i.pointB=vt(i.quadrant)?{x:t.x+a.width/2+u+p,y:t.y}:{x:t.x-a.width/2-u-p,y:t.y},this._computeX(i,e,s)}!1===e.coverEnable&&"none"===c.strategy&&this._coverLabels(t)}else{const i=h/((null===(o=e.textStyle)||void 0===o?void 0:o.fontSize)||16);this._adjustY(t,i,e,s);const{minY:a,maxY:n}=t.reduce(((t,e)=>{const{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(h,Math.max(s,t.maxY)),t}),{minY:1/0,maxY:-1/0}),r=Math.max(Math.abs(h/2-a),Math.abs(n-h/2)),l=this._computeLayoutRadius(r,e,s);for(const i of t)this._computePointB(i,l,e,s),this._computeX(i,e,s)}const b=2*d;return t.forEach((t=>{t.labelVisible&&(i.isLess(t.pointB.x,u+p)||i.isGreater(t.pointB.x,b-u-p))&&(t.labelVisible=!1),t.angle=0,t.labelLinePath=`M${Math.round(t.pointA.x)},${Math.round(t.pointA.y)} L${Math.round(t.pointB.x)},${Math.round(t.pointB.y)} L${Math.round(t.pointC.x)},${Math.round(t.pointC.y)}`})),t}_computeX(t,e,s){var a,n,r,l,o;const d=null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,h=2*d,u=(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y,this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height)),c=e.line.line1MinLength,p=e.line.line2MinLength,b=null===(o=e.layout)||void 0===o?void 0:o.align,v=e.spaceWidth;this._computeAlign(t,e);const{labelPosition:g,quadrant:_,pointB:y}=t;i.isValidNumber(y.x*y.y)||(t.pointC={x:NaN,y:NaN},g.x=NaN,t.labelLimit=0);const m=this.computeRadius(u,e.width,e.height),x=vt(_)?-1:1;let f=0;let A=(x>0?h-y.x:y.x)-p-v;"labelLine"===b&&(f=(m+c+p)*x+d,A=(x>0?h-f:f)-v);const S=this._getFormatLabelText(t.refDatum,A);t.labelText=S;let E=Math.min(A,t.labelSize.width);switch(b){case"labelLine":break;case"edge":f=x>0?h-E-v:E+v;break;default:f=y.x+x*p}if(E=Math.max(this._ellipsisWidth,E),t.pointC={x:f,y:g.y},"edge"===b){const t=0;g.x=x>0?h+t:t}else{const e=0;g.x=f+e+x*(v+.5*t.labelSize.width)}t.labelLimit=E}_computeAlignOffset(t,e,i){switch(t){case"left":return i<0?-e:0;case"right":return i<0?0:e;default:return e/2*i}}_computeAlign(t,e){var s,a,n,r,l,o;const d=e,h=null!==(a=null===(s=d.textStyle)||void 0===s?void 0:s.textAlign)&&void 0!==a?a:null===(n=d.textStyle)||void 0===n?void 0:n.align,u=null!==(l=null===(r=d.layout)||void 0===r?void 0:r.textAlign)&&void 0!==l?l:null===(o=d.layout)||void 0===o?void 0:o.align;return"inside"!==d.position?i.isNil(h)||"auto"===h?"edge"===u?vt(t.quadrant)?"left":"right":vt(t.quadrant)?"right":"left":h:i.isNil(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){return t.text}_adjustY(t,e,s,a){var n,r,l,o;r=null===(n=a[0].attribute)||void 0===n?void 0:n.x;const d=2*(null!==(o=null===(l=a[0].attribute)||void 0===l?void 0:l.y)&&void 0!==o?o:0),h=s.layout;if("vertical"===h.strategy){let e,s=0;const a=t.length;if(a<=0)return;for(let n=0;n<a;n++){const{y1:r}=t[n].getLabelBounds();if(e=r-s,i.isLess(e,0)){const i=this._shiftY(t,n,a-1,-e);this._shiftY(t,i,0,e/2)}const{y2:l}=t[n].getLabelBounds();s=l}const{y1:n}=t[0].getLabelBounds();e=n-0,i.isLess(e,0)&&this._shiftY(t,0,a-1,-e);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>d;e--)t[e].labelVisible=!1}else if("none"!==h.strategy){const n=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));n.sort(((t,e)=>e.arc.radian-t.arc.radian)),n.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let r=1/0,l=-1/0;for(let o=0;o<e&&o<t.length;o++){this._storeY(t);const e=n[o].arc;this._computeYRange(e,s,a),e.labelVisible=!0;const u=e.labelPosition.y,{lastIndex:c,nextIndex:p}=this._findNeighborIndex(t,n[o]),b=t[c],v=t[p];if(-1===c&&-1!==p){const i=v.labelPosition.y;u>i?e.labelPosition.y=i-v.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,v,p)}else if(-1!==c&&-1===p){const i=b.labelPosition.y;u<i?e.labelPosition.y=i+b.labelSize.height/2+e.labelSize.height/2:this._twoWayShift(t,b,e,n[o].originIndex)}else if(-1!==c&&-1!==p){const i=b.labelPosition.y,s=v.labelPosition.y;u>s?(e.labelPosition.y=s-v.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,b,e,n[o].originIndex)):u<i?(e.labelPosition.y=i+b.labelSize.height/2+e.labelSize.height/2,this._twoWayShift(t,e,v,p)):(this._twoWayShift(t,b,e,n[o].originIndex),this._twoWayShift(t,e,v,p))}const g=Math.min(r,n[o].originIndex),_=Math.max(l,n[o].originIndex);let y;if(y=t[_].getLabelBounds().y2-d,i.isGreater(y,0)&&this._shiftY(t,_,0,-y),y=t[g].getLabelBounds().y1-0,i.isLess(y,0)&&this._shiftY(t,g,t.length-1,-y),y=t[_].getLabelBounds().y2-d,i.isGreater(y,0)){e.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(e.labelVisible=!1,this._restoreY(t)):(r=g,l=_)}}}_shiftY(t,e,i,s){const a=e<i?1:-1;let n=e;for(;-1!==n;){t[n].labelPosition.y+=s;const e=this._findNextVisibleIndex(t,n,i,a);if(e>=0&&e<t.length){const{y1:i,y2:s}=t[n].getLabelBounds(),{y1:r,y2:l}=t[e].getLabelBounds();if(a>0&&s<r||a<0&&i>l)return n}n=e}return i}_findNextVisibleIndex(t,e,i,s){const a=(i-e)*s;for(let i=1;i<=a;i++){const a=e+i*s;if(t[a].labelVisible)return a}return-1}_computePointB(t,e,s,a){var n,r,l,o;const d=s,h=this.computeLayoutOuterRadius(a[0].attribute.outerRadius,s.width,s.height),u=d.line.line1MinLength;if("none"===d.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const d={x:null!==(r=null===(n=a[0].attribute)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(o=null===(l=a[0].attribute)||void 0===l?void 0:l.y)&&void 0!==o?o:0},c=this.computeRadius(h,s.width,s.height),{labelPosition:p,quadrant:b}=t,v=e-Math.max(c+u,a[0].attribute.outerRadius),g=Math.sqrt(e**2-Math.abs(d.y-p.y)**2)-v;i.isValidNumber(g)?t.pointB={x:d.x+g*(vt(b)?-1:1),y:p.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,s){var a,n,r,l;const o={width:2*(null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0),height:2*(null!==(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y)&&void 0!==l?l:0)},d=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),h=e.line.line1MinLength,{width:u,height:c}=o,p=this.computeRadius(d,e.width,e.height),b=this._computeLayoutRadius(c/2,e,s),v=Math.abs(t.center.x-u/2),g=t.center.y-c/2;let _,y,m;if(i.isNumberClose(u/2,v))_=0,y=1,m=-g;else if(i.isNumberClose(c/2,g))_=1,y=0,m=-v;else{const t=-1/(g/v);_=t,y=-1,m=g-t*v}const x=function(t,e,i,s,a,n){if(0===t&&0===e||n<=0)return[];if(0===t){const t=-i/e,r=n**2-(t-a)**2;return r<0?[]:0===r?[{x:s,y:t}]:[{x:Math.sqrt(r)+s,y:t},{x:-Math.sqrt(r)+s,y:t}]}if(0===e){const e=-i/t,r=n**2-(e-s)**2;return r<0?[]:0===r?[{x:e,y:a}]:[{x:e,y:Math.sqrt(r)+a},{x:e,y:-Math.sqrt(r)+a}]}const r=(e/t)**2+1,l=2*((i/t+s)*(e/t)-a),o=l**2-4*r*((i/t+s)**2+a**2-n**2);if(o<0)return[];const d=(-l+Math.sqrt(o))/(2*r),h=(-l-Math.sqrt(o))/(2*r),u=-(e*d+i)/t;return 0===o?[{x:u,y:d}]:[{x:u,y:d},{x:-(e*h+i)/t,y:h}]}(_,y,m,h+p-b,0,b);if(x.length<2)return;let f,A;x[0].x>x[1].x&&x.reverse(),x[0].x<0?i.isNumberClose(x[0].y,x[1].y)?Math.abs(t.middleAngle)<Math.PI/2?(f=0,A=x[1].y+c/2):(f=x[1].y+c/2,A=c):x[0].y<x[1].y?(f=0,A=x[1].y+c/2):(f=x[1].y+c/2,A=o.height):(f=Math.min(x[0].y,x[1].y)+c/2,A=Math.max(x[0].y,x[1].y)+c/2),t.labelYRange=[f,A]}_computeLayoutRadius(t,e,i){const s=e,a=s.layoutArcGap,n=s.line.line1MinLength,r=this.computeLayoutOuterRadius(i[0].attribute.outerRadius,e.width,e.height),l=this.computeRadius(r,e.width,e.height)+n,o=l-a;return Math.max((o**2+t**2)/(2*o),l)}_findNeighborIndex(t,e){const i=e.originIndex;let s=-1,a=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){a=e;break}return{lastIndex:s,nextIndex:a}}_twoWayShift(t,e,s,a){const n=s.getLabelBounds().y1-e.getLabelBounds().y2;if(i.isLess(n,0)){const e=this._shiftY(t,a,t.length-1,-n);this._shiftY(t,e,0,n/2)}}_restoreY(t){for(const e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(const e of t){const{labelYRange:t,labelPosition:s}=e;if(e.labelVisible&&t&&(i.isLess(s.y,t[0])||i.isGreater(s.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){const s=t[i].getLabelBounds();gt(e,s)?t[i].labelVisible=!1:e=s}}computeRadius(t,e,s,a){return this.computeLayoutRadius(e||0,s||0)*t*(i.isNil(a)?1:a)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){const s=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*s}}yt.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,textAlign:"center",textBaseline:"middle"},position:"outside",offset:0,line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0}};const mt={rect:ut,symbol:ht,arc:yt};class xt extends n{constructor(t){super(i.merge({},xt.defaultAttributes,t)),this.name="data-label"}render(){const{dataLabels:t,size:e}=this.attribute;if(!t||0===t.length)return;const{width:s=0,height:a=0}=e||{};if(!s||!a||!i.isValidNumber(a*s))return;this._componentMap||(this._componentMap=new Map);const n=Z(s,a),r=n.bitmap(),l=new Map,o=this._componentMap;for(let e=0;e<t.length;e++){const i=t[e];if(mt[i.type]){const{baseMarkGroupName:t}=i;let e=this._componentMap.get(t);e?(e.setBitmapTool(n),e.setBitmap(r),e.setAttributes(i),l.set(t,e)):(e=new mt[i.type](i),e.setBitmap(r),e.setBitmapTool(n),this.add(e),l.set(t,e))}}o.forEach(((t,e)=>{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}function ft(t,e){let i="";return 0===t.length||(t.forEach(((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function At(t,e,s,a){let n="";if(!t||0===e.length)return n;const r=e[0],l=i.PointService.distancePP(t,r),o=s?0:1;return a?n+=`M${t.x},${t.y-l}A${l},${l},0,0,${o},${t.x},${t.y+l}A${l},${l},0,0,${o},${t.x},${t.y-l}Z`:e.forEach(((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${l},${l},0,0,${o},${t.x},${t.y}`})),n}function St(t,e,s){const{type:a,closed:n}=s,r=e.slice(0).reverse();let l="",o="";if("line"===a&&s.smoothLink&&s.center){const e=t[0],a=r[0],d=s.center;l=ft(t,!!n),o=ft(r,!!n);const h=i.PointService.distancePP(a,d),u=i.PointService.distancePP(e,d);l+=`A${h},${h},0,0,1,${a.x},${a.y}L${a.x},${a.y}`,o+=`A${u},${u},0,0,0,${e.x},${e.y}`}else if("circle"===a){const{center:e}=s;l=At(e,t,!1,!!n),o=At(e,r,!0,!!n)}else"line"!==a&&"polygon"!==a||(l=ft(t,!!n),o=ft(r,!!n));return n?l+=o:(o="L"+o.substring(1),l+=o,l+="Z"),l}xt.defaultAttributes={pickable:!1};class Et extends n{constructor(t){super(i.merge({},Et.defaultAttributes,t)),this.name="grid"}render(){this.removeAllChild();const{type:t,items:s,style:a,closed:n,alternateColor:r,depth:l=0}=this.attribute;if(!i.isEmpty(s)&&(s.forEach(((s,r)=>{const{id:o,points:d}=s;let h="";if("line"===t||"polygon"===t)h=ft(d,!!n);else if("circle"===t){const{center:t}=this.attribute;h=At(t,d,!1,!!n)}const u=e.createPath({path:h,z:l,...i.isFunction(a)?i.merge({},Et.defaultAttributes.style,a(s,r)):a});u.name=`${this.name}-line`,u.id=this._getNodeId(`path-${o}`),this.add(u)})),l&&"line"===t&&s.forEach(((t,s)=>{const{id:r,points:o}=t,d=[];d.push(o[0]);const h=o[1].x-o[0].x,u=o[1].y-o[0].y,c=Math.sqrt(h*h+u*u),p=l/c;d.push({x:o[0].x+h*p,y:o[0].y+u*p});const b=ft(d,!!n),v=i.abs(d[0].x-d[1].x),g=i.abs(d[0].y-d[1].y),_=e.createPath({path:b,z:0,alpha:v>g?(o[1].x-o[0].x>0?-1:1)*i.pi/2:0,beta:v<g?-i.pi/2:0,anchor3d:v>g?[d[0].x,0]:[0,d[0].y],...i.isFunction(a)?i.merge({},Et.defaultAttributes.style,a(t,s)):a});_.name=`${this.name}-line`,_.id=this._getNodeId(`path-${r}`),this.add(_)})),s.length>1&&r)){const t=i.isArray(r)?r:[r,"transparent"],a=e=>t[e%t.length];for(let t=0;t<s.length-1;t++){const[i,n]=[s[t].points,s[t+1].points],r=St(i,n,this.attribute),l=e.createPath({path:r,fill:a(t)});l.name=`${this.name}-region`,l.id=this._getNodeId(`region-${t}`),this.add(l)}}}_getNodeId(t){return`${this.id}-${t}`}}Et.defaultAttributes={style:{lineWidth:1,stroke:"#416180"},zIndex:0};class Lt extends n{constructor(t){super(i.merge({},Lt.defaultAttributes,t)),this.name="segment"}computeLineAngle(){const{points:t}=this.attribute,e=t[0],i=t[1],s=t[t.length-2],a=t[t.length-1],n=[e.x-i.x,e.y-i.y],r=Math.atan2(n[1],n[0]),l=[a.x-s.x,a.y-s.y],o=Math.atan2(l[1],l[0]);this._startAngle=r,this._endAngle=o}render(){this.removeAllChild();const{points:t,startSymbol:s,endSymbol:a,lineStyle:n,state:r,visible:l=!0}=this.attribute;if(!l)return;t.length>1&&this.computeLineAngle();const o=this.renderSymbol(s,"start"),d=this.renderSymbol(a,"end");this.startSymbol=o,this.endSymbol=d;let h=t;if(null==s?void 0:s.visible){const e=(null==s?void 0:s.clip)?(null==s?void 0:s.size)||10:0;h=[{x:t[0].x-e/2*(Math.cos(this._startAngle)||0),y:t[0].y-e/2*(Math.sin(this._startAngle)||0)},...h.slice(1)]}if(null==a?void 0:a.visible){const e=(null==a?void 0:a.clip)?(null==a?void 0:a.size)||10:0,i={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};h=[...h.slice(0,h.length-1),i]}const u=e.createLine({points:h,fill:!1,...n});u.name="line",u.id=this._getNodeId("line"),i.isEmpty(null==r?void 0:r.line)||(u.states=r.line),this.line=u,this.add(u)}renderSymbol(t,s){const{autoRotate:a=!0}=t;let n;if(null==t?void 0:t.visible){const r=this._startAngle,l=this._endAngle,{points:o,state:d}=this.attribute,h=o[0],u=o[o.length-1],{refX:c=0,refY:p=0,refAngle:b=0,style:v,symbolType:g,size:_=12}=t;let y,m;"start"===s?(y={x:h.x+(r?c*Math.cos(r)+p*Math.cos(r-Math.PI/2):0),y:h.y+(r?c*Math.sin(r)+p*Math.sin(r-Math.PI/2):0)},m=r+Math.PI/2):(y={x:u.x+(l?c*Math.cos(l)+p*Math.cos(l-Math.PI/2):0),y:u.y+(l?c*Math.sin(l)+p*Math.sin(l-Math.PI/2):0)},m=l+Math.PI/2),n=e.createSymbol({...y,symbolType:g,size:_,angle:a?m+b:0,strokeBoundsBuffer:0,...v}),n.name=`${s}-symbol`,n.id=this._getNodeId(`${s}-symbol`),i.isEmpty(null==d?void 0:d.symbol)||(n.states=d.symbol),this.add(n)}return n}getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}}var kt,Bt;Lt.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},t.AXIS_ELEMENT_NAME=void 0,(kt=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",kt.axisContainer="axis-container",kt.labelContainer="axis-label-container",kt.tickContainer="axis-tick-container",kt.tick="axis-tick",kt.subTick="axis-sub-tick",kt.label="axis-label",kt.title="axis-title",kt.gridContainer="axis-grid-container",kt.grid="axis-grid",kt.gridRegion="axis-grid-region",kt.line="axis-line",kt.background="axis-background",kt.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(Bt=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",Bt.selectedReverse="selected_reverse",Bt.hover="hover",Bt.hoverReverse="hover_reverse";const Mt={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},wt={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},grid:{style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};class Tt extends n{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{const e=t.target;e!==this._lastHover&&e.name&&!i.isEmpty(e.states)&&(e.addState(x.hover,!0),l(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(x.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(l(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(x.hoverReverse),t.removeState(x.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState(x.selected))return this._lastSelect=null,void l(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(x.selectedReverse),t.removeState(x.selected))}));e.name&&!i.isEmpty(e.states)&&(e.addState(x.selected,!0),l(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(x.selectedReverse,!0)})),this._lastSelect=e)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const s=i.cloneDeep(this.attribute);i.merge(this.attribute,t);const a=e.createGroup({x:this.attribute.x,y:this.attribute.y});return this.add(a),this._renderInner(a),this.removeChild(a),this.attribute=s,a.AABBBounds}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=e.createGroup({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(i){const{title:s,label:a,tick:n,line:r,grid:l,items:o}=this.attribute,d=e.createGroup({x:0,y:0,zIndex:1});if(d.name=t.AXIS_ELEMENT_NAME.axisContainer,d.id=this._getNodeId("container"),d.setMode(this.mode),this.axisContainer=d,i.add(d),(null==r?void 0:r.visible)&&this.renderLine(d),o&&o.length){if(this.data=this._transformItems(o[0]),(null==n?void 0:n.visible)&&this.renderTicks(d),null==a?void 0:a.visible){const i=e.createGroup({x:0,y:0,pickable:!1});i.name=t.AXIS_ELEMENT_NAME.labelContainer,i.id=this._getNodeId("label-container"),this.axisLabelsContainer=i,d.add(i),o.forEach(((t,e)=>{const s=this.renderLabels(i,t,e),a=s.getChildren();this.beforeLabelsOverlap(a,t,s,e,o.length),this.handleLabelsOverlap(a,t,s,e,o.length),this.afterLabelsOverlap(a,t,s,e,o.length)}))}(null==l?void 0:l.visible)&&this.renderGrid(i)}(null==s?void 0:s.visible)&&this.renderTitle(d)}renderTicks(s){const a=this.getTickLineItems(),n=e.createGroup({x:0,y:0,pickable:!1});n.name=t.AXIS_ELEMENT_NAME.tickContainer,n.id=this._getNodeId("tick-container"),s.add(n),a.forEach(((s,r)=>{var l;const o=e.createLine({...this._getTickLineAttribute("tick",s,r,a)});if(o.name=t.AXIS_ELEMENT_NAME.tick,o.id=this._getNodeId(s.id),i.isEmpty(null===(l=this.attribute.tick)||void 0===l?void 0:l.state))o.states=f;else{const t=this.data[r],e=i.merge({},f,this.attribute.tick.state);Object.keys(e).forEach((s=>{i.isFunction(e[s])&&(e[s]=e[s](t.rawValue,r,t,this.data))})),o.states=e}n.add(o)})),this.tickLineItems=a;const{subTick:r}=this.attribute;if(null==r?void 0:r.visible){const s=this.getSubTickLineItems();s.length&&s.forEach(((s,l)=>{const o=e.createLine({...this._getTickLineAttribute("subTick",s,l,a)});if(o.name=t.AXIS_ELEMENT_NAME.subTick,o.id=this._getNodeId(`${l}`),i.isEmpty(r.state))o.states=f;else{const t=i.merge({},f,r.state);Object.keys(t).forEach((e=>{i.isFunction(t[e])&&(t[e]=t[e](s.value,l,s,a))})),o.states=t}n.add(o)})),this.subTickLineItems=s}}renderLabels(s,a,n){const{dataFilter:r}=this.attribute.label;r&&i.isFunction(r)&&(a=r(a,n));const l=this._transformItems(a),o=e.createGroup({x:0,y:0,pickable:!1});o.name=`${t.AXIS_ELEMENT_NAME.labelContainer}-layer-${n}`,o.id=this._getNodeId(`label-container-layer-${n}`),s.add(o);let d=0,h=0,u="center",c="middle";return l.forEach(((s,a)=>{var r,p;const b=this._getLabelAttribute(s,a,l,n),v=e.createText(b);if(v.name=t.AXIS_ELEMENT_NAME.label,v.id=this._getNodeId(`layer${n}-label-${s.id}`),i.isEmpty(null===(r=this.attribute.label)||void 0===r?void 0:r.state))v.states=f;else{const t=i.merge({},f,this.attribute.label.state);Object.keys(t).forEach((e=>{i.isFunction(t[e])&&(t[e]=t[e](s,a,l,n))})),v.states=t}o.add(v);const g=null!==(p=b.angle)&&void 0!==p?p:0;d=Math.max(d,v.AABBBounds.width()),h=Math.max(h,v.AABBBounds.height()),g&&(d=Math.abs(d*Math.cos(g)),h=Math.abs(h*Math.sin(g))),u=b.textAlign,c=b.textBaseline})),this.axisLabelLayerSize[n]={width:d,height:h,textAlign:u,textBaseline:c},o}renderTitle(e){const i=this.getTitleAttribute(),s=new E({...i});s.name=t.AXIS_ELEMENT_NAME.title,s.id=this._getNodeId("title"),e.add(s)}renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType("subGrid",t),this._renderGridByType("grid",t)}getVerticalCoord(t,e,i){const s=this.getVerticalVector(e,i,t);return{x:t.x+s[0],y:t.y+s[1]}}getTextAlign(t){let e="center";return i.isNumberClose(t[0],0)?i.isNumberClose(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,s=[],{alignWithLabel:a,inside:n=!1,length:r,dataFilter:l}=t;let o=1;return e.length>=2&&(o=e[1].value-e[0].value),(l&&i.isFunction(l)?l(e):e).forEach((t=>{let e=t.point,l=t.value;if(!a){const i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),l=i}const d=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const a=this.getVerticalVector(r,n,e);let o=0,h=0;i.abs(a[0])>i.abs(a[1])?o=i.pi/2*(d.x>e.x?1:-1):h=i.pi/2*(d.y>e.y?-1:1),s.push({start:e,end:d,value:l,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else s.push({start:e,end:d,value:l,id:`tick-${t.id}`})})),s}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:a=2}=t,n=this.tickLineItems,r=n.length;if(r>=2)for(let t=0;t<r-1;t++){const r=n[t],l=n[t+1];for(let t=0;t<i;t++){const n=(t+1)/(i+1),o=(1-n)*r.value+n*l.value,d=this.getTickCoord(o),h=this.getVerticalCoord(d,a,s);e.push({start:d,end:h,value:o,id:`sub-tick-${o}`})}}return e}_getTickLineAttribute(t,e,s,a){let n=i.get(this.attribute,`${t}.style`);const r=this.data[s];n=i.isFunction(n)?i.merge({},i.get(wt,`${t}.style`),"tick"===t?n(r.rawValue,s,r,this.data):n(e.value,s,e,a)):n;const{start:l,end:o,anchor:d,alpha:h,beta:u}=e;return{points:[l,o],anchor:d,alpha:h,beta:u,...n}}_getLabelAttribute(t,e,s,a){var n,r,l,o,d,h;const{space:u=4,inside:c=!1,formatMethod:p,...b}=this.attribute.label;let v=u,g=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&(null===(r=this.attribute.tick)||void 0===r?void 0:r.inside)===c&&(g=(null===(l=this.attribute.tick)||void 0===l?void 0:l.length)||4),(null===(o=this.attribute.subTick)||void 0===o?void 0:o.visible)&&(null===(d=this.attribute.subTick)||void 0===d?void 0:d.inside)===c&&(g=Math.max(g,(null===(h=this.attribute.subTick)||void 0===h?void 0:h.length)||2)),v+=g;const _=this.getRelativeVector(t.point);a>0&&(0===_[1]?v+=(this.axisLabelLayerSize[a-1].height+i.get(this.attribute,"label.space",4))*a:v+=(this.axisLabelLayerSize[a-1].width+i.get(this.attribute,"label.space",4))*a);const y=this.getVerticalCoord(t.point,v,c),m=this.getVerticalVector(v,c,y),x=p?p(`${t.label}`,t,e,s,a):t.label;let{style:f}=b;return f=i.isFunction(f)?i.merge({},wt.label.style,f(t,e,s,a)):f,f=i.merge({textAlign:this.getTextAlign(m),textBaseline:this.getTextBaseline(m,c)},f),i.isFunction(f.text)&&(f.text=f.text({label:t.label,value:t.rawValue,index:t.index,layer:a})),{...y,text:x,lineHeight:null==f?void 0:f.fontSize,...f}}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push({...t,point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label})})),e}_renderGridByType(e,i){const s=this.getGridAttribute(e),a=new Et({pickable:!1,...s,zIndex:0});a.name="subGrid"===e?`${t.AXIS_ELEMENT_NAME.grid}-sub`:`${t.AXIS_ELEMENT_NAME.grid}`,a.id=this._getNodeId(e),i.add(a)}}const Ct={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,s)=>s&&Pt(i.AABBBounds,t.AABBBounds,e)?t.setAttribute("opacity",0):(i=t,1)))}};function Pt(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function It(t,e){for(let i,s=1,a=t.length,n=t[0].AABBBounds;s<a;n=i,++s)if(Pt(n,i=t[s].AABBBounds,e))return!0}function Ht(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function zt(t){for(let a=1;a<t.length;a++)if(e=t[a-1],s=t[a],i.isRotateAABBIntersect(e.rotatedBounds,s.rotatedBounds,!0))return!0;var e,s;return!1}function Vt(t,e){"bottom"!==t&&"top"!==t||Nt(t,e),"left"!==t&&"right"!==t||Rt(t,e),function(t){t.forEach((t=>{const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(s=e.centerX,a=e.centerY,n=e.angle,r=t.attribute.x,l=t.attribute.y,{x:(s-r)*Math.cos(n)+(a-l)*Math.sin(n)+r,y:(s-r)*Math.sin(n)+(l-a)*Math.cos(n)+l});var s,a,n,r,l;const o=i.x-e.centerX,d=i.y-e.centerY;e.x1+=o,e.x2+=o,e.y1+=d,e.y2+=d,e.centerX+=o,e.centerY+=d,t.rotatedBounds=e}))}(e)}function Rt(t,e){let i=["right","right","center","left","center","left","center","right","right"],s=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","right","right","right","left","left","left","left","right"],s=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]),e.forEach(((t,e)=>{let a=t.attribute.angle||0;if(a<0)for(;a<0;)a+=2*Math.PI;if(a>0)for(;a>=2*Math.PI;)a-=2*Math.PI;const n=a/(.5*Math.PI);let r;r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,t.setAttributes({textAlign:i[r],textBaseline:s[r],angle:a})}))}function Nt(t,e){let i=["center","left","left","left","center","right","right","right","left"],s=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],s=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]),e.forEach((t=>{let e=t.attribute.angle||0;if(e<0)for(;e<0;)e+=2*Math.PI;if(e>0)for(;e>=2*Math.PI;)e-=2*Math.PI;const a=e/(.5*Math.PI);let n;n=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1,t.setAttributes({textAlign:i[n],textBaseline:s[n],angle:e})}))}class Dt extends Tt{constructor(t,e){super(i.merge({},Dt.defaultAttributes,t),e),"3d"===e&&this.setMode(e)}_renderInner(s){var a;super._renderInner(s);const{panel:n}=this.attribute;if(n&&n.visible){const s=this.axisContainer,r=s.AABBBounds,l=e.createRect({x:r.x1,y:r.y1,width:r.width(),height:r.height(),...n.style});l.name=t.AXIS_ELEMENT_NAME.background,l.id=this._getNodeId("background"),l.states=i.merge({},Mt,null!==(a=n.state)&&void 0!==a?a:{}),s.insertBefore(l,s.firstChild)}}renderLine(e){const{start:s,end:a,line:n}=this.attribute,{startSymbol:r,endSymbol:l,style:o,breakRange:d,breakShape:h,breakShapeStyle:u,state:c,...p}=n,b={points:[s,a],startSymbol:r,endSymbol:l,lineStyle:o,...p};i.isEmpty(c)||(b.state={line:i.merge({},Mt,c),symbol:i.merge({},Mt,c)});const v=new Lt(b);v.name=t.AXIS_ELEMENT_NAME.line,v.id=this._getNodeId("line"),e.add(v)}isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(){const{start:t,end:e}=this.attribute;return[e.x-t.x,e.y-t.y]}getVerticalVector(t,e=!1){const{verticalFactor:i=1}=this.attribute,s=function(t){const[e,i]=t;let s=e*e+i*i;return s>0&&(s=1/Math.sqrt(s)),[t[0]*s,t[1]*s]}(this.getRelativeVector());return v([s[1],-1*s[0]],t*(e?1:-1)*i)}getTitleAttribute(){var t,e,s,a,n,r,l,o;const{position:d="middle",space:h=4,textStyle:u={},autoRotate:c=!0,shape:p,background:b,state:v,..._}=this.attribute.title;let y=.5;"start"===d?y=0:"end"===d&&(y=1);const{verticalFactor:m=1}=this.attribute,x=-1*m,f=this.getTickCoord(y),A=this.getRelativeVector();let S=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(e=this.attribute.label)||void 0===e?void 0:e.inside)){const t=+i.get(this.attribute,"label.space",4);S+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===A[1]){const i=this.axisLabelsContainer.AABBBounds.height();isFinite(i)?S+=i+(e-1)*t:S=0}else{if(0===A[0]){const i=this.axisLabelsContainer.AABBBounds.width();isFinite(i)?S+=i+(e-1)*t:S=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{S+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const i=this.axisLabelLayerSize[0].textAlign,s="start"===i||"left"===i,a="center"===i,n=A[1]>0;S=1===x?n?s?S:a?S/2:t:s?t:a?S/2:S:n?s?t:a?S/2:S:s?S:a?S/2:t}}let E=0;(null===(s=this.attribute.tick)||void 0===s?void 0:s.visible)&&!1===(null===(a=this.attribute.tick)||void 0===a?void 0:a.inside)&&(E=(null===(n=this.attribute.tick)||void 0===n?void 0:n.length)||4),(null===(r=this.attribute.subTick)||void 0===r?void 0:r.visible)&&!1===(null===(l=this.attribute.subTick)||void 0===l?void 0:l.inside)&&(E=Math.max(E,(null===(o=this.attribute.subTick)||void 0===o?void 0:o.length)||2));const L=E+S+h,k=this.getVerticalCoord(f,L,!1),B=this.getVerticalVector(L,!1);let M,w,{angle:T}=_;if(M="start"===d?"start":"end"===d?"end":"center",i.isNil(T)&&c){T=g(A,[1,0],!0);const{verticalFactor:t=1}=this.attribute;w=1===-1*t?"bottom":"top"}else M=this.getTextAlign(B),w=this.getTextBaseline(B,!1);const C={...k,..._,textStyle:{textAlign:M,textBaseline:w,...u},state:{text:i.merge({},Mt,null==v?void 0:v.text),shape:i.merge({},Mt,null==v?void 0:v.shape),panel:i.merge({},Mt,null==v?void 0:v.background)}};return C.angle=T,p&&p.visible&&(C.shape={visible:!0,...p.style},p.space&&(C.space=p.space)),b&&b.visible&&(C.panel={visible:!0,...b.style}),C}_getGridPoint(t,e){let s;if("line"===t){const{length:t}=this.attribute.grid;s=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:a,startAngle:n=_,endAngle:r=y}=this.attribute.grid;s=function(t,e,s,a,n){const r=[],l=n-a;for(let n=0;n<e;n++){const o=a+n*l/e;r.push(i.polarToCartesian(t,s,o))}return r}(t,a,i.PointService.distancePP(t,e),n,r)}return s}getGridAttribute(t){const{type:e,alignWithLabel:s=!0}=this.attribute.grid;let a=1;let n;this.data.length>=2&&(a=this.data[1].value-this.data[0].value);let r=[];if("grid"===t){n=this.attribute.grid;const t=[];this.data.forEach((i=>{let{point:n}=i;if(!s){const t=i.value-a/2;if(this.isInValidValue(t))return;n=this.getTickCoord(t)}t.push({id:i.label,datum:i,points:this._getGridPoint(e,n)})})),r=t}else{n=i.merge({},this.attribute.grid,this.attribute.subGrid);const t=[],{count:l=4}=this.attribute.subTick||{};if(this.data.length>=2){const i=[];this.data.forEach((t=>{let e=t.value;if(!s){const i=t.value-a/2;if(this.isInValidValue(i))return;e=i}i.push({value:e})}));for(let s=0;s<i.length-1;s++){const a=i[s],n=i[s+1];t.push({id:`sub-${s}-0`,points:this._getGridPoint(e,this.getTickCoord(a.value)),datum:{}});for(let i=0;i<l;i++){const r=(i+1)/(l+1),o=(1-r)*a.value+r*n.value,d=this.getTickCoord(o);t.push({id:`sub-${s}-${i+1}`,points:this._getGridPoint(e,d),datum:{}})}s===i.length-2&&t.push({id:`sub-${s}-${l+1}`,points:this._getGridPoint(e,this.getTickCoord(n.value)),datum:{}})}r=t}}return{...n,items:r}}getTextBaseline(t,e){let s="middle";const{verticalFactor:a=1}=this.attribute,n=(e?1:-1)*a;return i.isNumberClose(t[1],0)?s=!i.isNumberClose(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?s="top":t[1]<0&&(s="bottom"),s}beforeLabelsOverlap(t,e,i,s,a){const n=this.attribute.orient;"left"===n||"right"===n?Rt(n,t):"bottom"!==n&&"top"!==n||Nt(n,t)}handleLabelsOverlap(t,e,s,a,n){if(i.isEmpty(t))return;const{verticalLimitSize:r,label:l,orient:o}=this.attribute,d=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:u,autoRotateAngle:c,autoLimit:p,limitEllipsis:b,autoHide:v,autoHideMethod:g,autoHideSeparation:_}=l;i.isFunction(h)?h(t,e,a,this):(u&&function(t,e){if(i.isEmpty(t))return;const{orient:s,labelRotateAngle:a=[0,45,90]}=e;if(0===a.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(a&&a.length>0&&(r=a.length);n<r;){const e=a[n++];if(t.forEach((t=>{t.attribute.angle=i.degreeToRadian(e)})),Vt(s,t),!zt(t))break}}(t,{labelRotateAngle:c,orient:o}),p&&i.isValidNumber(d)&&d>0&&function(t,e){const{limitLength:s,ellipsis:a="...",orient:n}=e;!i.isEmpty(t)&&i.isValidNumber(s)&&t.forEach((t=>{if(("top"===n||"bottom"===n)&&Math.floor(t.AABBBounds.height())<=s)return;if(("left"===n||"right"===n)&&Math.floor(t.AABBBounds.width())<=s)return;let e=0===t.attribute.angle||i.isNil(t.attribute.angle)?"top"===n||"bottom"===n?null:s:Math.abs(s/Math.sin(t.attribute.angle));i.isValidNumber(t.attribute.maxLineWidth)&&(e=i.isValidNumber(e)?Math.min(t.attribute.maxLineWidth,e):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:e,ellipsis:t.attribute.ellipsis||a})}))}(t,{limitLength:d,ellipsis:b,orient:o}),v&&function(t,e){if(i.isEmpty(t))return;const s=t.filter(Ht);if(i.isEmpty(s))return;let a;a=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(s);const{method:n="parity",separation:r=0}=e,l=i.isFunction(n)?n:Ct[n]||Ct.parity;if(a.length>=3&&It(a,r)){do{a=l(a,r)}while(a.length>=3&&It(a,r));a.length<3&&!i.last(s).attribute.opacity&&(a.length>1&&i.last(a).setAttribute("opacity",0),i.last(s).setAttribute("opacity",1))}s.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:o,method:g,separation:_}))}afterLabelsOverlap(s,a,n,r,l){const{verticalLimitSize:o,orient:d}=this.attribute,h="bottom"===d||"top"===d,u=n.AABBBounds;let c=h?u.height():u.width();const{verticalMinSize:p}=this.attribute;if(i.isValidNumber(p)&&(!i.isValidNumber(o)||p<=o)){const i=this._getAxisLabelLimitLength(p,l);let s,a;c=Math.max(c,i),"left"===d?(s=u.x2-c,a=u.y1):"right"===d?(s=u.x1,a=u.y1):"top"===d?(s=u.x1,a=u.y2-c):"bottom"===d&&(s=u.x1,a=u.y1);const r=e.createRect({x:s,y:a,width:h?u.width():c,height:h?c:u.height(),pickable:!1});r.name=t.AXIS_ELEMENT_NAME.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),n.insertBefore(r,n.firstChild)}if(i.isValid(this.attribute.label.containerAlign)){let t;"left"===d?t=u.x2:"right"===d?t=u.x1:"top"===d?t=u.y2:"bottom"===d&&(t=u.y1),function(t,e,i,s,a){if("right"===s||"left"===s){if("left"===a){const a="right"===s?0:-1;t.forEach((t=>{t.setAttributes({x:e+i*a,textAlign:"left"})}))}else if("right"===a){const a="right"===s?1:0;t.forEach((t=>{t.setAttributes({x:e+i*a,textAlign:"right"})}))}else if("center"===a){const a="right"===s?1:-1;t.forEach((t=>{t.setAttributes({x:e+.5*i*a,textAlign:"center"})}))}}else if("bottom"===s||"top"===s)if("top"===a){const a="bottom"===s?0:-1;t.forEach((t=>{t.setAttributes({y:e+i*a,textBaseline:"top"})}))}else if("bottom"===a){const a="bottom"===s?1:0;t.forEach((t=>{t.setAttributes({y:e+i*a,textBaseline:"bottom"})}))}else if("middle"===a){const a="bottom"===s?1:-1;t.forEach((t=>{t.setAttributes({y:e+.5*i*a,textBaseline:"middle"})}))}}(s,t,c,d,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var s,a,n;const{label:r,title:l,line:o,tick:d}=this.attribute,h=null!==(s=r.space)&&void 0!==s?s:4;let u=t,c=0,p=0;const b=(null==o?void 0:o.visible)?null!==(a=o.style.lineWidth)&&void 0!==a?a:1:0,v=(null==d?void 0:d.visible)?null!==(n=d.length)&&void 0!==n?n:4:0;if(null==l?void 0:l.visible){c=S(l.text,l.textStyle).height;const t=i.normalizePadding(l.padding);p=l.space+t[0]+t[2]}return u&&(u=(u-h-p-c-b-v)/e),u}}Dt.defaultAttributes=wt;class Ot extends Tt{constructor(t){super(i.merge({},Ot.defaultAttributes,t))}renderLine(s){const{startAngle:a=_,endAngle:n=y,radius:r,center:l,innerRadius:o=0,line:d,inside:h=!1}=this.attribute;let u=r,c=o;h&&o>0&&(u=o,c=0);const p={...l,startAngle:a,endAngle:n,radius:u,innerRadius:c,...null==d?void 0:d.style},b=e.createCircle(p);b.name=t.AXIS_ELEMENT_NAME.line,b.id=this._getNodeId("line"),i.isEmpty(null==d?void 0:d.state)||(b.states=i.merge({},Mt,d.state)),s.add(b)}isInValidValue(t){const{startAngle:e=_,endAngle:i=y}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=_,endAngle:s=y,center:a,radius:n,inside:r=!1,innerRadius:l=0}=this.attribute,o=e+(s-e)*t;return i.polarToCartesian(a,r&&l>0?l:n,o)}getVerticalVector(t,e=!1,i){const{inside:s=!1}=this.attribute,{center:a}=this.attribute,n=[i.x-a.x,i.y-a.y];return v(n,(e?-1:1)*(s?-1:1)*t/function(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}(n))}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}getTitleAttribute(){var t,e,s,a,n,r,l,o;const{center:d,radius:h,innerRadius:u=0}=this.attribute,{space:c=4,textStyle:p={},shape:b,background:v,state:g,..._}=this.attribute.title;let y=d,m=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(e=this.attribute.label)||void 0===e?void 0:e.inside)&&(m=i.get(this.attribute.label,"style.fontSize",12)+i.get(this.attribute.label,"space",4));let x=0;(null===(s=this.attribute.tick)||void 0===s?void 0:s.visible)&&!1===(null===(a=this.attribute.tick)||void 0===a?void 0:a.inside)&&(x=(null===(n=this.attribute.tick)||void 0===n?void 0:n.length)||4),(null===(r=this.attribute.subTick)||void 0===r?void 0:r.visible)&&!1===(null===(l=this.attribute.subTick)||void 0===l?void 0:l.inside)&&(x=Math.max(x,(null===(o=this.attribute.subTick)||void 0===o?void 0:o.length)||2));const f=h+x+m+c;let A="middle",{position:S}=this.attribute.title;i.isNil(S)&&(S=0===u?"end":"middle"),"start"===S?(A="bottom",y={x:d.x,y:d.y-f}):"end"===S&&(A="top",y={x:d.x,y:d.y+f});const E={...y,..._,textStyle:{textBaseline:A,textAlign:"center",...p},state:{text:i.merge({},Mt,null==g?void 0:g.text),shape:i.merge({},Mt,null==g?void 0:g.shape),panel:i.merge({},Mt,null==g?void 0:g.background)}},{angle:L}=_;return E.angle=L,b&&b.visible&&(E.shape={visible:!0,...b.style},b.space&&(E.space=b.space)),v&&v.visible&&(E.panel={visible:!0,...v.style}),E}getSubTickLineItems(){var t,e;const{subTick:i}=this.attribute,s=[],{count:a=4,inside:n=!1,length:r=2}=i,l=this.tickLineItems,o=l.length;if(o>=2){const i=this.data[1].value-this.data[0].value,d=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t<o;t++){const e=l[t],o=l[t+1];for(let t=0;t<a;t++){const l=(t+1)/(a+1),h=(1-l)*e.value+l*(o?o.value:d?1:e.value+i),u=this.getTickCoord(h),c=this.getVerticalCoord(u,r,n);s.push({start:u,end:c,value:h})}}}return s}getGridAttribute(t){let e,s=[];const{radius:a,innerRadius:n=0,startAngle:r=_,endAngle:l=y,center:o,grid:d}=this.attribute,{alignWithLabel:h=!0}=d||{},u=a-n;let c=1;if(this.data.length>=2&&(c=this.data[1].value-this.data[0].value),"grid"===t){e=this.attribute.grid;const t=[];let i;i=Math.abs(l-r)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,i.forEach((e=>{let{point:i}=e;if(!h){const t=e.value-c/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,u,!0);t.push({id:e.id,points:[i,s],datum:e})})),s=t}else{e=i.merge({},this.attribute.grid,this.attribute.subGrid);const t=[],{count:a=4}=this.attribute.subTick||{},n=this.data.length;if(n>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!h){const e=t.value-c/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let i=0;i<n;i++){const s=e[i],n=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(s.value),this.getVerticalCoord(this.getTickCoord(s.value),u,!0)],datum:{}});for(let e=0;e<a;e++){const r=(e+1)/(a+1),l=(1-r)*s.value+r*(n?n.value:h?1:s.value+c),o=this.getTickCoord(l),d=this.getVerticalCoord(o,u,!0);t.push({id:`sub-${i}-${e+1}`,points:[o,d],datum:{}})}}Math.abs(l-r)%(2*Math.PI)==0&&t.push(t[0]),s=t}}return{...e,items:s,center:o}}getTextBaseline(t){let e="middle";return i.isNumberClose(t[1],0)?e="middle":t[1]>0&&t[1]>Math.abs(t[0])?e="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(e="bottom"),e}beforeLabelsOverlap(t,e,i,s,a){}handleLabelsOverlap(t,e,i,s,a){}afterLabelsOverlap(t,e,i,s,a){}}Ot.defaultAttributes=wt;class $t extends e.ACustomAnimate{constructor(){super(...arguments),this.mode=e.AnimateMode.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._oldElementMap=function(t){const e={};return l(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(e),this._newElementAttrMap={},l(t,(t=>{var e,s,a,n,r,l;if("group"!==t.type&&t.id){const o=this._oldElementMap[t.id];if(o){if(!i.isEqual(t.attribute,o.attribute)){const n=i.cloneDeep(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:{...n,opacity:null!==(e=n.opacity)&&void 0!==e?e:1,fillOpacity:null!==(s=n.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(a=n.strokeOpacity)&&void 0!==a?a:1}},t.setAttributes(o.attribute)}}else{const e={opacity:null!==(n=t.attribute.opacity)&&void 0!==n?n:1,fillOpacity:null!==(r=t.attribute.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(l=t.attribute.strokeOpacity)&&void 0!==l?l:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,e=this.easing;Object.keys(this._newElementAttrMap).forEach((s=>{var a,n,r;const{node:l,attrs:o,state:d}=this._newElementAttrMap[s];"enter"===d&&(t=i.isValidNumber(null===(a=this.params.enter)||void 0===a?void 0:a.duration)?this.params.enter.duration:t,e=(null===(n=this.params.enter)||void 0===n?void 0:n.easing)?null===(r=this.params.enter)||void 0===r?void 0:r.easing:e),"path"===l.type?l.animate({interpolate:(t,e,s,a,n)=>"path"===t&&(n.path=i.interpolateString(s,a)(e),!0)}).to(o,t,e):l.animate().to(o,t,e)}))}onUpdate(t,e,i){}}class Ut extends e.ACustomAnimate{constructor(t,e,i,s){super(null,null,i,s)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}}class Wt extends e.ACustomAnimate{constructor(t,e,i,s){super(null,null,i,s)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}}var Ft;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(Ft||(Ft={}));class Gt extends n{constructor(t){super(i.merge({},Gt.defaultAttributes,t)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=t=>t,this._onHandlerPointerDown=(t,e)=>{"start"===e?(this._activeTag=Ft.startHandler,this._activeItem=this._startHandler):"end"===e?(this._activeTag=Ft.endHandler,this._activeItem=this._endHandler):"middleRect"===e?(this._activeTag=Ft.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=Ft.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=Ft.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t)},this._onHandlerPointerMove=t=>{const{start:e,end:i,brushSelect:s}=this.attribute,a=this.eventPosToStagePos(t),{attPos:n,max:r}=this._layoutCache,l=(a[n]-this._activeCache.lastPos[n])/r;this._activeState&&(this._activeTag===Ft.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===Ft.startHandler?this.state.start+l>this.state.end?(this.state.start=this.state.end,this.state.end=this.state.start+l,this._activeTag=Ft.endHandler):this.state.start=this.state.start+l:this._activeTag===Ft.endHandler&&(this.state.end+l<this.state.start?(this.state.end=this.state.start,this.state.start=this.state.end+l,this._activeTag=Ft.startHandler):this.state.end=this.state.end+l),this._activeCache.lastPos=a,s&&this.renderDragMask()),this.state.start=Math.min(Math.max(this.state.start,0),1),this.state.end=Math.min(Math.max(this.state.end,0),1),e===this.state.start&&i===this.state.end||(this.setAttributes({start:this.state.start,end:this.state.end}),this._updateStateCallback&&this._updateStateCallback(this.state.start,this.state.end))};const{start:e,end:s,size:a,orient:n,showDetail:r,position:l,previewData:o,previewCallbackX:d,previewCallbackY:h,previewCallbackX1:u,previewCallbackY1:c,updateStateCallback:p}=this.attribute,{width:b,height:v}=a;e&&(this.state.start=e),s&&(this.state.end=s),this._isHorizontal="top"===n||"bottom"===n,this._layoutCache.max=this._isHorizontal?b:v,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",this._activeCache.startPos=l,this._activeCache.lastPos=l,this._showText="auto"!==r&&r,o&&(this._previewData=o),i.isFunction(d)&&(this._previewCallbackX=d),i.isFunction(h)&&(this._previewCallbackY=h),i.isFunction(u)&&(this._previewCallbackX1=u),i.isFunction(c)&&(this._previewCallbackY1=c),i.isFunction(p)&&(this._updateStateCallback=p)}bindEvents(){const{showDetail:t,brushSelect:i}=this.attribute;this._startHandler&&this._startHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandler&&this._endHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const s=i?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,s))),i&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),i&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,s))),"browser"===e.vglobal.env&&(e.vglobal.addEventListener("pointermove",this._onHandlerPointerMove.bind(this)),e.vglobal.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",this._onHandlerPointerMove),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}eventPosToStagePos(t){var e,i,s;const a=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==a?void 0:a.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==a?void 0:a.top)||0)-((null===(s=this.stage)||void 0===s?void 0:s.y)||0)}}_onHandlerPointerUp(t){const{start:e,end:i,brushSelect:s}=this.attribute;if(this._activeState&&this._activeTag===Ft.background){const e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,s&&this.renderDragMask(),e===this.state.start&&i===this.state.end||(this.setAttributes({start:this.state.start,end:this.state.end}),this._updateStateCallback&&this._updateStateCallback(this.state.start,this.state.end))}_onHandlerPointerEnter(t){this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:s}=this._layoutCache,{position:a}=this.attribute,n=t[i]-a[i],r=e[i]-a[i],l=Math.min(Math.max(Math.min(n,r)/s,0),1),o=Math.min(Math.max(Math.max(n,r)/s,0),1);Math.abs(l-o)<.01?this.moveZoomWithMiddle(l):(this.state.start=l,this.state.end=o)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.state.start=this.state.start+e,this.state.end=this.state.end+e)}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:s,height:a}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",{x:i.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+s),y:e.y,width:this._activeState&&this._activeTag===Ft.background&&Math.abs(this.dragMaskSize())||0,height:a,...t},"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",{x:e.x,y:i.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+a),width:s,height:this._activeState&&this._activeTag===Ft.background&&Math.abs(this.dragMaskSize())||0,...t},"rect")}renderText(){const{startTextStyle:t,endTextStyle:e}=this.attribute,{formatMethod:s,...a}=t,{formatMethod:n,...r}=e,{start:l,end:o}=this.state;this._startValue=this._statePointToData(l),this._endValue=this._statePointToData(o);const{position:d,width:h,height:u}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:d.x+l*h,y:d.y+u/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${d}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:d.x+o*h,y:d.y+u/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${d}`)):(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:d.x+h/2,y:d.y+l*u,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${d}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:d.x+h/2,y:d.y+o*u,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${d}`))}getLayoutAttrFromConfig(){var t,e,i,s;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:a,size:n,orient:r,middleHandlerStyle:l,startHandlerStyle:o,endHandlerStyle:d}=this.attribute,{width:h,height:u}=n,c=null!==(e=null===(t=null==l?void 0:l.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let p,b,v;(null==l?void 0:l.visible)?this._isHorizontal?(p=h,b=u-c,v={x:a.x,y:a.y+c}):(p=h-c,b=u,v={x:a.x+("left"===r?c:0),y:a.y}):(p=h,b=u,v=a);const g=null!==(i=null==o?void 0:o.size)&&void 0!==i?i:this._isHorizontal?b:p,_=null!==(s=null==d?void 0:d.size)&&void 0!==s?s:this._isHorizontal?b:p;return(null==o?void 0:o.visible)&&(this._isHorizontal?(p-=(g+_)/2,v={x:v.x+g/2,y:v.y}):(b-=(g+_)/2,v={x:v.x,y:v.y+g})),this._layoutAttrFromConfig={position:v,width:p,height:b},this._layoutAttrFromConfig}render(){var t,e,i,s,a,n,r,l,o,d,h,u,c,p,b,v,g,_,y,m,x;this._layoutAttrFromConfig=null;const{orient:f,backgroundStyle:A,backgroundChartStyle:S,selectedBackgroundStyle:E,selectedBackgroundChartStyle:L,middleHandlerStyle:k,startHandlerStyle:B,endHandlerStyle:M,brushSelect:w}=this.attribute,{start:T,end:C}=this.state,{position:P,width:I,height:H}=this.getLayoutAttrFromConfig(),z=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=z,this._background=z.createOrUpdateChild("background",{x:P.x,y:P.y,width:I,height:H,cursor:w?"crosshair":"auto",...A},"rect"),(null===(t=null==S?void 0:S.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",z),(null===(e=null==S?void 0:S.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",z),w&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=z.createOrUpdateChild("selectedBackground",{x:P.x+T*I,y:P.y,width:(C-T)*I,height:H,cursor:w?"crosshair":"move",...E},"rect"):this._selectedBackground=z.createOrUpdateChild("selectedBackground",{x:P.x,y:P.y+T*H,width:I,height:(C-T)*H,cursor:w?"crosshair":"move",...E},"rect"),(null===(i=null==L?void 0:L.line)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("line",z),(null===(s=null==L?void 0:L.area)||void 0===s?void 0:s.visible)&&this.setSelectedPreviewAttributes("area",z),this.renderText(),this._isHorizontal?(this._startHandler=z.createOrUpdateChild("startHandler",{x:P.x+T*I,y:P.y+H/2,size:H,angle:0,symbolType:null!==(a=null==B?void 0:B.symbolType)&&void 0!==a?a:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",...B},"symbol"),this._endHandler=z.createOrUpdateChild("endHandler",{x:P.x+C*I,y:P.y+H/2,size:H,angle:0,symbolType:null!==(n=null==M?void 0:M.symbolType)&&void 0!==n?n:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",...M},"symbol"),(null==k?void 0:k.visible)&&(this._middleHandlerRect=z.createOrUpdateChild("middleHandlerRect",{x:P.x+T*I,y:P.y-((null===(r=null==k?void 0:k.background)||void 0===r?void 0:r.size)||10),width:(C-T)*I,height:(null===(l=null==k?void 0:k.background)||void 0===l?void 0:l.size)||10,...null===(o=null==k?void 0:k.background)||void 0===o?void 0:o.style},"rect"),this._middleHandlerSymbol=z.createOrUpdateChild("middleHandlerSymbol",{x:P.x+(T+C)/2*I,y:P.y-((null===(d=null==k?void 0:k.background)||void 0===d?void 0:d.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(u=null===(h=null==k?void 0:k.icon)||void 0===h?void 0:h.symbolType)&&void 0!==u?u:"square",...null==k?void 0:k.icon},"symbol"))):(this._startHandler=z.createOrUpdateChild("startHandler",{x:P.x+I/2,y:P.y+T*H,size:I,angle:Math.PI/180*90,symbolType:null!==(c=null==B?void 0:B.symbolType)&&void 0!==c?c:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0,...B},"symbol"),(null==k?void 0:k.visible)&&(this._middleHandlerRect=z.createOrUpdateChild("middleHandlerRect",{x:"left"===f?P.x-((null===(p=null==k?void 0:k.background)||void 0===p?void 0:p.size)||10):P.x+I,y:P.y+T*H,width:(null===(b=null==k?void 0:k.background)||void 0===b?void 0:b.size)||10,height:(C-T)*H,...null===(v=null==k?void 0:k.background)||void 0===v?void 0:v.style},"rect"),this._middleHandlerSymbol=z.createOrUpdateChild("middleHandlerSymbol",{x:"left"===f?P.x-((null===(g=null==k?void 0:k.background)||void 0===g?void 0:g.size)||10)/2:P.x+I+((null===(_=null==k?void 0:k.background)||void 0===_?void 0:_.size)||10)/2,y:P.y+(T+C)/2*H,angle:Math.PI/180*90,symbolType:null!==(m=null===(y=null==k?void 0:k.icon)||void 0===y?void 0:y.symbolType)&&void 0!==m?m:"square",strokeBoundsBuffer:0,...null==k?void 0:k.icon},"symbol")),this._endHandler=z.createOrUpdateChild("endHandler",{x:P.x+I/2,y:P.y+C*H,size:I,angle:Math.PI/180*90,symbolType:null!==(x=null==M?void 0:M.symbolType)&&void 0!==x?x:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0,...M},"symbol"))}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();let a,n;return this._isHorizontal?(a=[{x:e.x,y:e.y+s}],n=[{x:e.x+i,y:e.y+s}]):"left"===t?(a=[{x:e.x+i,y:e.y}],n=[{x:e.x+i,y:e.y+s}]):(a=[{x:e.x,y:e.y+s}],n=[{x:e.x,y:e.y}]),{basePointStart:a,basePointEnd:n}}getPreviewLinePoints(){const t=this._previewData.map((t=>({x:this._previewCallbackX&&this._previewCallbackX(t),y:this._previewCallbackY&&this._previewCallbackY(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){const t=this._previewData.map((t=>({x:this._previewCallbackX&&this._previewCallbackX(t),y:this._previewCallbackY&&this._previewCallbackY(t),x1:this._previewCallbackX1&&this._previewCallbackX1(t),y1:this._previewCallbackY1&&this._previewCallbackY1(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i}=this.attribute;"line"===t&&this._previewLine.setAttributes({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.line}),"area"===t&&this._previewArea.setAttributes({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.area})}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i}=this.attribute,{start:s,end:a}=this.state,{position:n,width:r,height:l}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?n.x+s*r:n.x,y:this._isHorizontal?n.y:n.y+s*l,width:this._isHorizontal?(a-s)*r:r,height:this._isHorizontal?l:(a-s)*l,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?n.x+s*r:n.x),y:-(this._isHorizontal?n.y:n.y+s*l),width:this._isHorizontal?(a-s)*r:r,height:this._isHorizontal?l:(a-s)*l,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.line}),"area"===t&&this._selectedPreviewArea.setAttributes({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1,...null==i?void 0:i.area})}maybeAddLabel(t,e,i){let s=this.find((t=>t.name===i),!0);return s?s.setAttributes(e):(s=new E(e),s.name=i),t.add(s),s}setStartAndEnd(t,e){const{start:s,end:a}=this.attribute;i.isValid(t)&&i.isValid(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,s===this.state.start&&a===this.state.end||(this.setAttributes({start:t,end:e}),this._updateStateCallback&&this._updateStateCallback(t,e)))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,s,a;const{middleHandlerStyle:n}=this.attribute,r=null!==(e=null===(t=null==n?void 0:n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,l=null!==(a=null===(s=null==n?void 0:n.icon)||void 0===s?void 0:s.size)&&void 0!==a?a:10;return Math.max(r,...i.array(l))}setUpdateStateCallback(t){i.isFunction(t)&&(this._updateStateCallback=t)}setPreviewCallbackX(t){i.isFunction(t)&&(this._previewCallbackX=t)}setPreviewCallbackY(t){i.isFunction(t)&&(this._previewCallbackY=t)}setPreviewCallbackX1(t){i.isFunction(t)&&(this._previewCallbackX1=t)}setPreviewCallbackY1(t){i.isFunction(t)&&(this._previewCallbackY1=t)}setStatePointToData(t){i.isFunction(t)&&(this._statePointToData=t)}}var Yt,Xt,qt;Gt.defaultAttributes={orient:"bottom",showDetail:"auto",brushSelect:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",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}},startHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},t.IMarkLineLabelPosition=void 0,(Yt=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",Yt.middle="middle",Yt.end="end",Yt.insideStartTop="insideStartTop",Yt.insideStartBottom="insideStartBottom",Yt.insideMiddleTop="insideMiddleTop",Yt.insideMiddleBottom="insideMiddleBottom",Yt.insideEndTop="insideEndTop",Yt.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(Xt=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",Xt.right="right",Xt.top="top",Xt.bottom="bottom",Xt.middle="middle",Xt.insideLeft="insideLeft",Xt.insideRight="insideRight",Xt.insideTop="insideTop",Xt.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(qt=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",qt.bottom="bottom",qt.middle="middle",qt.insideTop="insideTop",qt.insideBottom="insideBottom",qt.insideMiddle="insideMiddle";class Zt extends n{render(){var t,i;const s=null===(t=this.attribute.visible)||void 0===t||t;if(null!==(i=this.attribute.interactive)&&void 0!==i&&i||(this.setAttribute("pickable",!1),this.setAttribute("childrenPickable",!1)),s)if(this._container)this.updateMarker();else{const t=e.createGroup({});t.name="marker-container",this.add(t),this._container=t,this.initMarker(t)}}}const jt={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:t.IMarkLineLabelPosition.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},Jt={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},Kt={label:{position:t.IMarkAreaLabelPosition.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},Qt={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},te={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};class ee extends Zt{constructor(t){super(i.merge({},ee.defaultAttributes,t))}setLabelPos(){var t,e,i,s,a;const{points:n,label:r}=this.attribute,l=null!==(t=null==r?void 0:r.position)&&void 0!==t?t:"end",o=this._line.getEndAngle(),d=(null==r?void 0:r.refX)*Math.cos(o)+r.refY*Math.cos(o-Math.PI/2),h=(null==r?void 0:r.refX)*Math.sin(o)+r.refY*Math.sin(o-Math.PI/2);l.includes("start")||l.includes("Start")?null===(e=this._label)||void 0===e||e.setAttributes({x:n[0].x+d,y:n[0].y+h}):l.includes("middle")||l.includes("Middle")?null===(i=this._label)||void 0===i||i.setAttributes({x:(n[0].x+n[n.length-1].x)/2+d,y:(n[0].y+n[n.length-1].y)/2+h}):null===(s=this._label)||void 0===s||s.setAttributes({x:n[n.length-1].x+d,y:n[n.length-1].y+h}),this._label.setAttributes({angle:r.autoRotate&&o+(null!==(a=null==r?void 0:r.refAngle)&&void 0!==a?a:0),textStyle:{...Jt[l],...r.textStyle}})}initMarker(t){const{points:e,startSymbol:i,endSymbol:s,label:a,lineStyle:n}=this.attribute,r=new Lt({points:e,startSymbol:i,endSymbol:s,lineStyle:n});r.name="mark-line-line",this._line=r,t.add(r);const l=new E({...a});l.name="mark-line-label",this._label=l,t.add(l),this.setLabelPos()}updateMarker(){var t,e;const{points:i,startSymbol:s,endSymbol:a,label:n,lineStyle:r}=this.attribute;null===(t=this._line)||void 0===t||t.setAttributes({points:i,startSymbol:s,endSymbol:a,lineStyle:r}),null===(e=this._label)||void 0===e||e.setAttributes({...n}),this.setLabelPos()}}ee.defaultAttributes=jt;class ie extends Zt{constructor(t){super(i.merge({},ie.defaultAttributes,t))}getLeftPos(){return{x:this._area.AABBBounds.x1,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}getRightPos(){return{x:this._area.AABBBounds.x2,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}getTopPos(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:this._area.AABBBounds.y1}}getBottomPos(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:this._area.AABBBounds.y2}}getMiddlePos(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}setLabelPos(){var t,e,i,s,a,n,r;const{label:l}=this.attribute,o=null!==(t=null==l?void 0:l.position)&&void 0!==t?t:"middle";o.includes("left")||o.includes("Left")?null===(e=this._label)||void 0===e||e.setAttributes({...this.getLeftPos()}):o.includes("right")||o.includes("Right")?null===(i=this._label)||void 0===i||i.setAttributes({...this.getRightPos()}):o.includes("top")||o.includes("Top")?null===(s=this._label)||void 0===s||s.setAttributes({...this.getTopPos()}):o.includes("bottom")||o.includes("Bottom")?null===(a=this._label)||void 0===a||a.setAttributes({...this.getBottomPos()}):null===(n=this._label)||void 0===n||n.setAttributes({...this.getMiddlePos()}),null===(r=this._label)||void 0===r||r.setAttributes({textStyle:{...Qt[o],...l.textStyle}})}initMarker(t){const{points:i,label:s,areaStyle:a}=this.attribute,n=e.createPolygon({points:i,...a});n.name="mark-area-area",this._area=n,t.add(n);const r=new E({...s});r.name="mark-area-label",this._label=r,t.add(r),this.setLabelPos()}updateMarker(){var t,e;const{points:i,label:s,areaStyle:a}=this.attribute;null===(t=this._area)||void 0===t||t.setAttributes({points:i,...a}),null===(e=this._label)||void 0===e||e.setAttributes({...s}),this.setLabelPos()}}ie.defaultAttributes=Kt;class se extends Zt{constructor(t){super(i.merge({},se.defaultAttributes,t))}setLabelPos(){}setItemAttributes(e,i,s,a){var n;const{autoRotate:r=!0,refX:l=0,refY:o=0,refAngle:d=0,textStyle:h,richTextStyle:u,imageStyle:c,position:p=t.IMarkPointItemPosition.middle}=i,b=(null===(n=this._line)||void 0===n?void 0:n.getEndAngle())||0,v=l*Math.cos(b)+o*Math.cos(b-Math.PI/2),g=l*Math.sin(b)+o*Math.sin(b-Math.PI/2);"text"===a?null==e||e.setAttributes({...h,textStyle:{...te[(null==i?void 0:i.position)||"end"],...null==h?void 0:h.textStyle}}):"richText"===a?null==e||e.setAttributes({dx:this.getItemDx(e,p,u)+((null==u?void 0:u.dx)||0),dy:this.getItemDy(e,p,u)+((null==u?void 0:u.dy)||0)}):"image"===a&&(null==e||e.setAttributes({dx:this.getItemDx(e,p,c)+((null==c?void 0:c.dx)||0),dy:this.getItemDy(e,p,c)+((null==c?void 0:c.dy)||0)})),null==e||e.setAttributes({x:s.x+(v||0),y:s.y+(g||0),angle:r&&b+d})}getItemDx(t,e,i){var s,a;const n=null!==(a=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==a?a:(null==i?void 0:i.width)||0;return e.includes("inside")?-n:0}getItemDy(t,e,i){var s,a;const n=null!==(a=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==a?a:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-n:e.includes("middle")||e.includes("Middle")?-n/2:0}initItem(t,i){const{type:s="text",symbolStyle:a,richTextStyle:n,imageStyle:r,renderCustomCallback:l}=t;let o;return"symbol"===s?o=e.createSymbol({...i,...a}):"text"===s?o=new E({...i}):"richText"===s?o=e.createRichText({...i,...n}):"image"===s?o=e.createImage({...i,...r}):"custom"===s&&l&&(o=l()),this.setItemAttributes(o,t,i,s),o}getItemLineAttr(t,e,i){let s=[];const{type:a="type-s"}=t;return s="type-do"===a?[e,{x:(e.x+i.x)/2,y:i.y},i]:"type-po"===a?[e,{x:i.x,y:e.y},i]:"type-op"===a?[e,{x:e.x,y:i.y},i]:[e,i],s}setItemLineAttr(t,e,i,s){var a;const{startSymbol:n,endSymbol:r,lineStyle:l}=t,o=this.getItemLineAttr(t,e,i);null===(a=this._line)||void 0===a||a.setAttributes({points:o,startSymbol:n,endSymbol:r,lineStyle:l,visible:s})}getDecorativeLineAttr(t,e){var i;const s=(null===(i=null==t?void 0:t.decorativeLine)||void 0===i?void 0:i.length)||10,a=this._line.getEndAngle()||0;return{startPointOffsetX:s/2*Math.cos(a-Math.PI/2),startPointOffsetY:s/2*Math.sin(a-Math.PI/2),endPointOffsetX:-s/2*Math.cos(a-Math.PI/2),endPointOffsetY:-s/2*Math.sin(a-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var s;const{lineStyle:a}=t,{startPointOffsetX:n,startPointOffsetY:r,endPointOffsetX:l,endPointOffsetY:o}=this.getDecorativeLineAttr(t,e);null===(s=this._decorativeLine)||void 0===s||s.setAttributes({points:[{x:e.x+n,y:e.y+r},{x:e.x+l,y:e.y+o}],...a,visible:i})}initMarker(t){var i;const{position:s,itemLine:a,itemContent:n}=this.attribute,r={x:s.x+((null==n?void 0:n.offsetX)||0),y:s.y+((null==n?void 0:n.offsetY)||0)},l=new Lt({points:[]});l.name="mark-point-line",this._line=l,t.add(l);const o=e.createLine({points:[]});o.name="mark-point-decorativeLine",this._decorativeLine=o,t.add(o),this.setItemLineAttr(a,s,r,null==a?void 0:a.visible),this.setDecorativeLineAttr(a,r,null===(i=null==a?void 0:a.decorativeLine)||void 0===i?void 0:i.visible);const d=this.initItem(n,r);this._item=d,t.add(d)}updateMarker(){var t;const{position:e,itemLine:i,itemContent:s}=this.attribute,{type:a="text"}=s,n={x:e.x+((null==s?void 0:s.offsetX)||0),y:e.y+((null==s?void 0:s.offsetY)||0)};this.setItemLineAttr(i,e,n,null==i?void 0:i.visible),this.setDecorativeLineAttr(i,n,null===(t=null==i?void 0:i.decorativeLine)||void 0===t?void 0:t.visible),this.setItemAttributes(this._item,s,n,a)}}se.defaultAttributes={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}};const ae={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};class ne extends n{getCurrent(){return this._current}constructor(t){super(i.merge({},ne.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{var i,s;const a=t.target;if("preHandler"===a.name){if(1===this._current)return;this._current-=1,1===this._current?a.addState("disable"):a.removeState("disable");const t=new e.CustomEvent("toPrev",{current:this._current,total:this._total,direction:"pre"});t.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(t)}if("nextHandler"===a.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?a.addState("disable"):a.removeState("disable");const t=new e.CustomEvent("toNext",{current:this._current,total:this._total,direction:"next"});t.manager=null===(s=this.stage)||void 0===s?void 0:s.eventSystem.manager,this.dispatchEvent(t)}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",`${this._current}/${this._total}`)}}render(){var t;this._reset();const{layout:s="horizontal",handler:a=ae,total:n,defaultCurrent:r=1,textStyle:l,padding:o=0}=this.attribute;this._current=r;const d=i.normalizePadding(o),h="horizontal"===s,u=e.createGroup({x:0,y:0}),c=a.style||{},p=c.size||15,b=null!==(t=a.space)&&void 0!==t?t:8,v=a.state||{};let{preShape:g,nextShape:_}=a;g||(g=h?"triangleLeft":"triangleUp"),_||(_=h?"triangleRight":"triangleDown");const y=e.createSymbol({strokeBoundsBuffer:0,pickMode:"imprecise",...c,x:0,y:0,symbolType:g,size:p});y.states=v,y.name="preHandler",this.preHandler=y,u.add(y);const{width:m,height:x}=S(`${n}/${n}`,{textAlign:"center",textBaseline:"middle",...l}),f=i.isNumber(p)?p:p[0],A=i.isNumber(p)?p:p[1],E=e.createText({x:h?f/2+b+m/2:0,y:h?0:A/2+b+x/2,text:`${r}/${n}`,textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize,...l});this.text=E,u.add(E);const L=e.createSymbol({strokeBoundsBuffer:0,pickMode:"imprecise",...c,x:h?f+2*b+m:0,y:h?0:A+2*b+x,symbolType:_,size:p});L.name="nextHandler",L.states=v,this.nextHandler=L,u.add(L),1===this._total?(y.addState("disable"),L.addState("disable")):1===this._current?y.addState("disable"):this._current===n&&L.addState("disable");const k=u.AABBBounds,B=k.width(),M=k.height();u.translateTo(0-k.x1+d[3],0-k.y1+d[0]),this.add(u),this.attribute.width=B+d[1]+d[3],this.attribute.height=M+d[0]+d[2],this._bindEvents()}_bindEvents(){this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick))}_reset(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}}ne.defaultAttributes={handler:ae,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const re=16,le=8,oe=12,de=12;var he,ue,ce;t.LegendStateValue=void 0,(he=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",he.unSelected="unSelected",he.selectedHover="selectedHover",he.unSelectedHover="unSelectedHover",he.focus="focus",t.LegendEvent=void 0,(ue=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",ue.legendItemUnHover="legendItemUnHover",ue.legendItemClick="legendItemClick",t.LEGEND_ELEMENT_NAME=void 0,(ce=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",ce.title="legendTitle",ce.item="legendItem",ce.itemShape="legendItemShape",ce.itemLabel="legendItemLabel",ce.itemValue="legendItemValue",ce.focus="legendItemFocus";class pe extends n{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild();const{interactive:s=!0,title:a,padding:n=0}=this.attribute,r=i.normalizePadding(n),l=e.createGroup({x:r[3],y:r[0],pickable:s,childrenPickable:s});l.name=t.LEGEND_ELEMENT_NAME.innerView,this.add(l),this._innerView=l,(null==a?void 0:a.visible)&&this._renderTitle(a),this._renderContent(),this._adjustLayout(),s&&this._bindEvents();const o=this._innerView.AABBBounds;this.attribute.width=o.width()+r[1]+r[3],this.attribute.height=o.height()+r[0]+r[2]}_renderTitle(e){const{text:s="",textStyle:a,padding:n=0,background:r,minWidth:l,maxWidth:o,shape:d}=e,h={x:0,y:0,text:s,textStyle:a,padding:i.normalizePadding(n),minWidth:l,maxWidth:o};d&&d.visible&&(h.shape={visible:!0,...d.style},i.isValid(d.space)&&(h.space=d.space)),r&&r.visible&&(h.panel={visible:!0,...r.style});const u=new E(h);u.name=t.LEGEND_ELEMENT_NAME.title,this._title=u,this._innerView.add(u)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}const be={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};class ve extends pe{constructor(e){super(i.merge({},ve.defaultAttributes,e)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=e=>{var i;const s=e.target;if(null===(i=null==s?void 0:s.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const e=s.delegate;e.hasState(t.LegendStateValue.selected)?this._setLegendItemState(e,t.LegendStateValue.selectedHover):this._setLegendItemState(e,t.LegendStateValue.unSelectedHover);const i=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchEvent(t.LegendEvent.legendItemHover,e)}},this._onUnHover=e=>{var i;const s=e.target;if(null===(i=null==s?void 0:s.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const e=s.delegate;e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const i=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);i&&i.setAttribute("visible",!1),this._dispatchEvent(t.LegendEvent.legendItemUnHover,e)}},this._onClick=e=>{var i,s,a,n,r;const l=e.target;if(null===(i=null==l?void 0:l.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const e=l.delegate;if(l.name===t.LEGEND_ELEMENT_NAME.focus){const i=e.hasState(t.LegendStateValue.focus);e.toggleState(t.LegendStateValue.focus),i?null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((e=>{this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover,t.LegendStateValue.focus]),this._setLegendItemState(e,t.LegendStateValue.selected)})):(this._setLegendItemState(e,t.LegendStateValue.selected),this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover]),null===(a=this._itemsContainer)||void 0===a||a.getChildren().forEach((i=>{e!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover,t.LegendStateValue.focus]),this._setLegendItemState(i,t.LegendStateValue.unSelected))})))}else{null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{e.removeState(t.LegendStateValue.focus)}));const{selectMode:i="multiple",allowAllCanceled:s=!0}=this.attribute,a=e.hasState(t.LegendStateValue.selected),l=this._getSelectedLegends();if("multiple"===i){if(!1===s&&a&&1===l.length)return void this._dispatchEvent(t.LegendEvent.legendItemClick,e);a?(this._removeLegendItemState(e,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(e,t.LegendStateValue.unSelected)):(this._setLegendItemState(e,t.LegendStateValue.selected),this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover]))}else this._setLegendItemState(e,t.LegendStateValue.selected),this._removeLegendItemState(e,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover]),null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach((i=>{e!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}this._dispatchEvent(t.LegendEvent.legendItemClick,e)}}}setSelected(e){var i;(null===(i=this._itemsContainer)||void 0===i?void 0:i.getChildren()).forEach((i=>{const s=i.data;e.includes(s.label)?(this._setLegendItemState(i,t.LegendStateValue.selected),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover])):(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}_renderContent(){const{item:t={},items:s,reversed:a,maxCol:n=1,maxRow:r=2}=this.attribute;if(!1===t.visible||i.isEmpty(s))return;let l=s;a&&(l=null==s?void 0:s.reverse());const o=e.createGroup({x:0,y:0});this._itemsContainer=o;const{layout:d,maxWidth:h,maxHeight:u,defaultSelected:c=[],autoPage:p}=this.attribute,b="horizontal"===d,{spaceCol:v=re,spaceRow:g=le,maxWidth:_,width:y,height:m}=t;i.isValid(_)?i.isValid(y)?this._itemWidthByUser=Math.min(_,y):this._itemWidthByUser=_:i.isValid(y)&&(this._itemWidthByUser=y),i.isValid(m)&&(this._itemHeightByUser=m);let x=!1,f=0,A=0,S=0,E=1,L=1;l.forEach(((t,e)=>{t.id||(t.id=t.label),t.index=e;const s=this._renderEachItem(t,!!i.isEmpty(c)||(null==c?void 0:c.includes(t.label)),e,l),a=s.attribute.width,d=s.attribute.height;this._itemHeight=Math.max(this._itemHeight,d),f=Math.max(a,f),this._itemMaxWidth=Math.max(a,this._itemMaxWidth),b?(E=r,i.isValid(h)&&(a>=h?(x=!0,e>0&&(A=0,S+=d+g,L+=1)):h<A+a&&(x=!0,A=0,S+=d+g,L+=1)),e>0&&s.setAttributes({x:A,y:S}),A+=v+a):(E=n,i.isValid(u)&&u<S+d&&(x=!0,S=0,A+=f+v,f=0,L+=1),e>0&&s.setAttributes({x:A,y:S}),S+=g+d),o.add(s)}));let k=!1;x&&p&&L>E&&(k=this._renderPager(b)),k||(o.setAttribute("y",this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",8):0),this._innerView.add(o))}_bindEvents(){if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerout",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_renderEachItem(s,a,n,r){const{id:l,label:o,value:d,shape:h}=s,{padding:u=0,focus:c,focusIconStyle:p={}}=this.attribute.item;let{shape:b={},label:v={},value:g={},background:_={}}=this.attribute.item;b=this._handleStyle(b,s,a,n,r),v=this._handleStyle(v,s,a,n,r),g=this._handleStyle(g,s,a,n,r),_=this._handleStyle(_,s,a,n,r);const y=i.normalizePadding(u);let m;!1===_.visible?(m=e.createGroup({x:0,y:0,cursor:(null==_?void 0:_.style).cursor}),this._appendDataToShape(m,t.LEGEND_ELEMENT_NAME.item,s,m)):(m=e.createGroup({x:0,y:0,...null==_?void 0:_.style}),this._appendDataToShape(m,t.LEGEND_ELEMENT_NAME.item,s,m,null==_?void 0:_.state)),m.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const x=e.createGroup({x:0,y:0,pickable:!1});m.add(x);let f=0;const A=i.get(b,"style.size",10),S=i.get(b,"space",8),E=e.createSymbol({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0,...h,...b.style});let L;Object.keys(b.state||{}).forEach((t=>{const e=b.state[t].fill||b.state[t].stroke;h.fill&&i.isNil(b.state[t].fill)&&e&&(b.state[t].fill=e),h.stroke&&i.isNil(b.state[t].stroke)&&e&&(b.state[t].stroke=e)})),this._appendDataToShape(E,t.LEGEND_ELEMENT_NAME.itemShape,s,m,null==b?void 0:b.state),E.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(E);let k=0;if(c){const a=i.get(p,"size",10);L=e.createSymbol({x:0,y:-a/2-1,strokeBoundsBuffer:0,...p,visible:!1,pickMode:"imprecise",boundsPadding:y}),this._appendDataToShape(L,t.LEGEND_ELEMENT_NAME.focus,s,m),k=a}const B=e.createText({x:A/2+S,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==v?void 0:v.style).fontSize,...null==v?void 0:v.style,text:v.formatMethod?v.formatMethod(o,s,n):o});this._appendDataToShape(B,t.LEGEND_ELEMENT_NAME.itemLabel,s,m,null==v?void 0:v.state),B.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(B);const M=i.get(v,"space",8);if(f+=A/2+S+B.AABBBounds.width()+M,i.isValid(d)){const r=i.get(g,"space",c?8:0),l=e.createText({x:f+M,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==g?void 0:g.style).fontSize,...null==g?void 0:g.style,text:g.formatMethod?g.formatMethod(d,s,n):d});this._appendDataToShape(l,t.LEGEND_ELEMENT_NAME.itemValue,s,m,null==g?void 0:g.state),l.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser&&(l.setAttribute("maxLineWidth",this._itemWidthByUser-y[1]-y[3]-A-S-B.AABBBounds.width()-M-k-r),g.alignRight&&l.setAttributes({textAlign:"right",x:this._itemWidthByUser-A/2-y[1]-y[3]-k-r})),f=l.AABBBounds.x2+r,x.add(l)}else this._itemWidthByUser&&B.setAttribute("maxLineWidth",this._itemWidthByUser-y[1]-y[3]-A-S-k);L&&(L.setAttribute("x",f),x.add(L));const w=x.AABBBounds,T=w.width(),C=w.height(),P=i.isValid(this.attribute.item.width)?this.attribute.item.width:T+y[1]+y[3],I=this._itemHeightByUser||C+y[0]+y[2];return m.attribute.width=P,m.attribute.height=I,x.translateTo(-w.x1+y[3],-w.y1+y[0]),m}_renderPager(t){const s=this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",8):0,{maxWidth:a,maxHeight:n,maxCol:r=1,maxRow:l=2,item:o={},pager:d={}}=this.attribute,{spaceCol:h=re,spaceRow:u=le}=o,c=this._itemsContainer,{animation:p=!0,animationDuration:b=450,animationEasing:v="quadIn",space:g=de,..._}=d;let y,m=0,x=0,f=0,A=0,S=1;if(t){if(y=new ne({layout:1===l?"horizontal":"vertical",total:99,...i.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},_)}),this._pager=y,this._innerView.add(y),m=(l-1)*u+this._itemHeight*l,x=a-y.AABBBounds.width()-g,x<=0)return this._innerView.removeChild(y),!1;c.getChildren().forEach(((t,e)=>{const{width:i,height:s}=t.attribute;x<f+i&&(f=0,A+=s+u,S+=1),e>0&&t.setAttributes({x:f,y:A}),f+=h+i})),y.setAttributes({total:Math.ceil(S/l),x:x,y:s+m/2-y.AABBBounds.height()/2})}else{if(y=new ne({layout:"horizontal",total:99,..._}),this._pager=y,this._innerView.add(y),x=this._itemMaxWidth*r+(r-1)*h,m=n-y.AABBBounds.height()-g-s,m<=0)return this._innerView.removeChild(y),!1;c.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;m<A+i&&(A=0,f+=this._itemMaxWidth+h,S+=1),e>0&&t.setAttributes({x:f,y:A}),A+=u+i})),y.setAttributes({total:Math.ceil(S/r),x:(x-y.AABBBounds.width())/2,y:n-y.AABBBounds.height()})}d.defaultCurrent>1&&(t?c.setAttribute("y",-(d.defaultCurrent-1)*(m+u)):c.setAttribute("x",-(d.defaultCurrent-1)*(x+h)));const E=e.createGroup({x:0,y:s,width:x,height:m,clip:!0,pickable:!1});E.add(c),this._innerView.add(E);const L=e=>{const{current:i}=e.detail;p?c.animate().to(t?{y:-(i-1)*(m+u)}:{x:-(i-1)*(x+h)},b,v):t?c.setAttribute("y",-(i-1)*(m+u)):c.setAttribute("x",-(i-1)*(x+h))};return this._pager.addEventListener("toPrev",L),this._pager.addEventListener("toNext",L),!0}_setLegendItemState(e,i,s=!0){e.addState(i,s),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&e.addState(i,s)}))}_removeLegendItemState(e,i){i.forEach((t=>{e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{e.removeState(t)}))}))}_getSelectedLegends(){var e;const i=[];return null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{e.hasState(t.LegendStateValue.selected)&&i.push(e.data)})),i}_appendDataToShape(t,e,s,a,n={}){t.name=e,t.data=s,t.delegate=a,t.states=i.merge({},be,n)}_dispatchEvent(i,s){var a;const n=this._getSelectedLegends();n.sort(((t,e)=>t.index-e.index));const r=n.map((t=>t.label)),l=new e.CustomEvent(i,{item:s,data:s.data,selected:s.hasState(t.LegendStateValue.selected),currentSelectedItems:n,currentSelected:r});l.manager=null===(a=this.stage)||void 0===a?void 0:a.eventSystem.manager,this.dispatchEvent(l)}_handleStyle(t,e,s,a,n){const r=i.merge({},t);return t.style&&i.isFunction(t.style)&&(r.style=t.style(e,s,a,n)),t.state&&Object.keys(t.state).forEach((l=>{t.state[l]&&i.isFunction(t.state[l])&&(r.state[l]=t.state[l](e,s,a,n))})),r}}var ge;function _e(t){return i.isArray(t)?t:[t,t]}function ye(t){return t?"ew-resize":"ns-resize"}ve.defaultAttributes={layout:"horizontal",title:{align:"start",space:oe,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:re,spaceRow:le,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:de,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(ge=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",ge.railContainer="sliderRailContainer",ge.rail="sliderRail",ge.startText="sliderStartText",ge.endText="sliderEndText",ge.startHandler="sliderStartHandler",ge.startHandlerText="startHandlerText",ge.endHandler="sliderEndHandler",ge.endHandlerText="sliderEndHandlerText",ge.track="sliderTrack",ge.trackContainer="sliderTrackContainer";class me extends n{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}constructor(t){super(i.merge({},me.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._currentHandler=t.target,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===e.vglobal.env?(e.vglobal.addEventListener("pointermove",this._onHandlerPointerMove),e.vglobal.addEventListener("pointerup",this._onHandlerPointerUp)):(this._currentHandler.addEventListener("pointermove",this._onHandlerPointerMove),this._currentHandler.addEventListener("pointerup",this._onHandlerPointerUp),this._currentHandler.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,s;t.stopPropagation();const{railWidth:a,railHeight:n,min:r,max:l}=this.attribute;let o,d,h,u=0;this._isHorizontal?(o=t.clientX,u=o-this._prePos,d=null===(s=this._currentHandler)||void 0===s?void 0:s.attribute.x,h=a):(o=t.clientY,u=o-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,h=n);const c=i.clamp(d+u,0,h),p=c/h*(l-r)+r;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,p):this._updateHandler(this._currentHandler,c,p),this._updateTrack(),this._prePos=o,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{if(t.preventDefault(),this._currentHandler=null,"browser"===e.vglobal.env)e.vglobal.removeEventListener("pointermove",this._onHandlerPointerMove),e.vglobal.removeEventListener("pointerup",this._onHandlerPointerUp);else{const e=t.target;e.removeEventListener("pointermove",this._onHandlerPointerMove),e.removeEventListener("pointerup",this._onHandlerPointerUp),e.removeEventListener("pointerupoutside",this._onHandlerPointerUp)}},this._onTrackPointerdown=t=>{t.stopPropagation(),this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===e.vglobal.env?(e.vglobal.addEventListener("pointermove",this._onTrackPointerMove),e.vglobal.addEventListener("pointerup",this._onTrackPointerUp)):(this._track.addEventListener("pointermove",this._onTrackPointerMove),this._track.addEventListener("pointerup",this._onTrackPointerUp),this._track.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation();const{railWidth:e,railHeight:s,min:a,max:n}=this.attribute,{startHandler:r,endHandler:l}=this._getHandlers();let o,d,h;this._isHorizontal?(o=t.clientX,d=this._track.attribute.width,h=e):(o=t.clientY,d=this._track.attribute.height,h=s);const u=o-this._prePos;if(r){const t=this._isHorizontal?r.attribute.x:r.attribute.y,e=i.clamp(t+u,0,h-d),s=e/h*(n-a)+a;this._updateHandler(r,e,s)}if(l){const t=this._isHorizontal?l.attribute.x:l.attribute.y,e=i.clamp(t+u,d,h),s=e/h*(n-a)+a;this._updateHandler(l,e,s),this._track.setAttributes(this._isHorizontal?{x:Math.min(null==r?void 0:r.attribute.x,null==l?void 0:l.attribute.x),width:Math.abs((null==r?void 0:r.attribute.x)-(null==l?void 0:l.attribute.x))}:{y:Math.min(null==r?void 0:r.attribute.y,null==l?void 0:l.attribute.y),height:Math.abs((null==r?void 0:r.attribute.y)-(null==l?void 0:l.attribute.y))})}this._prePos=o,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),"browser"===e.vglobal.env?(e.vglobal.removeEventListener("pointermove",this._onTrackPointerMove),e.vglobal.removeEventListener("pointerup",this._onTrackPointerUp)):(this._track.removeEventListener("pointermove",this._onTrackPointerMove),this._track.removeEventListener("pointerup",this._onTrackPointerUp),this._track.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation();const{railWidth:e,railHeight:s,min:a,max:n}=this.attribute,r=this._startHandler,l=this._endHandler;let o,d,h,u;this._isHorizontal?(o=t.viewX-this._rail.globalAABBBounds.x1,d=null==r?void 0:r.attribute.x,h=null==l?void 0:l.attribute.x,u=e):(o=t.viewY-this._rail.globalAABBBounds.y1,d=null==r?void 0:r.attribute.y,h=null==l?void 0:l.attribute.y,u=s);const c=o/u*(n-a)+a;if(i.isValid(h)){const t=Math.abs(o-d)>Math.abs(o-h)?l:r;this._updateHandler(t,o,c)}else this._updateHandler(r,o,c);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){const[e,s]=i.array(t),{layout:a,railWidth:n,railHeight:r,min:l,max:o}=this.attribute,{startHandler:d,endHandler:h}=this._getHandlers(),u="vertical"===a?r:n,c=(e-l)/(o-l)*u;if(d&&this._updateHandler(d,c,e),h){const t=(s-l)/(o-l)*u;this._updateHandler(h,t,s)}this._updateTrack()}render(){var s,a;this.removeAllChild();const{layout:n="horizontal",railWidth:r,railHeight:l,startText:o,endText:d,min:h,max:u,showHandler:c=!0}=this.attribute;let{value:p}=this.attribute;i.isNil(p)&&(p=[h,u]),this._currentValue={startValue:_e(p)[0],endValue:_e(p)[1]};const b="horizontal"===n;this._isHorizontal=b;const v=e.createGroup({x:0,y:0});v.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(v),this._innerView=v;let g,_=0;if(o&&o.visible){g=e.createText({x:b?0:r/2,y:b?l/2:0,textAlign:b?"start":"center",textBaseline:b?"middle":"top",text:o.text,lineHeight:null===(s=o.style)||void 0===s?void 0:s.fontSize,...o.style}),g.name=t.SLIDER_ELEMENT_NAME.startText,v.add(g);const a=i.isValid(o.space)?o.space:0;_+=(b?g.AABBBounds.width():g.AABBBounds.height())+a}const y=e.createGroup({x:b?_:0,y:b?0:_});v.add(y);const m=e.createGroup({x:0,y:0});let x;if(m.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=m,y.add(m),this._renderRail(m),_+=b?r:l,d&&d.visible){const s=i.isValid(d.space)?d.space:0;x=e.createText({x:b?_+s:r/2,y:b?l/2:_+s,textAlign:b?"start":"center",textBaseline:b?"middle":"top",text:d.text,lineHeight:null===(a=d.style)||void 0===a?void 0:a.fontSize,...d.style}),x.name=t.SLIDER_ELEMENT_NAME.endText,v.add(x)}this._renderTrack(m),c&&(this._renderHandlers(y),this._bindEvents())}_renderRail(i){const{railWidth:s,railHeight:a,railStyle:n,slidable:r}=this.attribute;let l="default";!1!==r&&(l="pointer");const o=e.createRect({x:0,y:0,width:s,height:a,cursor:l,...n});return o.name=t.SLIDER_ELEMENT_NAME.rail,i.add(o),this._rail=o,o}_renderHandlers(e){const{range:s,min:a,max:n,handlerSize:r=14,handlerStyle:l,handlerText:o,railHeight:d,railWidth:h,slidable:u}=this.attribute;let{value:c}=this.attribute;i.isNil(c)&&(c=[a,n]);const p=o&&o.visible,b=this._isHorizontal,v=b?h:d,[g,_]=_e(c),y=(g-a)/(n-a)*v,m=this._renderHandler({x:b?y:h/2,y:b?d/2:y,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":ye(b),...l});if(m.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=m,e.add(m),this._currentValue.startPos=y,p){const i=this._renderHandlerText(g);i.name=t.SLIDER_ELEMENT_NAME.startHandlerText,e.add(i),this._startHandlerText=i}if(s){const i=(_-a)/(n-a)*v,s=this._renderHandler({x:b?i:h/2,y:b?d/2:i,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":ye(b),...l});if(s.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=s,e.add(s),this._currentValue.endPos=i,p){const i=this._renderHandlerText(_);i.name=t.SLIDER_ELEMENT_NAME.endHandlerText,e.add(i),this._endHandlerText=i}}}_renderTrack(s){const{range:a,min:n,max:r,railHeight:l,railWidth:o,trackStyle:d,railStyle:h,slidable:u}=this.attribute;let{value:c}=this.attribute;i.isNil(c)&&(c=[n,r]);const p=this._isHorizontal,b=p?o:l;let[v,g]=_e(c);a||(v=n);const _=e.createGroup({x:0,y:0,width:o,height:l,cornerRadius:null==h?void 0:h.cornerRadius,clip:!0,pickable:!1});_.name=t.SLIDER_ELEMENT_NAME.trackContainer;const y=i.isObject(a)&&!0===a.draggableTrack;let m;m=!1===u?"default":!1===a||!1===y?"pointer":ye(p);const x=(g-v)/(r-n)*b,f=e.createRect({x:p?(v-n)/(r-n)*b:0,y:p?0:(v-n)/(r-n)*b,width:p?x:o,height:p?l:x,cursor:m,...d});f.name=t.SLIDER_ELEMENT_NAME.track,this._track=f,_.add(f),s.add(_)}_renderHandler(t){return e.createSymbol(t)}_renderHandlerText(t){var i,s,a;const{align:n,min:r,max:l,handlerSize:o=14,handlerText:d={},railHeight:h,railWidth:u,slidable:c}=this.attribute,p=this._isHorizontal,b=(t-r)/(l-r)*(p?u:h),v=null!==(i=d.space)&&void 0!==i?i:4,g={text:(null==d?void 0:d.formatter)?d.formatter(t):t.toFixed(null!==(s=null==d?void 0:d.precision)&&void 0!==s?s:0),lineHeight:null===(a=d.style)||void 0===a?void 0:a.lineHeight,cursor:!1===c?"default":ye(p),...d.style};p?"top"===n?(g.textBaseline="bottom",g.textAlign="center",g.x=b,g.y=(h-o)/2-v):(g.textBaseline="top",g.textAlign="center",g.x=b,g.y=(h+o)/2+v):"left"===n?(g.textBaseline="middle",g.textAlign="end",g.x=(u-o)/2-v,g.y=b):(g.textBaseline="middle",g.textAlign="start",g.x=(u+o)/2+v,g.y=b);return e.createText(g)}_bindEvents(){const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),i.isObject(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_updateTrack(){const t=this._startHandler,e=this._endHandler;if(this._isHorizontal){const i=null==t?void 0:t.attribute.x;if(e){const t=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else this._track.setAttributes({width:i})}else{const i=null==t?void 0:t.attribute.y;if(e){const t=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,t),height:Math.abs(i-t)})}else this._track.setAttributes({height:i})}}_updateHandler(e,i,s){var a;const n=this._isHorizontal;e.setAttribute(n?"x":"y",i);const r=e.name===t.SLIDER_ELEMENT_NAME.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t}=this.attribute;null==r||r.setAttributes({text:(null==t?void 0:t.formatter)?t.formatter(s):s.toFixed(null!==(a=null==t?void 0:t.precision)&&void 0!==a?a:0),[n?"x":"y"]:i})}e.name===t.SLIDER_ELEMENT_NAME.startHandler?(this._currentValue.startValue=s,this._currentValue.startPos=i):(this._currentValue.endValue=s,this._currentValue.endPos=i)}_updateHandlerText(e,i,s){var a;const n=this._isHorizontal,{handlerText:r}=this.attribute;e.setAttributes({[n?"x":"y"]:i,text:(null==r?void 0:r.formatter)?r.formatter(s):s.toFixed(null!==(a=null==r?void 0:r.precision)&&void 0!==a?a:0)});const l=e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?this._startHandler:this._endHandler;l&&(null==l||l.setAttributes({[n?"x":"y"]:i})),e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?(this._currentValue.startValue=s,this._currentValue.startPos=i):(this._currentValue.endValue=s,this._currentValue.endPos=i)}_dispatchChangeEvent(){var t;const i=!!this.attribute.range,s=this._currentValue,a=new e.CustomEvent("change",{value:i?[Math.min(s.endValue,s.startValue),Math.max(s.endValue,s.startValue)]:s.startValue,position:i?[Math.min(s.endPos,s.startPos),Math.max(s.endPos,s.startPos)]:s.startPos});a.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(a)}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}me.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}};class xe extends pe{constructor(t){super(i.merge({},xe.defaultAttributes,t)),this.name="colorLegend",this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:a,align:n,min:r,max:l,value:o,railWidth:d,railHeight:h,showHandler:u=!0,handlerSize:c,handlerStyle:p,railStyle:b,trackStyle:v,startText:g,endText:_,handlerText:y,showTooltip:m,tooltip:x}=this.attribute,f=[],A=(l-r)/(t.length-1);for(let e=0;e<t.length;e++)f.push(r+A*e);this._colorScale=(new s.LinearScale).domain(f,!0).range(t),this._color=this._getTrackColor();const S=new me({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:a,align:n,min:r,max:l,value:o,railWidth:d,railHeight:h,showHandler:u,handlerSize:c,handlerStyle:p,railStyle:b,trackStyle:{fill:this._color,...v},startText:g,endText:_,handlerText:y,showTooltip:m,tooltip:x});this._innerView.add(S),this._slider=S,S.translateTo(0-S.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",oe):0)-S.AABBBounds.y1),this._updateColor()}_bindEvents(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}_getTrackColor(){const{colors:t,layout:e}=this.attribute;if(i.isEmpty(t))return;const s=t.length;if(1===s)return t[0];const a=[];for(let e=0;e<s;e++){const i=e/(s-1);a.push({offset:i,color:t[e]})}const n="horizontal"===e;return{gradient:"linear",stops:a,x0:0,y0:0,x1:n?1:0,y1:n?0:1}}_updateColor(){const{layout:t="horizontal",colors:e,railWidth:i,railHeight:s}=this.attribute,{startHandler:a,endHandler:n,track:r}=this._slider,{startValue:l,endValue:o,startPos:d,endPos:h}=this._slider.currentValue,u=this._colorScale.scale(l),c=this._colorScale.scale(o);null==a||a.setAttribute("fill",u),null==n||n.setAttribute("fill",c);const p="horizontal"===t?i:s;if(Math.abs(d-h)!==p&&e&&e.length>1){const t=this._color.stops,e=Math.min(d,h),i=Math.max(d,h),s=e/p,a=i/p,n=a-s,u=t.filter((t=>t.offset>s&&t.offset<a)),c=Math.min(l,o),b=Math.max(l,o),v=this._colorScale.scale(c),g=this._colorScale.scale(b),_=[{offset:0,color:v}];u.forEach((t=>{_.push({offset:(t.offset-s)/n,color:t.color})})),_.push({offset:1,color:g}),r.setAttribute("fill",{...this._color,stops:_})}}}function fe(t="bottom"){let e=0;const i=3.5,s=2.5;return"top"===t?`\n M${e},-6L${e-i},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+s},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-s},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-i},2.5\n v-5\n h7\n v5\n Z\n`}xe.defaultAttributes={layout:"horizontal",title:{align:"start",space:oe,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}}};class Ae extends pe{constructor(t){super(i.merge({},Ae.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:s,align:a,min:n,max:r,value:l,railWidth:o,railHeight:d,showHandler:h=!0,handlerSize:u,handlerStyle:c,railStyle:p,trackStyle:b,startText:v,endText:g,handlerText:_,showTooltip:y,tooltip:m,sizeBackground:x}=this.attribute,f=e.createGroup({x:0,y:0});this._innerView.add(f);const A=new me({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:s,align:a,min:n,max:r,value:l,railWidth:o,railHeight:d,showHandler:h,handlerSize:u,handlerStyle:{symbolType:fe(a),...c},railStyle:p,trackStyle:b,startText:v,endText:g,handlerText:_,showTooltip:y,tooltip:m});f.add(A);let S,E=0;const L=12;"horizontal"===s?"top"===a?(S=`M0,0L${o},0L${o},12Z`,E=d):(S=`M0,12L${o},12L${o},0Z`,A.setAttribute("y",L)):"left"===a?S=`M${o},0L${o},0L${o+L},${d}L${o},${d}Z`:(S=`M0,${d}L12,${d}L12,0Z`,A.setAttribute("x",L));const k=e.createPath({x:0,y:E,path:S,...x,zIndex:0});f.add(k);const B=this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",oe):0;f.translate(0-f.AABBBounds.x1,B-f.AABBBounds.y1),this._slider=A}_bindEvents(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}Ae.defaultAttributes={layout:"horizontal",title:{align:"start",space:oe,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};class Se extends n{constructor(t){super(i.merge({},Se.defaultAttributes,t)),this.name="title"}render(){var t,e,s,a,n,r,l,o,d,h,u,c,p,b,v,g,_,y,m,x,f,A,S,E,L,k,B,M,w,T,C,P,I,H,z,V,R,N,D,O,$,U,W,F,G,Y,X,q,Z,j,J,K,Q,tt,et,it,st,at,nt,rt,lt,ot;const{text:dt,textStyle:ht,subtext:ut,subtextStyle:ct,width:pt,height:bt,minWidth:vt,maxWidth:gt,minHeight:_t,maxHeight:yt,align:mt,verticalAlign:xt,padding:ft=0}=this.attribute,At=i.normalizePadding(ft),St=this.createOrUpdateChild("title-container",{x:At[3],y:At[0],zIndex:1},"group");if(!1!==(null===(t=this.attribute)||void 0===t?void 0:t.visible)&&!1!==(null==ht?void 0:ht.visible))if(ht&&i.isValid(null==ht?void 0:ht.character)){const t={x:null!==(e=ht.x)&&void 0!==e?e:0,y:null!==(s=ht.y)&&void 0!==s?s:0,width:null!==(n=null!==(a=ht.width)&&void 0!==a?a:pt)&&void 0!==n?n:0,height:null!==(l=null!==(r=ht.height)&&void 0!==r?r:bt)&&void 0!==l?l:0,ellipsis:null===(o=ht.ellipsis)||void 0===o||o,wordBreak:null!==(d=ht.wordBreak)&&void 0!==d?d:"break-word",maxHeight:ht.maxHeight,maxWidth:ht.maxWidth,textConfig:ht.character};this._mainTitle=St.createOrUpdateChild("mainTitle",t,"richtext")}else i.isValid(dt)&&(this._mainTitle=St.createOrUpdateChild("mainTitle",{text:[dt],...ht,maxLineWidth:null!==(h=null==ht?void 0:ht.maxLineWidth)&&void 0!==h?h:pt,heightLimit:null==ht?void 0:ht.heightLimit,lineClamp:null==ht?void 0:ht.lineClamp,ellipsis:null===(u=null==ht?void 0:ht.ellipsis)||void 0===u||u,x:0,y:0},"wrapText"));const Et=this._mainTitle?null===(c=this._mainTitle)||void 0===c?void 0:c.AABBBounds.height():0,Lt=this._mainTitle?null===(p=this._mainTitle)||void 0===p?void 0:p.AABBBounds.width():0;if(!1!==(null===(b=this.attribute)||void 0===b?void 0:b.visible)&&!1!==(null==ct?void 0:ct.visible))if(ct&&i.isValid(null==ct?void 0:ct.character)){const t={x:null!==(v=ct.x)&&void 0!==v?v:0,y:null!==(g=ct.y)&&void 0!==g?g:Et,width:null!==(y=null!==(_=ct.width)&&void 0!==_?_:pt)&&void 0!==y?y:0,height:null!==(x=null!==(m=ct.height)&&void 0!==m?m:bt)&&void 0!==x?x:0,ellipsis:null===(f=ct.ellipsis)||void 0===f||f,wordBreak:null!==(A=ct.wordBreak)&&void 0!==A?A:"break-word",maxHeight:ct.maxHeight,maxWidth:ct.maxWidth,textConfig:ct.character};this._subTitle=St.createOrUpdateChild("subTitle",t,"richtext")}else i.isValid(ut)&&(this._subTitle=St.createOrUpdateChild("subTitle",{text:[ut],...ct,maxLineWidth:null!==(S=null==ct?void 0:ct.maxLineWidth)&&void 0!==S?S:pt,heightLimit:null==ct?void 0:ct.heightLimit,lineClamp:null==ct?void 0:ct.lineClamp,ellipsis:null===(E=null==ct?void 0:ct.ellipsis)||void 0===E||E,x:0,y:Et},"wrapText"));const kt=this._subTitle?null===(L=this._subTitle)||void 0===L?void 0:L.AABBBounds.height():0,Bt=this._subTitle?null===(k=this._subTitle)||void 0===k?void 0:k.AABBBounds.width():0;let Mt=Math.max(Lt,Bt),wt=Et+(null!==(B=null==ct?void 0:ct.height)&&void 0!==B?B:kt);if(i.isValid(pt)&&(Mt=pt,null===(M=this._mainTitle)||void 0===M||M.setAttribute("maxLineWidth",pt),null===(w=this._subTitle)||void 0===w||w.setAttribute("maxLineWidth",pt)),i.isValid(bt)&&(wt=bt),i.isValid(vt)&&Mt<vt&&(Mt=vt),i.isValid(gt)&&(null===(T=this._mainTitle)||void 0===T||T.setAttribute("maxLineWidth",gt),null===(C=this._subTitle)||void 0===C||C.setAttribute("maxLineWidth",gt),null===(P=this._mainTitle)||void 0===P||P.setAttribute("maxWidth",gt),null===(I=this._subTitle)||void 0===I||I.setAttribute("maxWidth",gt),Mt>gt&&(Mt=gt)),i.isValid(_t)&&wt<_t&&(wt=_t),i.isValid(yt)&&(null===(H=this._mainTitle)||void 0===H||H.setAttribute("maxHeight",yt),null===(z=this._subTitle)||void 0===z||z.setAttribute("maxHeight",yt-Et),wt>yt&&(wt=yt)),St.attribute.width=Mt+At[1]+At[3],St.attribute.height=wt+At[0]+At[2],i.isValid(mt)||i.isValid(null==ht?void 0:ht.align)){const t=(null==ht?void 0:ht.align)?null==ht?void 0:ht.align:mt,e=null!==(V=null==ht?void 0:ht.width)&&void 0!==V?V:Lt;"left"===t?(null===(R=this._mainTitle)||void 0===R||R.setAttribute("x",0),null===(N=this._mainTitle)||void 0===N||N.setAttribute("textAlign","left")):"center"===t?(null===(D=this._mainTitle)||void 0===D||D.setAttribute("x",e/2),null===(O=this._mainTitle)||void 0===O||O.setAttribute("textAlign","center")):"right"===t&&(null===($=this._mainTitle)||void 0===$||$.setAttribute("x",e),null===(U=this._mainTitle)||void 0===U||U.setAttribute("textAlign","right"))}if(i.isValid(xt)||i.isValid(null==ht?void 0:ht.verticalAlign)){const t=(null==ht?void 0:ht.verticalAlign)?null==ht?void 0:ht.verticalAlign:xt,e=(null==ht?void 0:ht.height)?null==ht?void 0:ht.height:Mt;"top"===t?(null===(W=this._mainTitle)||void 0===W||W.setAttribute("y",0),null===(F=this._mainTitle)||void 0===F||F.setAttribute("textBaseline","top")):"middle"===t?(null===(G=this._mainTitle)||void 0===G||G.setAttribute("y",e/2),null===(Y=this._mainTitle)||void 0===Y||Y.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(X=this._mainTitle)||void 0===X||X.setAttribute("y",e),null===(q=this._mainTitle)||void 0===q||q.setAttribute("textBaseline","bottom"))}if(i.isValid(mt)||i.isValid(null==ct?void 0:ct.align)){const t=(null==ct?void 0:ct.align)?null==ct?void 0:ct.align:mt,e=null!==(Z=null==ct?void 0:ct.width)&&void 0!==Z?Z:Bt;"left"===t?(null===(j=this._subTitle)||void 0===j||j.setAttribute("x",0),null===(J=this._subTitle)||void 0===J||J.setAttribute("textAlign","left")):"center"===t?(null===(K=this._subTitle)||void 0===K||K.setAttribute("x",e/2),null===(Q=this._subTitle)||void 0===Q||Q.setAttribute("textAlign","center")):"right"===t&&(null===(tt=this._subTitle)||void 0===tt||tt.setAttribute("x",e),null===(et=this._subTitle)||void 0===et||et.setAttribute("textAlign","right"))}if(i.isValid(xt)||i.isValid(null==ht?void 0:ht.verticalAlign)){const t=(null==ct?void 0:ct.verticalAlign)?null==ct?void 0:ct.verticalAlign:xt,e=Et,i=null!==(it=null==ct?void 0:ct.height)&&void 0!==it?it:0;"top"===t?(null===(st=this._subTitle)||void 0===st||st.setAttribute("y",e),null===(at=this._subTitle)||void 0===at||at.setAttribute("textBaseline","top")):"middle"===t?(null===(nt=this._subTitle)||void 0===nt||nt.setAttribute("y",e+i/2),null===(rt=this._subTitle)||void 0===rt||rt.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(lt=this._subTitle)||void 0===lt||lt.setAttribute("y",e+i),null===(ot=this._subTitle)||void 0===ot||ot.setAttribute("textBaseline","bottom"))}}}Se.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};const Ee={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};const Le=(t,e)=>{let i=t.x0,s=t.x1;const a="number"==typeof e?t.thickness*e:t.thickness;let n=t.y0-t.thickness/2,r=t.y1-t.thickness/2;"center"===t.align?(n=t.y0-a/2,r=t.y1-a/2):"end"===t.align&&(n=t.y0+t.thickness/2-a,r=t.y1+t.thickness/2-a);let l=(i+s)/2,o=n+a,d=r+a;t.round&&(i=Math.round(i),s=Math.round(s),n=Math.round(n),r=Math.round(r),o=Math.round(o),d=Math.round(d),l=Math.round(l));const h=Math.abs(s-i)>1e-6,u=t.endArrow&&h?`L${s},${r-a/2}L${s+a},${(r+d)/2}L${s},${d+a/2}`:"",c=t.startArrow&&h?`L${i},${o+a/2}L${i-a},${(n+o)/2}L${i},${n-a/2}`:"";return!1===t.isSmooth?`M${i},${n}L${s},${r}${u}L${s},${d}L${i},${o}${c}Z`:`M${i},${n}\n C${l},${n},${l},${r},${s},${r}\n ${u}\n L${s},${d}\n C${l},${d},${l},${o},${i},${o}\n ${c}\n Z`},ke=(t,e)=>{let i=t.y0,s=t.y1,a=t.x0-t.thickness/2,n=t.x1-t.thickness/2;const r="number"==typeof e?t.thickness*e:t.thickness;"center"===t.align?(a=t.x0-r/2,n=t.x1-r/2):"end"===t.align&&(a=t.x0+t.thickness/2-r,n=t.x1+t.thickness/2-r);let l=(i+s)/2,o=a+r,d=n+r;t.round&&(i=Math.round(i),s=Math.round(s),a=Math.round(a),n=Math.round(n),o=Math.round(o),d=Math.round(d),l=Math.round(l));const h=Math.abs(s-i)>1e-6,u=t.endArrow&&h?`L${n-r/2},${s}L${(n+d)/2},${s+r}L${d+r/2},${s}`:"",c=t.startArrow&&h?`L${o+r/2},${i}L${(o+a)/2},${i-r}L${a-r/2},${i}`:"";return!1===t.isSmooth?`M${a},${i}L${n},${s}${u}L${d},${s}L${o},${i}${c}Z`:`M${a},${i}\n C${a},${l},${n},${l},${n},${s}\n ${u}\n L${d},${s}\n C${d},${l},${o},${l},${o},${i}\n ${c}\n Z`};class Be extends n{constructor(t){super(i.merge({},Be.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?ke:Le,i="number"==typeof this.attribute.ratio&&this.attribute.ratio>=0&&this.attribute.ratio<=1,s=["direction","x0","x1","y0","y1","thickness","round","ratio","align","isSmooth","backgroudStyle"],a={};if(Object.keys(this.attribute).forEach((t=>{s.includes(t)||(a[t]=this.attribute[t])})),i){const t=this.createOrUpdateChild("sankey-link-background",Object.assign({},a,this.attribute.backgroudStyle,{path:e(this.attribute,1),visible:!0,pickable:!1,zIndex:-1}),"path");this._backPath=t}else this._backPath&&this._backPath.setAttribute("visible",!1);const n=this.createOrUpdateChild("sankey-link-front",Object.assign({},a,{path:e(this.attribute,i?this.attribute.ratio:1),pickable:!1}),"path");this._frontPath=n}}Be.defaultAttributes={direction:"horizontal",align:"start"};class Me extends e.Symbol{constructor(t){super(t)}}var we,Te;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(we||(we={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(Te||(Te={}));class Ce extends n{constructor(t){super(i.merge({},Ce.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:{symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z",...Ce.defaultControllerAttr,...this.attribute.start.style}},this._pauseAttr={style:{symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z",...Ce.defaultControllerAttr,...this.attribute.pause.style}},this._forwardAttr={style:{...Ce.defaultControllerAttr,...this.attribute.forward.style}},this._backwardAttr={style:{...Ce.defaultControllerAttr,...this.attribute.backward.style}},this.updateLayout()},this.updateLayout=()=>{var t,e,i,s,a,n,r,l;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(e=null===(t=this._backwardAttr.style)||void 0===t?void 0:t.symbolType)&&void 0!==e?e:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(s=null===(i=this._forwardAttr.style)||void 0===i?void 0:i.symbolType)&&void 0!==s?s:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(n=null===(a=this._backwardAttr.style)||void 0===a?void 0:a.symbolType)&&void 0!==n?n:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(l=null===(r=this._forwardAttr.style)||void 0===r?void 0:r.symbolType)&&void 0!==l?l:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{i.isNil(this._playController)&&(this._playController=new Me({...this._startAttr.style}),this.add(this._playController))},this._initBackward=()=>{i.isNil(this._backwardController)&&(this._backwardController=new Me({...this._backwardAttr.style}),this.add(this._backwardController))},this._initForward=()=>{i.isNil(this._forwardController)&&(this._forwardController=new Me({...this._forwardAttr.style}),this.add(this._forwardController))},this._initEvents=()=>{this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()}))},this._createCustomEvent=t=>{var i;const s=new e.CustomEvent(t,{eventType:t});return s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,s},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes({symbolType:this._playController.getComputedAttribute("symbolType"),...this._startAttr.style}):this._playController.setAttributes({symbolType:this._playController.getComputedAttribute("symbolType"),...this._pauseAttr.style})},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{const t=this._createCustomEvent(we.OnPlay);this.dispatchEvent(t)},this.pause=()=>{const t=this._createCustomEvent(we.OnPause);this.dispatchEvent(t)},this.forward=()=>{const t=this._createCustomEvent(we.OnForward);this.dispatchEvent(t)},this.backward=()=>{const t=this._createCustomEvent(we.OnBackward);this.dispatchEvent(t)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}Ce.defaultControllerAttr={x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Ce.defaultAttributes={visible:!0,[Te.Start]:{},[Te.Pause]:{},[Te.Backward]:{},[Te.Forward]:{}};const Pe={style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},Ie=[200,10];var He,ze;t.DirectionEnum=void 0,(He=t.DirectionEnum||(t.DirectionEnum={})).Default="default",He.Reverse="reverse",t.PlayerEventEnum=void 0,(ze=t.PlayerEventEnum||(t.PlayerEventEnum={})).OnChange="onChange",ze.OnPlay="onPlay",ze.OnPause="onPause",ze.OnBackward="onBackward",ze.OnForward="onForward",ze.OnEnd="onEnd";const Ve=({direction:e,maxIndex:i,minIndex:s,dataIndex:a})=>(({direction:e,maxIndex:i,dataIndex:s})=>e===t.DirectionEnum.Default&&s===i)({direction:e,maxIndex:i,dataIndex:a})||(({direction:e,minIndex:i,dataIndex:s})=>e===t.DirectionEnum.Reverse&&s===i)({direction:e,minIndex:s,dataIndex:a}),Re=({direction:e,maxIndex:i,minIndex:s,dataIndex:a})=>(({direction:e,minIndex:i,dataIndex:s})=>e===t.DirectionEnum.Default&&s===i)({direction:e,minIndex:s,dataIndex:a})||(({direction:e,maxIndex:i,dataIndex:s})=>e===t.DirectionEnum.Reverse&&s===i)({direction:e,maxIndex:i,dataIndex:a}),Ne=t=>"top"===t||"bottom"===t;class De extends n{constructor(t){super(i.merge({},De.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e,s;let a;i.isValidNumber(this._handlerStyle.size)?a=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(a=i.max(this._handlerStyle.size[0],this._handlerStyle.size[1]));const n={min:this._minIndex,max:this._maxIndex,value:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:i.isValidNumber(a)?a:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,visible:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1}};if(Ne(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.height)&&void 0!==e?e:Ie[1];n.layout="horizontal",n.railHeight=i,n.railWidth=t,n.x=this._layoutInfo.slider.x,n.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(s=this._railStyle.width)&&void 0!==s?s:Ie[1];n.layout="vertical",n.railWidth=e,n.railHeight=t,n.x=this._layoutInfo.slider.x,n.y=this._layoutInfo.slider.y}return n},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new me(t),this.add(this._slider)},this._updateControllerAttrs=()=>{const t={visible:!0,start:this._start,pause:this._pause,forward:this._forward,backward:this._backward};return Ne(this._orient)?(t.layout="horizontal",t.start={style:{...t.start.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.pause={style:{...t.pause.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.backward={style:{...t.backward.style,x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y}},t.forward={style:{...t.forward.style,x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y}}):(t.layout="vertical",t.start={style:{...t.start.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.pause={style:{...t.pause.style,x:this._layoutInfo.start.x,y:this._layoutInfo.start.y}},t.backward={style:{...t.backward.style,x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y}},t.forward={style:{...t.forward.style,x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y}}),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new Ce(t),this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){var t,e,i,s,a,n,r,l,o,d,h,u,c,p;this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1,this._railStyle={...null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.railStyle},this._trackStyle={...null===(s=null===(i=this.attribute)||void 0===i?void 0:i.slider)||void 0===s?void 0:s.trackStyle},this._handlerStyle={...null===(n=null===(a=this.attribute)||void 0===a?void 0:a.slider)||void 0===n?void 0:n.handlerStyle},this._start={...null===(l=null===(r=this.attribute)||void 0===r?void 0:r.controller)||void 0===l?void 0:l.start},this._pause={...null===(d=null===(o=this.attribute)||void 0===o?void 0:o.controller)||void 0===d?void 0:d.pause},this._forward={...null===(u=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===u?void 0:u.forward},this._backward={...null===(p=null===(c=this.attribute)||void 0===c?void 0:c.controller)||void 0===p?void 0:p.backward}}_initLayoutInfo(){var t,e,s;const a=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),n=a.filter((t=>"end"!==t.position)),r=a.filter((t=>"end"===t.position)),l=null!==(t=Ne(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:Ie[1],o=a.reduce(((t,e)=>{const s=e.style.size,a=i.isNumber(s)?s:i.max(s[0],s[1]);return t+e.space+a}),0),d=(Ne(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(s=this._size)||void 0===s?void 0:s.height)-o,h=d-this.attribute.slider.space,u=n.reduce(((t,e)=>{const{key:s,space:a,style:{size:n}}=e,r=i.isNumber(n)?n:i.max(n[0],n[1]);return this._layoutInfo[s]={...this._layoutInfo[s],size:r,x:Ne(this._orient)?t+a:(this._size.width-r)/2,y:Ne(this._orient)?(this._size.height-r)/2:t+a},t+a+r}),0);this._layoutInfo.slider={...this._layoutInfo.slider,size:h,x:Ne(this._orient)?u+this.attribute.slider.space:(this._size.width-l)/2,y:Ne(this._orient)?(this._size.height-l)/2:u+this.attribute.slider.space},r.reduce(((t,e)=>{const{key:s,space:a,style:{size:n}}=e,r=i.isNumber(n)?n:i.max(n[0],n[1]);return this._layoutInfo[s]={...this._layoutInfo[s],size:r,x:Ne(this._orient)?t+a:(this._size.width-r)/2,y:Ne(this._orient)?(this._size.height-r)/2:t+a},t+a+r}),u+d)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,i){var s;const a=new e.CustomEvent(t,{eventType:t,index:i,value:this._data[i]});a.manager=null===(s=this.stage)||void 0===s?void 0:s.eventSystem.manager,this.dispatchEvent(a)}}De.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{start:{...Pe,key:"start",position:"start",space:0},pause:{...Pe,key:"pause",position:"start"},forward:{...Pe,key:"forward",position:"end"},backward:{...Pe,key:"backward",position:"start"}}};var Oe;t.IOperateType=void 0,(Oe=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",Oe.drawEnd="drawEnd",Oe.drawing="drawing",Oe.moving="moving",Oe.moveStart="moveStart",Oe.moveEnd="moveEnd",Oe.brushClear="brushClear";const $e={brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},Ue=5,We={debounce:i.debounce,throttle:i.throttle};class Fe extends n{constructor(e){super(i.merge({},Fe.defaultAttributes,e)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e,i;if(this._outOfInteractiveRange(t))return;const s=null===(i=null===(e=this.attribute)||void 0===e?void 0:e.brushMoved)||void 0===i||i;this._activeMoveState=s&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||(this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushEnd=e=>{var i;const{removeOnClick:s=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&s?(this._container.incrementalClearChild(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.brushClear,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})):this._outOfInteractiveRange(e)||this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:this._activeDrawState?t.IOperateType.drawEnd:t.IOperateType.moveEnd,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict}),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,null===(i=this._operatingMask)||void 0===i||i.setAttribute("pickable",!1)}}bindBrushEvents(){const{delayType:t="throttle",delayTime:e=0}=this.attribute;this.stage.addEventListener("pointerdown",this._onBrushStart),this.stage.addEventListener("pointermove",We[t](this._onBrushing,e)),this.stage.addEventListener("pointerup",this._onBrushEnd),this.stage.addEventListener("pointerupoutside",this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),s=this._container.getChildren();for(let t=0;t<s.length;t++){const{points:a=[],dx:n=0,dy:r=0}=s[t].attribute,l=a.map((t=>({x:t.x+n,y:t.y+r})));if(i.polygonContainPoint(l,e.x,e.y))return this._operatingMask=s[t],!0}return!1}_initDraw(e){const{brushMode:i}=this.attribute,s=this.eventPosToStagePos(e);this._cacheDrawPoints=[s],this._isDrawedBeforeEnd=!1,"single"===i&&this._container.incrementalClearChild(),this._addBrushMask(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_initMove(e){var i,s;this._cacheMovePoint=this.eventPosToStagePos(e),this._operatingMaskMoveDx=null!==(i=this._operatingMask.attribute.dx)&&void 0!==i?i:0,this._operatingMaskMoveDy=null!==(s=this._operatingMask.attribute.dy)&&void 0!==s?s:0;const{interactiveRange:a}=this.attribute,{minY:n=-1/0,maxY:r=1/0,minX:l=-1/0,maxX:o=1/0}=a,{x1:d,x2:h,y1:u,y2:c}=this._operatingMask.globalAABBBounds,p=l-d,b=o-h,v=n-u,g=r-c;this._operatingMaskMoveRangeX=[p,b],this._operatingMaskMoveRangeY=[v,g],this._operatingMask.setAttribute("pickable",!0),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moveStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_drawing(e){var i;const s=this.eventPosToStagePos(e),{x1:a=0,x2:n=0,y1:r=0,y2:l=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds,{sizeThreshold:o=Ue}=this.attribute;if(this._isDrawedBeforeEnd=!!(Math.abs(n-a)>o||Math.abs(r-l)>o),this._cacheDrawPoints.length>0){const t=this._cacheDrawPoints[this._cacheDrawPoints.length-1];if(s.x===(null==t?void 0:t.x)&&s.y===(null==t?void 0:t.y))return}this._cacheDrawPoints.push(s);const d=this._computeMaskPoints();this._operatingMask.setAttribute("points",d),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawing,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_moving(e){const i=this._cacheMovePoint,s=this.eventPosToStagePos(e);if(s.x===(null==i?void 0:i.x)&&s.y===(null==i?void 0:i.y))return;const a=s.x-i.x,n=s.y-i.y,r=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],a))+this._operatingMaskMoveDx,l=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:r,dy:l}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moving,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:s=[0,0]}=this.attribute;let a=[];const n=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return a="rect"===t?[n,{x:r.x,y:n.y},r,{x:n.x,y:r.y}]:"x"===t?[{x:n.x,y:s[0]},{x:r.x,y:s[0]},{x:r.x,y:s[1]},{x:n.x,y:s[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:n.y}]:i.cloneDeep(this._cacheDrawPoints),a}_addBrushMask(){const{brushStyle:t}=this.attribute,s=e.createPolygon({points:i.cloneDeep(this._cacheDrawPoints),cursor:"move",pickable:!1,...t});s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:a=-1/0,maxX:n=1/0}=e,r=this.eventPosToStagePos(t);return r.x>n||r.x<a||r.y>s||r.y<i}eventPosToStagePos(t){var e,i,s;const a=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==a?void 0:a.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==a?void 0:a.top)||0)-((null===(s=this.stage)||void 0===s?void 0:s.y)||0)}}render(){this.bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}setUpdateDragMaskCallback(t){i.isFunction(t)&&(this._updateDragMaskCallback=t)}}Fe.defaultAttributes=$e;const Ge=(t,...e)=>{const s=[t.shape,...e.map((t=>null==t?void 0:t.shape))],a=[t.key,...e.map((t=>null==t?void 0:t.key))],n=[t.value,...e.map((t=>null==t?void 0:t.value))];return i.merge(t,...e,{shape:s.every(i.isNil)?void 0:i.merge({},...s),key:a.every(i.isNil)?void 0:i.merge({},...a),value:n.every(i.isNil)?void 0:i.merge({},...n)})},Ye=t=>{const{width:e,height:s,wordBreak:a="break-word",textAlign:n,textBaseline:r,text:l}=t;return{width:e,height:s,wordBreak:a,textAlign:n,textBaseline:r,singleLine:!1,textConfig:i.array(l).map((e=>({...t,text:e})))}},Xe={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:m,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:m,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:m,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new i.AABBBounds).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},qe=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"],Ze="tooltip-title",je="tooltip-content",Je="shape",Ke="value";class Qe extends n{constructor(t){super(i.merge({},Qe.defaultAttributes,t)),this.name="tooltip"}render(){const{visible:t,content:e,panel:s,keyWidth:a,valueWidth:n,hasContentShape:r,autoCalculatePosition:l,autoMeasure:d}=this.attribute;if(!t)return void this.hideAll();d&&Qe.measureTooltip(this.attribute),l&&Qe.calculateTooltipPosition(this.attribute);const h=i.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",{visible:!0,...s},"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(Ze,{visible:!0,x:h[3],y:h[0]},"group");const u=Qe.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${Ze}-${Je}`,i.merge({symbolType:"circle"},u.shape,{visible:o(u)&&o(u.shape)}),"symbol"),u.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ze}-${Ke}`,{visible:o(u)&&o(u.value),...Ye(u.value)},"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ze}-${Ke}`,{text:"",visible:o(u)&&o(u.value),...u.value},"text");const c=o(u.shape)?u.shape.size+u.shape.spacing:0,{textAlign:p,textBaseline:b}=u.value,v=s.width-h[3]-h[0]-c;"center"===p?this._tooltipTitle.setAttribute("x",c+v/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",c+v):this._tooltipTitle.setAttribute("x",c),"bottom"===b?this._tooltipTitle.setAttribute("y",u.height):"middle"===b?this._tooltipTitle.setAttribute("y",u.height/2):this._tooltipTitle.setAttribute("y",0);const g=o(u)?u.height+u.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(je,{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==e?void 0:e.length){this._tooltipContent.setAttribute("x",h[3]),this._tooltipContent.setAttribute("y",h[0]+g);let t=0;e.forEach(((e,s)=>{var l;const d=Qe.getContentAttr(this.attribute,s);if(!o(d))return;const h=`${je}-${s}`,u=this._tooltipContent.createOrUpdateChild(h,{visible:!0,x:0,y:t},"group");let c=0;if(o(d.shape)&&u.createOrUpdateChild(`${h}-${Je}`,{visible:!0,x:d.shape.size/2,y:d.shape.size/2+((null!==(l=d.key.lineHeight)&&void 0!==l?l:d.key.fontSize)-d.shape.size)/2,...d.shape},"symbol"),r&&(c+=d.shape.size+d.shape.spacing),o(d.key)){let t;t=d.key.multiLine?u.createOrUpdateChild(`${h}-key`,{visible:!0,...Ye(d.key),textBaseline:"top"},"richtext"):u.createOrUpdateChild(`${h}-key`,{visible:!0,...d.key,textBaseline:"top"},"text");const{textAlign:e}=d.key;"center"===e?t.setAttribute("x",c+a/2):"right"===e||"end"===e?t.setAttribute("x",c+a):t.setAttribute("x",c),t.setAttribute("y",0),c+=a+d.key.spacing}if(o(d.value)){let t;t=d.value.multiLine?u.createOrUpdateChild(`${h}-${Ke}`,{visible:!0,...Ye(d.value),textBaseline:"top"},"richtext"):u.createOrUpdateChild(`${h}-${Ke}`,{visible:!0,...d.value,textBaseline:"top"},"text");let e="right";i.isValid(d.value.textAlign)?e=d.value.textAlign:o(d.key)||(e="left"),t.setAttribute("textAlign",e),"center"===e?t.setAttribute("x",c+n/2):"right"===e||"end"===e?t.setAttribute("x",c+n):t.setAttribute("x",c),c+=n,t.setAttribute("y",0),u.add(t)}t+=d.height+d.spaceRow}))}}setAttributes(t,e){const s=Object.keys(t);this.attribute.autoCalculatePosition&&s.every((t=>qe.includes(t)))?(this._mergeAttributes(t,s),i.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&Qe.measureTooltip(this.attribute),Qe.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:a,pointerX:n,pointerY:r,positionX:l,positionY:o,parentBounds:d}=t;let h=n,u=r;return"left"===l?h-=e+s:"center"===l?h-=e/2:h+=s,"top"===o?u-=i+a:"middle"===o?u-=i/2:u+=a,h+e>d.x2&&(h-=e+s),u+i>d.y2&&(u-=i+a),h<d.x1&&(h=d.x1),u<d.y1&&(u=d.y1),t.x=h,t.y=u,t}static measureTooltip(t){const{content:s,contentStyle:a}=t,n=i.normalizePadding(t.padding),r=Qe.getTitleAttr(t);let l=0,d=n[0]+n[2],h=0;const{value:u,shape:c}=r,{visible:p=!1,symbolType:b=""}=null!=c?c:{};if(i.isValid(u)){const{width:t,height:e}=A(u).quickMeasure(u.text);l=t,h=e}if(p&&e.builtinSymbolsMap[b]&&(l+=c.size+c.spacing,h=Math.max(c.size,h)),t.title&&(t.title.width=l,t.title.height=h),o(r)&&(d+=h+r.spaceRow),null==s?void 0:s.length){const i=[];if(s.forEach(((e,s)=>{const a=Qe.getContentAttr(t,s);(e.key||e.value)&&o(a)&&i.push([e,a])})),i.length){let n=!1;const r=[],h=[],u=[];i.forEach((([t,s],l)=>{var c;const{key:p,value:b,shape:v,spaceRow:g}=s,_=o(v),y=null!==(c=null==v?void 0:v.symbolType)&&void 0!==c?c:"",m=A(p),x=A(b);let f=0;if(o(p)){const{width:t,height:e}=m.quickMeasure(p.text);h.push(t),f=Math.max(f,e)}if(o(b)){const{width:t,height:e}=x.quickMeasure(b.text);u.push(t),f=Math.max(f,e)}_&&e.builtinSymbolsMap[y]&&(n=!0,r.push(v.size),f=Math.max(v.size,f)),t.height=f,d+=f,l<i.length-1&&(d+=null!=g?g:a.spaceRow)}));const c=r.length?Math.max(...r):0,p=h.length?Math.max(...h):0,b=u.length?Math.max(...u):0;l=Math.max(p+b+a.key.spacing+a.value.spacing+(n?c+a.shape.spacing:0),l),s.forEach((t=>{t.width=l})),t.hasContentShape=n,t.keyWidth=p,t.valueWidth=b}}return t.panel.width=l+n[1]+n[3],t.panel.height=d,t}static getTitleAttr(t){return Ge({},Qe.defaultAttributes.titleStyle,Qe.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return Ge({},Qe.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}Qe.defaultAttributes=Xe;t.AbstractComponent=n,t.ArcInfo=_t,t.ArcLabel=yt,t.BasePlayer=De,t.Brush=Fe,t.CircleAxis=Ot,t.CircleCrosshair=$,t.ColorContinuousLegend=xe,t.ContinuousPlayer=class extends De{constructor(i){super(i),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t,e;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3,this._dataIndex=null!==(e=this.attribute.dataIndex)&&void 0!==e?e:this._minIndex;const i=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=i?i:1)):(this._totalDuration=this._interval*i,this._interval=this.attribute.interval)},this._initEvents=()=>{this._controller.addEventListener(we.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(we.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(we.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(we.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)}))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=e=>{const i=Math.floor(e);i!==this._activeIndex&&(this._dataIndex=i,this._activeIndex=i,i!==this._maxIndex&&this.dispatchCustomEvent(t.PlayerEventEnum.OnChange))},this.play=async()=>{this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(t.PlayerEventEnum.OnPlay),this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this)))},this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.OnEnd)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.OnPause))},this.backward=()=>{const e=Date.now(),i=1*this._interval,s=this._elapsed-i;s<=0?(this._elapsed=0,this._startTime=e):(this._elapsed=s,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.OnBackward)},this.forward=()=>{const e=Date.now(),i=1*this._interval,s=this._elapsed+i;s>=this._totalDuration?(this._startTime=e-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-i,this._elapsed=s),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.OnForward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=re,t.DEFAULT_ITEM_SPACE_ROW=le,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=de,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=Mt,t.DEFAULT_TITLE_SPACE=oe,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=xt,t.DataZoom=Gt,t.DiscreteLegend=ve,t.DiscretePlayer=class extends De{constructor(s){super(i.merge({},s)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var e,s,a,n;super._initAttributes(),this._alternate=null!==(e=this.attribute.alternate)&&void 0!==e&&e,this._interval=null!==(s=this.attribute.interval)&&void 0!==s?s:1e3,this._direction=null!==(a=this.attribute.direction)&&void 0!==a?a:t.DirectionEnum.Default,this._dataIndex=i.isNil(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(n=this.attribute.dataIndex)&&void 0!==n?n:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this._controller.addEventListener(we.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(we.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(we.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(we.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(e=>{const i=Math.floor(e.detail.value)+.5;this._dataIndex=e.detail.value>=i?Math.ceil(e.detail.value):Math.floor(e.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(t.PlayerEventEnum.OnChange)}))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(Ve({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||Re({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===t.DirectionEnum.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(t.PlayerEventEnum.OnPlay),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=i=>{const s=Date.now();if(this._isReachEnd&&s-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();i&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(t.PlayerEventEnum.OnChange),this._activeIndex=this._dataIndex):s-this._tickTime>=this._interval&&(this._tickTime=s,this._updateDataIndex(((t,e,i,s)=>"default"===t?Math.min(e+1,s):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(t.PlayerEventEnum.OnChange)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=e.vglobal.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),e.vglobal.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(t.PlayerEventEnum.OnEnd)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.OnPause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.OnChange),this.dispatchCustomEvent(t.PlayerEventEnum.OnBackward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.OnChange),this.dispatchCustomEvent(t.PlayerEventEnum.OnForward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.Grid=Et,t.GroupFadeIn=Ut,t.GroupFadeOut=Wt,t.GroupTransition=$t,t.Indicator=class extends n{constructor(){super(...arguments),this.name="indicator"}render(){var t;const{visible:e,title:s,content:a,size:n,limitRatio:r=1/0}=this.attribute,l=Math.min(n.width,n.height)*r,o=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1},"group");if(!0!==e)return void(o&&o.hideAll());if(i.isValid(s))if(!1!==s.visible){const t=i.merge({},i.get(Ee,"title.style"),s.style);this._title=o.createOrUpdateChild("indicator-title",{...t,lineHeight:i.isValid(t.lineHeight)?t.lineHeight:t.fontSize,visible:s.visible,x:0,y:0},"text"),s.autoFit&&i.isValidNumber(l)&&this._setAutoFit(l,this._title,s),s.autoLimit&&i.isValidNumber(r)&&this._title.setAttribute("maxLineWidth",l)}else{const t=o.find((t=>"indicator-title"===t.name),!1);t&&o.removeChild(t),this._title=void 0}const d=this._title?this._title.AABBBounds.height():0;if(i.isValid(a)){const t=this._title&&(null==s?void 0:s.space)?s.space:0,e=i.array(a),n=[];let h=0;e.forEach(((e,s)=>{if(!1!==e.visible){const a=i.merge({},i.get(Ee,"content.style"),e.style),u=o.createOrUpdateChild("indicator-content-"+s,{...a,lineHeight:i.isValid(a.lineHeight)?a.lineHeight:a.fontSize,visible:e.visible,x:0,y:d+t+h},"text");e.autoFit&&i.isValidNumber(l)&&this._setAutoFit(l,u,e),e.autoLimit&&i.isValidNumber(r)&&u.setAttribute("maxLineWidth",l),n.push(u);const c=(null==e?void 0:e.space)?e.space:0;h+=u.AABBBounds.height()+c}else{const t=o.find((t=>t.name==="indicator-content-"+s),!1);t&&o.removeChild(t)}})),this._content=n}const h=null!==(t=null==o?void 0:o.AABBBounds.height())&&void 0!==t?t:0;o.setAttribute("y",n.height/2-h/2),o.setAttribute("x",n.width/2)}_setAutoFit(t,e,s){var a,n,r,l,o,d;const h=S(null!==(n=null===(a=s.style)||void 0===a?void 0:a.text)&&void 0!==n?n:"",null!==(r=s.style)&&void 0!==r?r:{}).width;if(h>0){const a=t*(null!==(l=s.fitPercent)&&void 0!==l?l:.5)/h,n=Math.floor((null!==(d=null===(o=s.style)||void 0===o?void 0:o.fontSize)&&void 0!==d?d:20)*a);e.setAttribute("fontSize",n),e.setAttribute("lineHeight",i.isValid(s.style.lineHeight)?s.style.lineHeight:n)}}},t.LabelBase=dt,t.LineAxis=Dt,t.LineCrosshair=D,t.LineLabel=ct,t.LinkPath=Be,t.MarkArea=ie,t.MarkLine=ee,t.MarkPoint=se,t.Pager=ne,t.PolygonCrosshair=W,t.PopTip=L,t.RectCrosshair=O,t.RectLabel=ut,t.ScrollBar=r,t.SectorCrosshair=U,t.Segment=Lt,t.SizeContinuousLegend=Ae,t.Slider=me,t.SymbolLabel=ht,t.Tag=E,t.Title=Se,t.Tooltip=Qe,t.getHorizontalPath=Le,t.getSizeHandlerPath=fe,t.getVerticalPath=ke,t.loadPoptip=function(t){i.merge(I.poptip,t),e.container.load(R)},t.popTipModule=R,t.setPoptipTheme=function(t){i.merge(I.poptip,P,t)},t.version="0.14.2-alpha.0"}));
package/es/brush/type.js CHANGED
@@ -4,4 +4,5 @@ export var IOperateType;
4
4
  IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
5
5
  IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
6
6
  IOperateType.brushClear = "brushClear";
7
- }(IOperateType || (IOperateType = {}));
7
+ }(IOperateType || (IOperateType = {}));
8
+ //# sourceMappingURL=type.js.map
package/es/core/type.js CHANGED
@@ -1,2 +1 @@
1
- export { };
2
- //# sourceMappingURL=type.js.map
1
+ export { };
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.14.1";
1
+ export declare const version = "0.14.2-alpha.0";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.14.1";
1
+ export const version = "0.14.2-alpha.0";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.1\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.2-alpha.0\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-components",
3
- "version": "0.14.1",
3
+ "version": "0.14.2-alpha.0",
4
4
  "description": "components library for dp visualization",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -12,7 +12,7 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@visactor/vrender": "0.14.1",
15
+ "@visactor/vrender": "0.15.0-alpha.0",
16
16
  "@visactor/vutils": "~0.15.3",
17
17
  "@visactor/vscale": "~0.15.3",
18
18
  "inversify": "6.0.1"
@@ -29,8 +29,8 @@
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
31
  "@internal/ts-config": "0.0.1",
32
- "@internal/bundler": "0.0.1",
33
- "@internal/eslint-config": "0.0.1"
32
+ "@internal/eslint-config": "0.0.1",
33
+ "@internal/bundler": "0.0.1"
34
34
  },
35
35
  "keywords": [
36
36
  "VisActor",