@visactor/vrender-components 0.15.0-alpha.14 → 0.15.0-alpha.16
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/axis/animate/group-transition.d.ts +1 -2
- package/cjs/axis/animate/group-transition.js +3 -3
- package/cjs/axis/animate/group-transition.js.map +1 -1
- package/cjs/axis/base.d.ts +8 -5
- package/cjs/axis/base.js +32 -16
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/circle.d.ts +23 -3
- package/cjs/axis/circle.js +84 -3
- package/cjs/axis/circle.js.map +1 -1
- package/cjs/axis/config.d.ts +17 -0
- package/cjs/axis/config.js +17 -0
- package/cjs/axis/config.js.map +1 -1
- package/cjs/axis/grid.d.ts +9 -0
- package/cjs/axis/{grid/base.js → grid.js} +20 -67
- package/cjs/axis/grid.js.map +1 -0
- package/cjs/axis/index.d.ts +1 -0
- package/cjs/axis/index.js +3 -3
- package/cjs/axis/index.js.map +1 -1
- package/cjs/axis/line.d.ts +24 -3
- package/cjs/axis/line.js +117 -16
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/type.d.ts +55 -0
- package/cjs/axis/type.js.map +1 -1
- package/cjs/core/base.d.ts +1 -2
- package/cjs/core/base.js +2 -4
- package/cjs/core/base.js.map +1 -1
- package/cjs/core/type.js +1 -2
- package/cjs/crosshair/base.js +2 -1
- package/cjs/index.d.ts +1 -3
- package/cjs/index.js +8 -9
- package/cjs/index.js.map +1 -1
- package/cjs/indicator/type.js +1 -2
- package/cjs/label/arc.d.ts +2 -1
- package/cjs/label/arc.js +34 -11
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/type.d.ts +3 -2
- package/cjs/label/type.js.map +1 -1
- package/cjs/link-path/index.js +2 -1
- package/cjs/link-path/link-path.js +1 -2
- package/cjs/marker/point.js +1 -1
- package/cjs/poptip/register.d.ts +1 -1
- package/cjs/poptip/register.js +6 -8
- package/cjs/poptip/register.js.map +1 -1
- package/cjs/util/matrix.d.ts +1 -1
- package/cjs/util/matrix.js.map +1 -1
- package/cjs/util/text.js +3 -3
- package/cjs/util/text.js.map +1 -1
- package/dist/index.js +625 -648
- package/dist/index.min.js +1 -1
- package/es/axis/animate/group-transition.d.ts +1 -2
- package/es/axis/animate/group-transition.js +3 -3
- package/es/axis/animate/group-transition.js.map +1 -1
- package/es/axis/base.d.ts +8 -5
- package/es/axis/base.js +33 -15
- package/es/axis/base.js.map +1 -1
- package/es/axis/circle.d.ts +23 -3
- package/es/axis/circle.js +85 -4
- package/es/axis/circle.js.map +1 -1
- package/es/axis/config.d.ts +17 -0
- package/es/axis/config.js +17 -0
- package/es/axis/config.js.map +1 -1
- package/es/axis/grid.d.ts +9 -0
- package/es/axis/{grid/base.js → grid.js} +21 -69
- package/es/axis/grid.js.map +1 -0
- package/es/axis/index.d.ts +1 -0
- package/es/axis/index.js +2 -0
- package/es/axis/index.js.map +1 -1
- package/es/axis/line.d.ts +24 -3
- package/es/axis/line.js +109 -8
- package/es/axis/line.js.map +1 -1
- package/es/axis/type.d.ts +55 -0
- package/es/axis/type.js.map +1 -1
- package/es/core/base.d.ts +1 -2
- package/es/core/base.js +3 -3
- package/es/core/base.js.map +1 -1
- package/es/core/type.js +1 -2
- package/es/crosshair/base.js +2 -1
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -5
- package/es/index.js.map +1 -1
- package/es/indicator/type.js +1 -2
- package/es/label/arc.d.ts +2 -1
- package/es/label/arc.js +34 -11
- package/es/label/arc.js.map +1 -1
- package/es/label/type.d.ts +3 -2
- package/es/label/type.js.map +1 -1
- package/es/link-path/index.js +2 -1
- package/es/link-path/link-path.js +1 -2
- package/es/marker/point.js +1 -1
- package/es/poptip/register.d.ts +1 -1
- package/es/poptip/register.js +6 -7
- package/es/poptip/register.js.map +1 -1
- package/es/util/matrix.d.ts +1 -1
- package/es/util/matrix.js.map +1 -1
- package/es/util/text.js +3 -3
- package/es/util/text.js.map +1 -1
- package/package.json +4 -4
- package/cjs/axis/grid/base.d.ts +0 -24
- package/cjs/axis/grid/base.js.map +0 -1
- package/cjs/axis/grid/circle.d.ts +0 -9
- package/cjs/axis/grid/circle.js +0 -92
- package/cjs/axis/grid/circle.js.map +0 -1
- package/cjs/axis/grid/index.d.ts +0 -3
- package/cjs/axis/grid/index.js +0 -22
- package/cjs/axis/grid/index.js.map +0 -1
- package/cjs/axis/grid/line.d.ts +0 -10
- package/cjs/axis/grid/line.js +0 -103
- package/cjs/axis/grid/line.js.map +0 -1
- package/cjs/axis/grid/type.d.ts +0 -63
- package/cjs/axis/grid/type.js +0 -6
- package/cjs/axis/grid/type.js.map +0 -1
- package/cjs/axis/mixin/circle.d.ts +0 -17
- package/cjs/axis/mixin/circle.js +0 -30
- package/cjs/axis/mixin/circle.js.map +0 -1
- package/cjs/axis/mixin/line.d.ts +0 -14
- package/cjs/axis/mixin/line.js +0 -32
- package/cjs/axis/mixin/line.js.map +0 -1
- package/cjs/jsx/component-type.d.ts +0 -4
- package/cjs/jsx/component-type.js +0 -13
- package/cjs/jsx/component-type.js.map +0 -1
- package/cjs/jsx/index.d.ts +0 -1
- package/cjs/jsx/index.js +0 -21
- package/cjs/jsx/index.js.map +0 -1
- package/es/axis/grid/base.d.ts +0 -24
- package/es/axis/grid/base.js.map +0 -1
- package/es/axis/grid/circle.d.ts +0 -9
- package/es/axis/grid/circle.js +0 -92
- package/es/axis/grid/circle.js.map +0 -1
- package/es/axis/grid/index.d.ts +0 -3
- package/es/axis/grid/index.js +0 -6
- package/es/axis/grid/index.js.map +0 -1
- package/es/axis/grid/line.d.ts +0 -10
- package/es/axis/grid/line.js +0 -102
- package/es/axis/grid/line.js.map +0 -1
- package/es/axis/grid/type.d.ts +0 -63
- package/es/axis/grid/type.js +0 -2
- package/es/axis/grid/type.js.map +0 -1
- package/es/axis/mixin/circle.d.ts +0 -17
- package/es/axis/mixin/circle.js +0 -25
- package/es/axis/mixin/circle.js.map +0 -1
- package/es/axis/mixin/line.d.ts +0 -14
- package/es/axis/mixin/line.js +0 -23
- package/es/axis/mixin/line.js.map +0 -1
- package/es/jsx/component-type.d.ts +0 -4
- package/es/jsx/component-type.js +0 -5
- package/es/jsx/component-type.js.map +0 -1
- package/es/jsx/index.d.ts +0 -1
- package/es/jsx/index.js +0 -2
- package/es/jsx/index.js.map +0 -1
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.isFunction(this.attribute[t])||i.isFunction(e)?this.attribute[t]=e:i.merge(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.isFunction(this.attribute[a])||i.isFunction(t[a])?this.attribute[a]=t[a]:i.merge(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 b;if("vertical"===r){const t=n-this._viewPosition.y,e=i.clamp(t-h/2,u,c);b=t/o,this._slider.setAttribute("y",e,!0)}else{const t=a-this._viewPosition.x,e=i.clamp(t-h/2,u,c);b=t/l,this._slider.setAttribute("x",e,!0)}this.setScrollRange([b-(d[1]-d[0])/2,b+(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",Object.assign({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])),b=c[1]-c[0];let g;this._sliderSize=b,g="horizontal"===t?{x:c[0],y:u.y1,width:b,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:b};const p=d.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},g),{cornerRadius:this._getDefaultSliderCornerRadius()}),l),{boundsPadding:i.normalizePadding(o),pickMode:"imprecise"}),"rect");this._slider=p,this._container=d;const v=this._container.AABBBounds;this._viewPosition={x:v.x1,y:v.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){return l="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},l(t)}function o(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(i[s[a]]=t[s[a]])}return i}function d(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":l(Reflect))&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(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 h(t,e,i,s){return new(i||(i=Promise))((function(a,n){function r(t){try{o(s.next(t))}catch(t){n(t)}}function l(t){try{o(s.throw(t))}catch(t){n(t)}}function o(t){var e;t.done?a(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,l)}o((s=s.apply(t,e||[])).next())}))}function u(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&u(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]},"function"==typeof SuppressedError&&SuppressedError;const c=t=>!i.isNil(t)&&!1!==t.visible;const b=["#ffffff","#000000"];function g(t,e,i,s,a){const n=m(t),r=m(e);return p(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(...b);for(const a of n)if(t!==a&&p(a,e,i,s))return a;return}(n,r,i,s,a)}function p(t,e,i,s){return s?v(t,e)>s:"largeText"===i?v(t,e)>3:v(t,e)>4.5}function v(t,e){const i=_(t),s=_(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function _(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 m(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 y(t,e,i,s){let a;switch(t){case"base":a=e;break;case"invertBase":a=i;break;case"similarBase":a=s}return a}function x(t,e){return[t[0]*e,t[1]*e]}function f(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 A=-.5*Math.PI,S=1.5*Math.PI,E="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 L;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(L||(L={}));const B={[L.selectedReverse]:{},[L.selected]:{},[L.hover]:{},[L.hoverReverse]:{}},k=(t,s,a)=>new i.TextMeasure(Object.assign({defaultFontParams:{fontFamily:E,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 M(t,i){var s;if(!t)return{width:0,height:0};const a=e.getTextBounds({text:t,fontFamily:i.fontFamily,fontSize:i.fontSize||12,fontWeight:i.fontWeight,textAlign:null!==(s=i.textAlign)&&void 0!==s?s:"center",textBaseline:i.textBaseline,ellipsis:!!i.ellipsis,maxLineWidth:i.maxLineWidth||1/0,lineHeight:i.fontSize||12});return{width:a.width(),height:a.height()}}class w extends n{constructor(t){super(i.merge({},w.defaultAttributes,t)),this.name="tag"}render(){var t;const{text:e="",textStyle:s={},shape:a={},panel:n={},space:r=4,minWidth:l,maxWidth:d,padding:h=4,visible:u,state:c}=this.attribute,b=i.normalizePadding(h),g=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let p,v=b[1]+b[3],_=b[0]+b[2],m=0,y=0;const{visible:x}=a,f=o(a,["visible"]);if(i.isBoolean(x)){const t=(null==f?void 0:f.size)||10,e=i.isNumber(t)?t:Math.max(t[0],t[1]);p=g.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},f),{visible:x,x:e/2,y:e/2}),"symbol"),i.isEmpty(null==c?void 0:c.shape)||(p.states=c.shape),x&&(y=e+r)}v+=y,m+=y;const A=Object.assign(Object.assign({text:e,visible:i.isValid(e)&&!1!==u,lineHeight:null==s?void 0:s.fontSize},s),{x:m,y:0});i.isNil(A.lineHeight)&&(A.lineHeight=A.fontSize);const S=g.createOrUpdateChild("tag-text",A,"text");i.isEmpty(null==c?void 0:c.text)||(S.states=c.text);const E=M(A.text,s),L=E.width,B=E.height;v+=L;const k=null!==(t=a.size)&&void 0!==t?t:10,w=i.isNumber(k)?k:Math.max(k[0],k[1]);_+=Math.max(B,(null==a?void 0:a.visible)?w:0);const{textAlign:T,textBaseline:C}=s;(i.isValid(l)||i.isValid(d))&&(i.isValid(l)&&v<l&&(v=l),i.isValid(d)&&v>d&&(v=d,S.setAttribute("maxLineWidth",d-b[1]-b[2])));let P=0,O=0;"center"===T?(P-=v/2,p&&p.setAttribute("x",(p.attribute.x||0)-L/2),g.setAttribute("x",-y/2)):"right"===T||"end"===T?(P-=v,p&&p.setAttribute("x",(p.attribute.x||0)-L),g.setAttribute("x",-b[1]-y)):"left"!==T&&"start"!==T||g.setAttribute("x",b[3]),"middle"===C?(O-=_/2,p&&p.setAttribute("y",0)):"bottom"===C?(O-=_,p&&p.setAttribute("y",-B/2),g.setAttribute("y",-b[2])):"top"===C&&(g.setAttribute("y",b[0]),p&&p.setAttribute("y",B/2));const{visible:I}=n,H=o(n,["visible"]);if(u&&i.isBoolean(I)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},H),{visible:I&&!!e,x:P,y:O,width:v,height:_}),"rect");i.isEmpty(null==c?void 0:c.panel)||(t.states=c.panel)}}}w.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const T=new i.AABBBounds;class C extends n{constructor(t){super(i.merge({},C.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,r,l,d;const{titleStyle:h={},position:u,contentStyle:c={},panel:b={},space:g=4,minWidth:p=0,maxWidth:v=1/0,padding:_=4,maxWidthPercent:m,visible:y,state:x,dx:f=0,dy:A=0}=this.attribute;let{title:S="",content:E=""}=this.attribute;S=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(S):S,E=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(E):E;const L=i.normalizePadding(_),B=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),k=v-L[1]-L[3],M=i.isValid(S)&&!1!==y,w=Object.assign(Object.assign({text:i.isArray(S)?S:[S],visible:M},h),{x:L[3],y:L[0],maxLineWidth:k,textAlign:"left",textBaseline:"top"}),C=B.createOrUpdateChild("poptip-title",w,"wrapText");i.isEmpty(null==x?void 0:x.title)||(C.states=x.title);const P=C.AABBBounds,O=P.height(),I=P.width();let H=O+g;M||(H=0);const V=i.isValid(E)&&!1!==y,z=Object.assign(Object.assign({text:i.isArray(E)?E:[E],visible:V},c),{x:L[3],y:L[0]+H,maxLineWidth:k,textAlign:"left",textBaseline:"top"}),j=B.createOrUpdateChild("poptip-content",z,"wrapText");i.isEmpty(null==x?void 0:x.content)||(j.states=x.content);const R=j.AABBBounds,N=R.height(),D=R.width();V&&(H+=N);let $=i.max(I+L[1]+L[3],D+L[1]+L[3]);$>v?$=v:$<p&&($=p);let W=L[0]+L[2]+H;const{visible:U}=b,F=o(b,["visible"]),G=null!==(t=F.size)&&void 0!==t?t:12,Y=i.isArray(G)?[G[0]+(null!==(e=F.space)&&void 0!==e?e:0),G[1]+(null!==(s=F.space)&&void 0!==s?s:0)]:G+(null!==(a=F.space)&&void 0!==a?a:0),X=null!==(n=F.lineWidth)&&void 0!==n?n:1,q=this.stage?[null!==(r=this.stage.viewWidth)&&void 0!==r?r:this.stage.width,null!==(l=this.stage.viewHeight)&&void 0!==l?l:this.stage.height]:void 0;if(q){const t=this.AABBBounds,e=null!==(d=this.attribute.x)&&void 0!==d?d:t.x1,s=q[0]-t.x1;let a=Math.max(e,s);const n=(i.isArray(G)?G[0]:12)+3;if(a=Math.min(a-n,a*m),a<$){$=a;const t=L[1]+L[3];C.setAttribute("maxLineWidth",a-t),j.setAttribute("maxLineWidth",a-t),W=L[0]+L[2],M&&(W+=C.AABBBounds.height()+g),W+=j.AABBBounds.height()}}const Z="auto"===u;let J,K=-1/0;for(let t=0;t<this.positionList.length+1;t++){const e=Z?this.positionList[t===this.positionList.length?J:t]:u,{angle:s,offset:a,rectOffset:n}=this.getAngleAndOffset(e,$,W,i.isArray(Y)?Y:[Y,Y-X]);if(i.isBoolean(U)){const t=(i.isArray(G)?G[0]:G)/4,e=B.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},F),{visible:U&&(V||M),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:s,dx:a[0],dy:a[1],size:G,zIndex:-9}),"symbol");i.isEmpty(null==x?void 0:x.panel)||(e.states=x.panel);const n=B.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},F),{visible:U&&(V||M),x:0,y:0,width:$,height:W,zIndex:-8}),"rect");i.isEmpty(null==x?void 0:x.panel)||(n.states=x.panel)}if(B.setAttributes({x:-a[0]+f,y:-a[1]+A}),!Z||!q)break;{T.setValue(0,0,$,W).transformWithMatrix(B.globalTransMatrix);const e=T,s=(new i.Bounds).setValue(0,0,q[0],q[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>K&&(K=n,J=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]]}}}}C.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"},maxWidthPercent:.8,space:8,padding:10};var P="inversify:paramtypes",O=0;var I=function(t){this.id=O++,this.registry=t};function H(){return function(t){if(Reflect.hasOwnMetadata(P,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(P,e,t),t}}const V={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}},z={poptip:i.merge({},V)};let j=class{render(t,e,s,a,n,r,l,o,d,h,u,c,b){var g,p,v;if(1===t._showPoptip){const{visible:e,visibleCb:s}=t.attribute.poptip||{};if(!1===e||s&&!1===s(t))return;const a={};i.merge(a,C.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(a):this.poptipComponent=new C(a);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};p=e,v=n,i.merge(p,z.poptip,v),n=e,n.content=null!==(g=n.content)&&void 0!==g?g:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const l=h.stage.getLayer("_builtin_interactive");l&&l.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};j=d([H()],j);let R=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)}};R=d([H()],R);let N=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)}};N=d([H()],N);const D=new I(((t,i,s,a)=>{s(j)||(t(j).toSelf().inSingletonScope(),t(e.InteractiveSubRenderContribution).toService(j)),s(R)||(t(R).toSelf(),t(e.AutoEnablePlugins).toService(R)),s(N)||(t(N).toSelf(),t(e.AutoEnablePlugins).toService(N))}));class $ extends n{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}class W extends ${constructor(t){super(i.merge({},W.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}W.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};class U extends ${constructor(t){super(i.merge({},U.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({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})}}U.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};class F extends ${constructor(t){super(i.merge({},F.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),s),"arc")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}F.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class G extends ${constructor(t){super(i.merge({},G.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",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:n,endAngle:r}),a),"arc")}setLocation(t){const{center:e,startAngle:s=A,endAngle:a=S}=this.attribute,n=a-s,r=i.radianToDegree(i.getAngleByPoint(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}G.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};class Y extends ${constructor(t){super(i.merge({},Y.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",Object.assign({path:h},n),"path")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}Y.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const X=5,q=31,Z=32,J=new Uint32Array(Z+1),K=new Uint32Array(Z+1);K[0]=0,J[0]=~K[0];for(let t=1;t<=Z;++t)K[t]=K[t-1]<<1|1,J[t]=~K[t];function Q(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+Z)/Z));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>>>X]&1<<(a&q)},set:(e,i)=>{const a=i*t+e;s(a>>>X,1<<(a&q))},clear:(e,i)=>{const s=i*t+e;a(s>>>X,~(1<<(s&q)))},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>>>X,h=o>>>X,d===h){if(i[d]&J[l&q]&K[1+(o&q)])return!0}else{if(i[d]&J[l&q])return!0;if(i[h]&K[1+(o&q)])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>>>X,h=o>>>X,d===h)s(d,J[l&q]&K[1+(o&q)]);else for(s(d,J[l&q]),s(h,K[1+(o&q)]),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>>>X,d=l>>>X,o===d)a(o,K[r&q]|J[1+(l&q)]);else for(a(o,K[r&q]),a(d,J[1+(l&q)]),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>>>X]&1<<(a&q);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 tt(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 et(t,e,i,s=!0,a=0){let n=i;a>0&&(n={x1:i.x1-a,x2:i.x2+a,y1:i.y1-a,y2:i.y2+a}),n=tt(t,n);return!(s&&e.outOfBounds(n))&&!e.getRange(n)}function it(t,e,i,s=[],a=!0,n=0){for(let r=0;r<s.length;r++){const l=i.clone();if(l.setAttributes(s[r]),l.update(),et(t,e,tt(t,l.AABBBounds),a,n))return e.setRange(tt(t,l.AABBBounds,!0)),s[r]}return!1}function st(t,e,s,a,n,r,l){var o,d;const h=null===(o=a.overlap)||void 0===o?void 0:o.clampForce,u=null===(d=a.overlap)||void 0===d?void 0:d.overlapPadding;if("bound"===s.type||"position"===s.type){if(i.isFunction(l)){const o=((i.isFunction(s.position)?s.position(n.attribute):s.position)||function(t){if("rect"===t)return nt;return at}(a.type)).map((t=>l(n.AABBBounds,r,t,a.offset)));return it(t,e,n,o,h,u)}return!1}if("moveY"===s.type){const a=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return it(t,e,n,a,h,u)}if("moveX"===s.type){const a=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return it(t,e,n,a,h,u)}return!1}const at=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],nt=["top","inside-top","inside"];function rt(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 lt={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 ot(t,e){var i,s;return null!==(s=null===(i=lt[e])||void 0===i?void 0:i.call(lt,t))&&void 0!==s?s:{from:{},to:{}}}const dt="same-time",ht=300,ut="linear";class ct extends n{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t){super(i.merge({},ct.defaultAttributes,t)),this.name="label",this._onHover=t=>{const e=t.target;e===this._lastHover||i.isEmpty(e.states)||(e.addState(L.hover,!0),u(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(L.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(u(this,(t=>{i.isEmpty(t.states)||(t.removeState(L.hoverReverse),t.removeState(L.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void u(this,(t=>{i.isEmpty(t.states)||(t.removeState(L.selectedReverse),t.removeState(L.selected))}));i.isEmpty(e.states)||(e.addState(L.selected,!0),u(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(L.selectedReverse,!0)})),this._lastSelect=e)}}labeling(t,e,i,s){}_labelLine(t){}render(){if(this._prepare(),i.isNil(this._idToGraphic))return;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)),r=i.isFunction(a)?a(l,(t=>this._idToGraphic.get(t.id))):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=[]){const{textStyle:e={},position:s,offset:a}=this.attribute,n=[];for(let r=0;r<t.length;r++){const l=t[r],o=this._idToGraphic.get(l.id),d=Object.assign(Object.assign({fill:o.attribute.fill},e),l),h=this._createLabelText(d),u=this.getGraphicBounds(h),c=this.getGraphicBounds(o,{x:l.x,y:l.y}),b=this.labeling(u,c,i.isFunction(s)?s(l):s,a);b&&(d.x=b.x,d.y=b.y,h.setAttributes(b)),n.push(h)}return n}_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:b=!0,avoidMarks:g=[],overlapPadding:p}=r,v=this._bmpTool||Q(d.width,d.height),_=this._bitmap||v.bitmap(),m=u.some((t=>"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&_.setRange(tt(v,t.AABBBounds,!0))}))),g.length>0&&g.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&&_.setRange(tt(v,t.AABBBounds,!0))})):t.AABBBounds&&_.setRange(tt(v,t.AABBBounds,!0))}));for(let e=0;e<t.length;e++){if(!1===t[e].visible)continue;const s=t[e],a=this._idToGraphic.get(s.attribute.id);if(s.update(),!i.isRectIntersect(a.AABBBounds,{x1:0,x2:v.width,y1:0,y2:v.height},!0))continue;if(et(v,_,s.AABBBounds,b,p)){if(!m){_.setRange(tt(v,s.AABBBounds,!0)),l.push(s);continue}if(m&&(null==a?void 0:a.AABBBounds)&&this._canPlaceInside(s.AABBBounds,null==a?void 0:a.AABBBounds)){_.setRange(tt(v,s.AABBBounds,!0)),l.push(s);continue}}let n=!1;for(let i=0;i<u.length;i++)if(n=st(v,_,u[i],this.attribute,s,this.getGraphicBounds(a,t[e]),this.labeling),!1!==n){s.setAttributes({x:n.x,y:n.y}),l.push(s);break}if(!n&&b){const{dx:t=0,dy:e=0}=rt(s,v.width,v.height);if((0!==t||0!==e)&&et(v,_,{x1:s.AABBBounds.x1+t,x2:s.AABBBounds.x2+t,y1:s.AABBBounds.y1+e,y2:s.AABBBounds.y2+e},void 0,p)){s.setAttributes({x:s.attribute.x+t,y:s.attribute.y+e}),_.setRange(tt(v,s.AABBBounds,!0)),l.push(s);continue}}!n&&!c&&l.push(s)}return i.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(_),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){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){var s,a,n,r,l;const o=null!==(s=this.attribute.animation)&&void 0!==s?s:{},d=null!==(a=o.mode)&&void 0!==a?a:dt,h=null!==(n=o.duration)&&void 0!==n?n:ht,u=null!==(r=o.easing)&&void 0!==r?r:ut,c=null!==(l=o.delay)&&void 0!==l?l:0,b=new Map,g=this._graphicToText||new Map,p=[];t.forEach(((t,s)=>{var a;const n=this._labelLine(t),r=this._idToGraphic.get(t.attribute.id),l=(null==g?void 0:g.get(r))?"update":"enter";if("enter"===l){if(p.push(t),b.set(r,n?{text:t,labelLine:n}:{text:t}),r){const{from:e,to:i}=ot(t.attribute,"fadeIn");this.add(t),n&&this.add(n),r.once("animate-bind",(()=>{t.setAttributes(e);const a=this._afterRelatedGraphicAttributeUpdate(t,p,s,r,{mode:d,duration:h,easing:u,to:i,delay:c});r.on("afterAttributeUpdate",a)}))}}else if("update"===l){const s=g.get(r);g.delete(r),b.set(r,s);const n=s.text;n.animate().to(t.attribute,h,u),s.labelLine&&s.labelLine.animate().to(i.merge({},s.labelLine.attribute,{points:null===(a=t.attribute)||void 0===a?void 0:a.points}),h,u),!1!==o.increaseEffect&&n.attribute.text!==t.attribute.text&&i.isValidNumber(Number(n.attribute.text)*Number(t.attribute.text))&&n.animate().play(new e.IncreaseCount({text:n.attribute.text},{text:t.attribute.text},h,u))}})),g.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(ot(t.text.attribute,"fadeOut").to,h,u).onEnd((()=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)}))})),this._graphicToText=b}_renderWithOutAnimation(t){const e=new Map,i=this._graphicToText||new Map;t.forEach((t=>{var s;const a=this._labelLine(t),n=this._idToGraphic.get(t.attribute.id),r=(null==i?void 0:i.get(n))?"update":"enter";if("enter"===r)e.set(n,a?{text:t,labelLine:a}:{text:t}),this.add(t),a&&this.add(a);else if("update"===r){const a=i.get(n);i.delete(n),e.set(n,a),a.text.setAttributes(t.attribute),(null==a?void 0:a.labelLine)&&a.labelLine.setAttributes({points:null===(s=t.attribute)||void 0===s?void 0:s.points})}})),i.forEach((t=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)})),this._graphicToText=e}_afterRelatedGraphicAttributeUpdate(t,i,s,a,{mode:n,duration:r,easing:l,to:o,delay:d}){const h=u=>{var c;const{detail:b}=u;if(!b)return{};if(!(b&&b.type===e.AttributeUpdateType.ANIMATE_UPDATE&&b.animationState&&"wait"!==(null===(c=b.animationState.step)||void 0===c?void 0:c.type)))return{};if(b.type===e.AttributeUpdateType.ANIMATE_END)return void t.setAttributes(o);const g=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",h))};switch(n){case"after":b.animationState.end&&t.animate({onEnd:g}).wait(d).to(o,r,l);break;case"after-all":s===i.length-1&&b.animationState.end&&i.forEach((t=>{t.animate({onEnd:g}).wait(d).to(o,r,l)}));break;default:b.animationState.isFirstFrameOfStep&&t.animate({onEnd:g}).wait(d).to(o,r,l)}};return h}_smartInvert(t){var e,i,s,a;const n=this.attribute.smartInvert||{},{textType:r,contrastRatiosThreshold:l,alternativeColors:o}=n,d=null!==(e=n.fillStrategy)&&void 0!==e?e:"invertBase",h=null!==(i=n.strokeStrategy)&&void 0!==i?i:"base",u=null!==(s=n.brightColor)&&void 0!==s?s:"#ffffff",c=null!==(a=n.darkColor)&&void 0!==a?a:"#000000";if("null"!==d||"null"!==h)for(let e=0;e<t.length;e++){const i=t[e];if(!i)continue;const s=this._idToGraphic.get(i.attribute.id),a=this._canPlaceInside(i.AABBBounds,null==s?void 0:s.AABBBounds),n=s.attribute.fill,b=n,v=g(i.attribute.fill,n,r,l,o),_=p(v,u)?u:c;if(a){const t=y(d,b,v,_);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=y(h,b,v,_);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:g(i.attribute.fill,i.attribute.stroke,r,l,o)});continue}const t=y(d,b,v,_);t&&i.setAttributes({fill:t});const e=y(h,b,v,_);e&&i.setAttributes({stroke:e})}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}ct.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class bt extends ct{constructor(t){super(i.merge({},bt.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,b=0,g=0,p=0;e&&(g=Math.abs(e.x1-e.x2)/2,p=Math.abs(e.y1-e.y2)/2);const v={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":b=-1;break;case"bottom":b=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(v[i]*(Math.PI/180)),b=Math.cos(v[i]*(Math.PI/180));break;case"center":c=0,b=0}return{x:h+c*(s+g)+Math.sign(c)*(o/2),y:u+b*(s+p)+Math.sign(b)*(d/2)}}}bt.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class gt extends ct{constructor(t){super(i.merge({},gt.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,b=(e.y1+e.y2)/2,g=0,p=0;switch(i){case"top":case"inside-top":p=-.5;break;case"bottom":case"inside-bottom":p=.5;break;case"left":case"inside-left":g=-.5;break;case"right":case"inside-right":g=.5}c+=g*h,b+=p*u;let v=0,_=0;const m=i.includes("inside");i.includes("top")?_=m?1:-1:i.includes("bottom")?_=m?-1:1:i.includes("left")?v=m?1:-1:i.includes("right")&&(v=m?-1:1);return{x:c+v*s+v*o/2,y:b+_*s+_*d/2}}}gt.tag="rect-label",gt.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class pt extends ct{constructor(t){super(i.merge({},pt.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 vt(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 _t(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 mt(t){return 3===t||4===t}function yt(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)}pt.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class xt{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 ft extends ct{constructor(t){super(i.merge({},ft.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}}_layout(t=[]){const e=super._layout(t),i=e.map((t=>this.getGraphicBounds(t))),s=Object.assign(Object.assign({},this.attribute.textStyle),{text:"..."}),a=this._createLabelText(s),n=this.getGraphicBounds(a),r=n.x2-n.x1,l=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),t,i,r);for(let i=0;i<t.length;i++){const s=t[i],a=l.find((t=>t.refDatum.id===s.id)),n={visible:a.labelVisible,x:a.labelPosition.x,y:a.labelPosition.y,angle:a.angle,maxLineWidth:a.labelLimit,points:(null==a?void 0:a.pointA)&&(null==a?void 0:a.pointB)&&(null==a?void 0:a.pointC)?[a.pointA,a.pointB,a.pointC]:void 0};e[i].setAttributes(n)}return e}layoutArcLabels(t,e,i,s,a,n){var r;this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=n;const l=null!==(r=null==e?void 0:e.centerOffset)&&void 0!==r?r:0;let o=0;i.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)})),i.forEach(((t,i)=>{var n,r;const d=t.attribute,h={x:null!==(n=null==d?void 0:d.x)&&void 0!==n?n:0,y:null!==(r=null==d?void 0:d.y)&&void 0!==r?r:0},u=s[i],c=a[i],b=(d.startAngle+d.endAngle)/2,g=d.endAngle-d.startAngle,p=_t(d.endAngle-g/2),v=vt(h.x,h.y,d.outerRadius,b),_=vt(h.x,h.y,o+e.line.line1MinLength,b),m=new xt(u,v,_,p,g,b);var y;m.pointA=vt(h.x,h.y,this.computeDatumRadius(2*h.x,2*h.y,d.outerRadius,l),m.middleAngle),m.labelSize={width:c.x2-c.x1,height:c.y2-c.y1},1===(y=m.quadrant)||2===y?this._arcRight.set(m.refDatum,m):mt(m.quadrant)&&this._arcLeft.set(m.refDatum,m)}));const d=Array.from(this._arcLeft.values()),h=Array.from(this._arcRight.values()),u=[];return"inside"===t?(u.push(...this._layoutInsideLabels(h,e,i)),u.push(...this._layoutInsideLabels(d,e,i))):(u.push(...this._layoutOutsideLabels(h,e,i)),u.push(...this._layoutOutsideLabels(d,e,i))),u}_layoutInsideLabels(t,e,s){var a,n,r,l,o;const d={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},h=null!==(o=null==e?void 0:e.centerOffset)&&void 0!==o?o:0,u=this.computeLayoutOuterRadius(s[0].attribute.innerRadius,e.width,e.height),c=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),b=e,g=b.spaceWidth;return t.forEach((t=>{var s,a;const{labelSize:n,radian:r}=t,l=this.computeRadius(u,e.width,e.height,h,1),o=this.computeRadius(c,e.width,e.height,h,1),p=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(o,n.height);let v;if(r<p)v=0;else{let t;t=r>=Math.PI?l:Math.max(l,n.height/2/Math.tan(r/2)),v=o-t-g}!0!==(null==b?void 0:b.rotate)&&(v=o-g);const _=this._getFormatLabelText(t.refDatum,v);t.labelText=_;const m=Math.min(v,t.labelSize.width),y=this._computeAlign(t,e),x=o-g-("left"===y?m:"right"===y?0:m/2);t.labelPosition=vt(d.x,d.y,x,t.middleAngle),t.labelLimit=m,i.isGreater(m,0)||(t.labelVisible=!1),t.angle=null!==(a=null===(s=null==e?void 0:e.textStyle)||void 0===s?void 0:s.angle)&&void 0!==a?a: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,b=e.spaceWidth;if(t.forEach((t=>{const e=mt(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+u+b),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=mt(i.quadrant)?{x:t.x+a.width/2+u+b,y:t.y}:{x:t.x-a.width/2-u-b,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 g=2*d;return t.forEach((t=>{var s,a;t.labelVisible&&(i.isLess(t.pointB.x,u+b)||i.isGreater(t.pointB.x,g-u-b))&&(t.labelVisible=!1),t.angle=null!==(a=null===(s=null==e?void 0:e.textStyle)||void 0===s?void 0:s.angle)&&void 0!==a?a:0})),t}_computeX(t,e,s){var a,n,r,l,o,d;const h=null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,u=(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y,null!==(o=null==e?void 0:e.centerOffset)&&void 0!==o?o:0),c=2*h,b=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),g=e.line.line1MinLength,p=e.line.line2MinLength,v=null===(d=e.layout)||void 0===d?void 0:d.align,_=e.spaceWidth,{labelPosition:m,quadrant:y,pointB:x}=t;i.isValidNumber(x.x*x.y)||(t.pointC={x:NaN,y:NaN},m.x=NaN,t.labelLimit=0);const f=this.computeRadius(b,e.width,e.height,u),A=mt(y)?-1:1;let S=0;let E=(A>0?c-x.x:x.x)-p-_;"labelLine"===v&&(S=(f+g+p)*A+h,E=(A>0?c-S:S)-_);const L=this._getFormatLabelText(t.refDatum,E);t.labelText=L;let B=Math.min(E,t.labelSize.width);switch(v){case"labelLine":break;case"edge":S=A>0?c-B-_:B+_;break;default:S=x.x+A*p}B=Math.max(this._ellipsisWidth,B),t.labelLimit=B,t.pointC={x:S,y:m.y};const k=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);if("edge"===v){const t=0;m.x=(A>0?c+t:t)-A*k}else{const t=0;m.x=S+t+A*(_+k)}}_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?mt(t.quadrant)?"left":"right":mt(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:b}=this._findNeighborIndex(t,n[o]),g=t[c],p=t[b];if(-1===c&&-1!==b){const i=p.labelPosition.y;u>i?e.labelPosition.y=i-p.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,p,b)}else if(-1!==c&&-1===b){const i=g.labelPosition.y;u<i?e.labelPosition.y=i+g.labelSize.height/2+e.labelSize.height/2:this._twoWayShift(t,g,e,n[o].originIndex)}else if(-1!==c&&-1!==b){const i=g.labelPosition.y,s=p.labelPosition.y;u>s?(e.labelPosition.y=s-p.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,g,e,n[o].originIndex)):u<i?(e.labelPosition.y=i+g.labelSize.height/2+e.labelSize.height/2,this._twoWayShift(t,e,p,b)):(this._twoWayShift(t,g,e,n[o].originIndex),this._twoWayShift(t,e,p,b))}const v=Math.min(r,n[o].originIndex),_=Math.max(l,n[o].originIndex);let m;if(m=t[_].getLabelBounds().y2-d,i.isGreater(m,0)&&this._shiftY(t,_,0,-m),m=t[v].getLabelBounds().y1-0,i.isLess(m,0)&&this._shiftY(t,v,t.length-1,-m),m=t[_].getLabelBounds().y2-d,i.isGreater(m,0)){e.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(e.labelVisible=!1,this._restoreY(t)):(r=v,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,d;const h=s,u=this.computeLayoutOuterRadius(a[0].attribute.outerRadius,s.width,s.height),c=h.line.line1MinLength;if("none"===h.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const h={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},b=null!==(d=null==s?void 0:s.centerOffset)&&void 0!==d?d:0,g=this.computeRadius(u,s.width,s.height,b),{labelPosition:p,quadrant:v}=t,_=e-Math.max(g+c,a[0].attribute.outerRadius),m=Math.sqrt(e**2-Math.abs(h.y-p.y)**2)-_;i.isValidNumber(m)?t.pointB={x:h.x+m*(mt(v)?-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,o;const d={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)},h=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),u=e.line.line1MinLength,{width:c,height:b}=d,g=null!==(o=null==e?void 0:e.centerOffset)&&void 0!==o?o:0,p=this.computeRadius(h,e.width,e.height,g),v=this._computeLayoutRadius(b/2,e,s),_=Math.abs(t.center.x-c/2),m=t.center.y-b/2;let y,x,f;if(i.isNumberClose(c/2,_))y=0,x=1,f=-m;else if(i.isNumberClose(b/2,m))y=1,x=0,f=-_;else{const t=-1/(m/_);y=t,x=-1,f=m-t*_}const A=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,x,f,u+p-v,0,v);if(A.length<2)return;let S,E;A[0].x>A[1].x&&A.reverse(),A[0].x<0?i.isNumberClose(A[0].y,A[1].y)?Math.abs(t.middleAngle)<Math.PI/2?(S=0,E=A[1].y+b/2):(S=A[1].y+b/2,E=b):A[0].y<A[1].y?(S=0,E=A[1].y+b/2):(S=A[1].y+b/2,E=d.height):(S=Math.min(A[0].y,A[1].y)+b/2,E=Math.max(A[0].y,A[1].y)+b/2),t.labelYRange=[S,E]}_computeLayoutRadius(t,e,i){var s;const a=e,n=a.layoutArcGap,r=a.line.line1MinLength,l=this.computeLayoutOuterRadius(i[0].attribute.outerRadius,e.width,e.height),o=null!==(s=null==e?void 0:e.centerOffset)&&void 0!==s?s:0,d=this.computeRadius(l,e.width,e.height,o)+r,h=d-n;return Math.max((h**2+t**2)/(2*h),d)}_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();yt(e,s)?t[i].labelVisible=!1:e=s}}_labelLine(t){var i,s,a,n,r,l,o,d,h,u,c;return(null===(i=t.attribute)||void 0===i?void 0:i.points)?e.createLine({visible:null===(a=null===(s=t.attribute)||void 0===s?void 0:s.visible)||void 0===a||a,stroke:null!==(l=null===(r=null===(n=t.attribute)||void 0===n?void 0:n.line)||void 0===r?void 0:r.stroke)&&void 0!==l?l:null===(o=t.attribute)||void 0===o?void 0:o.fill,lineWidth:null!==(u=null===(h=null===(d=t.attribute)||void 0===d?void 0:d.line)||void 0===h?void 0:h.lineWidth)&&void 0!==u?u:1,points:null===(c=t.attribute)||void 0===c?void 0:c.points}):void 0}computeRadius(t,e,s,a,n){var r;return null!==(r=this.computeLayoutRadius(e||0,s||0)*t*(i.isNil(n)?1:n)+a)&&void 0!==r?r:0}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i,s){var a;const n=this.computeLayoutOuterRadius(i,t,e);return null!==(a=this.computeLayoutRadius(t||0,e||0)*n+s)&&void 0!==a?a:0}}ft.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},pickable:!1};const At={rect:gt,symbol:bt,arc:ft};class St extends n{constructor(t){super(i.merge({},St.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=Q(s,a),r=n.bitmap(),l=new Map,o=this._componentMap;for(let e=0;e<t.length;e++){const i=t[e],s=At[i.type]||ct;if(s){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 s(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()}))}}St.defaultAttributes={pickable:!1};class Et extends n{constructor(t){super(i.merge({},Et.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(Object.assign({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:b=0,refAngle:g=0,style:p,symbolType:v,size:_=12}=t;let m,y;"start"===s?(m={x:h.x+(r?c*Math.cos(r)+b*Math.cos(r-Math.PI/2):0),y:h.y+(r?c*Math.sin(r)+b*Math.sin(r-Math.PI/2):0)},y=r+Math.PI/2):(m={x:u.x+(l?c*Math.cos(l)+b*Math.cos(l-Math.PI/2):0),y:u.y+(l?c*Math.sin(l)+b*Math.sin(l-Math.PI/2):0)},y=l+Math.PI/2),n=e.createSymbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:v,size:_,angle:a?y+g:0,strokeBoundsBuffer:0}),p)),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 Lt,Bt;Et.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,(Lt=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",Lt.axisContainer="axis-container",Lt.labelContainer="axis-label-container",Lt.tickContainer="axis-tick-container",Lt.tick="axis-tick",Lt.subTick="axis-sub-tick",Lt.label="axis-label",Lt.title="axis-title",Lt.gridContainer="axis-grid-container",Lt.grid="axis-grid",Lt.gridRegion="axis-grid-region",Lt.line="axis-line",Lt.background="axis-background",Lt.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 kt={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},Mt={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}}};class wt 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(L.hover,!0),u(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(L.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(u(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(L.hoverReverse),t.removeState(L.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState(L.selected))return this._lastSelect=null,void u(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(L.selectedReverse),t.removeState(L.selected))}));e.name&&!i.isEmpty(e.states)&&(e.addState(L.selected,!0),u(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(L.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,items:l}=this.attribute,o=e.createGroup({x:0,y:0,zIndex:1});if(o.name=t.AXIS_ELEMENT_NAME.axisContainer,o.id=this._getNodeId("container"),o.setMode(this.mode),this.axisContainer=o,i.add(o),(null==r?void 0:r.visible)&&this.renderLine(o),l&&l.length&&(this.data=this._transformItems(l[0]),(null==n?void 0:n.visible)&&this.renderTicks(o),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,o.add(i),l.forEach(((t,e)=>{const s=this.renderLabels(i,t,e),a=s.getChildren();this.beforeLabelsOverlap(a,t,s,e,l.length),this.handleLabelsOverlap(a,t,s,e,l.length),this.afterLabelsOverlap(a,t,s,e,l.length)}))}(null==s?void 0:s.visible)&&this.renderTitle(o)}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(Object.assign({},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=B;else{const t=this.data[r],e=i.merge({},B,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(Object.assign({},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=B;else{const t=i.merge({},B,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,b;const g=this._getLabelAttribute(s,a,l,n),p=e.createText(g);if(p.name=t.AXIS_ELEMENT_NAME.label,p.id=this._getNodeId(`layer${n}-label-${s.id}`),i.isEmpty(null===(r=this.attribute.label)||void 0===r?void 0:r.state))p.states=B;else{const t=i.merge({},B,this.attribute.label.state);Object.keys(t).forEach((e=>{i.isFunction(t[e])&&(t[e]=t[e](s,a,l,n))})),p.states=t}o.add(p);const v=null!==(b=g.angle)&&void 0!==b?b:0;d=Math.max(d,p.AABBBounds.width()),h=Math.max(h,p.AABBBounds.height()),v&&(d=Math.abs(d*Math.cos(v)),h=Math.abs(h*Math.sin(v))),u=g.textAlign,c=g.textBaseline})),this.axisLabelLayerSize[n]={width:d,height:h,textAlign:u,textBaseline:c},o}renderTitle(e){const i=this.getTitleAttribute(),s=new w(Object.assign({},i));s.name=t.AXIS_ELEMENT_NAME.title,s.id=this._getNodeId("title"),e.add(s)}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(Mt,`${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 Object.assign({points:[l,o],anchor:d,alpha:h,beta:u},n)}_getLabelAttribute(t,e,s,a){var n,r,l,d,h,u;const c=this.attribute.label,{space:b=4,inside:g=!1,formatMethod:p}=c,v=o(c,["space","inside","formatMethod"]);let _=b,m=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)===g&&(m=(null===(l=this.attribute.tick)||void 0===l?void 0:l.length)||4),(null===(d=this.attribute.subTick)||void 0===d?void 0:d.visible)&&(null===(h=this.attribute.subTick)||void 0===h?void 0:h.inside)===g&&(m=Math.max(m,(null===(u=this.attribute.subTick)||void 0===u?void 0:u.length)||2)),_+=m;const y=this.getRelativeVector(t.point);a>0&&(0===y[1]?_+=(this.axisLabelLayerSize[a-1].height+i.get(this.attribute,"label.space",4))*a:_+=(this.axisLabelLayerSize[a-1].width+i.get(this.attribute,"label.space",4))*a);const x=this.getVerticalCoord(t.point,_,g),f=this.getVerticalVector(_,g,x),A=p?p(`${t.label}`,t,e,s,a):t.label;let{style:S}=v;S=i.isFunction(S)?i.merge({},Mt.label.style,S(t,e,s,a)):S;const E=this.getLabelAlign(f,g,S.angle);return S=i.merge(E,S),i.isFunction(S.text)&&(S.text=S.text({label:t.label,value:t.rawValue,index:t.index,layer:a})),Object.assign(Object.assign(Object.assign({},x),{text:A,lineHeight:null==S?void 0:S.fontSize}),S)}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}}const Tt={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&&Ct(i.AABBBounds,t.AABBBounds,e)?t.setAttribute("opacity",0):(i=t,1)))}};function Ct(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function Pt(t,e){for(let i,s=1,a=t.length,n=t[0].AABBBounds;s<a;n=i,++s)if(Ct(n,i=t[s].AABBBounds,e))return!0}function Ot(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function It(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 Ht(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},zt(t,e.attribute.angle)),{angle:Vt(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},jt(t,e.attribute.angle)),{angle:Vt(e.attribute.angle)}))}))}(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 Vt(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function zt(t,e=0){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"]);const a=(e=Vt(e))/(.5*Math.PI);let n;return n=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1,{textAlign:i[n],textBaseline:s[n]}}function jt(t,e=0){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"]);const a=(e=Vt(e))/(.5*Math.PI);let n;return n=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1,{textAlign:i[n],textBaseline:s[n]}}class Rt{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(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:s=1}=this.attribute,a=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 x([a[1],-1*a[0]],t*(e?1:-1)*s)}}class Nt extends wt{constructor(t,e){super(i.merge({},Nt.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(Object.assign({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({},kt,null!==(a=n.state)&&void 0!==a?a:{}),s.insertBefore(l,s.firstChild)}}renderLine(e){const{start:s,end:a,line:n}=this.attribute,r=n,{startSymbol:l,endSymbol:d,style:h,breakRange:u,breakShape:c,breakShapeStyle:b,state:g}=r,p=o(r,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),v=Object.assign({points:[s,a],startSymbol:l,endSymbol:d,lineStyle:h},p);i.isEmpty(g)||(v.state={line:i.merge({},kt,g),symbol:i.merge({},kt,g)});const _=new Et(v);_.name=t.AXIS_ELEMENT_NAME.line,_.id=this._getNodeId("line"),e.add(_)}getTitleAttribute(){var t,e,s,a,n,r,l,d;const h=this.attribute.title,{position:u="middle",space:c=4,textStyle:b={},autoRotate:g=!0,shape:p,background:v,state:_}=h,m=o(h,["position","space","textStyle","autoRotate","shape","background","state"]);let y=.5;"start"===u?y=0:"end"===u&&(y=1);const{verticalFactor:x=1}=this.attribute,A=-1*x,S=this.getTickCoord(y),E=this.getRelativeVector();let L=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);L+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===E[1]){const i=this.axisLabelsContainer.AABBBounds.height();isFinite(i)?L+=i+(e-1)*t:L=0}else{if(0===E[0]){const i=this.axisLabelsContainer.AABBBounds.width();isFinite(i)?L+=i+(e-1)*t:L=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{L+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const i=this.axisLabelLayerSize[0].textAlign,s="start"===i||"left"===i,a="center"===i,n=E[1]>0;L=1===A?n?s?L:a?L/2:t:s?t:a?L/2:L:n?s?t:a?L/2:L:s?L:a?L/2:t}}let B=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)&&(B=(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)&&(B=Math.max(B,(null===(d=this.attribute.subTick)||void 0===d?void 0:d.length)||2));const k=B+L+c,M=this.getVerticalCoord(S,k,!1),w=this.getVerticalVector(k,!1,{x:0,y:0});let T,C,{angle:P}=m;if(T="start"===u?"start":"end"===u?"end":"center",i.isNil(P)&&g){P=f(E,[1,0],!0);const{verticalFactor:t=1}=this.attribute;C=1===-1*t?"bottom":"top"}else T=this.getTextAlign(w),C=this.getTextBaseline(w,!1);const O=Object.assign(Object.assign(Object.assign({},M),m),{textStyle:Object.assign({textAlign:T,textBaseline:C},b),state:{text:i.merge({},kt,null==_?void 0:_.text),shape:i.merge({},kt,null==_?void 0:_.shape),panel:i.merge({},kt,null==_?void 0:_.background)}});return O.angle=P,p&&p.visible&&(O.shape=Object.assign({visible:!0},p.style),p.space&&(O.space=p.space)),v&&v.visible&&(O.panel=Object.assign({visible:!0},v.style)),O}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}getLabelAlign(t,e,s){const a=this.attribute.orient;if(i.isValidNumber(s)){if("top"===a||"bottom"===a)return zt(a,s);if("left"===a||"right"===a)return jt(a,s)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,s,a,n){const{flush:r=!1}=this.attribute.label||{};if(r){const{orient:e,start:s,end:a}=this.attribute,n="bottom"===e||"top"===e,r=t[0],l=i.last(t),o=n?r.attribute.x>l.attribute.x:r.attribute.y<l.attribute.y;if(n){const t=Math.abs(s.x-a.x);if(o){const e=t,i=0,s=r.AABBBounds.x2,a=l.AABBBounds.x1;s>e&&r.setAttributes({x:e,textAlign:"right"}),a<i&&l.setAttributes({x:i,textAlign:"left"})}else{const e=0,i=t,s=r.AABBBounds.x1,a=l.AABBBounds.x2;s<e&&r.setAttributes({x:e,textAlign:"left"}),a>i&&l.setAttributes({x:i,textAlign:"right"})}}else{const t=Math.abs(s.y-a.y);if(o){const e=r.AABBBounds.y1,i=l.AABBBounds.y2,s=0,a=t;e<s&&r.setAttributes({y:s,textBaseline:"top"}),i>a&&l.setAttributes({y:a,textBaseline:"bottom"})}else{const e=t,i=0,s=r.AABBBounds.y2,a=l.AABBBounds.y1;s>e&&r.setAttributes({y:e,textBaseline:"bottom"}),a<i&&l.setAttributes({y:i,textBaseline:"top"})}}}}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:b,limitEllipsis:g,autoHide:p,autoHideMethod:v,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)})),Ht(s,t),!It(t))break}}(t,{labelRotateAngle:c,orient:o}),b&&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:g,orient:o}),p&&function(t,e){if(i.isEmpty(t))return;const s=t.filter(Ot);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:Tt[n]||Tt.parity;if(a.length>=3&&Pt(a,r)){do{a=l(a,r)}while(a.length>=3&&Pt(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:v,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:b}=this.attribute;if(i.isValidNumber(b)&&(!i.isValidNumber(o)||b<=o)){const i=this._getAxisLabelLimitLength(b,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,b=0;const g=(null==o?void 0:o.visible)?null!==(a=o.style.lineWidth)&&void 0!==a?a:1:0,p=(null==d?void 0:d.visible)?null!==(n=d.length)&&void 0!==n?n:4:0;if(null==l?void 0:l.visible){c=M(l.text,l.textStyle).height;const t=i.normalizePadding(l.padding);b=l.space+t[0]+t[2]}return u&&(u=(u-h-b-c-g-p)/e),u}}Nt.defaultAttributes=Mt,i.mixin(Nt,Rt);class Dt{isInValidValue(t){const{startAngle:e=A,endAngle:i=S}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=A,endAngle:s=S,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 x(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)]}}class $t extends wt{constructor(t){super(i.merge({},$t.defaultAttributes,t))}renderLine(s){const{startAngle:a=A,endAngle:n=S,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 b=Object.assign(Object.assign(Object.assign({},l),{startAngle:a,endAngle:n,radius:u,innerRadius:c}),null==d?void 0:d.style),g=e.createCircle(b);g.name=t.AXIS_ELEMENT_NAME.line,g.id=this._getNodeId("line"),i.isEmpty(null==d?void 0:d.state)||(g.states=i.merge({},kt,d.state)),s.add(g)}getTitleAttribute(){var t,e,s,a,n,r,l,d;const{center:h,radius:u,innerRadius:c=0}=this.attribute,b=this.attribute.title,{space:g=4,textStyle:p={},shape:v,background:_,state:m}=b,y=o(b,["space","textStyle","shape","background","state"]);let x=h,f=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)&&(f=i.get(this.attribute.label,"style.fontSize",12)+i.get(this.attribute.label,"space",4));let A=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)&&(A=(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)&&(A=Math.max(A,(null===(d=this.attribute.subTick)||void 0===d?void 0:d.length)||2));const S=u+A+f+g;let E="middle",{position:L}=this.attribute.title;i.isNil(L)&&(L=0===c?"end":"middle"),"start"===L?(E="bottom",x={x:h.x,y:h.y-S}):"end"===L&&(E="top",x={x:h.x,y:h.y+S});const B=Object.assign(Object.assign(Object.assign({},x),y),{textStyle:Object.assign({textBaseline:E,textAlign:"center"},p),state:{text:i.merge({},kt,null==m?void 0:m.text),shape:i.merge({},kt,null==m?void 0:m.shape),panel:i.merge({},kt,null==m?void 0:m.background)}}),{angle:k}=y;return B.angle=k,v&&v.visible&&(B.shape=Object.assign({visible:!0},v.style),v.space&&(B.space=v.space)),_&&_.visible&&(B.panel=Object.assign({visible:!0},_.style)),B}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}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){}getLabelAlign(t,e,i){return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t)}}}$t.defaultAttributes=Mt,i.mixin($t,Dt);class Wt 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 u(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(e),this._newElementAttrMap={},u(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:Object.assign(Object.assign({},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,l,o,d,h;const{node:u,attrs:c,state:b}=this._newElementAttrMap[s];"enter"===b&&(t=i.isValidNumber(null===(n=null===(a=this.params)||void 0===a?void 0:a.enter)||void 0===n?void 0:n.duration)?null===(r=this.params)||void 0===r?void 0:r.enter.duration:t,e=(null===(o=null===(l=this.params)||void 0===l?void 0:l.enter)||void 0===o?void 0:o.easing)?null===(h=null===(d=this.params)||void 0===d?void 0:d.enter)||void 0===h?void 0:h.easing:e),"path"===u.type?u.animate({interpolate:(t,e,s,a,n)=>"path"===t&&(n.path=i.interpolateString(s,a)(e),!0)}).to(c,t,e):u.animate().to(c,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 Ft 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}})}}function Gt(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 Yt(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 Xt(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=Gt(t,!!n),o=Gt(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=Yt(e,t,!1,!!n),o=Yt(e,r,!0,!!n)}else"line"!==a&&"polygon"!==a||(l=Gt(t,!!n),o=Gt(r,!!n));return n?l+=o:(o="L"+o.substring(1),l+=o,l+="Z"),l}class qt extends n{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=e.createGroup({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:i}=this.attribute;t&&t.length&&!1!==i&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){const s=this.getVerticalVector(e,i,t);return{x:t.x+s[0],y:t.y+s[1]}}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(s,a){const n=i.merge({},this.attribute,this.getGridAttribute(s)),{type:r,items:l,style:o,closed:d,alternateColor:h,depth:u=0}=n,c=s?`${t.AXIS_ELEMENT_NAME.grid}-sub`:`${t.AXIS_ELEMENT_NAME.grid}`;if(l.forEach(((t,s)=>{const{id:n,points:l}=t;let h="";if("line"===r||"polygon"===r)h=Gt(l,!!d);else if("circle"===r){const{center:t}=this.attribute;h=Yt(t,l,!1,!!d)}const b=e.createPath(Object.assign({path:h,z:u},i.isFunction(o)?i.merge({},qt.defaultAttributes.style,o(t,s)):o));b.name=`${c}-line`,b.id=this._getNodeId(`${c}-path-${n}`),a.add(b)})),u&&"line"===r&&l.forEach(((t,s)=>{const{id:n,points:r}=t,l=[];l.push(r[0]);const h=r[1].x-r[0].x,b=r[1].y-r[0].y,g=Math.sqrt(h*h+b*b),p=u/g;l.push({x:r[0].x+h*p,y:r[0].y+b*p});const v=Gt(l,!!d),_=i.abs(l[0].x-l[1].x),m=i.abs(l[0].y-l[1].y),y=e.createPath(Object.assign({path:v,z:0,alpha:_>m?(r[1].x-r[0].x>0?-1:1)*i.pi/2:0,beta:_<m?-i.pi/2:0,anchor3d:_>m?[l[0].x,0]:[0,l[0].y]},i.isFunction(o)?i.merge({},qt.defaultAttributes.style,o(t,s)):o));y.name=`${c}-line`,y.id=this._getNodeId(`${c}-path-${n}`),a.add(y)})),l.length>1&&h){const t=i.isArray(h)?h:[h,"transparent"],s=e=>t[e%t.length];for(let t=0;t<l.length-1;t++){const[i,r]=[l[t].points,l[t+1].points],o=Xt(i,r,n),d=e.createPath({path:o,fill:s(t)});d.name=`${c}-region`,d.id=this._getNodeId(`${c}-region-${t}`),a.add(d)}}}_getNodeId(t){return`${this.id}-${t}`}}qt.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};class Zt extends qt{constructor(t,e){super(i.merge({},qt.defaultAttributes,t),e),"3d"===e&&this.setMode(e)}_getGridPoint(t,e){let s;if("line"===t){const{length:t}=this.attribute;s=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:a=6,startAngle:n=A,endAngle:r=S}=this.attribute;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;let a=1;let n;this.data.length>=2&&(a=this.data[1].value-this.data[0].value);let r=[];if(t){n=i.merge({},this.attribute,this.attribute.subGrid);const t=[],{count:l=4}=this.attribute.subGrid||{};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}}else{n=this.attribute;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}return Object.assign(Object.assign({},n),{items:r})}}i.mixin(Zt,Rt);class Jt extends qt{constructor(t){super(i.merge({},qt.defaultAttributes,t))}getGridAttribute(t){let e,s=[];const a=this.attribute,{radius:n,innerRadius:r=0,startAngle:l=A,endAngle:d=S,center:h,subGrid:u}=a,c=o(a,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:b=!0}=c||{},g=n-r;let p=1;if(this.data.length>=2&&(p=this.data[1].value-this.data[0].value),t){e=i.merge({},c,u);const t=[],{count:a=4}=u||{},n=this.data.length;if(n>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!b){const e=t.value-p/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),g,!0)],datum:{}});for(let e=0;e<a;e++){const r=(e+1)/(a+1),l=(1-r)*s.value+r*(n?n.value:b?1:s.value+p),o=this.getTickCoord(l),d=this.getVerticalCoord(o,g,!0);t.push({id:`sub-${i}-${e+1}`,points:[o,d],datum:{}})}}Math.abs(d-l)%(2*Math.PI)==0&&t.push(t[0]),s=t}}else{e=c;const t=[];let i;i=Math.abs(d-l)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,i.forEach((e=>{let{point:i}=e;if(!b){const t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,g,!0);t.push({id:e.id,points:[i,s],datum:e})})),s=t}return Object.assign(Object.assign({},e),{items:s,center:h,type:"line"})}}var Kt;i.mixin(Jt,Dt),function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(Kt||(Kt={}));class Qt extends n{constructor(t){super(i.merge({},Qt.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=Kt.startHandler,this._activeItem=this._startHandler):"end"===e?(this._activeTag=Kt.endHandler,this._activeItem=this._endHandler):"middleRect"===e?(this._activeTag=Kt.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=Kt.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=Kt.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===Kt.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===Kt.startHandler?this.state.start+l>this.state.end?(this.state.start=this.state.end,this.state.end=this.state.start+l,this._activeTag=Kt.endHandler):this.state.start=this.state.start+l:this._activeTag===Kt.endHandler&&(this.state.end+l<this.state.start?(this.state.end=this.state.start,this.state.start=this.state.end+l,this._activeTag=Kt.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:b}=this.attribute,{width:g,height:p}=a;e&&(this.state.start=e),s&&(this.state.end=s),this._isHorizontal="top"===n||"bottom"===n,this._layoutCache.max=this._isHorizontal?g:p,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(b)&&(this._updateStateCallback=b)}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===Kt.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",Object.assign({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===Kt.background&&Math.abs(this.dragMaskSize())||0,height:a},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({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===Kt.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}renderText(){const{startTextStyle:t,endTextStyle:e}=this.attribute,{formatMethod:s}=t,a=o(t,["formatMethod"]),{formatMethod:n}=e,r=o(e,["formatMethod"]),{start:l,end:d}=this.state;this._startValue=this._statePointToData(l),this._endValue=this._statePointToData(d);const{position:h,width:u,height:c}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:h.x+l*u,y:h.y+c/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${h}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:h.x+d*u,y:h.y+c/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${h}`)):(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:h.x+u/2,y:h.y+l*c,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${h}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:h.x+u/2,y:h.y+d*c,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${h}`))}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 b,g,p;(null==l?void 0:l.visible)?this._isHorizontal?(b=h,g=u-c,p={x:a.x,y:a.y+c}):(b=h-c,g=u,p={x:a.x+("left"===r?c:0),y:a.y}):(b=h,g=u,p=a);const v=null!==(i=null==o?void 0:o.size)&&void 0!==i?i:this._isHorizontal?g:b,_=null!==(s=null==d?void 0:d.size)&&void 0!==s?s:this._isHorizontal?g:b;return(null==o?void 0:o.visible)&&(this._isHorizontal?(b-=(v+_)/2,p={x:p.x+v/2,y:p.y}):(g-=(v+_)/2,p={x:p.x,y:p.y+v})),this._layoutAttrFromConfig={position:p,width:b,height:g},this._layoutAttrFromConfig}render(){var t,e,i,s,a,n,r,l,o,d,h,u,c,b,g,p,v,_,m,y,x;this._layoutAttrFromConfig=null;const{orient:f,backgroundStyle:A,backgroundChartStyle:S,selectedBackgroundStyle:E,selectedBackgroundChartStyle:L,middleHandlerStyle:B,startHandlerStyle:k,endHandlerStyle:M,brushSelect:w}=this.attribute,{start:T,end:C}=this.state,{position:P,width:O,height:I}=this.getLayoutAttrFromConfig(),H=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=H,this._background=H.createOrUpdateChild("background",Object.assign({x:P.x,y:P.y,width:O,height:I,cursor:w?"crosshair":"auto"},A),"rect"),(null===(t=null==S?void 0:S.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",H),(null===(e=null==S?void 0:S.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",H),w&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=H.createOrUpdateChild("selectedBackground",Object.assign({x:P.x+T*O,y:P.y,width:(C-T)*O,height:I,cursor:w?"crosshair":"move"},E),"rect"):this._selectedBackground=H.createOrUpdateChild("selectedBackground",Object.assign({x:P.x,y:P.y+T*I,width:O,height:(C-T)*I,cursor:w?"crosshair":"move"},E),"rect"),(null===(i=null==L?void 0:L.line)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("line",H),(null===(s=null==L?void 0:L.area)||void 0===s?void 0:s.visible)&&this.setSelectedPreviewAttributes("area",H),this.renderText(),this._isHorizontal?(this._startHandler=H.createOrUpdateChild("startHandler",Object.assign({x:P.x+T*O,y:P.y+I/2,size:I,angle:0,symbolType:null!==(a=null==k?void 0:k.symbolType)&&void 0!==a?a:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},k),"symbol"),this._endHandler=H.createOrUpdateChild("endHandler",Object.assign({x:P.x+C*O,y:P.y+I/2,size:I,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==B?void 0:B.visible)&&(this._middleHandlerRect=H.createOrUpdateChild("middleHandlerRect",Object.assign({x:P.x+T*O,y:P.y-((null===(r=null==B?void 0:B.background)||void 0===r?void 0:r.size)||10),width:(C-T)*O,height:(null===(l=null==B?void 0:B.background)||void 0===l?void 0:l.size)||10},null===(o=null==B?void 0:B.background)||void 0===o?void 0:o.style),"rect"),this._middleHandlerSymbol=H.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:P.x+(T+C)/2*O,y:P.y-((null===(d=null==B?void 0:B.background)||void 0===d?void 0:d.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(u=null===(h=null==B?void 0:B.icon)||void 0===h?void 0:h.symbolType)&&void 0!==u?u:"square"},null==B?void 0:B.icon),"symbol"))):(this._startHandler=H.createOrUpdateChild("startHandler",Object.assign({x:P.x+O/2,y:P.y+T*I,size:O,angle:Math.PI/180*90,symbolType:null!==(c=null==k?void 0:k.symbolType)&&void 0!==c?c:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},k),"symbol"),(null==B?void 0:B.visible)&&(this._middleHandlerRect=H.createOrUpdateChild("middleHandlerRect",Object.assign({x:"left"===f?P.x-((null===(b=null==B?void 0:B.background)||void 0===b?void 0:b.size)||10):P.x+O,y:P.y+T*I,width:(null===(g=null==B?void 0:B.background)||void 0===g?void 0:g.size)||10,height:(C-T)*I},null===(p=null==B?void 0:B.background)||void 0===p?void 0:p.style),"rect"),this._middleHandlerSymbol=H.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:"left"===f?P.x-((null===(v=null==B?void 0:B.background)||void 0===v?void 0:v.size)||10)/2:P.x+O+((null===(_=null==B?void 0:B.background)||void 0===_?void 0:_.size)||10)/2,y:P.y+(T+C)/2*I,angle:Math.PI/180*90,symbolType:null!==(y=null===(m=null==B?void 0:B.icon)||void 0===m?void 0:m.symbolType)&&void 0!==y?y:"square",strokeBoundsBuffer:0},null==B?void 0:B.icon),"symbol")),this._endHandler=H.createOrUpdateChild("endHandler",Object.assign({x:P.x+O/2,y:P.y+C*I,size:O,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(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({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(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({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 w(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 te,ee,ie;Qt.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,(te=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",te.middle="middle",te.end="end",te.insideStartTop="insideStartTop",te.insideStartBottom="insideStartBottom",te.insideMiddleTop="insideMiddleTop",te.insideMiddleBottom="insideMiddleBottom",te.insideEndTop="insideEndTop",te.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(ee=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",ee.right="right",ee.top="top",ee.bottom="bottom",ee.middle="middle",ee.insideLeft="insideLeft",ee.insideRight="insideRight",ee.insideTop="insideTop",ee.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(ie=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",ie.bottom="bottom",ie.middle="middle",ie.insideTop="insideTop",ie.insideBottom="insideBottom",ie.insideMiddle="insideMiddle";class se extends n{_initContainer(){var t,s,a,n,r,l,o,d,h;const u=e.createGroup(Object.assign(Object.assign({},null===(t=this.attribute)||void 0===t?void 0:t.clipRange),{clip:null!==(a=i.isValid(null===(s=this.attribute)||void 0===s?void 0:s.clipRange))&&void 0!==a&&a}));u.name="marker-container";const c=e.createGroup({x:-(null!==(l=null===(r=null===(n=this.attribute)||void 0===n?void 0:n.clipRange)||void 0===r?void 0:r.x)&&void 0!==l?l:0),y:-(null!==(h=null===(d=null===(o=this.attribute)||void 0===o?void 0:o.clipRange)||void 0===d?void 0:d.y)&&void 0!==h?h:0)});u.add(c),this._containerClip=u,this.add(u),this._container=c}_updateContainer(){var t,e,s,a,n,r,l,o,d;this._containerClip.setAttributes(Object.assign(Object.assign({},null===(t=this.attribute)||void 0===t?void 0:t.clipRange),{clip:null!==(s=i.isValid(null===(e=this.attribute)||void 0===e?void 0:e.clipRange))&&void 0!==s&&s})),this._container.setAttributes({x:-(null!==(r=null===(n=null===(a=this.attribute)||void 0===a?void 0:a.clipRange)||void 0===n?void 0:n.x)&&void 0!==r?r:0),y:-(null!==(d=null===(o=null===(l=this.attribute)||void 0===l?void 0:l.clipRange)||void 0===o?void 0:o.y)&&void 0!==d?d:0)})}render(){var t,e;const i=null===(t=this.attribute.visible)||void 0===t||t;null!==(e=this.attribute.interactive)&&void 0!==e&&e||(this.setAttribute("pickable",!1),this.setAttribute("childrenPickable",!1)),i&&(this._containerClip?(this._updateContainer(),this.updateMarker()):(this._initContainer(),this.initMarker(this._container)))}}const ae={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]}},ne={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"}},re={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}},le={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"}},oe={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 de extends se{constructor(t){super(i.merge({},de.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:Object.assign(Object.assign({},ne[l]),r.textStyle)})}initMarker(t){const{points:e,startSymbol:i,endSymbol:s,label:a,lineStyle:n}=this.attribute,r=new Et({points:e,startSymbol:i,endSymbol:s,lineStyle:n});r.name="mark-line-line",this._line=r,t.add(r);const l=new w(Object.assign({},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(Object.assign({},n)),this.setLabelPos()}}de.defaultAttributes=ae;class he extends se{constructor(t){super(i.merge({},he.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(Object.assign({},this.getLeftPos())):o.includes("right")||o.includes("Right")?null===(i=this._label)||void 0===i||i.setAttributes(Object.assign({},this.getRightPos())):o.includes("top")||o.includes("Top")?null===(s=this._label)||void 0===s||s.setAttributes(Object.assign({},this.getTopPos())):o.includes("bottom")||o.includes("Bottom")?null===(a=this._label)||void 0===a||a.setAttributes(Object.assign({},this.getBottomPos())):null===(n=this._label)||void 0===n||n.setAttributes(Object.assign({},this.getMiddlePos())),null===(r=this._label)||void 0===r||r.setAttributes({textStyle:Object.assign(Object.assign({},le[o]),l.textStyle)})}initMarker(t){const{points:i,label:s,areaStyle:a}=this.attribute,n=e.createPolygon(Object.assign({points:i},a));n.name="mark-area-area",this._area=n,t.add(n);const r=new w(Object.assign({},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(Object.assign({points:i},a)),null===(e=this._label)||void 0===e||e.setAttributes(Object.assign({},s)),this.setLabelPos()}}he.defaultAttributes=re;class ue extends se{constructor(t){super(i.merge({},ue.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:b=t.IMarkPointItemPosition.middle}=i,g=(null===(n=this._line)||void 0===n?void 0:n.getEndAngle())||0,p=l*Math.cos(g)+o*Math.cos(g-Math.PI/2),v=l*Math.sin(g)+o*Math.sin(g-Math.PI/2);"text"===a?null==e||e.setAttributes(Object.assign(Object.assign({},h),{textStyle:Object.assign(Object.assign({},oe[(null==i?void 0:i.position)||"end"]),null==h?void 0:h.textStyle)})):"richText"===a?null==e||e.setAttributes({dx:this.getItemDx(e,b,u)+((null==u?void 0:u.dx)||0),dy:this.getItemDy(e,b,u)+((null==u?void 0:u.dy)||0)}):"image"===a&&(null==e||e.setAttributes({dx:this.getItemDx(e,b,c)+((null==c?void 0:c.dx)||0),dy:this.getItemDy(e,b,c)+((null==c?void 0:c.dy)||0)})),null==e||e.setAttributes({x:s.x+(p||0),y:s.y+(v||0),angle:r&&g+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(Object.assign(Object.assign({},i),a)):"text"===s?o=new w(Object.assign({},i)):"richText"===s?o=e.createRichText(Object.assign(Object.assign({},i),n)):"image"===s?o=e.createImage(Object.assign(Object.assign({},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(Object.assign(Object.assign({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 Et({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)}}ue.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 ce={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};class be extends n{getCurrent(){return this._current}constructor(t){super(i.merge({},be.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=ce,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||{},b=c.size||15,g=null!==(t=a.space)&&void 0!==t?t:8,p=a.state||{};let{preShape:v,nextShape:_}=a;v||(v=h?"triangleLeft":"triangleUp"),_||(_=h?"triangleRight":"triangleDown");const m=e.createSymbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:0,y:0,symbolType:v,size:b}));m.states=p,m.name="preHandler",this.preHandler=m,u.add(m);const{width:y,height:x}=M(`${n}/${n}`,Object.assign({textAlign:"center",textBaseline:"middle"},l)),f=i.isNumber(b)?b:b[0],A=i.isNumber(b)?b:b[1],S=e.createText(Object.assign({x:h?f/2+g+y/2:0,y:h?0:A/2+g+x/2,text:`${r}/${n}`,textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize},l));this.text=S,u.add(S);const E=e.createSymbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:h?f+2*g+y:0,y:h?0:A+2*g+x,symbolType:_,size:b}));E.name="nextHandler",E.states=p,this.nextHandler=E,u.add(E),1===this._total?(m.addState("disable"),E.addState("disable")):1===this._current?m.addState("disable"):this._current===n&&E.addState("disable");const L=u.AABBBounds,B=L.width(),k=L.height();u.translateTo(0-L.x1+d[3],0-L.y1+d[0]),this.add(u),this.attribute.width=B+d[1]+d[3],this.attribute.height=k+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}}be.defaultAttributes={handler:ce,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const ge=16,pe=8,ve=12,_e=12;var me,ye,xe;t.LegendStateValue=void 0,(me=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",me.unSelected="unSelected",me.selectedHover="selectedHover",me.unSelectedHover="unSelectedHover",me.focus="focus",t.LegendEvent=void 0,(ye=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",ye.legendItemUnHover="legendItemUnHover",ye.legendItemClick="legendItemClick",ye.legendItemAttributeUpdate="legendItemAttributeUpdate",t.LEGEND_ELEMENT_NAME=void 0,(xe=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",xe.title="legendTitle",xe.item="legendItem",xe.itemShape="legendItemShape",xe.itemLabel="legendItemLabel",xe.itemValue="legendItemValue",xe.focus="legendItemFocus";class fe 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=Object.assign({visible:!0},d.style),i.isValid(d.space)&&(h.space=d.space)),r&&r.visible&&(h.panel=Object.assign({visible:!0},r.style));const u=new w(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 Ae={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};class Se extends fe{constructor(e){super(i.merge({},Se.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;let i=!1;(e.hasState(t.LegendStateValue.unSelectedHover)||e.hasState(t.LegendStateValue.selectedHover))&&(i=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{i||!e.hasState(t.LegendStateValue.unSelectedHover)&&!e.hasState(t.LegendStateValue.selectedHover)||(i=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const a=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);a&&a.setAttribute("visible",!1),i&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e),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:b}=this.attribute,g="horizontal"===d,{spaceCol:p=ge,spaceRow:v=pe,maxWidth:_,width:m,height:y}=t;i.isValid(_)?i.isValid(m)?this._itemWidthByUser=Math.min(_,m):this._itemWidthByUser=_:i.isValid(m)&&(this._itemWidthByUser=m),i.isValid(y)&&(this._itemHeightByUser=y);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),g?(E=r,i.isValid(h)&&(a>=h?(x=!0,e>0&&(A=0,S+=d+v,L+=1)):h<A+a&&(x=!0,A=0,S+=d+v,L+=1)),e>0&&s.setAttributes({x:A,y:S}),A+=p+a):(E=n,i.isValid(u)&&u<S+d&&(x=!0,S=0,A+=f+p,f=0,L+=1),e>0&&s.setAttributes({x:A,y:S}),S+=v+d),o.add(s)}));let B=!1;x&&b&&L>E&&(B=this._renderPager(g)),B||(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:b={}}=this.attribute.item;let{shape:g={},label:p={},value:v={},background:_={}}=this.attribute.item;g=this._handleStyle(g,s,a,n,r),p=this._handleStyle(p,s,a,n,r),v=this._handleStyle(v,s,a,n,r),_=this._handleStyle(_,s,a,n,r);const m=i.normalizePadding(u);let y;!1===_.visible?(y=e.createGroup({x:0,y:0,cursor:(null==_?void 0:_.style).cursor}),this._appendDataToShape(y,t.LEGEND_ELEMENT_NAME.item,s,y)):(y=e.createGroup(Object.assign({x:0,y:0},null==_?void 0:_.style)),this._appendDataToShape(y,t.LEGEND_ELEMENT_NAME.item,s,y,null==_?void 0:_.state)),y.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const x=e.createGroup({x:0,y:0,pickable:!1});y.add(x);let f=0;const A=i.get(g,"style.size",10),S=i.get(g,"space",8),E=e.createSymbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),g.style));let L;Object.keys(g.state||{}).forEach((t=>{const e=g.state[t].fill||g.state[t].stroke;h.fill&&i.isNil(g.state[t].fill)&&e&&(g.state[t].fill=e),h.stroke&&i.isNil(g.state[t].stroke)&&e&&(g.state[t].stroke=e)})),this._appendDataToShape(E,t.LEGEND_ELEMENT_NAME.itemShape,s,y,null==g?void 0:g.state),E.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(E);let B=0;if(c){const a=i.get(b,"size",10);L=e.createSymbol(Object.assign(Object.assign({x:0,y:-a/2-1,strokeBoundsBuffer:0},b),{visible:!1,pickMode:"imprecise",boundsPadding:m})),this._appendDataToShape(L,t.LEGEND_ELEMENT_NAME.focus,s,y),B=a}const k=e.createText(Object.assign(Object.assign({x:A/2+S,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==p?void 0:p.style).fontSize},null==p?void 0:p.style),{text:p.formatMethod?p.formatMethod(o,s,n):o}));this._appendDataToShape(k,t.LEGEND_ELEMENT_NAME.itemLabel,s,y,null==p?void 0:p.state),k.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(k);const M=i.get(p,"space",8);if(f+=A/2+S+k.AABBBounds.width()+M,i.isValid(d)){const r=i.get(v,"space",c?8:0),l=e.createText(Object.assign(Object.assign({x:f+M,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(d,s,n):d}));if(this._appendDataToShape(l,t.LEGEND_ELEMENT_NAME.itemValue,s,y,null==v?void 0:v.state),l.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-m[1]-m[3]-A-S-M-B-r,e=l.AABBBounds,i=k.AABBBounds,s=e.width(),a=i.width();a>t?(t-s)/a>.4?k.setAttribute("maxLineWidth",t-s):(l.setAttribute("maxLineWidth",.5*t),k.setAttribute("maxLineWidth",.5*t)):l.setAttribute("maxLineWidth",t-a),v.alignRight&&l.setAttributes({textAlign:"right",x:this._itemWidthByUser-A/2-m[1]-m[3]-B-r})}f=l.AABBBounds.x2+r,x.add(l)}else this._itemWidthByUser&&k.setAttribute("maxLineWidth",this._itemWidthByUser-m[1]-m[3]-A-S-B);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+m[1]+m[3],O=this._itemHeightByUser||C+m[0]+m[2];return y.attribute.width=P,y.attribute.height=O,x.translateTo(-w.x1+m[3],-w.y1+m[0]),y}_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:d={},pager:h={}}=this.attribute,{spaceCol:u=ge,spaceRow:c=pe}=d,b=this._itemsContainer,{animation:g=!0,animationDuration:p=450,animationEasing:v="quadIn",space:_=_e}=h,m=o(h,["animation","animationDuration","animationEasing","space"]);let y,x=0,f=0,A=0,S=0,E=1;if(t){if(y=new be(Object.assign({layout:1===l?"horizontal":"vertical",total:99},i.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},m))),this._pager=y,this._innerView.add(y),x=(l-1)*c+this._itemHeight*l,f=a-y.AABBBounds.width()-_,f<=0)return this._innerView.removeChild(y),!1;b.getChildren().forEach(((t,e)=>{const{width:i,height:s}=t.attribute;f<A+i&&(A=0,S+=s+c,E+=1),e>0&&t.setAttributes({x:A,y:S}),A+=u+i})),y.setAttributes({total:Math.ceil(E/l),x:f,y:s+x/2-y.AABBBounds.height()/2})}else{if(y=new be(Object.assign({layout:"horizontal",total:99},m)),this._pager=y,this._innerView.add(y),f=this._itemMaxWidth*r+(r-1)*u,x=n-y.AABBBounds.height()-_-s,x<=0)return this._innerView.removeChild(y),!1;b.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;x<S+i&&(S=0,A+=this._itemMaxWidth+u,E+=1),e>0&&t.setAttributes({x:A,y:S}),S+=c+i})),y.setAttributes({total:Math.ceil(E/r),x:(f-y.AABBBounds.width())/2,y:n-y.AABBBounds.height()})}h.defaultCurrent>1&&(t?b.setAttribute("y",-(h.defaultCurrent-1)*(x+c)):b.setAttribute("x",-(h.defaultCurrent-1)*(f+u)));const L=e.createGroup({x:0,y:s,width:f,height:x,clip:!0,pickable:!1});L.add(b),this._innerView.add(L);const B=e=>{const{current:i}=e.detail;g?b.animate().to(t?{y:-(i-1)*(x+c)}:{x:-(i-1)*(f+u)},p,v):t?b.setAttribute("y",-(i-1)*(x+c)):b.setAttribute("x",-(i-1)*(f+u))};return this._pager.addEventListener("toPrev",B),this._pager.addEventListener("toNext",B),!0}_setLegendItemState(e,i,s=!0){let a=!1;e.hasState(i)||(a=!0),e.addState(i,s),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&(a||e.hasState(i)||(a=!0),e.addState(i,s))})),a&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e)}_removeLegendItemState(e,i){let s=!1;i.forEach((t=>{!s&&e.hasState(t)&&(s=!0),e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{!s&&e.hasState(t)&&(s=!0),e.removeState(t)}))})),s&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e)}_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({},Ae,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 Ee;function Le(t){return i.isArray(t)?t:[t,t]}function Be(t){return t?"ew-resize":"ns-resize"}Se.defaultAttributes={layout:"horizontal",title:{align:"start",space:ve,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:ge,spaceRow:pe,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:_e,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(Ee=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",Ee.railContainer="sliderRailContainer",Ee.rail="sliderRail",Ee.startText="sliderStartText",Ee.endText="sliderEndText",Ee.startHandler="sliderStartHandler",Ee.startHandlerText="startHandlerText",Ee.endHandler="sliderEndHandler",Ee.endHandlerText="sliderEndHandlerText",Ee.track="sliderTrack",Ee.trackContainer="sliderTrackContainer";class ke 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({},ke.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;if(l===r)return;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),b=c/h*(l-r)+r;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,b):this._updateHandler(this._currentHandler,c,b),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;if(n===a)return;const{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;if(n===a)return;const 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{layout:e,railWidth:s,railHeight:a,min:n,max:r}=this.attribute;if(r===n)return;const[l,o]=i.array(t),{startHandler:d,endHandler:h}=this._getHandlers(),u="vertical"===e?a:s,c=(l-n)/(r-n)*u;if(d&&this._updateHandler(d,c,l),h){const t=(o-n)/(r-n)*u;this._updateHandler(h,t,o)}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:b}=this.attribute;i.isNil(b)&&(b=[h,u]),this._currentValue={startValue:Le(b)[0],endValue:Le(b)[1]};const g="horizontal"===n;this._isHorizontal=g;const p=e.createGroup({x:0,y:0});p.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(p),this._innerView=p;let v,_=0;if(o&&o.visible){v=e.createText(Object.assign({x:g?0:r/2,y:g?l/2:0,textAlign:g?"start":"center",textBaseline:g?"middle":"top",text:o.text,lineHeight:null===(s=o.style)||void 0===s?void 0:s.fontSize},o.style)),v.name=t.SLIDER_ELEMENT_NAME.startText,p.add(v);const a=i.isValid(o.space)?o.space:0;_+=(g?v.AABBBounds.width():v.AABBBounds.height())+a}const m=e.createGroup({x:g?_:0,y:g?0:_});p.add(m);const y=e.createGroup({x:0,y:0});let x;if(y.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=y,m.add(y),this._renderRail(y),_+=g?r:l,d&&d.visible){const s=i.isValid(d.space)?d.space:0;x=e.createText(Object.assign({x:g?_+s:r/2,y:g?l/2:_+s,textAlign:g?"start":"center",textBaseline:g?"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,p.add(x)}this._renderTrack(y),c&&(this._renderHandlers(m),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(Object.assign({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 b=o&&o.visible,g=this._isHorizontal,p=g?h:d,[v,_]=Le(c),m=n===a?s?0:p:(v-a)/(n-a)*p,y=this._renderHandler(Object.assign({x:g?m:h/2,y:g?d/2:m,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":Be(g)},l));if(y.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=y,e.add(y),this._currentValue.startPos=m,b){const i=this._renderHandlerText(v,s?"start":"end");i.name=t.SLIDER_ELEMENT_NAME.startHandlerText,e.add(i),this._startHandlerText=i}if(s){const i=n===a?p:(_-a)/(n-a)*p,s=this._renderHandler(Object.assign({x:g?i:h/2,y:g?d/2:i,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":Be(g)},l));if(s.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=s,e.add(s),this._currentValue.endPos=i,b){const i=this._renderHandlerText(_,"end");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,value:c}=this.attribute;let b,g;if(i.isNil(c))a?(b=n,g=r):b=g=n;else if(a){const t=i.clampRange(c,n,r);b=t[0],g=t[1]}else b=n,g=i.clamp(c,n,r);const p=this._isHorizontal,v=p?o:l;a||(b=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 m=i.isObject(a)&&!0===a.draggableTrack;let y;y=!1===u?"default":!1===a||!1===m?"pointer":Be(p);const x=r===n?v:(g-b)/(r-n)*v,f=r===n?0:(b-n)/(r-n)*v,A=e.createRect(Object.assign({x:p?f:0,y:p?0:f,width:p?x:o,height:p?l:x,cursor:y},d));A.name=t.SLIDER_ELEMENT_NAME.track,this._track=A,_.add(A),s.add(_)}_renderHandler(t){return e.createSymbol(t)}_renderHandlerText(t,i){var s,a,n;const{align:r,min:l,max:o,handlerSize:d=14,handlerText:h={},railHeight:u,railWidth:c,slidable:b}=this.attribute,g=this._isHorizontal,p=g?c:u,v=o===l?"start"===i?0:p:(t-l)/(o-l)*p,_=null!==(s=h.space)&&void 0!==s?s:4,m=Object.assign({text:(null==h?void 0:h.formatter)?h.formatter(t):t.toFixed(null!==(a=null==h?void 0:h.precision)&&void 0!==a?a:0),lineHeight:null===(n=h.style)||void 0===n?void 0:n.lineHeight,cursor:!1===b?"default":Be(g)},h.style);g?"top"===r?(m.textBaseline="bottom",m.textAlign="center",m.x=v,m.y=(u-d)/2-_):(m.textBaseline="top",m.textAlign="center",m.x=v,m.y=(u+d)/2+_):"left"===r?(m.textBaseline="middle",m.textAlign="end",m.x=(c-d)/2-_,m.y=v):(m.textBaseline="middle",m.textAlign="start",m.x=(c+d)/2+_,m.y=v);return e.createText(m)}_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}}}ke.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 Me extends fe{constructor(t){super(i.merge({},Me.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:b,railStyle:g,trackStyle:p,startText:v,endText:_,handlerText:m,showTooltip:y,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 ke({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:b,railStyle:g,trackStyle:Object.assign({fill:this._color},p),startText:v,endText:_,handlerText:m,showTooltip:y,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",ve):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 b="horizontal"===t?i:s;if(Math.abs(d-h)!==b&&e&&e.length>1){const t=this._color.stops,e=Math.min(d,h),i=Math.max(d,h),s=e/b,a=i/b,n=a-s,u=t.filter((t=>t.offset>s&&t.offset<a)),c=Math.min(l,o),g=Math.max(l,o),p=this._colorScale.scale(c),v=this._colorScale.scale(g),_=[{offset:0,color:p}];u.forEach((t=>{_.push({offset:(t.offset-s)/n,color:t.color})})),_.push({offset:1,color:v}),r.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:_}))}}}function we(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`}Me.defaultAttributes={layout:"horizontal",title:{align:"start",space:ve,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 Te extends fe{constructor(t){super(i.merge({},Te.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:b,trackStyle:g,startText:p,endText:v,handlerText:_,showTooltip:m,tooltip:y,sizeBackground:x}=this.attribute,f=e.createGroup({x:0,y:0});this._innerView.add(f);const A=new ke({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:Object.assign({symbolType:we(a)},c),railStyle:b,trackStyle:g,startText:p,endText:v,handlerText:_,showTooltip:m,tooltip:y});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 B=e.createPath(Object.assign(Object.assign({x:0,y:E,path:S},x),{zIndex:0}));f.add(B);const k=this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",ve):0;f.translate(0-f.AABBBounds.x1,k-f.AABBBounds.y1),this._slider=A}_bindEvents(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}Te.defaultAttributes={layout:"horizontal",title:{align:"start",space:ve,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 Ce extends n{constructor(t){super(i.merge({},Ce.defaultAttributes,t)),this.name="title"}render(){var t,e,s,a,n,r,l,o,d,h,u,c,b,g,p,v,_,m,y,x,f,A,S,E,L,B,k,M,w,T,C,P,O,I,H,V,z,j,R,N,D,$,W,U,F,G,Y,X,q,Z,J,K,Q,tt,et,it,st,at,nt,rt,lt,ot;const{text:dt,textStyle:ht,subtext:ut,subtextStyle:ct,width:bt,height:gt,minWidth:pt,maxWidth:vt,minHeight:_t,maxHeight:mt,align:yt,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:bt)&&void 0!==n?n:0,height:null!==(l=null!==(r=ht.height)&&void 0!==r?r:gt)&&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",Object.assign(Object.assign({text:[dt]},ht),{maxLineWidth:null!==(h=null==ht?void 0:ht.maxLineWidth)&&void 0!==h?h:bt,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===(b=this._mainTitle)||void 0===b?void 0:b.AABBBounds.width():0;if(!1!==(null===(g=this.attribute)||void 0===g?void 0:g.visible)&&!1!==(null==ct?void 0:ct.visible))if(ct&&i.isValid(null==ct?void 0:ct.character)){const t={x:null!==(p=ct.x)&&void 0!==p?p:0,y:null!==(v=ct.y)&&void 0!==v?v:Et,width:null!==(m=null!==(_=ct.width)&&void 0!==_?_:bt)&&void 0!==m?m:0,height:null!==(x=null!==(y=ct.height)&&void 0!==y?y:gt)&&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",Object.assign(Object.assign({text:[ut]},ct),{maxLineWidth:null!==(S=null==ct?void 0:ct.maxLineWidth)&&void 0!==S?S:bt,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 Bt=this._subTitle?null===(L=this._subTitle)||void 0===L?void 0:L.AABBBounds.height():0,kt=this._subTitle?null===(B=this._subTitle)||void 0===B?void 0:B.AABBBounds.width():0;let Mt=Math.max(Lt,kt),wt=Et+(null!==(k=null==ct?void 0:ct.height)&&void 0!==k?k:Bt);if(i.isValid(bt)&&(Mt=bt,null===(M=this._mainTitle)||void 0===M||M.setAttribute("maxLineWidth",bt),null===(w=this._subTitle)||void 0===w||w.setAttribute("maxLineWidth",bt)),i.isValid(gt)&&(wt=gt),i.isValid(pt)&&Mt<pt&&(Mt=pt),i.isValid(vt)&&(null===(T=this._mainTitle)||void 0===T||T.setAttribute("maxLineWidth",vt),null===(C=this._subTitle)||void 0===C||C.setAttribute("maxLineWidth",vt),null===(P=this._mainTitle)||void 0===P||P.setAttribute("maxWidth",vt),null===(O=this._subTitle)||void 0===O||O.setAttribute("maxWidth",vt),Mt>vt&&(Mt=vt)),i.isValid(_t)&&wt<_t&&(wt=_t),i.isValid(mt)&&(null===(I=this._mainTitle)||void 0===I||I.setAttribute("maxHeight",mt),null===(H=this._subTitle)||void 0===H||H.setAttribute("maxHeight",mt-Et),wt>mt&&(wt=mt)),St.attribute.width=Mt+At[1]+At[3],St.attribute.height=wt+At[0]+At[2],i.isValid(yt)||i.isValid(null==ht?void 0:ht.align)){const t=(null==ht?void 0:ht.align)?null==ht?void 0:ht.align:yt,e=null!==(V=null==ht?void 0:ht.width)&&void 0!==V?V:Lt;"left"===t?(null===(z=this._mainTitle)||void 0===z||z.setAttribute("x",0),null===(j=this._mainTitle)||void 0===j||j.setAttribute("textAlign","left")):"center"===t?(null===(R=this._mainTitle)||void 0===R||R.setAttribute("x",e/2),null===(N=this._mainTitle)||void 0===N||N.setAttribute("textAlign","center")):"right"===t&&(null===(D=this._mainTitle)||void 0===D||D.setAttribute("x",e),null===($=this._mainTitle)||void 0===$||$.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===(U=this._mainTitle)||void 0===U||U.setAttribute("textBaseline","top")):"middle"===t?(null===(F=this._mainTitle)||void 0===F||F.setAttribute("y",e/2),null===(G=this._mainTitle)||void 0===G||G.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(Y=this._mainTitle)||void 0===Y||Y.setAttribute("y",e),null===(X=this._mainTitle)||void 0===X||X.setAttribute("textBaseline","bottom"))}if(i.isValid(yt)||i.isValid(null==ct?void 0:ct.align)){const t=(null==ct?void 0:ct.align)?null==ct?void 0:ct.align:yt,e=null!==(q=null==ct?void 0:ct.width)&&void 0!==q?q:kt;"left"===t?(null===(Z=this._subTitle)||void 0===Z||Z.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"))}}}Ce.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 Pe={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 Oe=(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`},Ie=(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 He extends n{constructor(t){super(i.merge({},He.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?Ie:Oe,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}}He.defaultAttributes={direction:"horizontal",align:"start"};class Ve extends e.Symbol{constructor(t){super(t)}}var ze,je;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(ze||(ze={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(je||(je={}));class Re extends n{constructor(t){super(i.merge({},Re.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({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"},Re.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({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"},Re.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},Re.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},Re.defaultControllerAttr),{visible:this.attribute.backward.visible}),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 Ve(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{i.isNil(this._backwardController)&&(this._backwardController=new Ve(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{i.isNil(this._forwardController)&&(this._forwardController=new Ve(Object.assign({},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(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({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(ze.OnPlay);this.dispatchEvent(t)},this.pause=()=>{const t=this._createCustomEvent(ze.OnPause);this.dispatchEvent(t)},this.forward=()=>{const t=this._createCustomEvent(ze.OnForward);this.dispatchEvent(t)},this.backward=()=>{const t=this._createCustomEvent(ze.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()}}Re.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Re.defaultAttributes={[je.Start]:{},[je.Pause]:{},[je.Backward]:{},[je.Forward]:{}};const Ne={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},De=[200,10];var $e,We;t.DirectionEnum=void 0,($e=t.DirectionEnum||(t.DirectionEnum={})).Default="default",$e.Reverse="reverse",t.PlayerEventEnum=void 0,(We=t.PlayerEventEnum||(t.PlayerEventEnum={})).change="change",We.play="play",We.pause="pause",We.backward="backward",We.forward="forward",We.end="end",We.OnChange="change",We.OnPlay="play",We.OnPause="pause",We.OnBackward="backward",We.OnForward="forward",We.OnEnd="end";const Ue=({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}),Fe=({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}),Ge=t=>"top"===t||"bottom"===t;class Ye extends n{constructor(t){super(i.merge({},Ye.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={visible:this._sliderVisible,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,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1}};if(Ge(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.height)&&void 0!==e?e:De[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:De[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 ke(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward};return Ge(this._orient)?(t.layout="horizontal",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})):(t.layout="vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new Re(t),this._controllerVisible&&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,b,g,p,v,_;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._sliderVisible=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.visible,this._railStyle=Object.assign({},null===(s=null===(i=this.attribute)||void 0===i?void 0:i.slider)||void 0===s?void 0:s.railStyle),this._trackStyle=Object.assign({},null===(n=null===(a=this.attribute)||void 0===a?void 0:a.slider)||void 0===n?void 0:n.trackStyle),this._handlerStyle=Object.assign({},null===(l=null===(r=this.attribute)||void 0===r?void 0:r.slider)||void 0===l?void 0:l.handlerStyle),this._controllerVisible=null===(d=null===(o=this.attribute)||void 0===o?void 0:o.controller)||void 0===d?void 0:d.visible,this._start=Object.assign({},null===(u=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===u?void 0:u.start),this._pause=Object.assign({},null===(b=null===(c=this.attribute)||void 0===c?void 0:c.controller)||void 0===b?void 0:b.pause),this._forward=Object.assign({},null===(p=null===(g=this.attribute)||void 0===g?void 0:g.controller)||void 0===p?void 0:p.forward),this._backward=Object.assign({},null===(_=null===(v=this.attribute)||void 0===v?void 0:v.controller)||void 0===_?void 0:_.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=Ge(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:De[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=this._sliderVisible?(Ge(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:0,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]=Object.assign(Object.assign({},this._layoutInfo[s]),{size:r,x:Ge(this._orient)?t+a:(this._size.width-r)/2,y:Ge(this._orient)?(this._size.height-r)/2:t+a}),t+a+r}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:Ge(this._orient)?u+this.attribute.slider.space:(this._size.width-l)/2,y:Ge(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]=Object.assign(Object.assign({},this._layoutInfo[s]),{size:r,x:Ge(this._orient)?t+a:(this._size.width-r)/2,y:Ge(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)}}Ye.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},Ne),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},Ne),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},Ne),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},Ne),{key:"backward",position:"start"})}};var Xe;t.IOperateType=void 0,(Xe=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",Xe.drawEnd="drawEnd",Xe.drawing="drawing",Xe.moving="moving",Xe.moveStart="moveStart",Xe.moveEnd="moveEnd",Xe.brushClear="brushClear";const qe={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}},Ze=5,Je={debounce:i.debounce,throttle:i.throttle};class Ke extends n{constructor(e){super(i.merge({},Ke.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",Je[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,b=l-d,g=o-h,p=n-u,v=r-c;this._operatingMaskMoveRangeX=[b,g],this._operatingMaskMoveRangeY=[p,v],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=Ze}=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(Object.assign({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)}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0}=this.attribute;this.stage.removeEventListener("pointerdown",this._onBrushStart),this.stage.removeEventListener("pointermove",Je[t](this._onBrushing,e)),this.stage.removeEventListener("pointerup",this._onBrushEnd),this.stage.removeEventListener("pointerupoutside",this._onBrushEnd)}}Ke.defaultAttributes=qe;const Qe=(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)})},ti=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=>Object.assign(Object.assign({},t),{text:e})))}},ei={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:E,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:E,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:E,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},ii=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"],si="tooltip-title",ai="tooltip-content",ni="shape",ri="value";class li extends n{constructor(t){super(i.merge({},li.defaultAttributes,t)),this.name="tooltip"}render(){const{visible:t,content:e,panel:s,keyWidth:a,valueWidth:n,hasContentShape:r,autoCalculatePosition:l,autoMeasure:o}=this.attribute;if(!t)return void this.hideAll();o&&li.measureTooltip(this.attribute),l&&li.calculateTooltipPosition(this.attribute);const d=i.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(si,{visible:!0,x:d[3],y:d[0]},"group");const h=li.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${si}-${ni}`,i.merge({symbolType:"circle"},h.shape,{visible:c(h)&&c(h.shape)}),"symbol"),h.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${si}-${ri}`,Object.assign({visible:c(h)&&c(h.value)},ti(h.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${si}-${ri}`,Object.assign({text:"",visible:c(h)&&c(h.value)},h.value),"text");const u=c(h.shape)?h.shape.size+h.shape.spacing:0,{textAlign:b,textBaseline:g}=h.value,p=s.width-d[3]-d[0]-u;"center"===b?this._tooltipTitle.setAttribute("x",u+p/2):"right"===b||"end"===b?this._tooltipTitle.setAttribute("x",u+p):this._tooltipTitle.setAttribute("x",u),"bottom"===g?this._tooltipTitle.setAttribute("y",h.height):"middle"===g?this._tooltipTitle.setAttribute("y",h.height/2):this._tooltipTitle.setAttribute("y",0);const v=c(h)?h.height+h.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(ai,{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==e?void 0:e.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+v);let t=0;e.forEach(((e,s)=>{var l;const o=li.getContentAttr(this.attribute,s);if(!c(o))return;const d=`${ai}-${s}`,h=this._tooltipContent.createOrUpdateChild(d,{visible:!0,x:0,y:t},"group");let u=0;if(c(o.shape)&&h.createOrUpdateChild(`${d}-${ni}`,Object.assign({visible:!0,x:o.shape.size/2,y:o.shape.size/2+((null!==(l=o.key.lineHeight)&&void 0!==l?l:o.key.fontSize)-o.shape.size)/2},o.shape),"symbol"),r&&(u+=o.shape.size+o.shape.spacing),c(o.key)){let t;t=o.key.multiLine?h.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},ti(o.key)),{textBaseline:"top"}),"richtext"):h.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},o.key),{textBaseline:"top"}),"text");const{textAlign:e}=o.key;"center"===e?t.setAttribute("x",u+a/2):"right"===e||"end"===e?t.setAttribute("x",u+a):t.setAttribute("x",u),t.setAttribute("y",0),u+=a+o.key.spacing}if(c(o.value)){let t;t=o.value.multiLine?h.createOrUpdateChild(`${d}-${ri}`,Object.assign(Object.assign({visible:!0},ti(o.value)),{textBaseline:"top"}),"richtext"):h.createOrUpdateChild(`${d}-${ri}`,Object.assign(Object.assign({visible:!0},o.value),{textBaseline:"top"}),"text");let e="right";i.isValid(o.value.textAlign)?e=o.value.textAlign:c(o.key)||(e="left"),t.setAttribute("textAlign",e),"center"===e?t.setAttribute("x",u+n/2):"right"===e||"end"===e?t.setAttribute("x",u+n):t.setAttribute("x",u),u+=n,t.setAttribute("y",0),h.add(t)}t+=o.height+o.spaceRow}))}}setAttributes(t,e){const s=Object.keys(t);this.attribute.autoCalculatePosition&&s.every((t=>ii.includes(t)))?(this._mergeAttributes(t,s),i.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&li.measureTooltip(this.attribute),li.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=li.getTitleAttr(t);let l=0,o=n[0]+n[2],d=0;const{value:h,shape:u}=r,{visible:b=!1,symbolType:g=""}=null!=u?u:{};if(i.isValid(h)){const{width:t,height:e}=k(h).quickMeasure(h.text);l=t,d=e}if(b&&e.builtinSymbolsMap[g]&&(l+=u.size+u.spacing,d=Math.max(u.size,d)),t.title&&(t.title.width=l,t.title.height=d),c(r)&&(o+=d+r.spaceRow),null==s?void 0:s.length){const i=[];if(s.forEach(((e,s)=>{const a=li.getContentAttr(t,s);(e.key||e.value)&&c(a)&&i.push([e,a])})),i.length){let n=!1;const r=[],d=[],h=[];i.forEach((([t,s],l)=>{var u;const{key:b,value:g,shape:p,spaceRow:v}=s,_=c(p),m=null!==(u=null==p?void 0:p.symbolType)&&void 0!==u?u:"",y=k(b),x=k(g);let f=0;if(c(b)){const{width:t,height:e}=y.quickMeasure(b.text);d.push(t),f=Math.max(f,e)}if(c(g)){const{width:t,height:e}=x.quickMeasure(g.text);h.push(t),f=Math.max(f,e)}_&&e.builtinSymbolsMap[m]&&(n=!0,r.push(p.size),f=Math.max(p.size,f)),t.height=f,o+=f,l<i.length-1&&(o+=null!=v?v:a.spaceRow)}));const u=r.length?Math.max(...r):0,b=d.length?Math.max(...d):0,g=h.length?Math.max(...h):0;l=Math.max(b+g+a.key.spacing+a.value.spacing+(n?u+a.shape.spacing:0),l),s.forEach((t=>{t.width=l})),t.hasContentShape=n,t.keyWidth=b,t.valueWidth=g}}return t.panel.width=l+n[1]+n[3],t.panel.height=o,t}static getTitleAttr(t){return Qe({},li.defaultAttributes.titleStyle,li.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return Qe({},li.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}li.defaultAttributes=ei;t.AbstractComponent=n,t.ArcInfo=xt,t.ArcLabel=ft,t.BasePlayer=Ye,t.Brush=Ke,t.CircleAxis=$t,t.CircleAxisGrid=Jt,t.CircleCrosshair=F,t.ColorContinuousLegend=Me,t.ContinuousPlayer=class extends Ye{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(ze.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(ze.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(ze.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(ze.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.change))},this.play=()=>h(this,void 0,void 0,(function*(){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.play),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.end)},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.pause))},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.backward)},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.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=ge,t.DEFAULT_ITEM_SPACE_ROW=pe,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=_e,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=kt,t.DEFAULT_TITLE_SPACE=ve,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=St,t.DataZoom=Qt,t.DiscreteLegend=Se,t.DiscretePlayer=class extends Ye{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(ze.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(ze.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(ze.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(ze.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.change)}))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(Ue({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||Fe({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.play),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.change),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.change)),("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.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.GroupFadeIn=Ut,t.GroupFadeOut=Ft,t.GroupTransition=Wt,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(Pe,"title.style"),s.style);this._title=o.createOrUpdateChild("indicator-title",Object.assign(Object.assign({},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(Pe,"content.style"),e.style),u=o.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({},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=M(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=ct,t.LineAxis=Nt,t.LineAxisGrid=Zt,t.LineCrosshair=W,t.LineLabel=pt,t.LinkPath=He,t.MarkArea=he,t.MarkLine=de,t.MarkPoint=ue,t.Pager=be,t.PolygonCrosshair=Y,t.PopTip=C,t.RectCrosshair=U,t.RectLabel=gt,t.ScrollBar=r,t.SectorCrosshair=G,t.Segment=Et,t.SizeContinuousLegend=Te,t.Slider=ke,t.SymbolLabel=bt,t.Tag=w,t.Title=Ce,t.Tooltip=li,t.VTag=function(t){return new w(t?t.attribute:{})},t.getHorizontalPath=Oe,t.getSizeHandlerPath=we,t.getVerticalPath=Ie,t.loadPoptip=function(){e.container.load(D)},t.popTipModule=D,t.setPoptipTheme=function(t){i.merge(z.poptip,V,t)},t.version="0.15.0-alpha.14"}));
|
|
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 b;if("vertical"===r){const t=n-this._viewPosition.y,e=i.clamp(t-h/2,u,c);b=t/o,this._slider.setAttribute("y",e,!0)}else{const t=a-this._viewPosition.x,e=i.clamp(t-h/2,u,c);b=t/l,this._slider.setAttribute("x",e,!0)}this.setScrollRange([b-(d[1]-d[0])/2,b+(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",Object.assign({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])),b=c[1]-c[0];let g;this._sliderSize=b,g="horizontal"===t?{x:c[0],y:u.y1,width:b,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:b};const p=d.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},g),{cornerRadius:this._getDefaultSliderCornerRadius()}),l),{boundsPadding:i.normalizePadding(o),pickMode:"imprecise"}),"rect");this._slider=p,this._container=d;const v=this._container.AABBBounds;this._viewPosition={x:v.x1,y:v.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){return l="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},l(t)}function o(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(i[s[a]]=t[s[a]])}return i}function d(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":l(Reflect))&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(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 h(t,e,i,s){return new(i||(i=Promise))((function(a,n){function r(t){try{o(s.next(t))}catch(t){n(t)}}function l(t){try{o(s.throw(t))}catch(t){n(t)}}function o(t){var e;t.done?a(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,l)}o((s=s.apply(t,e||[])).next())}))}function u(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&u(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]},"function"==typeof SuppressedError&&SuppressedError;const c=t=>!i.isNil(t)&&!1!==t.visible;const b=["#ffffff","#000000"];function g(t,e,i,s,a){const n=m(t),r=m(e);return p(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(...b);for(const a of n)if(t!==a&&p(a,e,i,s))return a;return}(n,r,i,s,a)}function p(t,e,i,s){return s?v(t,e)>s:"largeText"===i?v(t,e)>3:v(t,e)>4.5}function v(t,e){const i=_(t),s=_(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function _(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 m(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 y(t,e,i,s){let a;switch(t){case"base":a=e;break;case"invertBase":a=i;break;case"similarBase":a=s}return a}function x(t,e){return[t[0]*e,t[1]*e]}function f(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 A=-.5*Math.PI,S=1.5*Math.PI,E="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 L;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(L||(L={}));const B={[L.selectedReverse]:{},[L.selected]:{},[L.hover]:{},[L.hoverReverse]:{}},k=(t,s,a)=>new i.TextMeasure(Object.assign({defaultFontParams:{fontFamily:E,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 M(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 w extends n{constructor(t){super(i.merge({},w.defaultAttributes,t)),this.name="tag"}render(){var t;const{text:e="",textStyle:s={},shape:a={},panel:n={},space:r=4,minWidth:l,maxWidth:d,padding:h=4,visible:u,state:c}=this.attribute,b=i.normalizePadding(h),g=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let p,v=b[1]+b[3],_=b[0]+b[2],m=0,y=0;const{visible:x}=a,f=o(a,["visible"]);if(i.isBoolean(x)){const t=(null==f?void 0:f.size)||10,e=i.isNumber(t)?t:Math.max(t[0],t[1]);p=g.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},f),{visible:x,x:e/2,y:e/2}),"symbol"),i.isEmpty(null==c?void 0:c.shape)||(p.states=c.shape),x&&(y=e+r)}v+=y,m+=y;const A=Object.assign(Object.assign({text:e,visible:i.isValid(e)&&!1!==u,lineHeight:null==s?void 0:s.fontSize},s),{x:m,y:0});i.isNil(A.lineHeight)&&(A.lineHeight=A.fontSize);const S=g.createOrUpdateChild("tag-text",A,"text");i.isEmpty(null==c?void 0:c.text)||(S.states=c.text);const E=M(A.text,s),L=E.width,B=E.height;v+=L;const k=null!==(t=a.size)&&void 0!==t?t:10,w=i.isNumber(k)?k:Math.max(k[0],k[1]);_+=Math.max(B,(null==a?void 0:a.visible)?w:0);const{textAlign:T,textBaseline:C}=s;(i.isValid(l)||i.isValid(d))&&(i.isValid(l)&&v<l&&(v=l),i.isValid(d)&&v>d&&(v=d,S.setAttribute("maxLineWidth",d-b[1]-b[2])));let P=0,O=0;"center"===T?(P-=v/2,p&&p.setAttribute("x",(p.attribute.x||0)-L/2),g.setAttribute("x",-y/2)):"right"===T||"end"===T?(P-=v,p&&p.setAttribute("x",(p.attribute.x||0)-L),g.setAttribute("x",-b[1]-y)):"left"!==T&&"start"!==T||g.setAttribute("x",b[3]),"middle"===C?(O-=_/2,p&&p.setAttribute("y",0)):"bottom"===C?(O-=_,p&&p.setAttribute("y",-B/2),g.setAttribute("y",-b[2])):"top"===C&&(g.setAttribute("y",b[0]),p&&p.setAttribute("y",B/2));const{visible:I}=n,H=o(n,["visible"]);if(u&&i.isBoolean(I)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},H),{visible:I&&!!e,x:P,y:O,width:v,height:_}),"rect");i.isEmpty(null==c?void 0:c.panel)||(t.states=c.panel)}}}w.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const T=new i.AABBBounds;class C extends n{constructor(t){super(i.merge({},C.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,r,l,d;const{titleStyle:h={},position:u,contentStyle:c={},panel:b={},space:g=4,minWidth:p=0,maxWidth:v=1/0,padding:_=4,maxWidthPercent:m,visible:y,state:x,dx:f=0,dy:A=0}=this.attribute;let{title:S="",content:E=""}=this.attribute;S=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(S):S,E=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(E):E;const L=i.normalizePadding(_),B=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),k=v-L[1]-L[3],M=i.isValid(S)&&!1!==y,w=Object.assign(Object.assign({text:i.isArray(S)?S:[S],visible:M},h),{x:L[3],y:L[0],maxLineWidth:k,textAlign:"left",textBaseline:"top"}),C=B.createOrUpdateChild("poptip-title",w,"wrapText");i.isEmpty(null==x?void 0:x.title)||(C.states=x.title);const P=C.AABBBounds,O=P.height(),I=P.width();let H=O+g;M||(H=0);const z=i.isValid(E)&&!1!==y,V=Object.assign(Object.assign({text:i.isArray(E)?E:[E],visible:z},c),{x:L[3],y:L[0]+H,maxLineWidth:k,textAlign:"left",textBaseline:"top"}),j=B.createOrUpdateChild("poptip-content",V,"wrapText");i.isEmpty(null==x?void 0:x.content)||(j.states=x.content);const R=j.AABBBounds,N=R.height(),D=R.width();z&&(H+=N);let $=i.max(I+L[1]+L[3],D+L[1]+L[3]);$>v?$=v:$<p&&($=p);let W=L[0]+L[2]+H;const{visible:U}=b,F=o(b,["visible"]),G=null!==(t=F.size)&&void 0!==t?t:12,Y=i.isArray(G)?[G[0]+(null!==(e=F.space)&&void 0!==e?e:0),G[1]+(null!==(s=F.space)&&void 0!==s?s:0)]:G+(null!==(a=F.space)&&void 0!==a?a:0),X=null!==(n=F.lineWidth)&&void 0!==n?n:1,q=this.stage?[null!==(r=this.stage.viewWidth)&&void 0!==r?r:this.stage.width,null!==(l=this.stage.viewHeight)&&void 0!==l?l:this.stage.height]:void 0;if(q){const t=this.AABBBounds,e=null!==(d=this.attribute.x)&&void 0!==d?d:t.x1,s=q[0]-t.x1;let a=Math.max(e,s);const n=(i.isArray(G)?G[0]:12)+3;if(a=Math.min(a-n,a*m),a<$){$=a;const t=L[1]+L[3];C.setAttribute("maxLineWidth",a-t),j.setAttribute("maxLineWidth",a-t),W=L[0]+L[2],M&&(W+=C.AABBBounds.height()+g),W+=j.AABBBounds.height()}}const Z="auto"===u;let J,K=-1/0;for(let t=0;t<this.positionList.length+1;t++){const e=Z?this.positionList[t===this.positionList.length?J:t]:u,{angle:s,offset:a,rectOffset:n}=this.getAngleAndOffset(e,$,W,i.isArray(Y)?Y:[Y,Y-X]);if(i.isBoolean(U)){const t=(i.isArray(G)?G[0]:G)/4,e=B.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},F),{visible:U&&(z||M),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:s,dx:a[0],dy:a[1],size:G,zIndex:-9}),"symbol");i.isEmpty(null==x?void 0:x.panel)||(e.states=x.panel);const n=B.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},F),{visible:U&&(z||M),x:0,y:0,width:$,height:W,zIndex:-8}),"rect");i.isEmpty(null==x?void 0:x.panel)||(n.states=x.panel)}if(B.setAttributes({x:-a[0]+f,y:-a[1]+A}),!Z||!q)break;{T.setValue(0,0,$,W).transformWithMatrix(B.globalTransMatrix);const e=T,s=(new i.Bounds).setValue(0,0,q[0],q[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>K&&(K=n,J=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]]}}}}C.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"},maxWidthPercent:.8,space:8,padding:10};var P="inversify:paramtypes",O=0;var I=function(t){this.id=O++,this.registry=t};function H(){return function(t){if(Reflect.hasOwnMetadata(P,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(P,e,t),t}}const z={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}},V={poptip:i.merge({},z)};let j=class{render(t,e,s,a,n,r,l,o,d,h,u,c,b){var g,p,v;if(1===t._showPoptip){const{visible:e,visibleCb:s}=t.attribute.poptip||{};if(!1===e||s&&!1===s(t))return;const a={};i.merge(a,C.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(a):this.poptipComponent=new C(a);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};p=e,v=n,i.merge(p,V.poptip,v),n=e,n.content=null!==(g=n.content)&&void 0!==g?g:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const l=h.stage.getLayer("_builtin_interactive");l&&l.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};j=d([H()],j);let R=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)}};R=d([H()],R);let N=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)}};N=d([H()],N);const D=new I((t=>{t(j).toSelf().inSingletonScope(),t(e.InteractiveSubRenderContribution).toService(j),t(R).toSelf().inSingletonScope(),t(e.AutoEnablePlugins).toService(R),t(N).toSelf().inSingletonScope(),t(e.AutoEnablePlugins).toService(N)}));class $ extends n{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}class W extends ${constructor(t){super(i.merge({},W.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}W.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};class U extends ${constructor(t){super(i.merge({},U.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({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})}}U.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};class F extends ${constructor(t){super(i.merge({},F.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),s),"arc")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}F.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class G extends ${constructor(t){super(i.merge({},G.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",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:n,endAngle:r}),a),"arc")}setLocation(t){const{center:e,startAngle:s=A,endAngle:a=S}=this.attribute,n=a-s,r=i.radianToDegree(i.getAngleByPoint(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}G.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};class Y extends ${constructor(t){super(i.merge({},Y.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",Object.assign({path:h},n),"path")}setLocation(t){const{center:e}=this.attribute,s=i.PointService.distancePP(t,e);this.setAttribute("radius",s)}}Y.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const X=5,q=31,Z=32,J=new Uint32Array(Z+1),K=new Uint32Array(Z+1);K[0]=0,J[0]=~K[0];for(let t=1;t<=Z;++t)K[t]=K[t-1]<<1|1,J[t]=~K[t];function Q(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+Z)/Z));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>>>X]&1<<(a&q)},set:(e,i)=>{const a=i*t+e;s(a>>>X,1<<(a&q))},clear:(e,i)=>{const s=i*t+e;a(s>>>X,~(1<<(s&q)))},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>>>X,h=o>>>X,d===h){if(i[d]&J[l&q]&K[1+(o&q)])return!0}else{if(i[d]&J[l&q])return!0;if(i[h]&K[1+(o&q)])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>>>X,h=o>>>X,d===h)s(d,J[l&q]&K[1+(o&q)]);else for(s(d,J[l&q]),s(h,K[1+(o&q)]),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>>>X,d=l>>>X,o===d)a(o,K[r&q]|J[1+(l&q)]);else for(a(o,K[r&q]),a(d,J[1+(l&q)]),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>>>X]&1<<(a&q);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 tt(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 et(t,e,i,s=!0,a=0){let n=i;a>0&&(n={x1:i.x1-a,x2:i.x2+a,y1:i.y1-a,y2:i.y2+a}),n=tt(t,n);return!(s&&e.outOfBounds(n))&&!e.getRange(n)}function it(t,e,i,s=[],a=!0,n=0){for(let r=0;r<s.length;r++){const l=i.clone();if(l.setAttributes(s[r]),l.update(),et(t,e,tt(t,l.AABBBounds),a,n))return e.setRange(tt(t,l.AABBBounds,!0)),s[r]}return!1}function st(t,e,s,a,n,r,l){var o,d;const h=null===(o=a.overlap)||void 0===o?void 0:o.clampForce,u=null===(d=a.overlap)||void 0===d?void 0:d.overlapPadding;if("bound"===s.type||"position"===s.type){if(i.isFunction(l)){const o=((i.isFunction(s.position)?s.position(n.attribute):s.position)||function(t){if("rect"===t)return nt;return at}(a.type)).map((t=>l(n.AABBBounds,r,t,a.offset)));return it(t,e,n,o,h,u)}return!1}if("moveY"===s.type){const a=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return it(t,e,n,a,h,u)}if("moveX"===s.type){const a=(s.offset?i.isFunction(s.offset)?s.offset(n.attribute):s.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return it(t,e,n,a,h,u)}return!1}const at=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],nt=["top","inside-top","inside"];function rt(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 lt={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 ot(t,e){var i,s;return null!==(s=null===(i=lt[e])||void 0===i?void 0:i.call(lt,t))&&void 0!==s?s:{from:{},to:{}}}const dt="same-time",ht=300,ut="linear";class ct extends n{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t){super(i.merge({},ct.defaultAttributes,t)),this.name="label",this._onHover=t=>{const e=t.target;e===this._lastHover||i.isEmpty(e.states)||(e.addState(L.hover,!0),u(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(L.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(u(this,(t=>{i.isEmpty(t.states)||(t.removeState(L.hoverReverse),t.removeState(L.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void u(this,(t=>{i.isEmpty(t.states)||(t.removeState(L.selectedReverse),t.removeState(L.selected))}));i.isEmpty(e.states)||(e.addState(L.selected,!0),u(this,(t=>{t===e||i.isEmpty(t.states)||t.addState(L.selectedReverse,!0)})),this._lastSelect=e)}}labeling(t,e,i,s){}_labelLine(t){}render(){if(this._prepare(),i.isNil(this._idToGraphic))return;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)),r=i.isFunction(a)?a(l,(t=>this._idToGraphic.get(t.id))):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=[]){const{textStyle:e={},position:s,offset:a}=this.attribute,n=[];for(let r=0;r<t.length;r++){const l=t[r],o=this._idToGraphic.get(l.id),d=Object.assign(Object.assign({fill:o.attribute.fill},e),l),h=this._createLabelText(d),u=this.getGraphicBounds(h),c=this.getGraphicBounds(o,{x:l.x,y:l.y}),b=this.labeling(u,c,i.isFunction(s)?s(l):s,a);b&&(d.x=b.x,d.y=b.y,h.setAttributes(b)),n.push(h)}return n}_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:b=!0,avoidMarks:g=[],overlapPadding:p}=r,v=this._bmpTool||Q(d.width,d.height),_=this._bitmap||v.bitmap(),m=u.some((t=>"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&_.setRange(tt(v,t.AABBBounds,!0))}))),g.length>0&&g.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&&_.setRange(tt(v,t.AABBBounds,!0))})):t.AABBBounds&&_.setRange(tt(v,t.AABBBounds,!0))}));for(let e=0;e<t.length;e++){if(!1===t[e].visible)continue;const s=t[e],a=this._idToGraphic.get(s.attribute.id);if(s.update(),!i.isRectIntersect(a.AABBBounds,{x1:0,x2:v.width,y1:0,y2:v.height},!0))continue;if(et(v,_,s.AABBBounds,b,p)){if(!m){_.setRange(tt(v,s.AABBBounds,!0)),l.push(s);continue}if(m&&(null==a?void 0:a.AABBBounds)&&this._canPlaceInside(s.AABBBounds,null==a?void 0:a.AABBBounds)){_.setRange(tt(v,s.AABBBounds,!0)),l.push(s);continue}}let n=!1;for(let i=0;i<u.length;i++)if(n=st(v,_,u[i],this.attribute,s,this.getGraphicBounds(a,t[e]),this.labeling),!1!==n){s.setAttributes({x:n.x,y:n.y}),l.push(s);break}if(!n&&b){const{dx:t=0,dy:e=0}=rt(s,v.width,v.height);if((0!==t||0!==e)&&et(v,_,{x1:s.AABBBounds.x1+t,x2:s.AABBBounds.x2+t,y1:s.AABBBounds.y1+e,y2:s.AABBBounds.y2+e},void 0,p)){s.setAttributes({x:s.attribute.x+t,y:s.attribute.y+e}),_.setRange(tt(v,s.AABBBounds,!0)),l.push(s);continue}}!n&&!c&&l.push(s)}return i.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(_),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){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){var s,a,n,r,l;const o=null!==(s=this.attribute.animation)&&void 0!==s?s:{},d=null!==(a=o.mode)&&void 0!==a?a:dt,h=null!==(n=o.duration)&&void 0!==n?n:ht,u=null!==(r=o.easing)&&void 0!==r?r:ut,c=null!==(l=o.delay)&&void 0!==l?l:0,b=new Map,g=this._graphicToText||new Map,p=[];t.forEach(((t,s)=>{var a;const n=this._labelLine(t),r=this._idToGraphic.get(t.attribute.id),l=(null==g?void 0:g.get(r))?"update":"enter";if("enter"===l){if(p.push(t),b.set(r,n?{text:t,labelLine:n}:{text:t}),r){const{from:e,to:i}=ot(t.attribute,"fadeIn");this.add(t),n&&this.add(n),r.once("animate-bind",(()=>{t.setAttributes(e);const a=this._afterRelatedGraphicAttributeUpdate(t,p,s,r,{mode:d,duration:h,easing:u,to:i,delay:c});r.on("afterAttributeUpdate",a)}))}}else if("update"===l){const s=g.get(r);g.delete(r),b.set(r,s);const n=s.text;n.animate().to(t.attribute,h,u),s.labelLine&&s.labelLine.animate().to(i.merge({},s.labelLine.attribute,{points:null===(a=t.attribute)||void 0===a?void 0:a.points}),h,u),!1!==o.increaseEffect&&n.attribute.text!==t.attribute.text&&i.isValidNumber(Number(n.attribute.text)*Number(t.attribute.text))&&n.animate().play(new e.IncreaseCount({text:n.attribute.text},{text:t.attribute.text},h,u))}})),g.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(ot(t.text.attribute,"fadeOut").to,h,u).onEnd((()=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)}))})),this._graphicToText=b}_renderWithOutAnimation(t){const e=new Map,i=this._graphicToText||new Map;t.forEach((t=>{var s;const a=this._labelLine(t),n=this._idToGraphic.get(t.attribute.id),r=(null==i?void 0:i.get(n))?"update":"enter";if("enter"===r)e.set(n,a?{text:t,labelLine:a}:{text:t}),this.add(t),a&&this.add(a);else if("update"===r){const a=i.get(n);i.delete(n),e.set(n,a),a.text.setAttributes(t.attribute),(null==a?void 0:a.labelLine)&&a.labelLine.setAttributes({points:null===(s=t.attribute)||void 0===s?void 0:s.points})}})),i.forEach((t=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)})),this._graphicToText=e}_afterRelatedGraphicAttributeUpdate(t,i,s,a,{mode:n,duration:r,easing:l,to:o,delay:d}){const h=u=>{var c;const{detail:b}=u;if(!b)return{};if(!(b&&b.type===e.AttributeUpdateType.ANIMATE_UPDATE&&b.animationState&&"wait"!==(null===(c=b.animationState.step)||void 0===c?void 0:c.type)))return{};if(b.type===e.AttributeUpdateType.ANIMATE_END)return void t.setAttributes(o);const g=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",h))};switch(n){case"after":b.animationState.end&&t.animate({onEnd:g}).wait(d).to(o,r,l);break;case"after-all":s===i.length-1&&b.animationState.end&&i.forEach((t=>{t.animate({onEnd:g}).wait(d).to(o,r,l)}));break;default:b.animationState.isFirstFrameOfStep&&t.animate({onEnd:g}).wait(d).to(o,r,l)}};return h}_smartInvert(t){var e,i,s,a;const n=this.attribute.smartInvert||{},{textType:r,contrastRatiosThreshold:l,alternativeColors:o}=n,d=null!==(e=n.fillStrategy)&&void 0!==e?e:"invertBase",h=null!==(i=n.strokeStrategy)&&void 0!==i?i:"base",u=null!==(s=n.brightColor)&&void 0!==s?s:"#ffffff",c=null!==(a=n.darkColor)&&void 0!==a?a:"#000000";if("null"!==d||"null"!==h)for(let e=0;e<t.length;e++){const i=t[e];if(!i)continue;const s=this._idToGraphic.get(i.attribute.id),a=this._canPlaceInside(i.AABBBounds,null==s?void 0:s.AABBBounds),n=s.attribute.fill,b=n,v=g(i.attribute.fill,n,r,l,o),_=p(v,u)?u:c;if(a){const t=y(d,b,v,_);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=y(h,b,v,_);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:g(i.attribute.fill,i.attribute.stroke,r,l,o)});continue}const t=y(d,b,v,_);t&&i.setAttributes({fill:t});const e=y(h,b,v,_);e&&i.setAttributes({stroke:e})}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}ct.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class bt extends ct{constructor(t){super(i.merge({},bt.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,b=0,g=0,p=0;e&&(g=Math.abs(e.x1-e.x2)/2,p=Math.abs(e.y1-e.y2)/2);const v={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":b=-1;break;case"bottom":b=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(v[i]*(Math.PI/180)),b=Math.cos(v[i]*(Math.PI/180));break;case"center":c=0,b=0}return{x:h+c*(s+g)+Math.sign(c)*(o/2),y:u+b*(s+p)+Math.sign(b)*(d/2)}}}bt.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class gt extends ct{constructor(t){super(i.merge({},gt.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,b=(e.y1+e.y2)/2,g=0,p=0;switch(i){case"top":case"inside-top":p=-.5;break;case"bottom":case"inside-bottom":p=.5;break;case"left":case"inside-left":g=-.5;break;case"right":case"inside-right":g=.5}c+=g*h,b+=p*u;let v=0,_=0;const m=i.includes("inside");i.includes("top")?_=m?1:-1:i.includes("bottom")?_=m?-1:1:i.includes("left")?v=m?1:-1:i.includes("right")&&(v=m?-1:1);return{x:c+v*s+v*o/2,y:b+_*s+_*d/2}}}gt.tag="rect-label",gt.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class pt extends ct{constructor(t){super(i.merge({},pt.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 vt(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 _t(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 mt(t){return 3===t||4===t}function yt(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)}pt.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class xt{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 ft extends ct{constructor(t){super(i.merge({},ft.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}}_layout(t=[]){const e=super._layout(t),i=e.map((t=>this.getGraphicBounds(t))),s=Object.assign(Object.assign({},this.attribute.textStyle),{text:"..."}),a=this._createLabelText(s),n=this.getGraphicBounds(a),r=n.x2-n.x1,l=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),t,i,r);for(let i=0;i<t.length;i++){const s=t[i],a=l.find((t=>t.refDatum.id===s.id)),n={visible:a.labelVisible,x:a.labelPosition.x,y:a.labelPosition.y,angle:a.angle,maxLineWidth:a.labelLimit,points:(null==a?void 0:a.pointA)&&(null==a?void 0:a.pointB)&&(null==a?void 0:a.pointC)?[a.pointA,a.pointB,a.pointC]:void 0,line:null==a?void 0:a.labelLine};e[i].setAttributes(n)}return e}layoutArcLabels(t,e,i,s,a,n){var r;this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=n;const l=null!==(r=null==e?void 0:e.centerOffset)&&void 0!==r?r:0;let o=0;i.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)})),i.forEach(((t,i)=>{var n,r;const d=t.attribute,h={x:null!==(n=null==d?void 0:d.x)&&void 0!==n?n:0,y:null!==(r=null==d?void 0:d.y)&&void 0!==r?r:0},u=s[i],c=a[i],b=(d.startAngle+d.endAngle)/2,g=d.endAngle-d.startAngle,p=_t(d.endAngle-g/2),v=vt(h.x,h.y,d.outerRadius,b),_=vt(h.x,h.y,o+e.line.line1MinLength,b),m=new xt(u,v,_,p,g,b);var y;m.pointA=vt(h.x,h.y,this.computeDatumRadius(2*h.x,2*h.y,d.outerRadius,l),m.middleAngle),m.labelSize={width:c.x2-c.x1,height:c.y2-c.y1},1===(y=m.quadrant)||2===y?this._arcRight.set(m.refDatum,m):mt(m.quadrant)&&this._arcLeft.set(m.refDatum,m)}));const d=Array.from(this._arcLeft.values()),h=Array.from(this._arcRight.values()),u=[];return"inside"===t?(u.push(...this._layoutInsideLabels(h,e,i)),u.push(...this._layoutInsideLabels(d,e,i))):(u.push(...this._layoutOutsideLabels(h,e,i)),u.push(...this._layoutOutsideLabels(d,e,i))),u}_layoutInsideLabels(t,e,s){var a,n,r,l,o;const d={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},h=null!==(o=null==e?void 0:e.centerOffset)&&void 0!==o?o:0,u=this.computeLayoutOuterRadius(s[0].attribute.innerRadius,e.width,e.height),c=this.computeLayoutOuterRadius(s[0].attribute.outerRadius,e.width,e.height),b=e,g=b.spaceWidth;return t.forEach((t=>{var s,a;const{labelSize:n,radian:r}=t,l=this.computeRadius(u,e.width,e.height,h,1),o=this.computeRadius(c,e.width,e.height,h,1),p=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(o,n.height);let v;if(r<p)v=0;else{let t;t=r>=Math.PI?l:Math.max(l,n.height/2/Math.tan(r/2)),v=o-t-g}!0!==(null==b?void 0:b.rotate)&&(v=o-g);const _=this._getFormatLabelText(t.refDatum,v);t.labelText=_;const m=Math.min(v,t.labelSize.width),y=this._computeAlign(t,e),x=o-g-("left"===y?m:"right"===y?0:m/2);t.labelPosition=vt(d.x,d.y,x,t.middleAngle),t.labelLimit=m,i.isGreater(m,0)||(t.labelVisible=!1),t.angle=null!==(a=null===(s=null==e?void 0:e.textStyle)||void 0===s?void 0:s.angle)&&void 0!==a?a: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,b=e.spaceWidth;if(t.forEach((t=>{const e=mt(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+u+b),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=mt(i.quadrant)?{x:t.x+a.width/2+u+b,y:t.y}:{x:t.x-a.width/2-u-b,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 g=2*d;return t.forEach((t=>{var s,a;t.labelVisible&&(i.isLess(t.pointB.x,u+b)||i.isGreater(t.pointB.x,g-u-b))&&(t.labelVisible=!1),t.angle=null!==(a=null===(s=null==e?void 0:e.textStyle)||void 0===s?void 0:s.angle)&&void 0!==a?a:0,t.labelLine=Object.assign({},null==e?void 0:e.line)})),t}_computeX(t,e,s){var a,n,r,l,o,d;const h=null!==(n=null===(a=s[0].attribute)||void 0===a?void 0:a.x)&&void 0!==n?n:0,u=(l=null===(r=s[0].attribute)||void 0===r?void 0:r.y,null!==(o=null==e?void 0:e.centerOffset)&&void 0!==o?o:0),c=2*h;let b=0;s.forEach((t=>{t.attribute.outerRadius>b&&(b=t.attribute.outerRadius)}));const g=this.computeLayoutOuterRadius(b,e.width,e.height),p=e.line.line1MinLength,v=e.line.line2MinLength,_=null===(d=e.layout)||void 0===d?void 0:d.align,m=e.spaceWidth,{labelPosition:y,quadrant:x,pointB:f}=t;i.isValidNumber(f.x*f.y)||(t.pointC={x:NaN,y:NaN},y.x=NaN,t.labelLimit=0);const A=this.computeRadius(g,e.width,e.height,u),S=mt(x)?-1:1;let E=0;let L=(S>0?c-f.x:f.x)-v-m;"labelLine"===_&&(E=(A+p+v)*S+h,L=(S>0?c-E:E)-m);const B=this._getFormatLabelText(t.refDatum,L);t.labelText=B;let k=Math.min(L,t.labelSize.width);switch(_){case"labelLine":break;case"edge":E=S>0?c-k-m:k+m;break;default:E=f.x+S*v}k=Math.max(this._ellipsisWidth,k),t.labelLimit=k,t.pointC={x:E,y:y.y};const M=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);if("edge"===_){const t=0;y.x=(S>0?c+t:t)-S*M}else{const t=0;y.x=E+t+S*(m+M)}}_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?mt(t.quadrant)?"left":"right":mt(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:b}=this._findNeighborIndex(t,n[o]),g=t[c],p=t[b];if(-1===c&&-1!==b){const i=p.labelPosition.y;u>i?e.labelPosition.y=i-p.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,p,b)}else if(-1!==c&&-1===b){const i=g.labelPosition.y;u<i?e.labelPosition.y=i+g.labelSize.height/2+e.labelSize.height/2:this._twoWayShift(t,g,e,n[o].originIndex)}else if(-1!==c&&-1!==b){const i=g.labelPosition.y,s=p.labelPosition.y;u>s?(e.labelPosition.y=s-p.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,g,e,n[o].originIndex)):u<i?(e.labelPosition.y=i+g.labelSize.height/2+e.labelSize.height/2,this._twoWayShift(t,e,p,b)):(this._twoWayShift(t,g,e,n[o].originIndex),this._twoWayShift(t,e,p,b))}const v=Math.min(r,n[o].originIndex),_=Math.max(l,n[o].originIndex);let m;if(m=t[_].getLabelBounds().y2-d,i.isGreater(m,0)&&this._shiftY(t,_,0,-m),m=t[v].getLabelBounds().y1-0,i.isLess(m,0)&&this._shiftY(t,v,t.length-1,-m),m=t[_].getLabelBounds().y2-d,i.isGreater(m,0)){e.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(e.labelVisible=!1,this._restoreY(t)):(r=v,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,d;const h=s;let u=0;a.forEach((t=>{t.attribute.outerRadius>u&&(u=t.attribute.outerRadius)}));const c=this.computeLayoutOuterRadius(u,s.width,s.height),b=h.line.line1MinLength;if("none"===h.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const h={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},u=null!==(d=null==s?void 0:s.centerOffset)&&void 0!==d?d:0,g=this.computeRadius(c,s.width,s.height,u),{labelPosition:p,quadrant:v}=t,_=e-Math.max(g+b,a[0].attribute.outerRadius),m=Math.sqrt(e**2-Math.abs(h.y-p.y)**2)-_;i.isValidNumber(m)?t.pointB={x:h.x+m*(mt(v)?-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,o;const d={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)};let h=0;s.forEach((t=>{t.attribute.outerRadius>h&&(h=t.attribute.outerRadius)}));const u=this.computeLayoutOuterRadius(h,e.width,e.height),c=e.line.line1MinLength,{width:b,height:g}=d,p=null!==(o=null==e?void 0:e.centerOffset)&&void 0!==o?o:0,v=this.computeRadius(u,e.width,e.height,p),_=this._computeLayoutRadius(g/2,e,s),m=Math.abs(t.center.x-b/2),y=t.center.y-g/2;let x,f,A;if(i.isNumberClose(b/2,m))x=0,f=1,A=-y;else if(i.isNumberClose(g/2,y))x=1,f=0,A=-m;else{const t=-1/(y/m);x=t,f=-1,A=y-t*m}const S=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}]}(x,f,A,c+v-_,0,_);if(S.length<2)return;let E,L;S[0].x>S[1].x&&S.reverse(),S[0].x<0?i.isNumberClose(S[0].y,S[1].y)?Math.abs(t.middleAngle)<Math.PI/2?(E=0,L=S[1].y+g/2):(E=S[1].y+g/2,L=g):S[0].y<S[1].y?(E=0,L=S[1].y+g/2):(E=S[1].y+g/2,L=d.height):(E=Math.min(S[0].y,S[1].y)+g/2,L=Math.max(S[0].y,S[1].y)+g/2),t.labelYRange=[E,L]}_computeLayoutRadius(t,e,i){var s;const a=e,n=a.layoutArcGap,r=a.line.line1MinLength;let l=0;i.forEach((t=>{t.attribute.outerRadius>l&&(l=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(l,e.width,e.height),d=null!==(s=null==e?void 0:e.centerOffset)&&void 0!==s?s:0,h=this.computeRadius(o,e.width,e.height,d)+r,u=h-n;return Math.max((u**2+t**2)/(2*u),h)}_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();yt(e,s)?t[i].labelVisible=!1:e=s}}_labelLine(t){var i,s,a,n,r,l,o,d,h,u,c,b,g,p,v,_,m;return(null===(i=t.attribute)||void 0===i?void 0:i.points)?e.createLine({visible:null===(o=null!==(r=(null===(a=null===(s=t.attribute)||void 0===s?void 0:s.line)||void 0===a?void 0:a.visible)&&(null===(n=t.attribute)||void 0===n?void 0:n.visible))&&void 0!==r?r:null===(l=t.attribute)||void 0===l?void 0:l.visible)||void 0===o||o,stroke:null!==(u=null===(h=null===(d=t.attribute)||void 0===d?void 0:d.line)||void 0===h?void 0:h.stroke)&&void 0!==u?u:null===(c=t.attribute)||void 0===c?void 0:c.fill,lineWidth:null!==(p=null===(g=null===(b=t.attribute)||void 0===b?void 0:b.line)||void 0===g?void 0:g.lineWidth)&&void 0!==p?p:1,points:null===(v=t.attribute)||void 0===v?void 0:v.points,curveType:(null===(m=null===(_=t.attribute)||void 0===_?void 0:_.line)||void 0===m?void 0:m.smooth)?"basis":null}):void 0}computeRadius(t,e,s,a,n){var r;return null!==(r=this.computeLayoutRadius(e||0,s||0)*t*(i.isNil(n)?1:n)+a)&&void 0!==r?r:0}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i,s){var a;const n=this.computeLayoutOuterRadius(i,t,e);return null!==(a=this.computeLayoutRadius(t||0,e||0)*n+s)&&void 0!==a?a:0}}ft.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},pickable:!1};const At={rect:gt,symbol:bt,arc:ft};class St extends n{constructor(t){super(i.merge({},St.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=Q(s,a),r=n.bitmap(),l=new Map,o=this._componentMap;for(let e=0;e<t.length;e++){const i=t[e],s=At[i.type]||ct;if(s){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 s(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 Et(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 Lt(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 Bt(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=Et(t,!!n),o=Et(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=Lt(e,t,!1,!!n),o=Lt(e,r,!0,!!n)}else"line"!==a&&"polygon"!==a||(l=Et(t,!!n),o=Et(r,!!n));return n?l+=o:(o="L"+o.substring(1),l+=o,l+="Z"),l}St.defaultAttributes={pickable:!1};class kt extends n{constructor(t){super(i.merge({},kt.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=Et(d,!!n);else if("circle"===t){const{center:t}=this.attribute;h=Lt(t,d,!1,!!n)}const u=e.createPath(Object.assign({path:h,z:l},i.isFunction(a)?i.merge({},kt.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),b=l/c;d.push({x:o[0].x+h*b,y:o[0].y+u*b});const g=Et(d,!!n),p=i.abs(d[0].x-d[1].x),v=i.abs(d[0].y-d[1].y),_=e.createPath(Object.assign({path:g,z:0,alpha:p>v?(o[1].x-o[0].x>0?-1:1)*i.pi/2:0,beta:p<v?-i.pi/2:0,anchor3d:p>v?[d[0].x,0]:[0,d[0].y]},i.isFunction(a)?i.merge({},kt.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=Bt(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}`}}kt.defaultAttributes={style:{lineWidth:1,stroke:"#416180"},zIndex:0};class Mt extends n{constructor(t){super(i.merge({},Mt.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(Object.assign({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:b=0,refAngle:g=0,style:p,symbolType:v,size:_=12}=t;let m,y;"start"===s?(m={x:h.x+(r?c*Math.cos(r)+b*Math.cos(r-Math.PI/2):0),y:h.y+(r?c*Math.sin(r)+b*Math.sin(r-Math.PI/2):0)},y=r+Math.PI/2):(m={x:u.x+(l?c*Math.cos(l)+b*Math.cos(l-Math.PI/2):0),y:u.y+(l?c*Math.sin(l)+b*Math.sin(l-Math.PI/2):0)},y=l+Math.PI/2),n=e.createSymbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:v,size:_,angle:a?y+g:0,strokeBoundsBuffer:0}),p)),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 wt,Tt;Mt.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,(wt=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",wt.axisContainer="axis-container",wt.labelContainer="axis-label-container",wt.tickContainer="axis-tick-container",wt.tick="axis-tick",wt.subTick="axis-sub-tick",wt.label="axis-label",wt.title="axis-title",wt.gridContainer="axis-grid-container",wt.grid="axis-grid",wt.gridRegion="axis-grid-region",wt.line="axis-line",wt.background="axis-background",wt.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(Tt=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",Tt.selectedReverse="selected_reverse",Tt.hover="hover",Tt.hoverReverse="hover_reverse";const Ct={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},Pt={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 Ot 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(L.hover,!0),u(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(L.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(u(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(L.hoverReverse),t.removeState(L.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState(L.selected))return this._lastSelect=null,void u(this.axisContainer,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(L.selectedReverse),t.removeState(L.selected))}));e.name&&!i.isEmpty(e.states)&&(e.addState(L.selected,!0),u(this.axisContainer,(t=>{t!==e&&t.name&&!i.isEmpty(t.states)&&t.addState(L.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(Object.assign({},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=B;else{const t=this.data[r],e=i.merge({},B,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(Object.assign({},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=B;else{const t=i.merge({},B,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,b;const g=this._getLabelAttribute(s,a,l,n),p=e.createText(g);if(p.name=t.AXIS_ELEMENT_NAME.label,p.id=this._getNodeId(`layer${n}-label-${s.id}`),i.isEmpty(null===(r=this.attribute.label)||void 0===r?void 0:r.state))p.states=B;else{const t=i.merge({},B,this.attribute.label.state);Object.keys(t).forEach((e=>{i.isFunction(t[e])&&(t[e]=t[e](s,a,l,n))})),p.states=t}o.add(p);const v=null!==(b=g.angle)&&void 0!==b?b:0;d=Math.max(d,p.AABBBounds.width()),h=Math.max(h,p.AABBBounds.height()),v&&(d=Math.abs(d*Math.cos(v)),h=Math.abs(h*Math.sin(v))),u=g.textAlign,c=g.textBaseline})),this.axisLabelLayerSize[n]={width:d,height:h,textAlign:u,textBaseline:c},o}renderTitle(e){const i=this.getTitleAttribute(),s=new w(Object.assign({},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(Pt,`${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 Object.assign({points:[l,o],anchor:d,alpha:h,beta:u},n)}_getLabelAttribute(t,e,s,a){var n,r,l,d,h,u;const c=this.attribute.label,{space:b=4,inside:g=!1,formatMethod:p}=c,v=o(c,["space","inside","formatMethod"]);let _=b,m=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)===g&&(m=(null===(l=this.attribute.tick)||void 0===l?void 0:l.length)||4),(null===(d=this.attribute.subTick)||void 0===d?void 0:d.visible)&&(null===(h=this.attribute.subTick)||void 0===h?void 0:h.inside)===g&&(m=Math.max(m,(null===(u=this.attribute.subTick)||void 0===u?void 0:u.length)||2)),_+=m;const y=this.getRelativeVector(t.point);a>0&&(0===y[1]?_+=(this.axisLabelLayerSize[a-1].height+i.get(this.attribute,"label.space",4))*a:_+=(this.axisLabelLayerSize[a-1].width+i.get(this.attribute,"label.space",4))*a);const x=this.getVerticalCoord(t.point,_,g),f=this.getVerticalVector(_,g,x),A=p?p(`${t.label}`,t,e,s,a):t.label;let{style:S}=v;S=i.isFunction(S)?i.merge({},Pt.label.style,S(t,e,s,a)):S;const E=this.getLabelAlign(f,g,S.angle);return S=i.merge(E,S),i.isFunction(S.text)&&(S.text=S.text({label:t.label,value:t.rawValue,index:t.index,layer:a})),Object.assign(Object.assign(Object.assign({},x),{text:A,lineHeight:null==S?void 0:S.fontSize}),S)}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},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 kt(Object.assign(Object.assign({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 It={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&&Ht(i.AABBBounds,t.AABBBounds,e)?t.setAttribute("opacity",0):(i=t,1)))}};function Ht(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function zt(t,e){for(let i,s=1,a=t.length,n=t[0].AABBBounds;s<a;n=i,++s)if(Ht(n,i=t[s].AABBBounds,e))return!0}function Vt(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function jt(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 Rt(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},Dt(t,e.attribute.angle)),{angle:Nt(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},$t(t,e.attribute.angle)),{angle:Nt(e.attribute.angle)}))}))}(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 Nt(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Dt(t,e=0){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"]);const a=(e=Nt(e))/(.5*Math.PI);let n;return n=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1,{textAlign:i[n],textBaseline:s[n]}}function $t(t,e=0){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"]);const a=(e=Nt(e))/(.5*Math.PI);let n;return n=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1,{textAlign:i[n],textBaseline:s[n]}}class Wt extends Ot{constructor(t,e){super(i.merge({},Wt.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(Object.assign({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({},Ct,null!==(a=n.state)&&void 0!==a?a:{}),s.insertBefore(l,s.firstChild)}}renderLine(e){const{start:s,end:a,line:n}=this.attribute,r=n,{startSymbol:l,endSymbol:d,style:h,breakRange:u,breakShape:c,breakShapeStyle:b,state:g}=r,p=o(r,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),v=Object.assign({points:[s,a],startSymbol:l,endSymbol:d,lineStyle:h},p);i.isEmpty(g)||(v.state={line:i.merge({},Ct,g),symbol:i.merge({},Ct,g)});const _=new Mt(v);_.name=t.AXIS_ELEMENT_NAME.line,_.id=this._getNodeId("line"),e.add(_)}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 x([s[1],-1*s[0]],t*(e?1:-1)*i)}getTitleAttribute(){var t,e,s,a,n,r,l,d;const h=this.attribute.title,{position:u="middle",space:c=4,textStyle:b={},autoRotate:g=!0,shape:p,background:v,state:_}=h,m=o(h,["position","space","textStyle","autoRotate","shape","background","state"]);let y=.5;"start"===u?y=0:"end"===u&&(y=1);const{verticalFactor:x=1}=this.attribute,A=-1*x,S=this.getTickCoord(y),E=this.getRelativeVector();let L=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);L+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===E[1]){const i=this.axisLabelsContainer.AABBBounds.height();isFinite(i)?L+=i+(e-1)*t:L=0}else{if(0===E[0]){const i=this.axisLabelsContainer.AABBBounds.width();isFinite(i)?L+=i+(e-1)*t:L=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{L+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const i=this.axisLabelLayerSize[0].textAlign,s="start"===i||"left"===i,a="center"===i,n=E[1]>0;L=1===A?n?s?L:a?L/2:t:s?t:a?L/2:L:n?s?t:a?L/2:L:s?L:a?L/2:t}}let B=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)&&(B=(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)&&(B=Math.max(B,(null===(d=this.attribute.subTick)||void 0===d?void 0:d.length)||2));const k=B+L+c,M=this.getVerticalCoord(S,k,!1),w=this.getVerticalVector(k,!1);let T,C,{angle:P}=m;if(T="start"===u?"start":"end"===u?"end":"center",i.isNil(P)&&g){P=f(E,[1,0],!0);const{verticalFactor:t=1}=this.attribute;C=1===-1*t?"bottom":"top"}else T=this.getTextAlign(w),C=this.getTextBaseline(w,!1);const O=Object.assign(Object.assign(Object.assign({},M),m),{textStyle:Object.assign({textAlign:T,textBaseline:C},b),state:{text:i.merge({},Ct,null==_?void 0:_.text),shape:i.merge({},Ct,null==_?void 0:_.shape),panel:i.merge({},Ct,null==_?void 0:_.background)}});return O.angle=P,p&&p.visible&&(O.shape=Object.assign({visible:!0},p.style),p.space&&(O.space=p.space)),v&&v.visible&&(O.panel=Object.assign({visible:!0},v.style)),O}_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=A,endAngle:r=S}=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 Object.assign(Object.assign({},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}getLabelAlign(t,e,s){const a=this.attribute.orient;if(i.isValidNumber(s)){if("top"===a||"bottom"===a)return Dt(a,s);if("left"===a||"right"===a)return $t(a,s)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,s,a,n){const{flush:r=!1}=this.attribute.label||{};if(r){const{orient:e,start:s,end:a}=this.attribute,n="bottom"===e||"top"===e,r=t[0],l=i.last(t),o=n?r.attribute.x>l.attribute.x:r.attribute.y<l.attribute.y;if(n){const t=Math.abs(s.x-a.x);if(o){const e=t,i=0,s=r.AABBBounds.x2,a=l.AABBBounds.x1;s>e&&r.setAttributes({x:e,textAlign:"right"}),a<i&&l.setAttributes({x:i,textAlign:"left"})}else{const e=0,i=t,s=r.AABBBounds.x1,a=l.AABBBounds.x2;s<e&&r.setAttributes({x:e,textAlign:"left"}),a>i&&l.setAttributes({x:i,textAlign:"right"})}}else{const t=Math.abs(s.y-a.y);if(o){const e=r.AABBBounds.y1,i=l.AABBBounds.y2,s=0,a=t;e<s&&r.setAttributes({y:s,textBaseline:"top"}),i>a&&l.setAttributes({y:a,textBaseline:"bottom"})}else{const e=t,i=0,s=r.AABBBounds.y2,a=l.AABBBounds.y1;s>e&&r.setAttributes({y:e,textBaseline:"bottom"}),a<i&&l.setAttributes({y:i,textBaseline:"top"})}}}}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:b,limitEllipsis:g,autoHide:p,autoHideMethod:v,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)})),Rt(s,t),!jt(t))break}}(t,{labelRotateAngle:c,orient:o}),b&&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:g,orient:o}),p&&function(t,e){if(i.isEmpty(t))return;const s=t.filter(Vt);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:It[n]||It.parity;if(a.length>=3&&zt(a,r)){do{a=l(a,r)}while(a.length>=3&&zt(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:v,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:b}=this.attribute;if(i.isValidNumber(b)&&(!i.isValidNumber(o)||b<=o)){const i=this._getAxisLabelLimitLength(b,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,b=0;const g=(null==o?void 0:o.visible)?null!==(a=o.style.lineWidth)&&void 0!==a?a:1:0,p=(null==d?void 0:d.visible)?null!==(n=d.length)&&void 0!==n?n:4:0;if(null==l?void 0:l.visible){c=M(l.text,l.textStyle).height;const t=i.normalizePadding(l.padding);b=l.space+t[0]+t[2]}return u&&(u=(u-h-b-c-g-p)/e),u}}Wt.defaultAttributes=Pt;class Ut extends Ot{constructor(t){super(i.merge({},Ut.defaultAttributes,t))}renderLine(s){const{startAngle:a=A,endAngle:n=S,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 b=Object.assign(Object.assign(Object.assign({},l),{startAngle:a,endAngle:n,radius:u,innerRadius:c}),null==d?void 0:d.style),g=e.createCircle(b);g.name=t.AXIS_ELEMENT_NAME.line,g.id=this._getNodeId("line"),i.isEmpty(null==d?void 0:d.state)||(g.states=i.merge({},Ct,d.state)),s.add(g)}isInValidValue(t){const{startAngle:e=A,endAngle:i=S}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=A,endAngle:s=S,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 x(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,d;const{center:h,radius:u,innerRadius:c=0}=this.attribute,b=this.attribute.title,{space:g=4,textStyle:p={},shape:v,background:_,state:m}=b,y=o(b,["space","textStyle","shape","background","state"]);let x=h,f=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)&&(f=i.get(this.attribute.label,"style.fontSize",12)+i.get(this.attribute.label,"space",4));let A=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)&&(A=(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)&&(A=Math.max(A,(null===(d=this.attribute.subTick)||void 0===d?void 0:d.length)||2));const S=u+A+f+g;let E="middle",{position:L}=this.attribute.title;i.isNil(L)&&(L=0===c?"end":"middle"),"start"===L?(E="bottom",x={x:h.x,y:h.y-S}):"end"===L&&(E="top",x={x:h.x,y:h.y+S});const B=Object.assign(Object.assign(Object.assign({},x),y),{textStyle:Object.assign({textBaseline:E,textAlign:"center"},p),state:{text:i.merge({},Ct,null==m?void 0:m.text),shape:i.merge({},Ct,null==m?void 0:m.shape),panel:i.merge({},Ct,null==m?void 0:m.background)}}),{angle:k}=y;return B.angle=k,v&&v.visible&&(B.shape=Object.assign({visible:!0},v.style),v.space&&(B.space=v.space)),_&&_.visible&&(B.panel=Object.assign({visible:!0},_.style)),B}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=A,endAngle:l=S,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 Object.assign(Object.assign({},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){}getLabelAlign(t,e,i){return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t)}}}Ut.defaultAttributes=Pt;class Ft 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 u(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(e),this._newElementAttrMap={},u(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:Object.assign(Object.assign({},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 Gt 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 Yt 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 Xt;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(Xt||(Xt={}));class qt extends n{constructor(t){super(i.merge({},qt.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=Xt.startHandler,this._activeItem=this._startHandler):"end"===e?(this._activeTag=Xt.endHandler,this._activeItem=this._endHandler):"middleRect"===e?(this._activeTag=Xt.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=Xt.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=Xt.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===Xt.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===Xt.startHandler?this.state.start+l>this.state.end?(this.state.start=this.state.end,this.state.end=this.state.start+l,this._activeTag=Xt.endHandler):this.state.start=this.state.start+l:this._activeTag===Xt.endHandler&&(this.state.end+l<this.state.start?(this.state.end=this.state.start,this.state.start=this.state.end+l,this._activeTag=Xt.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:b}=this.attribute,{width:g,height:p}=a;e&&(this.state.start=e),s&&(this.state.end=s),this._isHorizontal="top"===n||"bottom"===n,this._layoutCache.max=this._isHorizontal?g:p,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(b)&&(this._updateStateCallback=b)}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===Xt.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",Object.assign({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===Xt.background&&Math.abs(this.dragMaskSize())||0,height:a},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({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===Xt.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}renderText(){const{startTextStyle:t,endTextStyle:e}=this.attribute,{formatMethod:s}=t,a=o(t,["formatMethod"]),{formatMethod:n}=e,r=o(e,["formatMethod"]),{start:l,end:d}=this.state;this._startValue=this._statePointToData(l),this._endValue=this._statePointToData(d);const{position:h,width:u,height:c}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:h.x+l*u,y:h.y+c/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${h}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:h.x+d*u,y:h.y+c/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${h}`)):(this._startText=this.maybeAddLabel(this._container,i.merge({},a,{text:s?s(this._startValue):this._startValue,x:h.x+u/2,y:h.y+l*c,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${h}`),this._endText=this.maybeAddLabel(this._container,i.merge({},r,{text:n?n(this._endValue):this._endValue,x:h.x+u/2,y:h.y+d*c,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${h}`))}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 b,g,p;(null==l?void 0:l.visible)?this._isHorizontal?(b=h,g=u-c,p={x:a.x,y:a.y+c}):(b=h-c,g=u,p={x:a.x+("left"===r?c:0),y:a.y}):(b=h,g=u,p=a);const v=null!==(i=null==o?void 0:o.size)&&void 0!==i?i:this._isHorizontal?g:b,_=null!==(s=null==d?void 0:d.size)&&void 0!==s?s:this._isHorizontal?g:b;return(null==o?void 0:o.visible)&&(this._isHorizontal?(b-=(v+_)/2,p={x:p.x+v/2,y:p.y}):(g-=(v+_)/2,p={x:p.x,y:p.y+v})),this._layoutAttrFromConfig={position:p,width:b,height:g},this._layoutAttrFromConfig}render(){var t,e,i,s,a,n,r,l,o,d,h,u,c,b,g,p,v,_,m,y,x;this._layoutAttrFromConfig=null;const{orient:f,backgroundStyle:A,backgroundChartStyle:S,selectedBackgroundStyle:E,selectedBackgroundChartStyle:L,middleHandlerStyle:B,startHandlerStyle:k,endHandlerStyle:M,brushSelect:w}=this.attribute,{start:T,end:C}=this.state,{position:P,width:O,height:I}=this.getLayoutAttrFromConfig(),H=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=H,this._background=H.createOrUpdateChild("background",Object.assign({x:P.x,y:P.y,width:O,height:I,cursor:w?"crosshair":"auto"},A),"rect"),(null===(t=null==S?void 0:S.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",H),(null===(e=null==S?void 0:S.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",H),w&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=H.createOrUpdateChild("selectedBackground",Object.assign({x:P.x+T*O,y:P.y,width:(C-T)*O,height:I,cursor:w?"crosshair":"move"},E),"rect"):this._selectedBackground=H.createOrUpdateChild("selectedBackground",Object.assign({x:P.x,y:P.y+T*I,width:O,height:(C-T)*I,cursor:w?"crosshair":"move"},E),"rect"),(null===(i=null==L?void 0:L.line)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("line",H),(null===(s=null==L?void 0:L.area)||void 0===s?void 0:s.visible)&&this.setSelectedPreviewAttributes("area",H),this.renderText(),this._isHorizontal?(this._startHandler=H.createOrUpdateChild("startHandler",Object.assign({x:P.x+T*O,y:P.y+I/2,size:I,angle:0,symbolType:null!==(a=null==k?void 0:k.symbolType)&&void 0!==a?a:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},k),"symbol"),this._endHandler=H.createOrUpdateChild("endHandler",Object.assign({x:P.x+C*O,y:P.y+I/2,size:I,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==B?void 0:B.visible)&&(this._middleHandlerRect=H.createOrUpdateChild("middleHandlerRect",Object.assign({x:P.x+T*O,y:P.y-((null===(r=null==B?void 0:B.background)||void 0===r?void 0:r.size)||10),width:(C-T)*O,height:(null===(l=null==B?void 0:B.background)||void 0===l?void 0:l.size)||10},null===(o=null==B?void 0:B.background)||void 0===o?void 0:o.style),"rect"),this._middleHandlerSymbol=H.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:P.x+(T+C)/2*O,y:P.y-((null===(d=null==B?void 0:B.background)||void 0===d?void 0:d.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(u=null===(h=null==B?void 0:B.icon)||void 0===h?void 0:h.symbolType)&&void 0!==u?u:"square"},null==B?void 0:B.icon),"symbol"))):(this._startHandler=H.createOrUpdateChild("startHandler",Object.assign({x:P.x+O/2,y:P.y+T*I,size:O,angle:Math.PI/180*90,symbolType:null!==(c=null==k?void 0:k.symbolType)&&void 0!==c?c:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},k),"symbol"),(null==B?void 0:B.visible)&&(this._middleHandlerRect=H.createOrUpdateChild("middleHandlerRect",Object.assign({x:"left"===f?P.x-((null===(b=null==B?void 0:B.background)||void 0===b?void 0:b.size)||10):P.x+O,y:P.y+T*I,width:(null===(g=null==B?void 0:B.background)||void 0===g?void 0:g.size)||10,height:(C-T)*I},null===(p=null==B?void 0:B.background)||void 0===p?void 0:p.style),"rect"),this._middleHandlerSymbol=H.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:"left"===f?P.x-((null===(v=null==B?void 0:B.background)||void 0===v?void 0:v.size)||10)/2:P.x+O+((null===(_=null==B?void 0:B.background)||void 0===_?void 0:_.size)||10)/2,y:P.y+(T+C)/2*I,angle:Math.PI/180*90,symbolType:null!==(y=null===(m=null==B?void 0:B.icon)||void 0===m?void 0:m.symbolType)&&void 0!==y?y:"square",strokeBoundsBuffer:0},null==B?void 0:B.icon),"symbol")),this._endHandler=H.createOrUpdateChild("endHandler",Object.assign({x:P.x+O/2,y:P.y+C*I,size:O,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(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({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(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({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 w(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 Zt,Jt,Kt;qt.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,(Zt=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",Zt.middle="middle",Zt.end="end",Zt.insideStartTop="insideStartTop",Zt.insideStartBottom="insideStartBottom",Zt.insideMiddleTop="insideMiddleTop",Zt.insideMiddleBottom="insideMiddleBottom",Zt.insideEndTop="insideEndTop",Zt.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(Jt=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",Jt.right="right",Jt.top="top",Jt.bottom="bottom",Jt.middle="middle",Jt.insideLeft="insideLeft",Jt.insideRight="insideRight",Jt.insideTop="insideTop",Jt.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(Kt=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",Kt.bottom="bottom",Kt.middle="middle",Kt.insideTop="insideTop",Kt.insideBottom="insideBottom",Kt.insideMiddle="insideMiddle";class Qt extends n{_initContainer(){var t,s,a,n,r,l,o,d,h;const u=e.createGroup(Object.assign(Object.assign({},null===(t=this.attribute)||void 0===t?void 0:t.clipRange),{clip:null!==(a=i.isValid(null===(s=this.attribute)||void 0===s?void 0:s.clipRange))&&void 0!==a&&a}));u.name="marker-container";const c=e.createGroup({x:-(null!==(l=null===(r=null===(n=this.attribute)||void 0===n?void 0:n.clipRange)||void 0===r?void 0:r.x)&&void 0!==l?l:0),y:-(null!==(h=null===(d=null===(o=this.attribute)||void 0===o?void 0:o.clipRange)||void 0===d?void 0:d.y)&&void 0!==h?h:0)});u.add(c),this._containerClip=u,this.add(u),this._container=c}_updateContainer(){var t,e,s,a,n,r,l,o,d;this._containerClip.setAttributes(Object.assign(Object.assign({},null===(t=this.attribute)||void 0===t?void 0:t.clipRange),{clip:null!==(s=i.isValid(null===(e=this.attribute)||void 0===e?void 0:e.clipRange))&&void 0!==s&&s})),this._container.setAttributes({x:-(null!==(r=null===(n=null===(a=this.attribute)||void 0===a?void 0:a.clipRange)||void 0===n?void 0:n.x)&&void 0!==r?r:0),y:-(null!==(d=null===(o=null===(l=this.attribute)||void 0===l?void 0:l.clipRange)||void 0===o?void 0:o.y)&&void 0!==d?d:0)})}render(){var t,e;const i=null===(t=this.attribute.visible)||void 0===t||t;null!==(e=this.attribute.interactive)&&void 0!==e&&e||(this.setAttribute("pickable",!1),this.setAttribute("childrenPickable",!1)),i&&(this._containerClip?(this._updateContainer(),this.updateMarker()):(this._initContainer(),this.initMarker(this._container)))}}const te={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]}},ee={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"}},ie={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}},se={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"}},ae={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 ne extends Qt{constructor(t){super(i.merge({},ne.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:Object.assign(Object.assign({},ee[l]),r.textStyle)})}initMarker(t){const{points:e,startSymbol:i,endSymbol:s,label:a,lineStyle:n}=this.attribute,r=new Mt({points:e,startSymbol:i,endSymbol:s,lineStyle:n});r.name="mark-line-line",this._line=r,t.add(r);const l=new w(Object.assign({},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(Object.assign({},n)),this.setLabelPos()}}ne.defaultAttributes=te;class re extends Qt{constructor(t){super(i.merge({},re.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(Object.assign({},this.getLeftPos())):o.includes("right")||o.includes("Right")?null===(i=this._label)||void 0===i||i.setAttributes(Object.assign({},this.getRightPos())):o.includes("top")||o.includes("Top")?null===(s=this._label)||void 0===s||s.setAttributes(Object.assign({},this.getTopPos())):o.includes("bottom")||o.includes("Bottom")?null===(a=this._label)||void 0===a||a.setAttributes(Object.assign({},this.getBottomPos())):null===(n=this._label)||void 0===n||n.setAttributes(Object.assign({},this.getMiddlePos())),null===(r=this._label)||void 0===r||r.setAttributes({textStyle:Object.assign(Object.assign({},se[o]),l.textStyle)})}initMarker(t){const{points:i,label:s,areaStyle:a}=this.attribute,n=e.createPolygon(Object.assign({points:i},a));n.name="mark-area-area",this._area=n,t.add(n);const r=new w(Object.assign({},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(Object.assign({points:i},a)),null===(e=this._label)||void 0===e||e.setAttributes(Object.assign({},s)),this.setLabelPos()}}re.defaultAttributes=ie;class le extends Qt{constructor(t){super(i.merge({},le.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:b=t.IMarkPointItemPosition.middle}=i,g=(null===(n=this._line)||void 0===n?void 0:n.getEndAngle())||0,p=l*Math.cos(g)+o*Math.cos(g-Math.PI/2),v=l*Math.sin(g)+o*Math.sin(g-Math.PI/2);"text"===a?null==e||e.setAttributes(Object.assign(Object.assign({},h),{textStyle:Object.assign(Object.assign({},ae[(null==i?void 0:i.position)||"end"]),null==h?void 0:h.textStyle)})):"richText"===a?null==e||e.setAttributes({dx:this.getItemDx(e,b,u)+((null==u?void 0:u.dx)||0),dy:this.getItemDy(e,b,u)+((null==u?void 0:u.dy)||0)}):"image"===a&&(null==e||e.setAttributes({dx:this.getItemDx(e,b,c)+((null==c?void 0:c.dx)||0),dy:this.getItemDy(e,b,c)+((null==c?void 0:c.dy)||0)})),null==e||e.setAttributes({x:s.x+(p||0),y:s.y+(v||0),angle:r&&g+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(Object.assign(Object.assign({},i),a)):"text"===s?o=new w(Object.assign({},i)):"richText"===s?o=e.createRichText(Object.assign(Object.assign({},i),n)):"image"===s?o=e.createImage(Object.assign(Object.assign({},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(Object.assign(Object.assign({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 Mt({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)}}le.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 oe={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};class de extends n{getCurrent(){return this._current}constructor(t){super(i.merge({},de.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=oe,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||{},b=c.size||15,g=null!==(t=a.space)&&void 0!==t?t:8,p=a.state||{};let{preShape:v,nextShape:_}=a;v||(v=h?"triangleLeft":"triangleUp"),_||(_=h?"triangleRight":"triangleDown");const m=e.createSymbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:0,y:0,symbolType:v,size:b}));m.states=p,m.name="preHandler",this.preHandler=m,u.add(m);const{width:y,height:x}=M(`${n}/${n}`,Object.assign({textAlign:"center",textBaseline:"middle"},l)),f=i.isNumber(b)?b:b[0],A=i.isNumber(b)?b:b[1],S=e.createText(Object.assign({x:h?f/2+g+y/2:0,y:h?0:A/2+g+x/2,text:`${r}/${n}`,textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize},l));this.text=S,u.add(S);const E=e.createSymbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:h?f+2*g+y:0,y:h?0:A+2*g+x,symbolType:_,size:b}));E.name="nextHandler",E.states=p,this.nextHandler=E,u.add(E),1===this._total?(m.addState("disable"),E.addState("disable")):1===this._current?m.addState("disable"):this._current===n&&E.addState("disable");const L=u.AABBBounds,B=L.width(),k=L.height();u.translateTo(0-L.x1+d[3],0-L.y1+d[0]),this.add(u),this.attribute.width=B+d[1]+d[3],this.attribute.height=k+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}}de.defaultAttributes={handler:oe,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const he=16,ue=8,ce=12,be=12;var ge,pe,ve;t.LegendStateValue=void 0,(ge=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",ge.unSelected="unSelected",ge.selectedHover="selectedHover",ge.unSelectedHover="unSelectedHover",ge.focus="focus",t.LegendEvent=void 0,(pe=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",pe.legendItemUnHover="legendItemUnHover",pe.legendItemClick="legendItemClick",pe.legendItemAttributeUpdate="legendItemAttributeUpdate",t.LEGEND_ELEMENT_NAME=void 0,(ve=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",ve.title="legendTitle",ve.item="legendItem",ve.itemShape="legendItemShape",ve.itemLabel="legendItemLabel",ve.itemValue="legendItemValue",ve.focus="legendItemFocus";class _e 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=Object.assign({visible:!0},d.style),i.isValid(d.space)&&(h.space=d.space)),r&&r.visible&&(h.panel=Object.assign({visible:!0},r.style));const u=new w(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 me={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};class ye extends _e{constructor(e){super(i.merge({},ye.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;let i=!1;(e.hasState(t.LegendStateValue.unSelectedHover)||e.hasState(t.LegendStateValue.selectedHover))&&(i=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{i||!e.hasState(t.LegendStateValue.unSelectedHover)&&!e.hasState(t.LegendStateValue.selectedHover)||(i=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const a=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);a&&a.setAttribute("visible",!1),i&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e),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:b}=this.attribute,g="horizontal"===d,{spaceCol:p=he,spaceRow:v=ue,maxWidth:_,width:m,height:y}=t;i.isValid(_)?i.isValid(m)?this._itemWidthByUser=Math.min(_,m):this._itemWidthByUser=_:i.isValid(m)&&(this._itemWidthByUser=m),i.isValid(y)&&(this._itemHeightByUser=y);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),g?(E=r,i.isValid(h)&&(a>=h?(x=!0,e>0&&(A=0,S+=d+v,L+=1)):h<A+a&&(x=!0,A=0,S+=d+v,L+=1)),e>0&&s.setAttributes({x:A,y:S}),A+=p+a):(E=n,i.isValid(u)&&u<S+d&&(x=!0,S=0,A+=f+p,f=0,L+=1),e>0&&s.setAttributes({x:A,y:S}),S+=v+d),o.add(s)}));let B=!1;x&&b&&L>E&&(B=this._renderPager(g)),B||(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:b={}}=this.attribute.item;let{shape:g={},label:p={},value:v={},background:_={}}=this.attribute.item;g=this._handleStyle(g,s,a,n,r),p=this._handleStyle(p,s,a,n,r),v=this._handleStyle(v,s,a,n,r),_=this._handleStyle(_,s,a,n,r);const m=i.normalizePadding(u);let y;!1===_.visible?(y=e.createGroup({x:0,y:0,cursor:(null==_?void 0:_.style).cursor}),this._appendDataToShape(y,t.LEGEND_ELEMENT_NAME.item,s,y)):(y=e.createGroup(Object.assign({x:0,y:0},null==_?void 0:_.style)),this._appendDataToShape(y,t.LEGEND_ELEMENT_NAME.item,s,y,null==_?void 0:_.state)),y.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const x=e.createGroup({x:0,y:0,pickable:!1});y.add(x);let f=0;const A=i.get(g,"style.size",10),S=i.get(g,"space",8),E=e.createSymbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),g.style));let L;Object.keys(g.state||{}).forEach((t=>{const e=g.state[t].fill||g.state[t].stroke;h.fill&&i.isNil(g.state[t].fill)&&e&&(g.state[t].fill=e),h.stroke&&i.isNil(g.state[t].stroke)&&e&&(g.state[t].stroke=e)})),this._appendDataToShape(E,t.LEGEND_ELEMENT_NAME.itemShape,s,y,null==g?void 0:g.state),E.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(E);let B=0;if(c){const a=i.get(b,"size",10);L=e.createSymbol(Object.assign(Object.assign({x:0,y:-a/2-1,strokeBoundsBuffer:0},b),{visible:!1,pickMode:"imprecise",boundsPadding:m})),this._appendDataToShape(L,t.LEGEND_ELEMENT_NAME.focus,s,y),B=a}const k=e.createText(Object.assign(Object.assign({x:A/2+S,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==p?void 0:p.style).fontSize},null==p?void 0:p.style),{text:p.formatMethod?p.formatMethod(o,s,n):o}));this._appendDataToShape(k,t.LEGEND_ELEMENT_NAME.itemLabel,s,y,null==p?void 0:p.state),k.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),x.add(k);const M=i.get(p,"space",8);if(f+=A/2+S+k.AABBBounds.width()+M,i.isValid(d)){const r=i.get(v,"space",c?8:0),l=e.createText(Object.assign(Object.assign({x:f+M,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(d,s,n):d}));if(this._appendDataToShape(l,t.LEGEND_ELEMENT_NAME.itemValue,s,y,null==v?void 0:v.state),l.addState(a?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-m[1]-m[3]-A-S-M-B-r,e=l.AABBBounds,i=k.AABBBounds,s=e.width(),a=i.width();a>t?(t-s)/a>.4?k.setAttribute("maxLineWidth",t-s):(l.setAttribute("maxLineWidth",.5*t),k.setAttribute("maxLineWidth",.5*t)):l.setAttribute("maxLineWidth",t-a),v.alignRight&&l.setAttributes({textAlign:"right",x:this._itemWidthByUser-A/2-m[1]-m[3]-B-r})}f=l.AABBBounds.x2+r,x.add(l)}else this._itemWidthByUser&&k.setAttribute("maxLineWidth",this._itemWidthByUser-m[1]-m[3]-A-S-B);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+m[1]+m[3],O=this._itemHeightByUser||C+m[0]+m[2];return y.attribute.width=P,y.attribute.height=O,x.translateTo(-w.x1+m[3],-w.y1+m[0]),y}_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:d={},pager:h={}}=this.attribute,{spaceCol:u=he,spaceRow:c=ue}=d,b=this._itemsContainer,{animation:g=!0,animationDuration:p=450,animationEasing:v="quadIn",space:_=be}=h,m=o(h,["animation","animationDuration","animationEasing","space"]);let y,x=0,f=0,A=0,S=0,E=1;if(t){if(y=new de(Object.assign({layout:1===l?"horizontal":"vertical",total:99},i.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},m))),this._pager=y,this._innerView.add(y),x=(l-1)*c+this._itemHeight*l,f=a-y.AABBBounds.width()-_,f<=0)return this._innerView.removeChild(y),!1;b.getChildren().forEach(((t,e)=>{const{width:i,height:s}=t.attribute;f<A+i&&(A=0,S+=s+c,E+=1),e>0&&t.setAttributes({x:A,y:S}),A+=u+i})),y.setAttributes({total:Math.ceil(E/l),x:f,y:s+x/2-y.AABBBounds.height()/2})}else{if(y=new de(Object.assign({layout:"horizontal",total:99},m)),this._pager=y,this._innerView.add(y),f=this._itemMaxWidth*r+(r-1)*u,x=n-y.AABBBounds.height()-_-s,x<=0)return this._innerView.removeChild(y),!1;b.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;x<S+i&&(S=0,A+=this._itemMaxWidth+u,E+=1),e>0&&t.setAttributes({x:A,y:S}),S+=c+i})),y.setAttributes({total:Math.ceil(E/r),x:(f-y.AABBBounds.width())/2,y:n-y.AABBBounds.height()})}h.defaultCurrent>1&&(t?b.setAttribute("y",-(h.defaultCurrent-1)*(x+c)):b.setAttribute("x",-(h.defaultCurrent-1)*(f+u)));const L=e.createGroup({x:0,y:s,width:f,height:x,clip:!0,pickable:!1});L.add(b),this._innerView.add(L);const B=e=>{const{current:i}=e.detail;g?b.animate().to(t?{y:-(i-1)*(x+c)}:{x:-(i-1)*(f+u)},p,v):t?b.setAttribute("y",-(i-1)*(x+c)):b.setAttribute("x",-(i-1)*(f+u))};return this._pager.addEventListener("toPrev",B),this._pager.addEventListener("toNext",B),!0}_setLegendItemState(e,i,s=!0){let a=!1;e.hasState(i)||(a=!0),e.addState(i,s),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&(a||e.hasState(i)||(a=!0),e.addState(i,s))})),a&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e)}_removeLegendItemState(e,i){let s=!1;i.forEach((t=>{!s&&e.hasState(t)&&(s=!0),e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{!s&&e.hasState(t)&&(s=!0),e.removeState(t)}))})),s&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e)}_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({},me,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 xe;function fe(t){return i.isArray(t)?t:[t,t]}function Ae(t){return t?"ew-resize":"ns-resize"}ye.defaultAttributes={layout:"horizontal",title:{align:"start",space:ce,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:he,spaceRow:ue,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:be,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(xe=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",xe.railContainer="sliderRailContainer",xe.rail="sliderRail",xe.startText="sliderStartText",xe.endText="sliderEndText",xe.startHandler="sliderStartHandler",xe.startHandlerText="startHandlerText",xe.endHandler="sliderEndHandler",xe.endHandlerText="sliderEndHandlerText",xe.track="sliderTrack",xe.trackContainer="sliderTrackContainer";class Se 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({},Se.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;if(l===r)return;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),b=c/h*(l-r)+r;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,b):this._updateHandler(this._currentHandler,c,b),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;if(n===a)return;const{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;if(n===a)return;const 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{layout:e,railWidth:s,railHeight:a,min:n,max:r}=this.attribute;if(r===n)return;const[l,o]=i.array(t),{startHandler:d,endHandler:h}=this._getHandlers(),u="vertical"===e?a:s,c=(l-n)/(r-n)*u;if(d&&this._updateHandler(d,c,l),h){const t=(o-n)/(r-n)*u;this._updateHandler(h,t,o)}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:b}=this.attribute;i.isNil(b)&&(b=[h,u]),this._currentValue={startValue:fe(b)[0],endValue:fe(b)[1]};const g="horizontal"===n;this._isHorizontal=g;const p=e.createGroup({x:0,y:0});p.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(p),this._innerView=p;let v,_=0;if(o&&o.visible){v=e.createText(Object.assign({x:g?0:r/2,y:g?l/2:0,textAlign:g?"start":"center",textBaseline:g?"middle":"top",text:o.text,lineHeight:null===(s=o.style)||void 0===s?void 0:s.fontSize},o.style)),v.name=t.SLIDER_ELEMENT_NAME.startText,p.add(v);const a=i.isValid(o.space)?o.space:0;_+=(g?v.AABBBounds.width():v.AABBBounds.height())+a}const m=e.createGroup({x:g?_:0,y:g?0:_});p.add(m);const y=e.createGroup({x:0,y:0});let x;if(y.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=y,m.add(y),this._renderRail(y),_+=g?r:l,d&&d.visible){const s=i.isValid(d.space)?d.space:0;x=e.createText(Object.assign({x:g?_+s:r/2,y:g?l/2:_+s,textAlign:g?"start":"center",textBaseline:g?"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,p.add(x)}this._renderTrack(y),c&&(this._renderHandlers(m),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(Object.assign({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 b=o&&o.visible,g=this._isHorizontal,p=g?h:d,[v,_]=fe(c),m=n===a?s?0:p:(v-a)/(n-a)*p,y=this._renderHandler(Object.assign({x:g?m:h/2,y:g?d/2:m,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":Ae(g)},l));if(y.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=y,e.add(y),this._currentValue.startPos=m,b){const i=this._renderHandlerText(v,s?"start":"end");i.name=t.SLIDER_ELEMENT_NAME.startHandlerText,e.add(i),this._startHandlerText=i}if(s){const i=n===a?p:(_-a)/(n-a)*p,s=this._renderHandler(Object.assign({x:g?i:h/2,y:g?d/2:i,size:r,strokeBoundsBuffer:0,cursor:!1===u?"default":Ae(g)},l));if(s.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=s,e.add(s),this._currentValue.endPos=i,b){const i=this._renderHandlerText(_,"end");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,value:c}=this.attribute;let b,g;if(i.isNil(c))a?(b=n,g=r):b=g=n;else if(a){const t=i.clampRange(c,n,r);b=t[0],g=t[1]}else b=n,g=i.clamp(c,n,r);const p=this._isHorizontal,v=p?o:l;a||(b=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 m=i.isObject(a)&&!0===a.draggableTrack;let y;y=!1===u?"default":!1===a||!1===m?"pointer":Ae(p);const x=r===n?v:(g-b)/(r-n)*v,f=r===n?0:(b-n)/(r-n)*v,A=e.createRect(Object.assign({x:p?f:0,y:p?0:f,width:p?x:o,height:p?l:x,cursor:y},d));A.name=t.SLIDER_ELEMENT_NAME.track,this._track=A,_.add(A),s.add(_)}_renderHandler(t){return e.createSymbol(t)}_renderHandlerText(t,i){var s,a,n;const{align:r,min:l,max:o,handlerSize:d=14,handlerText:h={},railHeight:u,railWidth:c,slidable:b}=this.attribute,g=this._isHorizontal,p=g?c:u,v=o===l?"start"===i?0:p:(t-l)/(o-l)*p,_=null!==(s=h.space)&&void 0!==s?s:4,m=Object.assign({text:(null==h?void 0:h.formatter)?h.formatter(t):t.toFixed(null!==(a=null==h?void 0:h.precision)&&void 0!==a?a:0),lineHeight:null===(n=h.style)||void 0===n?void 0:n.lineHeight,cursor:!1===b?"default":Ae(g)},h.style);g?"top"===r?(m.textBaseline="bottom",m.textAlign="center",m.x=v,m.y=(u-d)/2-_):(m.textBaseline="top",m.textAlign="center",m.x=v,m.y=(u+d)/2+_):"left"===r?(m.textBaseline="middle",m.textAlign="end",m.x=(c-d)/2-_,m.y=v):(m.textBaseline="middle",m.textAlign="start",m.x=(c+d)/2+_,m.y=v);return e.createText(m)}_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}}}Se.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 Ee extends _e{constructor(t){super(i.merge({},Ee.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:b,railStyle:g,trackStyle:p,startText:v,endText:_,handlerText:m,showTooltip:y,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 Se({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:b,railStyle:g,trackStyle:Object.assign({fill:this._color},p),startText:v,endText:_,handlerText:m,showTooltip:y,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",ce):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 b="horizontal"===t?i:s;if(Math.abs(d-h)!==b&&e&&e.length>1){const t=this._color.stops,e=Math.min(d,h),i=Math.max(d,h),s=e/b,a=i/b,n=a-s,u=t.filter((t=>t.offset>s&&t.offset<a)),c=Math.min(l,o),g=Math.max(l,o),p=this._colorScale.scale(c),v=this._colorScale.scale(g),_=[{offset:0,color:p}];u.forEach((t=>{_.push({offset:(t.offset-s)/n,color:t.color})})),_.push({offset:1,color:v}),r.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:_}))}}}function Le(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`}Ee.defaultAttributes={layout:"horizontal",title:{align:"start",space:ce,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 Be extends _e{constructor(t){super(i.merge({},Be.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:b,trackStyle:g,startText:p,endText:v,handlerText:_,showTooltip:m,tooltip:y,sizeBackground:x}=this.attribute,f=e.createGroup({x:0,y:0});this._innerView.add(f);const A=new Se({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:Object.assign({symbolType:Le(a)},c),railStyle:b,trackStyle:g,startText:p,endText:v,handlerText:_,showTooltip:m,tooltip:y});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 B=e.createPath(Object.assign(Object.assign({x:0,y:E,path:S},x),{zIndex:0}));f.add(B);const k=this._title?this._title.AABBBounds.height()+i.get(this.attribute,"title.space",ce):0;f.translate(0-f.AABBBounds.x1,k-f.AABBBounds.y1),this._slider=A}_bindEvents(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}Be.defaultAttributes={layout:"horizontal",title:{align:"start",space:ce,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 ke extends n{constructor(t){super(i.merge({},ke.defaultAttributes,t)),this.name="title"}render(){var t,e,s,a,n,r,l,o,d,h,u,c,b,g,p,v,_,m,y,x,f,A,S,E,L,B,k,M,w,T,C,P,O,I,H,z,V,j,R,N,D,$,W,U,F,G,Y,X,q,Z,J,K,Q,tt,et,it,st,at,nt,rt,lt,ot;const{text:dt,textStyle:ht,subtext:ut,subtextStyle:ct,width:bt,height:gt,minWidth:pt,maxWidth:vt,minHeight:_t,maxHeight:mt,align:yt,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:bt)&&void 0!==n?n:0,height:null!==(l=null!==(r=ht.height)&&void 0!==r?r:gt)&&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",Object.assign(Object.assign({text:[dt]},ht),{maxLineWidth:null!==(h=null==ht?void 0:ht.maxLineWidth)&&void 0!==h?h:bt,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===(b=this._mainTitle)||void 0===b?void 0:b.AABBBounds.width():0;if(!1!==(null===(g=this.attribute)||void 0===g?void 0:g.visible)&&!1!==(null==ct?void 0:ct.visible))if(ct&&i.isValid(null==ct?void 0:ct.character)){const t={x:null!==(p=ct.x)&&void 0!==p?p:0,y:null!==(v=ct.y)&&void 0!==v?v:Et,width:null!==(m=null!==(_=ct.width)&&void 0!==_?_:bt)&&void 0!==m?m:0,height:null!==(x=null!==(y=ct.height)&&void 0!==y?y:gt)&&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",Object.assign(Object.assign({text:[ut]},ct),{maxLineWidth:null!==(S=null==ct?void 0:ct.maxLineWidth)&&void 0!==S?S:bt,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 Bt=this._subTitle?null===(L=this._subTitle)||void 0===L?void 0:L.AABBBounds.height():0,kt=this._subTitle?null===(B=this._subTitle)||void 0===B?void 0:B.AABBBounds.width():0;let Mt=Math.max(Lt,kt),wt=Et+(null!==(k=null==ct?void 0:ct.height)&&void 0!==k?k:Bt);if(i.isValid(bt)&&(Mt=bt,null===(M=this._mainTitle)||void 0===M||M.setAttribute("maxLineWidth",bt),null===(w=this._subTitle)||void 0===w||w.setAttribute("maxLineWidth",bt)),i.isValid(gt)&&(wt=gt),i.isValid(pt)&&Mt<pt&&(Mt=pt),i.isValid(vt)&&(null===(T=this._mainTitle)||void 0===T||T.setAttribute("maxLineWidth",vt),null===(C=this._subTitle)||void 0===C||C.setAttribute("maxLineWidth",vt),null===(P=this._mainTitle)||void 0===P||P.setAttribute("maxWidth",vt),null===(O=this._subTitle)||void 0===O||O.setAttribute("maxWidth",vt),Mt>vt&&(Mt=vt)),i.isValid(_t)&&wt<_t&&(wt=_t),i.isValid(mt)&&(null===(I=this._mainTitle)||void 0===I||I.setAttribute("maxHeight",mt),null===(H=this._subTitle)||void 0===H||H.setAttribute("maxHeight",mt-Et),wt>mt&&(wt=mt)),St.attribute.width=Mt+At[1]+At[3],St.attribute.height=wt+At[0]+At[2],i.isValid(yt)||i.isValid(null==ht?void 0:ht.align)){const t=(null==ht?void 0:ht.align)?null==ht?void 0:ht.align:yt,e=null!==(z=null==ht?void 0:ht.width)&&void 0!==z?z:Lt;"left"===t?(null===(V=this._mainTitle)||void 0===V||V.setAttribute("x",0),null===(j=this._mainTitle)||void 0===j||j.setAttribute("textAlign","left")):"center"===t?(null===(R=this._mainTitle)||void 0===R||R.setAttribute("x",e/2),null===(N=this._mainTitle)||void 0===N||N.setAttribute("textAlign","center")):"right"===t&&(null===(D=this._mainTitle)||void 0===D||D.setAttribute("x",e),null===($=this._mainTitle)||void 0===$||$.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===(U=this._mainTitle)||void 0===U||U.setAttribute("textBaseline","top")):"middle"===t?(null===(F=this._mainTitle)||void 0===F||F.setAttribute("y",e/2),null===(G=this._mainTitle)||void 0===G||G.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(Y=this._mainTitle)||void 0===Y||Y.setAttribute("y",e),null===(X=this._mainTitle)||void 0===X||X.setAttribute("textBaseline","bottom"))}if(i.isValid(yt)||i.isValid(null==ct?void 0:ct.align)){const t=(null==ct?void 0:ct.align)?null==ct?void 0:ct.align:yt,e=null!==(q=null==ct?void 0:ct.width)&&void 0!==q?q:kt;"left"===t?(null===(Z=this._subTitle)||void 0===Z||Z.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"))}}}ke.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 Me={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 we=(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`},Te=(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 Ce extends n{constructor(t){super(i.merge({},Ce.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?Te:we,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}}Ce.defaultAttributes={direction:"horizontal",align:"start"};class Pe extends e.Symbol{constructor(t){super(t)}}var Oe,Ie;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(Oe||(Oe={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(Ie||(Ie={}));class He extends n{constructor(t){super(i.merge({},He.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({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"},He.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({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"},He.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},He.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},He.defaultControllerAttr),{visible:this.attribute.backward.visible}),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 Pe(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{i.isNil(this._backwardController)&&(this._backwardController=new Pe(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{i.isNil(this._forwardController)&&(this._forwardController=new Pe(Object.assign({},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(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({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(Oe.OnPlay);this.dispatchEvent(t)},this.pause=()=>{const t=this._createCustomEvent(Oe.OnPause);this.dispatchEvent(t)},this.forward=()=>{const t=this._createCustomEvent(Oe.OnForward);this.dispatchEvent(t)},this.backward=()=>{const t=this._createCustomEvent(Oe.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()}}He.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},He.defaultAttributes={[Ie.Start]:{},[Ie.Pause]:{},[Ie.Backward]:{},[Ie.Forward]:{}};const ze={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},Ve=[200,10];var je,Re;t.DirectionEnum=void 0,(je=t.DirectionEnum||(t.DirectionEnum={})).Default="default",je.Reverse="reverse",t.PlayerEventEnum=void 0,(Re=t.PlayerEventEnum||(t.PlayerEventEnum={})).change="change",Re.play="play",Re.pause="pause",Re.backward="backward",Re.forward="forward",Re.end="end",Re.OnChange="change",Re.OnPlay="play",Re.OnPause="pause",Re.OnBackward="backward",Re.OnForward="forward",Re.OnEnd="end";const Ne=({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}),De=({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}),$e=t=>"top"===t||"bottom"===t;class We extends n{constructor(t){super(i.merge({},We.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={visible:this._sliderVisible,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,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1}};if($e(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.height)&&void 0!==e?e:Ve[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:Ve[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 Se(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward};return $e(this._orient)?(t.layout="horizontal",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})):(t.layout="vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new He(t),this._controllerVisible&&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,b,g,p,v,_;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._sliderVisible=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.visible,this._railStyle=Object.assign({},null===(s=null===(i=this.attribute)||void 0===i?void 0:i.slider)||void 0===s?void 0:s.railStyle),this._trackStyle=Object.assign({},null===(n=null===(a=this.attribute)||void 0===a?void 0:a.slider)||void 0===n?void 0:n.trackStyle),this._handlerStyle=Object.assign({},null===(l=null===(r=this.attribute)||void 0===r?void 0:r.slider)||void 0===l?void 0:l.handlerStyle),this._controllerVisible=null===(d=null===(o=this.attribute)||void 0===o?void 0:o.controller)||void 0===d?void 0:d.visible,this._start=Object.assign({},null===(u=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===u?void 0:u.start),this._pause=Object.assign({},null===(b=null===(c=this.attribute)||void 0===c?void 0:c.controller)||void 0===b?void 0:b.pause),this._forward=Object.assign({},null===(p=null===(g=this.attribute)||void 0===g?void 0:g.controller)||void 0===p?void 0:p.forward),this._backward=Object.assign({},null===(_=null===(v=this.attribute)||void 0===v?void 0:v.controller)||void 0===_?void 0:_.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=$e(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:Ve[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=this._sliderVisible?($e(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:0,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]=Object.assign(Object.assign({},this._layoutInfo[s]),{size:r,x:$e(this._orient)?t+a:(this._size.width-r)/2,y:$e(this._orient)?(this._size.height-r)/2:t+a}),t+a+r}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:$e(this._orient)?u+this.attribute.slider.space:(this._size.width-l)/2,y:$e(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]=Object.assign(Object.assign({},this._layoutInfo[s]),{size:r,x:$e(this._orient)?t+a:(this._size.width-r)/2,y:$e(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)}}We.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},ze),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},ze),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},ze),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},ze),{key:"backward",position:"start"})}};var Ue;t.IOperateType=void 0,(Ue=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",Ue.drawEnd="drawEnd",Ue.drawing="drawing",Ue.moving="moving",Ue.moveStart="moveStart",Ue.moveEnd="moveEnd",Ue.brushClear="brushClear";const Fe={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}},Ge=5,Ye={debounce:i.debounce,throttle:i.throttle};class Xe extends n{constructor(e){super(i.merge({},Xe.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",Ye[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,b=l-d,g=o-h,p=n-u,v=r-c;this._operatingMaskMoveRangeX=[b,g],this._operatingMaskMoveRangeY=[p,v],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=Ge}=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(Object.assign({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)}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0}=this.attribute;this.stage.removeEventListener("pointerdown",this._onBrushStart),this.stage.removeEventListener("pointermove",Ye[t](this._onBrushing,e)),this.stage.removeEventListener("pointerup",this._onBrushEnd),this.stage.removeEventListener("pointerupoutside",this._onBrushEnd)}}Xe.defaultAttributes=Fe;const qe=(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)})},Ze=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=>Object.assign(Object.assign({},t),{text:e})))}},Je={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:E,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:E,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:E,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},Ke=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"],Qe="tooltip-title",ti="tooltip-content",ei="shape",ii="value";class si extends n{constructor(t){super(i.merge({},si.defaultAttributes,t)),this.name="tooltip"}render(){const{visible:t,content:e,panel:s,keyWidth:a,valueWidth:n,hasContentShape:r,autoCalculatePosition:l,autoMeasure:o}=this.attribute;if(!t)return void this.hideAll();o&&si.measureTooltip(this.attribute),l&&si.calculateTooltipPosition(this.attribute);const d=i.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(Qe,{visible:!0,x:d[3],y:d[0]},"group");const h=si.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${Qe}-${ei}`,i.merge({symbolType:"circle"},h.shape,{visible:c(h)&&c(h.shape)}),"symbol"),h.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Qe}-${ii}`,Object.assign({visible:c(h)&&c(h.value)},Ze(h.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Qe}-${ii}`,Object.assign({text:"",visible:c(h)&&c(h.value)},h.value),"text");const u=c(h.shape)?h.shape.size+h.shape.spacing:0,{textAlign:b,textBaseline:g}=h.value,p=s.width-d[3]-d[0]-u;"center"===b?this._tooltipTitle.setAttribute("x",u+p/2):"right"===b||"end"===b?this._tooltipTitle.setAttribute("x",u+p):this._tooltipTitle.setAttribute("x",u),"bottom"===g?this._tooltipTitle.setAttribute("y",h.height):"middle"===g?this._tooltipTitle.setAttribute("y",h.height/2):this._tooltipTitle.setAttribute("y",0);const v=c(h)?h.height+h.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(ti,{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==e?void 0:e.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+v);let t=0;e.forEach(((e,s)=>{var l;const o=si.getContentAttr(this.attribute,s);if(!c(o))return;const d=`${ti}-${s}`,h=this._tooltipContent.createOrUpdateChild(d,{visible:!0,x:0,y:t},"group");let u=0;if(c(o.shape)&&h.createOrUpdateChild(`${d}-${ei}`,Object.assign({visible:!0,x:o.shape.size/2,y:o.shape.size/2+((null!==(l=o.key.lineHeight)&&void 0!==l?l:o.key.fontSize)-o.shape.size)/2},o.shape),"symbol"),r&&(u+=o.shape.size+o.shape.spacing),c(o.key)){let t;t=o.key.multiLine?h.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},Ze(o.key)),{textBaseline:"top"}),"richtext"):h.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},o.key),{textBaseline:"top"}),"text");const{textAlign:e}=o.key;"center"===e?t.setAttribute("x",u+a/2):"right"===e||"end"===e?t.setAttribute("x",u+a):t.setAttribute("x",u),t.setAttribute("y",0),u+=a+o.key.spacing}if(c(o.value)){let t;t=o.value.multiLine?h.createOrUpdateChild(`${d}-${ii}`,Object.assign(Object.assign({visible:!0},Ze(o.value)),{textBaseline:"top"}),"richtext"):h.createOrUpdateChild(`${d}-${ii}`,Object.assign(Object.assign({visible:!0},o.value),{textBaseline:"top"}),"text");let e="right";i.isValid(o.value.textAlign)?e=o.value.textAlign:c(o.key)||(e="left"),t.setAttribute("textAlign",e),"center"===e?t.setAttribute("x",u+n/2):"right"===e||"end"===e?t.setAttribute("x",u+n):t.setAttribute("x",u),u+=n,t.setAttribute("y",0),h.add(t)}t+=o.height+o.spaceRow}))}}setAttributes(t,e){const s=Object.keys(t);this.attribute.autoCalculatePosition&&s.every((t=>Ke.includes(t)))?(this._mergeAttributes(t,s),i.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&si.measureTooltip(this.attribute),si.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=si.getTitleAttr(t);let l=0,o=n[0]+n[2],d=0;const{value:h,shape:u}=r,{visible:b=!1,symbolType:g=""}=null!=u?u:{};if(i.isValid(h)){const{width:t,height:e}=k(h).quickMeasure(h.text);l=t,d=e}if(b&&e.builtinSymbolsMap[g]&&(l+=u.size+u.spacing,d=Math.max(u.size,d)),t.title&&(t.title.width=l,t.title.height=d),c(r)&&(o+=d+r.spaceRow),null==s?void 0:s.length){const i=[];if(s.forEach(((e,s)=>{const a=si.getContentAttr(t,s);(e.key||e.value)&&c(a)&&i.push([e,a])})),i.length){let n=!1;const r=[],d=[],h=[];i.forEach((([t,s],l)=>{var u;const{key:b,value:g,shape:p,spaceRow:v}=s,_=c(p),m=null!==(u=null==p?void 0:p.symbolType)&&void 0!==u?u:"",y=k(b),x=k(g);let f=0;if(c(b)){const{width:t,height:e}=y.quickMeasure(b.text);d.push(t),f=Math.max(f,e)}if(c(g)){const{width:t,height:e}=x.quickMeasure(g.text);h.push(t),f=Math.max(f,e)}_&&e.builtinSymbolsMap[m]&&(n=!0,r.push(p.size),f=Math.max(p.size,f)),t.height=f,o+=f,l<i.length-1&&(o+=null!=v?v:a.spaceRow)}));const u=r.length?Math.max(...r):0,b=d.length?Math.max(...d):0,g=h.length?Math.max(...h):0;l=Math.max(b+g+a.key.spacing+a.value.spacing+(n?u+a.shape.spacing:0),l),s.forEach((t=>{t.width=l})),t.hasContentShape=n,t.keyWidth=b,t.valueWidth=g}}return t.panel.width=l+n[1]+n[3],t.panel.height=o,t}static getTitleAttr(t){return qe({},si.defaultAttributes.titleStyle,si.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return qe({},si.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}si.defaultAttributes=Je;t.AbstractComponent=n,t.ArcInfo=xt,t.ArcLabel=ft,t.BasePlayer=We,t.Brush=Xe,t.CircleAxis=Ut,t.CircleCrosshair=F,t.ColorContinuousLegend=Ee,t.ContinuousPlayer=class extends We{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(Oe.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(Oe.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(Oe.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(Oe.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.change))},this.play=()=>h(this,void 0,void 0,(function*(){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.play),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.end)},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.pause))},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.backward)},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.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=he,t.DEFAULT_ITEM_SPACE_ROW=ue,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=be,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=Ct,t.DEFAULT_TITLE_SPACE=ce,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=St,t.DataZoom=qt,t.DiscreteLegend=ye,t.DiscretePlayer=class extends We{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(Oe.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(Oe.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(Oe.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(Oe.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.change)}))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(Ne({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||De({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.play),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.change),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.change)),("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.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,e.vglobal.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.Grid=kt,t.GroupFadeIn=Gt,t.GroupFadeOut=Yt,t.GroupTransition=Ft,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(Me,"title.style"),s.style);this._title=o.createOrUpdateChild("indicator-title",Object.assign(Object.assign({},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(Me,"content.style"),e.style),u=o.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({},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=M(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=ct,t.LineAxis=Wt,t.LineCrosshair=W,t.LineLabel=pt,t.LinkPath=Ce,t.MarkArea=re,t.MarkLine=ne,t.MarkPoint=le,t.Pager=de,t.PolygonCrosshair=Y,t.PopTip=C,t.RectCrosshair=U,t.RectLabel=gt,t.ScrollBar=r,t.SectorCrosshair=G,t.Segment=Mt,t.SizeContinuousLegend=Be,t.Slider=Se,t.SymbolLabel=bt,t.Tag=w,t.Title=ke,t.Tooltip=si,t.getHorizontalPath=we,t.getSizeHandlerPath=Le,t.getVerticalPath=Te,t.loadPoptip=function(t){i.merge(V.poptip,t),e.container.load(D)},t.popTipModule=D,t.setPoptipTheme=function(t){i.merge(V.poptip,z,t)},t.version="0.15.0-alpha.16"}));
|