9 lines
869 KiB
JavaScript
Executable File
9 lines
869 KiB
JavaScript
Executable File
var TA=Object.defineProperty,CA=Object.getOwnPropertyDescriptor,u=(e,t,i,s)=>{for(var o=s>1?void 0:s?CA(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&TA(t,i,o),o};import{ModuleRegistry as cm,enterpriseRegistry as In}from"ag-charts-core";import{_ModuleSupport as wA}from"ag-charts-community";import{ActionOnSet as OA,ChartUpdateType as EA,Property as PA}from"ag-charts-core";import{_ModuleSupport as RA}from"ag-charts-community";import{BaseProperties as _A,ObserveChanges as zA,Property as bo,ProxyProperty as BA,calculatePlacement as VA,createElement as FA}from"ag-charts-core";var Pi=class extends _A{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=FA("img"),this.imageElement.onload=this.onImageLoad,this.node=new RA.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=VA(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};u([bo],Pi.prototype,"top",2),u([bo],Pi.prototype,"right",2),u([bo],Pi.prototype,"bottom",2),u([bo],Pi.prototype,"left",2),u([bo],Pi.prototype,"width",2),u([bo],Pi.prototype,"height",2),u([bo],Pi.prototype,"opacity",2),u([BA("imageElement.src"),zA(e=>e.loadedSynchronously=e.complete)],Pi.prototype,"url",2);var xh=class extends wA.Background{constructor(){super(...arguments),this.image=new Pi}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(EA.SCENE_RENDER)}};u([PA,OA({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],xh.prototype,"image",2);import{_ModuleSupport as hm}from"ag-charts-community";import{ActionOnSet as HA,ChartUpdateType as KA,Property as Sh,ProxyPropertyOnWrite as dm,ZIndexMap as GA}from"ag-charts-core";var Nn=class extends hm.Background{constructor(){super(...arguments),this.image=new Pi,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new hm.Group({name:"foreground",zIndex:GA.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart,s=this.image.performLayout(t,i);this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(KA.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const{width:i}=t.getBBox(),s=10;t.x=e.x+e.width/2-i/2,t.y=e.y+e.height+s}};u([Sh,HA({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],Nn.prototype,"image",2),u([Sh,dm("rectNode","fill")],Nn.prototype,"fill",2),u([Sh,dm("rectNode","fillOpacity")],Nn.prototype,"fillOpacity",2);var WA=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],s=e[1],o=e[2],a=e[3];i=this.ff(i,s,o,a,t[0],7,-680876936),a=this.ff(a,i,s,o,t[1],12,-389564586),o=this.ff(o,a,i,s,t[2],17,606105819),s=this.ff(s,o,a,i,t[3],22,-1044525330),i=this.ff(i,s,o,a,t[4],7,-176418897),a=this.ff(a,i,s,o,t[5],12,1200080426),o=this.ff(o,a,i,s,t[6],17,-1473231341),s=this.ff(s,o,a,i,t[7],22,-45705983),i=this.ff(i,s,o,a,t[8],7,1770035416),a=this.ff(a,i,s,o,t[9],12,-1958414417),o=this.ff(o,a,i,s,t[10],17,-42063),s=this.ff(s,o,a,i,t[11],22,-1990404162),i=this.ff(i,s,o,a,t[12],7,1804603682),a=this.ff(a,i,s,o,t[13],12,-40341101),o=this.ff(o,a,i,s,t[14],17,-1502002290),s=this.ff(s,o,a,i,t[15],22,1236535329),i=this.gg(i,s,o,a,t[1],5,-165796510),a=this.gg(a,i,s,o,t[6],9,-1069501632),o=this.gg(o,a,i,s,t[11],14,643717713),s=this.gg(s,o,a,i,t[0],20,-373897302),i=this.gg(i,s,o,a,t[5],5,-701558691),a=this.gg(a,i,s,o,t[10],9,38016083),o=this.gg(o,a,i,s,t[15],14,-660478335),s=this.gg(s,o,a,i,t[4],20,-405537848),i=this.gg(i,s,o,a,t[9],5,568446438),a=this.gg(a,i,s,o,t[14],9,-1019803690),o=this.gg(o,a,i,s,t[3],14,-187363961),s=this.gg(s,o,a,i,t[8],20,1163531501),i=this.gg(i,s,o,a,t[13],5,-1444681467),a=this.gg(a,i,s,o,t[2],9,-51403784),o=this.gg(o,a,i,s,t[7],14,1735328473),s=this.gg(s,o,a,i,t[12],20,-1926607734),i=this.hh(i,s,o,a,t[5],4,-378558),a=this.hh(a,i,s,o,t[8],11,-2022574463),o=this.hh(o,a,i,s,t[11],16,1839030562),s=this.hh(s,o,a,i,t[14],23,-35309556),i=this.hh(i,s,o,a,t[1],4,-1530992060),a=this.hh(a,i,s,o,t[4],11,1272893353),o=this.hh(o,a,i,s,t[7],16,-155497632),s=this.hh(s,o,a,i,t[10],23,-1094730640),i=this.hh(i,s,o,a,t[13],4,681279174),a=this.hh(a,i,s,o,t[0],11,-358537222),o=this.hh(o,a,i,s,t[3],16,-722521979),s=this.hh(s,o,a,i,t[6],23,76029189),i=this.hh(i,s,o,a,t[9],4,-640364487),a=this.hh(a,i,s,o,t[12],11,-421815835),o=this.hh(o,a,i,s,t[15],16,530742520),s=this.hh(s,o,a,i,t[2],23,-995338651),i=this.ii(i,s,o,a,t[0],6,-198630844),a=this.ii(a,i,s,o,t[7],10,1126891415),o=this.ii(o,a,i,s,t[14],15,-1416354905),s=this.ii(s,o,a,i,t[5],21,-57434055),i=this.ii(i,s,o,a,t[12],6,1700485571),a=this.ii(a,i,s,o,t[3],10,-1894986606),o=this.ii(o,a,i,s,t[10],15,-1051523),s=this.ii(s,o,a,i,t[1],21,-2054922799),i=this.ii(i,s,o,a,t[8],6,1873313359),a=this.ii(a,i,s,o,t[15],10,-30611744),o=this.ii(o,a,i,s,t[6],15,-1560198380),s=this.ii(s,o,a,i,t[13],21,1309151649),i=this.ii(i,s,o,a,t[4],6,-145523070),a=this.ii(a,i,s,o,t[11],10,-1120210379),o=this.ii(o,a,i,s,t[2],15,718787259),s=this.ii(s,o,a,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(o,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,i,s,o,a){return t=this.add32(this.add32(t,e),this.add32(s,a)),this.add32(t<<o|t>>>32-o,i)}ff(e,t,i,s,o,a,n){return this.cmn(t&i|~t&s,e,t,o,a,n)}gg(e,t,i,s,o,a,n){return this.cmn(t&s|i&~s,e,t,o,a,n)}hh(e,t,i,s,o,a,n){return this.cmn(t^i^s,e,t,o,a,n)}ii(e,t,i,s,o,a,n){return this.cmn(i^(t|~s),e,t,o,a,n)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)o[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(o[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,o),s=0;s<16;s++)o[s]=0;return o[14]=t*8,this.md5cycle(i,o),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>s*8+4&15]+t[e>>s*8&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(i>>16)<<16|i&65535}};function bh(e){return e==null||e.length===0}var jA="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",Br={"01":"GRID","02":"CHARTS","0102":"BOTH"},um="https://www.ag-grid.com/charts/licensing/",vh=class Ge{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new WA,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(Ge.licenseKey,Ge.gridContext),i=`AG ${t.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(t.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":t.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":t.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const o=Ge.getChartsReleaseDate(),a=Ge.formatDate(o);this.outputExpiredKey(t.expiry,a,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(Number.parseInt(Ge.decode(i),10))}static extractLicenseComponents(t){let i=t.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,o=i.substring(s),a=i.substring(0,s),[n,r,l]=Ge.extractBracketedInformation(i);return{md5:o,license:a,version:n,isTrial:r,type:l}}getLicenseDetails(t,i=!1){const s="CHARTS";if(bh(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const o=Ge.getChartsReleaseDate(),{md5:a,license:n,version:r,isTrial:l,type:c}=Ge.extractLicenseComponents(t);let h=a===this.md5.md5(n)&&!t.includes("For_Trialing_ag-Grid_Only"),d,p,g=null,m=!1,y;function S(){d=g<new Date,p=void 0}if(h&&(g=Ge.extractExpiry(n),h=!Number.isNaN(g.getTime()),h))switch(p=o>g,r){case"legacy":case"2":{h=!1;break}case"3":bh(c)?h=!1:(y=c,c!==Br["02"]&&c!==Br["0102"]?(h=!1,m=!0):l&&S())}return h?{licenseKey:t,valid:h,expiry:Ge.formatDate(g),expired:p,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?y!=="BOTH":void 0,incorrectLicenseType:m,currentLicenseType:s,suppliedLicenseType:y}:{licenseKey:t,valid:h,incorrectLicenseType:m,currentLicenseType:s,suppliedLicenseType:y}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!bh(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getWatermarkForegroundConfig(){const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}getWatermarkForegroundConfigForBrowser(){if(!this.isDisplayWatermark())return;const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}buildWatermarkConfig(t){return{text:t,image:{url:jA,width:170,height:25,right:25,bottom:50,opacity:.7}}}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??globalThis;if(!t)return"localhost";try{return(t.location?.hostname??"")||"localhost"}catch{return"localhost"}}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!t)return!1;const i=t.location?.pathname;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null}isLocalhost(){const t=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(t)!==null}isE2ETest(){const t=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(t)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),o=t.getMonth(),a=t.getFullYear();return s+" "+i[o]+" "+a}static getChartsReleaseDate(){return new Date(Number.parseInt(Ge.decode(Ge.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",o,a,n,r,l,c,h,d=0;const p=t.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;d<p.length;)r=i.indexOf(p.charAt(d++)),l=i.indexOf(p.charAt(d++)),c=i.indexOf(p.charAt(d++)),h=i.indexOf(p.charAt(d++)),o=r<<2|l>>4,a=(l&15)<<4|c>>2,n=(c&3)<<6|h,s=s+String.fromCodePoint(o),c!=64&&(s=s+String.fromCodePoint(a)),h!=64&&(s=s+String.fromCodePoint(n));return s=Ge.utf8_decode(s),s}static utf8_decode(t){t=t.replaceAll("rn","n");let i="";for(let s=0;s<t.length;s++){const o=t.codePointAt(s);o<128?i+=String.fromCodePoint(o):o>127&&o<2048?(i+=String.fromCodePoint(o>>6|192),i+=String.fromCodePoint(o&63|128)):(i+=String.fromCodePoint(o>>12|224),i+=String.fromCodePoint(o>>6&63|128),i+=String.fromCodePoint(o&63|128))}return i}static setGridContext(t=!1){Ge.gridContext=t}static setLicenseKey(t){this.licenseKey&&this.licenseKey!==t&&console.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),Ge.licenseKey=t}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(r=>r==="TRIAL").length===1,o=i.find(r=>r.startsWith("v")),a=o?o.replace("v",""):"legacy",n=Br[i.find(r=>Br[r])];return[a,s,n]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){Ge.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${um}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${um}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){Ge.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){Ge.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s){Ge.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};vh.RELEASE_INFORMATION="MTc3MDgwNzY1NDM4MQ==",vh.gridContext=!1;var vo=vh;import{createElement as $A}from"ag-charts-core";function pm(e,t){const i=e.addChild("canvas-overlay","watermark"),s=$A("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var gm=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-menu-border);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-left-color:var(--ag-charts-border-color)}}
|
|
`,UA=void 0,YA=void 0;YA=UA;var XA=void 0,ZA=void 0;ZA=XA;var mm=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(mm||{}),ym=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(ym||{}),QA=void 0,qA=void 0;qA=QA;var JA=void 0,eI=void 0;eI=JA;export*from"ag-charts-community";import{VERSION as tI,_ModuleSupport as iI}from"ag-charts-community";import{_ModuleSupport as sI}from"ag-charts-community";import{Property as Dh,isNumberEqual as fm}from"ag-charts-core";function Mh(e,t,i){const s=Math.floor(e.length/2);return xm(e,t,s,t,i)||xm(e,e.length-t,s,-t,i)}function xm(e,t,i,s,o){let a=e[0];for(let n=t;s>0?n<=i:n>i;n+=s){const r=e[n];if(o(a,r))return!0;a=r}return!1}import{_ModuleSupport as oI}from"ag-charts-community";import{Property as aI}from"ag-charts-core";var{AxisInterval:nI}=oI,kh=class extends nI{};u([aI],kh.prototype,"minSpacing",2);import{_ModuleSupport as Vr}from"ag-charts-community";import{ChartAxisDirection as rI,Property as Ah,countFractionDigits as lI,isNumberEqual as ya,normalizeAngle360 as Os,normalizeAngle360Inclusive as cI,toRadians as Ln,wrapTextOrSegments as hI}from"ag-charts-core";import{_ModuleSupport as Sm}from"ag-charts-community";import{ChartAxisDirection as dI,isNumberEqual as bm,normalizeAngle360 as Ih}from"ag-charts-core";import{_ModuleSupport as uI}from"ag-charts-community";import{BaseProperties as pI,ChartAxisDirection as gI,Property as it,createId as mI}from"ag-charts-core";var{Group:Nh,LabelStyle:yI}=uI,fa=class extends yI{constructor(){super(...arguments),this.padding=5}};u([it],fa.prototype,"enabled",2),u([it],fa.prototype,"padding",2),u([it],fa.prototype,"text",2),u([it],fa.prototype,"parallel",2);var gt=class extends pI{constructor(){super(...arguments),this.id=mI(this),this.defaultColorRange=[],this.shape="polygon",this.label=new fa,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=gI.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Nh({name:this.id}),this.rangeGroup=new Nh({name:this.id}),this.labelGroup=new Nh({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,o){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=s,e.rotation=o,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.setFont(a),e.setBoxing(a),e.visible=!0}};gt.className="PolarCrossLine",u([it],gt.prototype,"enabled",2),u([it],gt.prototype,"type",2),u([it],gt.prototype,"range",2),u([it],gt.prototype,"value",2),u([it],gt.prototype,"defaultColorRange",2),u([it],gt.prototype,"fill",2),u([it],gt.prototype,"fillOpacity",2),u([it],gt.prototype,"stroke",2),u([it],gt.prototype,"strokeWidth",2),u([it],gt.prototype,"strokeOpacity",2),u([it],gt.prototype,"lineDash",2),u([it],gt.prototype,"shape",2),u([it],gt.prototype,"label",2);var{getCrossLineValue:fI,validateCrossLineValue:xI,Group:SI,Path:vm,Sector:bI,RotatableText:vI,ContinuousScale:DI}=Sm,Lh=class extends gt{constructor(){super(),this.direction=dI.Angle,this.polygonNode=new vm,this.sectorNode=new bI,this.lineNode=new vm,this.crossLineRange=new SI,this.labelNode=new vI,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!DI.is(this.scale))return!0;const[e,t]=this.scale.domain,i=fI(this);if(this.type==="range"){const[s,o]=i;return s>=e&&s<=t&&o>=s&&o<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!xI(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:o}=this;if(!e||i!=="line"||!t){o.visible=!1;return}const a=t.convert(s);if(Number.isNaN(a)){o.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this;o.visible=!0,o.stroke=this.stroke,o.strokeOpacity=this.strokeOpacity??1,o.strokeWidth=this.strokeWidth??1,o.fill=void 0,o.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),h=n*Math.cos(a),d=n*Math.sin(a);o.path.clear(!0),o.path.moveTo(h,d),o.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:o,type:a,ticks:n}=this;if(!e||a!=="range"||o!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=n.indexOf(i[0]),h=n.indexOf(i[1]),p=(c<=h?n.slice(c,h+1):n.slice(c).concat(n.slice(0,h+1))).map(m=>s.convert(m));t.visible=!0,this.setSectorNodeProps(t);const{path:g}=t;g.clear(!0);for(const[m,y]of p.entries()){const S=l*Math.cos(y),x=l*Math.sin(y);m===0?g.moveTo(S,x):g.lineTo(S,x)}if(r===0)g.lineTo(0,0);else{const m=p.slice().reverse();for(const y of m){const S=r*Math.cos(y),x=r*Math.sin(y);g.lineTo(S,x)}}t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:o,type:a}=this;if(!e||a!=="range"||o!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,h=s instanceof Sm.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=n,t.outerRadius=r,t.startAngle=l[0]-h,t.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:o,type:a,ticks:n}=this;if(!e||t.enabled===!1||!t.text||!o||a==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,d,p;if(a==="line"){const g=Ih(o.convert(this.value)),m=1.5*Math.PI,y=bm(g,m)||g>m||g<Math.PI/2,S=(r+l)/2*Math.cos(g),x=(r+l)/2*Math.sin(g);c=S+t.padding*Math.cos(g+Math.PI/2),h=x+t.padding*Math.sin(g+Math.PI/2),p=y?"top":"bottom",d=y?g:g-Math.PI}else{const[g,m]=s.map(b=>Ih(o.convert(b)));let y=(g+m)/2;g>m&&(y-=Math.PI),y=Ih(y);const S=(bm(y,0)||y>0)&&y<Math.PI;let x;this.shape==="circle"||n.length<3?x=l-t.padding:x=l*Math.cos(Math.PI/n.length)-t.padding,c=x*Math.cos(y),h=x*Math.sin(y),p=S?"bottom":"top",d=S?y-Math.PI/2:y+Math.PI/2}this.setLabelNodeProps(i,c,h,p,d)}};Lh.className="AngleCrossLine";var{Path:MI,RotatableText:kI,Transformable:AI,BBox:II,Selection:Dm,Line:Mm}=Vr,Th=class extends Vr.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};u([Ah],Th.prototype,"orientation",2);var Tn=class extends Vr.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=Dm.select(this.tickLineGroup,Mm,!1),this.gridLineGroupSelection=Dm.select(this.gridLineGroup,Mm,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new Vr.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new MI),this.includeInvisibleDomains=!0}get direction(){return rI.Angle}createLabel(){return new Th}calculateRotations(){const e=Ln(this.startAngle),t=Os(e),i=Os(e-Math.PI/2);return{rotation:e,parallelFlipRotation:t,regularFlipRotation:i}}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:[t,t],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},o=t?i.niceDomain(s,e):e,a=this.generateAngleTicks(o);this.tickData=a;const n=a.map(l=>l.value),r=n.reduce((l,c)=>Math.max(typeof c=="number"?lI(c):0,l),0);return{niceDomain:o,tickDomain:o,ticks:n,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Os(-Math.PI/2+Ln(this.startAngle)),t=this.endAngle==null?2*Math.PI:cI(Ln(this.endAngle)-Ln(this.startAngle)),i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();for(const{x:o,y:a,moveTo:n,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0}of i)r?t.arc(o,a,l,c,h):n?t.moveTo(o,a):t.lineTo(o,a);s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,o]=this.range,a=ya(o-s,2*Math.PI),n=[];if(t==="circle")a?n.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):n.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Os(s),endAngle:Os(o),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));if(r&&r.length>2)for(const[l,c]of r.entries()){const h=i*Math.cos(c),d=i*Math.sin(c),p=l===0;n.push({x:h,y:d,moveTo:p})}}return{points:n,closePath:a}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:o}=this;if(!(i&&t>0))return;const a=t*o,n=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:d,lineDash:p}=i[c%n],g=e.convert(h);r.x1=a*Math.cos(g),r.y1=a*Math.sin(g),r.x2=t*Math.cos(g),r.y2=t*Math.sin(g),r.stroke=d,r.strokeWidth=s,r.lineDash=p,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,o)=>{const a=this.labelData[o];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(e),i.fill=e.color,i.x=a.x,i.y=a.y,i.setAlign(a),i.setBoxing(e),i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((o,a)=>{const{value:n}=a,r=e.convert(n),l=Math.cos(r),c=Math.sin(r);o.x1=t*l,o.y1=t*c,o.x2=(t+i.size)*l,o.y2=(t+i.size)*c,o.stroke=i.stroke,o.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:o,scale:a,tick:n}=this;if(!s.enabled)return[];const r=new kI,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,h),p=e.map((g,m)=>{const{value:y}=g,S=o+s.spacing+n.size,x=a.convert(y),b=Math.cos(x),f=Math.sin(x),D=S*b,v=S*f,{textAlign:M,textBaseline:A}=this.getLabelAlign(x),I=m===e.length-1&&y!==e[0]&&ya(Os(x),Os(a.convert(e[0]))),k=this.getLabelRotation(x);let N=d(y,m);r.text=N,r.x=D,r.y=v,r.setFont(s),r.textAlign=M,r.textBaseline=A,r.rotation=k,k&&(r.rotationCenterX=D,r.rotationCenterY=v);let L=k?AI.toCanvas(r):r.getBBox();if(L&&t.hideWhenNecessary&&!k){const T=l-L.x,P=L.x+L.width-c,O=1;if(T>O||P>O){const R={maxWidth:L.width-Math.max(T,P),font:s,textWrap:"never"};N=hI(N,R),r.text=N,L=r.getBBox()}}return{text:N,x:D,y:v,textAlign:M,textBaseline:A,hidden:N===""||(g.hidden??I),rotation:k,box:L}});return s.avoidCollisions&&this.avoidLabelCollisions(p),p}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:II.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof Th?e.orientation:"fixed"}getLabelRotation(e){let t=Ln(this.label.rotation??0);e=Os(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):i==="perpendicular"&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,o;const a=this.getLabelOrientation(),n=ya(t,0),r=ya(i,0),l=ya(t,1),c=ya(i,-1),h=t>0&&!n,d=i>0&&!r;return a==="parallel"?(s="center",o=l&&r||d?"top":"bottom"):a==="perpendicular"?(s=c||h?"left":"right",o="middle"):(s="right",n?s="center":h&&(s="left"),o="bottom",r?o="middle":d&&(o="top")),{textAlign:s,textBaseline:o}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;for(const s of this.crossLines)s instanceof Lh&&(s.ticks=this.tickData.map(o=>o.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i);super.updateCrossLines()}};Tn.CrossLineConstructor=Lh,u([Ah],Tn.prototype,"startAngle",2),u([Ah],Tn.prototype,"endAngle",2);var{CategoryScale:NI}=sI,Do=class extends Tn{constructor(e){super(e,new NI),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new kh}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:s,minSpacing:o}=this.interval,a={nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=s??t.ticks(a,e)?.ticks??[];if(n.length<2||o==null)return n.map(d=>({value:d,visible:!0}));const r=n[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let d=1;d<n.length-1;d++){const p=n[d],g=t.convert(p);if(g-l>Math.PI)break;const m=i*Math.cos(g),y=i*Math.sin(g);if(Math.hypot(m-c,y-h)>o){const x=new Set([r]);return Mh(n,d,(b,f)=>{x.add(f)}),n.map(b=>{const f=x.has(b);return{value:b,visible:f}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return h.collidesBBox(d)},s=e[0],o=e.at(-1),a=new Set([s]),n=fm(s.x,o.x)&&fm(s.y,o.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=n?e.slice(0,-1):e;if(!Mh(c,l,i)){Mh(c,l,(d,p)=>{a.add(p)});break}}for(const l of e)a.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}}};Do.className="AngleCategoryAxis",Do.type="angle-category",u([Dh],Do.prototype,"groupPaddingInner",2),u([Dh],Do.prototype,"paddingInner",2),u([Dh],Do.prototype,"interval",2);var km={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,version:tI,options:iI.angleCategoryAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},create:e=>new Do(e)};import{VERSION as LI,_ModuleSupport as TI}from"ag-charts-community";import"ag-charts-community";import{Property as Cn,angleBetween as CI,findMinMax as wI,isNumberEqual as Am,normalisedExtentWithMetadata as OI}from"ag-charts-core";import{_ModuleSupport as EI}from"ag-charts-community";import{isDenseInterval as PI,isNumberEqual as RI,range as Im}from"ag-charts-core";var{LinearScale:Ch}=EI,Nm=class om extends Ch{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,o]=i;let a=Ch.getTickStep(s,o,t);const n=Number.isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(o-s)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>n&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(h=>!Number.isFinite(h))||s<=0)return{ticks:[],count:0};const{nice:o,interval:a}=t,[n,r]=i;if(a){const h=Math.abs(a),d=this.getPixelRange();if(!PI((r-n)/h,d)){const p=Im(n,r,h);return{ticks:p.ticks,count:p.count}}}let l;if(o&&this.hasNiceRange()){const h=super.niceDomain(t,i);l=om.getNiceStepAndTickCount(t,h).step}else l=Ch.getTickStep(n,r,t);const c=Im(n,r,l);return{ticks:c.ticks,count:c.count}}hasNiceRange(){const t=this.range.slice().sort((s,o)=>s-o);return[Math.PI,2*Math.PI].some(s=>RI(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const o=s[0]>s[1],a=o?s[1]:s[0],{step:n,count:r}=om.getNiceStepAndTickCount(t,s),l=1/n,c=n>=1?Math.ceil(a/n+r)*n:Math.ceil((a+r*n)*l)/l;return o?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},Es=class extends Tn{constructor(e){super(e,new Nm),this.shape="circle",this.interval=new kh}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:o}=this,{extent:a,clipped:n}=OI(e.domain,t,i,s,o,void 0,e.sortMetadata?.sortOrder);return{domain:a,clipped:n}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e),s=CI(t,i)||2*Math.PI,o=this.gridLength;return s*o}generateAngleTicks(e){const{scale:t,range:i,nice:s}=this,{values:o,step:a,minSpacing:n,maxSpacing:r}=this.interval;let l;if(o==null){const{arcLength:c}=t,h=r?Math.floor(c/r):1,d=n?Math.floor(c/n):1/0,p=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),g=Math.max(h,Math.min(d,p)),m={nice:[s,s],interval:a,tickCount:g,minTickCount:h,maxTickCount:d};l=t.ticks(m,e)?.ticks??[]}else{const[c,h]=wI(e.map(Number));l=o.filter(d=>d>=c&&d<=h).sort((d,p)=>d-p)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,n)=>{if(a.hidden||n.hidden)return!1;if(t==null)return a.box.collidesBBox(n.box);const r=a.box.clone().grow(t/2),l=n.box.clone().grow(t/2);return r.collidesBBox(l)},s=e[0],o=e.at(-1);s!==o&&Am(s.x,o.x)&&Am(s.y,o.y)&&(o.hidden=!0);for(let a=1;a<e.length;a*=2){let n=!1;for(let r=a;r<e.length;r+=a){const l=e[r],c=e[r-a];if(i(c,l)){n=!0;break}}if(!n){for(const[r,l]of e.entries())r%a>0&&(l.hidden=!0,l.box=void 0);return}}for(const[a,n]of e.entries())a>0&&(n.hidden=!0,n.box=void 0)}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i,visibleDomain:void 0}}};Es.className="AngleNumberAxis",Es.type="angle-number",u([Cn],Es.prototype,"min",2),u([Cn],Es.prototype,"max",2),u([Cn],Es.prototype,"preferredMin",2),u([Cn],Es.prototype,"preferredMax",2),u([Cn],Es.prototype,"interval",2);var Lm={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,version:LI,options:TI.angleNumberAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1}},create:e=>new Es(e)};import{VERSION as _I,_ModuleSupport as zI}from"ag-charts-community";import{_ModuleSupport as Tm}from"ag-charts-community";import{Property as BI,dateTruncationForDomain as VI,intervalEpoch as Cm,intervalMilliseconds as wm,intervalStep as Om,intervalUnit as Em,lowestGranularityUnitForTicks as FI,lowestGranularityUnitForValue as HI}from"ag-charts-core";var{OrdinalTimeScale:KI,ApproximateOrdinalTimeScale:GI,APPROXIMATE_THRESHOLD:WI,TimeAxisParentLevel:jI,minimumTimeAxisDatumGranularity:$I}=Tm,Fr=class extends Tm.DiscreteTimeAxis{constructor(e){const t=new KI;super(e,t),this.parentLevel=new jI,this.accurateScale=t,this.approximateScale=new GI,this.approximateScale.setSourceScale(t),Object.defineProperty(this,"scale",{get:()=>this.getActiveScale(),configurable:!0})}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}getActiveScale(){const e=this.accurateScale.bandCount(this.visibleRange);return(this.accurateScale.getUniformityCache(this.visibleRange)?.isUniform??!1)&&e>=WI?this.approximateScale:this.accurateScale}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=$I(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=FI(t));const o=VI(e),a=Em(s),n=Om(s),r=Cm(s);return{type:"date",unit:a,step:n,epoch:r,truncateDate:o}}datumFormatParams(e,t,i,s,o){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:S}=this,x=HI(e);S!=null&&wm(S)<wm(x)?s=S:s=x}const{datum:a,seriesId:n,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:p}=t,g=Em(s),m=Om(s),y=Cm(s);return{type:"date",value:e,datum:a,seriesId:n,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:p,unit:g,step:m,epoch:y,style:o}}};Fr.className="OrdinalTimeAxis",Fr.type="ordinal-time",u([BI],Fr.prototype,"parentLevel",2);var wh={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,version:_I,options:zI.ordinalTimeAxisOptionsDefs,themeTemplate:{groupPaddingInner:0,label:{autoRotate:!1,minSpacing:40},gridLine:{enabled:!1},interval:{placement:"between"}},create:e=>new Fr(e)};import{VERSION as UI,_ModuleSupport as YI}from"ag-charts-community";import{_ModuleSupport as XI}from"ag-charts-community";import{Property as Oh,ProxyPropertyOnWrite as Pm}from"ag-charts-core";import{_ModuleSupport as Hr}from"ag-charts-community";import{ChartAxisDirection as ZI,Property as Eh,ZIndexMap as QI,isNumberEqual as qI,normalizeAngle360 as Rm,toRadians as JI}from"ag-charts-core";import{_ModuleSupport as _m}from"ag-charts-community";import{ChartAxisDirection as e0,Property as t0,clamp as zm,isNumberEqual as i0,normalizeAngle360FromDegrees as s0}from"ag-charts-core";var{validateCrossLineValue:o0,Group:a0,Path:n0,Sector:r0,RotatableText:l0}=_m,Bm=class extends fa{constructor(){super(...arguments),this.positionAngle=void 0}};u([t0],Bm.prototype,"positionAngle",2);var Ph=class extends gt{constructor(){super(),this.direction=e0.Radius,this.label=new Bm,this.polygonNode=new n0,this.sectorNode=new r0,this.crossLineRange=new a0,this.labelNode=new l0,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!o0(this,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;e&&(e=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:o}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=l=>o+s-l;let n,r;if(i==="line")n=a(t.convert(this.value)),r=n;else{const l=Math.abs(t?.bandwidth??0),c=e.map(h=>t.convert(h));n=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=n,this.innerRadius=r}drawPolygon(e,t,i){for(const[s,o]of t.entries()){const a=e*Math.cos(o),n=e*Math.sin(o);s===0?i.path.moveTo(a,n):i.path.lineTo(a,n)}i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:o,type:a,innerRadius:n,outerRadius:r}=this;if(!e||o!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),h=a==="line"?r-l:n+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:o,shape:a,innerRadius:n,outerRadius:r}=this;if(!e||a!=="circle"||!s){o.visible=!1;return}o.visible=!0,o.startAngle=0,o.endAngle=2*Math.PI;const l=this.getPadding(),c=zm(t,n+l,i),h=zm(t,r-l,i);o.innerRadius=Math.min(c,h),o.outerRadius=Math.max(c,h),this.setSectorNodeProps(o)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:o,shape:a,type:n}=this;if(!e||i.enabled===!1||!i.text||!o){s.visible=!1;return}const r=s0((i.positionAngle??0)-90),l=(i0(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let h;const d=this.gridAngles??[];n==="line"?h=t+i.padding:a==="circle"||d.length<3?h=t-i.padding:h=t*Math.cos(Math.PI/d.length)-i.padding;const p=h*Math.cos(r),g=h*Math.sin(r);let m;n==="line"?m=l?"top":"bottom":m=l?"bottom":"top",this.setLabelNodeProps(s,p,g,m,c)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof _m.BandScale?(i-t)/2:0}};Ph.className="RadiusCrossLine";var{Caption:c0,Group:h0,TransformableGroup:Vm,Path:d0,Line:Fm,Selection:Hm,generateTicks:u0,AxisGroupZIndexMap:p0}=Hr,Rh=class extends Hr.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};u([Eh],Rh.prototype,"autoRotate",2),u([Eh],Rh.prototype,"autoRotateAngle",2);var Kr=class extends Hr.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=Hm.select(this.gridLineGroup,Fm,!1),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new Vm({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Vm({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Fm({name:`${this.id}-Axis-line`,zIndex:p0.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new h0({name:`${this.id}-gridPaths`,zIndex:QI.AXIS_GRID})),this.gridPathSelection=Hm.select(this.gridPathGroup,d0),this.headingLabelGroup.appendChild(this.title.caption.node),this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return ZI.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,o=e*s,a=JI(i);return{translationX:t.x,translationY:t.y-e-o,rotation:a,rotationCenterX:0,rotationCenterY:e+o}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const s=[0,1],o=this.label.getSideFlag(),a=o*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),{range:n,reverse:r,defaultTickMinSpacing:l}=this,c=u0({scale:this.scale,label:this.label,interval:this.interval,tickFormatter:(...b)=>this.tickFormatter(...b),domain:e,range:n,reverse:r,niceMode:t,visibleRange:s,defaultTickMinSpacing:l,labelOffset:a,sideFlag:o,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:h}=c,{ticks:d,rawTicks:p,rawTickCount:g,tickDomain:m,fractionDigits:y,niceDomain:S=e}=h,x=d.map(b=>this.getTickLabelProps(b,c));return this.generatedTicks={ticks:d,labels:x},{ticks:p,tickDomain:m,niceDomain:S,rawTickCount:g,fractionDigits:y,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=Hr.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const o=e.length,a=(p,g)=>{const{stroke:m,lineDash:y}=e[g%o];p.stroke=m,p.strokeWidth=t,p.lineDash=y,p.fill=void 0},[n,r]=this.gridRange??[0,2*Math.PI],l=qI(r-n,2*Math.PI),d=i==="circle"?(p,g)=>{const{path:m}=p;m.clear(!0);const y=this.getTickRadius(g);l?(m.moveTo(y,0),m.arc(0,0,y,0,2*Math.PI)):(m.moveTo(y*Math.cos(n),y*Math.sin(n)),m.arc(0,0,y,Rm(n),Rm(r))),l&&m.closePath()}:(p,g)=>{const{path:m}=p,y=this.gridAngles;if(m.clear(!0),!y||y.length<3)return;const S=this.getTickRadius(g);for(const[x,b]of y.entries()){const f=S*Math.cos(b),D=S*Math.sin(b);x===0?m.moveTo(f,D):m.lineTo(f,D);for(const[v,M]of y.entries()){const A=S*Math.cos(M),I=S*Math.sin(M);v===0?m.moveTo(A,I):m.lineTo(A,I)}m.closePath()}m.closePath()};this.gridPathSelection.each((p,g,m)=>{a(p,m),d(p,g)})}updateTitle(){const e=n=>n.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let o=!1;const a=t.caption.node;t.enabled&&(o=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-c0.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain))),a.visible=o}updateCrossLines(){for(const e of this.crossLines)if(e instanceof Ph){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:o}=this,a=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=a,e.axisInnerRadius=a*o}super.updateCrossLines()}createLabel(){return new Rh}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:o,textAlign:a}=t,n=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null,d=s;return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:d,text:r,textAlign:a,textBaseline:o,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:n}}};Kr.CrossLineConstructor=Ph,u([Eh],Kr.prototype,"positionAngle",2);var{CategoryScale:Km}=XI,Mo=class extends Kr{constructor(e){super(e,new Km),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],o=s*i;if(Km.is(t)){const a=t.domain,n=a.length-1-a.indexOf(e.tick);return n===0?o:t.inset+t.step*(n-.5)+t.bandwidth/2}else{const a=(s-o)/t.domain.length;return s-e.translation+o-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}}};Mo.className="RadiusCategoryAxis",Mo.type="radius-category",u([Oh],Mo.prototype,"groupPaddingInner",2),u([Pm("scale","paddingInner"),Oh],Mo.prototype,"paddingInner",2),u([Pm("scale","paddingOuter"),Oh],Mo.prototype,"paddingOuter",2);var Gm={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,version:UI,options:YI.radiusCategoryAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},label:{minSpacing:5}},create:e=>new Mo(e)};import{VERSION as g0,_ModuleSupport as m0}from"ag-charts-community";import{_ModuleSupport as y0}from"ag-charts-community";import{Property as Gr,normalisedExtentWithMetadata as f0}from"ag-charts-core";var{LinearScale:x0}=y0,ko=class extends Kr{constructor(e){super(e,new x0),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:s})=>s!==i).sort((s,o)=>o.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translation+s}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:o}=this,{extent:a,clipped:n}=f0(e.domain,t,i,s,o,void 0,e.sortMetadata?.sortOrder);return{domain:a,clipped:n}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i,visibleDomain:void 0}}};ko.className="RadiusNumberAxis",ko.type="radius-number",u([Gr],ko.prototype,"min",2),u([Gr],ko.prototype,"max",2),u([Gr],ko.prototype,"preferredMin",2),u([Gr],ko.prototype,"preferredMax",2);var Wm={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,version:g0,options:m0.radiusNumberAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0},label:{minSpacing:5}},create:e=>new ko(e)};import{VERSION as S0}from"ag-charts-community";import{boolean as b0,positiveNumber as jm,undocumented as v0}from"ag-charts-core";import"ag-charts-community";import{AbstractModuleInstance as D0,ObserveChanges as _h,Property as zh}from"ag-charts-core";var Wr=class extends D0{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.cleanup.register(()=>e.animationManager.skip(!0))}};u([_h((e,t)=>{e.ctx.animationManager.skip(!t)}),zh],Wr.prototype,"enabled",2),u([_h((e,t)=>{t!=null&&(e.ctx.animationManager.defaultDuration=t)}),zh],Wr.prototype,"duration",2),u([_h((e,t)=>{e.ctx.animationManager.maxAnimatableItems=t??1/0}),zh],Wr.prototype,"maxAnimatableItems",2);var wn={type:"plugin",name:"animation",enterprise:!0,version:S0,options:{enabled:b0,duration:jm},themeTemplate:{enabled:!0},create:e=>new Wr(e)};wn.options.maxAnimatableItems=v0(jm);import{VERSION as M0,_ModuleSupport as k0}from"ag-charts-community";import"ag-charts-core";import{_ModuleSupport as A0}from"ag-charts-community";import{AbstractModuleInstance as I0}from"ag-charts-core";var $m=class Rr extends I0{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),t==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new A0.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(o,a)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const n=i.getBounds().width;i.setBounds({x:o.x,y:o.y,width:n}),o.shrink({left:n+i.horizontalSpacing+(a??0)})},addToolbarListener:(o,a)=>i.addToolbarListener(o,n=>{const r=this.getSectionIndex(t,n.button.index);if(r<0)return;const l={...n,button:this.sectionButtons[t][r]};a(l)}),updateButtons:o=>{this.sectionButtons[t]=o;const a=Rr.SECTION_ORDER.flatMap(n=>this.sectionButtons[n]);i.updateButtons(a)},updateButtonByIndex:(o,a)=>{i.updateButtonByIndex(this.getIndex(t,o),a)},toggleActiveButtonByIndex:o=>{i.toggleActiveButtonByIndex(this.getIndex(t,o))},toggleButtonEnabledByIndex:(o,a)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,o),a)},setHidden:o=>{o?this.activeSections.delete(t):this.activeSections.add(t);let a=0;for(const n of Rr.SECTION_ORDER){if(n!==t){a+=this.sectionButtons[n].length;continue}for(const r of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(a+r,o)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const o of Rr.SECTION_ORDER){if(o===t)return s+i;s+=this.sectionButtons[o].length}return-1}getSectionIndex(t,i){let s=0;for(const o of Rr.SECTION_ORDER){if(o===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[o].length}return-1}};$m.SECTION_ORDER=["chartToolbar","annotations"];var Um=$m;import{_ModuleSupport as jr}from"ag-charts-community";import{AbstractModuleInstance as N0,ChartAxisDirection as Bh,ChartUpdateType as L0,ObserveChanges as T0,PropertiesArray as C0,Property as On,Vec2 as Ao,isValidDate as Vh}from"ag-charts-core";import{_ModuleSupport as w0}from"ag-charts-community";import{CleanupRegistry as O0,attachListener as E0,ceilTo as P0,focusCursorAtEnd as R0,setAttributes as _0}from"ag-charts-core";var z0='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>',Ym="text-input",Xm="canvas-overlay",B0=class{constructor(e){this.ctx=e,this.cleanup=new O0,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(Xm,Ym),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>e.domManager.removeChild(Xm,Ym))}setKeyDownHandler(e){this.cleanup.register(E0(this.element,"keydown",e))}show(e){this.element.innerHTML=z0;const t=this.element.firstElementChild;_0(t,{role:"textbox","data-preventdefault":!1}),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight=typeof e.styles?.fontWeight=="number"?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",R0(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",i=>{i.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:o,getTextPosition:a,alignment:n,textAlign:r}=this.layout;e.style.setProperty("width",s?`${s}px`:"unset");const l=t.getBoundingClientRect(),c=o(l.height);let h=c.x;n==="center"?h-=(s??l.width)/2:n==="right"&&(h-=s??l.width);const d=a();let p=c.y;d==="center"?p-=l.height/2:d==="bottom"&&(p-=l.height),e.style.setProperty("top",`${p}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",`${i.width-h}px`),e.style.setProperty("text-align",n),t.style.setProperty("text-align",r)}getBBox(){const{left:e,top:t,width:i,height:s}=this.element.getBoundingClientRect();return new w0.BBox(e,t,P0(i,2),s)}destroy(){this.cleanup.flush()}};import{BaseProperties as V0,Property as Zm}from"ag-charts-core";var Fh=class extends V0{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};u([Zm],Fh.prototype,"enabled",2),u([Zm],Fh.prototype,"axes",2);import"ag-charts-community";import{deepClone as ri}from"ag-charts-core";var Hh=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(Hh||{}),F0=Object.values(Hh);function H0(e){for(const t of F0)if(t===e)return t}import{isObject as K0}from"ag-charts-core";import{Color as Qm,Property as G0,isObject as W0}from"ag-charts-core";import"ag-charts-community";import{BaseProperties as Ps,FONT_SIZE as j0,Property as Y,generateUUID as $0}from"ag-charts-core";var En=class extends Ps{};u([Y],En.prototype,"x",2),u([Y],En.prototype,"y",2);var U0=class extends mt(ns(ty(Ps))){},Kh=class extends mt(ns(Ri(jh(Lo(Ps))))){constructor(){super(...arguments),this.cornerRadius=2}};u([Y],Kh.prototype,"enabled",2),u([Y],Kh.prototype,"cornerRadius",2);var Y0=class extends Ri(Ps){},X0=class extends mt(ns(Ri(Ps))){},Io=class extends Lo(Ps){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};u([Y],Io.prototype,"label",2),u([Y],Io.prototype,"position",2),u([Y],Io.prototype,"alignment",2);var Z0=class extends Lo(Ps){},Pn=class extends Lo(Ps){constructor(){super(...arguments),this.label=""}};u([Y],Pn.prototype,"label",2),u([Y],Pn.prototype,"position",2),u([Y],Pn.prototype,"alignment",2);function No(e){class t extends q0(ty(e)){constructor(){super(...arguments),this.id=$0()}}return t}function Gh(e){class t extends e{constructor(){super(...arguments),this.start=new En,this.end=new En}}return u([Y],t.prototype,"start",2),u([Y],t.prototype,"end",2),t}function qm(e){class t extends e{}return u([Y],t.prototype,"x",2),u([Y],t.prototype,"y",2),t}function Jm(e){class t extends e{}return u([Y],t.prototype,"value",2),t}function Wh(e){class t extends e{constructor(){super(...arguments),this.background=new Y0}}return u([Y],t.prototype,"background",2),t}function Rs(e){class t extends e{constructor(){super(...arguments),this.handle=new X0}}return u([Y],t.prototype,"handle",2),t}function ey(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new Kh}}return u([Y],t.prototype,"axisLabel",2),t}function jh(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return u([Y],t.prototype,"padding",2),u([Y],t.prototype,"textAlign",2),u([Y],t.prototype,"formatter",2),t}function Q0(e){class t extends e{}return t}function $h(e){class t extends e{}return u([Y],t.prototype,"extendStart",2),u([Y],t.prototype,"extendEnd",2),t}function q0(e){class t extends e{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return u([Y],t.prototype,"locked",2),u([Y],t.prototype,"readOnly",2),t}function Uh(e){class t extends e{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return t}function ty(e){class t extends e{}return u([Y],t.prototype,"visible",2),t}function Ri(e){class t extends e{}return u([Y],t.prototype,"fill",2),u([Y],t.prototype,"fillOpacity",2),t}function mt(e){class t extends e{}return u([Y],t.prototype,"stroke",2),u([Y],t.prototype,"strokeOpacity",2),u([Y],t.prototype,"strokeWidth",2),t}function ns(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return u([Y],t.prototype,"lineDash",2),u([Y],t.prototype,"lineDashOffset",2),u([Y],t.prototype,"lineStyle",2),t}function Lo(e){class t extends e{constructor(){super(...arguments),this.fontSize=j0.SMALL,this.fontFamily="Verdana, sans-serif"}}return u([Y],t.prototype,"fontStyle",2),u([Y],t.prototype,"fontWeight",2),u([Y],t.prototype,"fontSize",2),u([Y],t.prototype,"fontFamily",2),u([Y],t.prototype,"color",2),t}import{Property as J0}from"ag-charts-core";import{isDate as eN,isNumber as tN,isString as iN}from"ag-charts-core";function iy(e){return tN(e)||iN(e)||eN(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Be(e){return iy(e)?.value}function At(e,t){if(e.start==null||e.end==null)return;const i=Se(e.start,t),s=Se(e.end,t);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function Se(e,t){const i=rs(e.x,t.xAxis),s=rs(e.y,t.yAxis);return{x:i,y:s}}function rs(e,t){if(e==null)return 0;const{value:i,groupPercentage:s}=iy(e),{scale:o,snapToGroup:a}=t,n=o.bandwidth===0?o.step??0:o.bandwidth??0,r=a?n/2:n*s;return o.convert(i)+r}function It(e,t){const i=$r(e.x,t.xAxis),s=$r(e.y,t.yAxis);return{x:i,y:s}}function $r(e,t){const{scale:i}=t;if(t.continuous&&i.step==null)return t.scaleInvert(e);const s=t.scaleInvertNearest(e),o=i.bandwidth===0?i.step:i.bandwidth??0,a=i.convert(s),n=a+o,r=a===n?0:(e-a)/(n-a);return{value:s,groupPercentage:r}}import{BaseProperties as sN}from"ag-charts-core";var Yh=class extends No(Gh(Rs(sN))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},sy=class extends Uh(jh(Lo(Yh))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return Se(this.end,e)}getTextPosition(){return this.position}};u([J0],sy.prototype,"text",2);var oN={top:6,right:12,bottom:9,left:12},vi=class extends Ri(mt(sy)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return W0(e)&&e.type==="callout"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Qm.fromString(this.color??"#888888");return new Qm(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...oN}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding(),o=s.left??0,a=s.bottom??0;return{x:i.x+o,y:i.y-a}}};u([G0],vi.prototype,"type",2);import{Color as oy,Property as aN,isObject as nN}from"ag-charts-core";import{BaseProperties as rN,Property as lN}from"ag-charts-core";var Ur=class extends No(qm(Rs(jh(Lo(rN))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return Se(this,e)}getTextPosition(){return this.position}};u([lN],Ur.prototype,"text",2);var Yr={top:8,right:14,bottom:8,left:14},_i=class extends Ri(mt(Ur)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return nN(e)&&e.type==="comment"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=oy.fromString(this.color??"#888888");return new oy(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,Yr.top),bottom:Math.max(t*.4,Yr.bottom),left:Math.max(t*.8,Yr.left),right:Math.max(t*.8,Yr.right)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};u([aN],_i.prototype,"type",2);import"ag-charts-community";import{BaseProperties as Xh,Property as Et,isObject as Xr}from"ag-charts-core";import{Vec2 as To}from"ag-charts-core";function Rn(e,t){return e?"dashed":t??"solid"}function ay(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function xa(e,t,i,s){const o=Rn(e,i);return t??e??ay(s??1,o)}function Sa(e,t,i){const s=Rn(t,i);return e??s==="dotted"?"round":void 0}function cN(e,t){const[i,s]=To.from(e),o=t.height,a=To.gradient(s,i,o),n=To.intercept(s,a,o),r=[{x:i.x,y:o??0},{x:i.x,y:o==null?t.height:o-t.height}];if(a===1/0)return r;let l=[To.intersectAtY(a,n,0,o),To.intersectAtY(a,n,t.height,o),To.intersectAtX(a,n,0,o),To.intersectAtX(a,n,t.width,o)];return l=l.filter(c=>c.x>=t.x&&c.x<=t.width&&c.y>=t.y&&c.y<=t.height).sort((c,h)=>c.x===h.x?0:c.x<h.x?-1:1),l.length!==2?r:l}var hN=class extends mt(Xh){},Zh=class extends Lo(Ri(mt(Xh))){constructor(){super(...arguments),this.divider=new hN}};u([Et],Zh.prototype,"divider",2);var Qh=class extends Ri(mt(Rs(Xh))){constructor(){super(...arguments),this.statistics=new Zh}};u([Et],Qh.prototype,"statistics",2);var ba=class extends Uh(Wh(mt(ns(Yh)))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new Zh,this.getVolume=()=>{},this.text=new Io}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return xa(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Sa(this.lineCap,this.lineDash,this.lineStyle)}};u([Et],ba.prototype,"statistics",2),u([Et],ba.prototype,"text",2);function qh(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function Jh(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var li=class extends qh(ba){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return Xr(e)&&e.type==="date-range"}};u([Et],li.prototype,"type",2),u([Et],li.prototype,"extendAbove",2),u([Et],li.prototype,"extendBelow",2);var ci=class extends Jh(ba){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return Xr(e)&&e.type==="price-range"}};u([Et],ci.prototype,"type",2),u([Et],ci.prototype,"extendLeft",2),u([Et],ci.prototype,"extendRight",2);var ls=class extends qh(Jh(ba)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return Xr(e)&&e.type==="date-price-range"}};u([Et],ls.prototype,"type",2);var Wt=class extends qh(Jh(ba)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new Qh,this.down=new Qh,this.direction="both"}static is(e){return Xr(e)&&e.type==="quick-date-price-range"}};u([Et],Wt.prototype,"type",2),u([Et],Wt.prototype,"up",2),u([Et],Wt.prototype,"down",2);import{BaseProperties as dN,Property as ny,clamp as uN,isObject as pN}from"ag-charts-core";import{_ModuleSupport as gN}from"ag-charts-community";import{cachedTextMeasurer as mN,calcLineHeight as ry,wrapText as yN}from"ag-charts-core";var{BBox:fN}=gN,Zr=1.38;function Qr(e,t,i){return i?yN(t,{maxWidth:i,font:e,textWrap:"always",avoidOrphans:!1}):t}function xN(e,t){const{lineMetrics:i,width:s}=mN(e).measureLines(t),o=i.length*ry(e.fontSize,Zr);return{width:s,height:o}}function ed(e,t,i,s){let o=s?.width??0,a=s?.height??0;if(!s){const n=e.width==null?t:Qr(e,t,e.width);({width:o,height:a}=xN(e,n))}return new fN(i.x,i.y,o,a)}function ly(e,t,i,s,{x:o,y:a},n){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:p}=s,g=ry(c,Zr);n??(n=s.position=="center"?"middle":s.position);const m=i?s.getPlaceholderColor():s.color;e.setProperties({x:o,y:a,visible:r,text:t,fill:m,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:p,lineHeight:g,textBaseline:n})}var SN=10,bN=11,cy=20,vN=22,DN=10,hy=cy+DN,dy=34,MN=class extends Ri(mt(dN)){},Pt=class extends Ri(mt(Ur)){constructor(){super(...arguments),this.type="note",this.background=new MN,this.position="bottom",this.alignment="center",this.width=200}static is(e){return pN(e)&&e.type==="note"}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??SN;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,o=super.getTextInputCoords(e,t),a=this.getPadding().top,n=ed(this,s,o);n.x=uN(i/2,n.x,e.seriesRect.width-i/2);const r=n.y-hy-a*2,l=n.y+bN+a*2,c=Math.max(n.height,t);return r-c-dy<0?(n.y=l,this.position="top"):(n.y=r+a,this.position="bottom"),{x:n.x,y:n.y}}isHoverable(){return!0}};u([ny],Pt.prototype,"type",2),u([ny],Pt.prototype,"background",2);import{BaseProperties as kN}from"ag-charts-core";var AN=class extends No(qm(Rs(kN))){getDefaultColor(e){}getDefaultOpacity(e){}},td=class kA extends Ri(AN){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof kA}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}};import"ag-charts-community";import{BaseProperties as uy,Property as qr,isObject as py}from"ag-charts-core";var yt=class extends No(Jm(Rs(ey(mt(ns(uy)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Io}static is(e){return py(e)&&e.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return xa(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Sa(this.lineCap,this.lineDash,this.lineStyle)}};u([qr],yt.prototype,"type",2),u([qr],yt.prototype,"text",2);var zi=class extends No(Jm(Rs(ey(mt(ns(uy)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Io}static is(e){return py(e)&&e.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return xa(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Sa(this.lineCap,this.lineDash,this.lineStyle)}};u([qr],zi.prototype,"type",2),u([qr],zi.prototype,"text",2);import"ag-charts-community";import{BaseProperties as IN,Logger as NN,Property as Jr,isObject as LN}from"ag-charts-core";var hi=class extends No(Wh(Gh(Rs($h(mt(ns(IN))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Pn,this.snapToAngle=45}static is(e){return LN(e)&&e.type==="disjoint-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):NN.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return xa(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Sa(this.lineCap,this.lineDash,this.lineStyle)}};u([Jr],hi.prototype,"type",2),u([Jr],hi.prototype,"startHeight",2),u([Jr],hi.prototype,"endHeight",2),u([Jr],hi.prototype,"text",2);import{Property as gy,isObject as TN}from"ag-charts-core";import{Property as Co}from"ag-charts-core";import"ag-charts-community";import{Property as id,isObject as my}from"ag-charts-core";var el=class extends Uh(Q0($h(mt(ns(Yh))))){constructor(){super(...arguments),this.text=new Io}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return xa(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Sa(this.lineCap,this.lineDash,this.lineStyle)}};u([id],el.prototype,"text",2);var cs=class extends el{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return my(e)&&e.type==="arrow"}};u([id],cs.prototype,"type",2);var hs=class extends el{constructor(){super(...arguments),this.type="line"}static is(e){return my(e)&&e.type==="line"}};u([id],hs.prototype,"type",2);var ds=class extends el{constructor(){super(...arguments),this.label=new Z0,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};u([Co],ds.prototype,"label",2),u([Co],ds.prototype,"reverse",2),u([Co],ds.prototype,"showFill",2),u([Co],ds.prototype,"isMultiColor",2),u([Co],ds.prototype,"strokes",2),u([Co],ds.prototype,"rangeStroke",2),u([Co],ds.prototype,"bands",2);var Bi=class extends ds{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new En}static is(e){return TN(e)&&e.type==="fibonacci-retracement-trend-based"}};u([gy],Bi.prototype,"type",2),u([gy],Bi.prototype,"endRetracement",2);import{Property as CN,isObject as wN}from"ag-charts-core";var us=class extends ds{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return wN(e)&&e.type==="fibonacci-retracement"}};u([CN],us.prototype,"type",2);import"ag-charts-community";import{BaseProperties as ON,Logger as EN,Property as tl,isObject as PN}from"ag-charts-core";var di=class extends No(Wh(Gh(Rs($h(mt(ns(ON))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new U0,this.text=new Pn,this.snapToAngle=45}static is(e){return PN(e)&&e.type==="parallel-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.height,e.end.y-=this.height):EN.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return xa(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Sa(this.lineCap,this.lineDash,this.lineStyle)}};u([tl],di.prototype,"type",2),u([tl],di.prototype,"height",2),u([tl],di.prototype,"middle",2),u([tl],di.prototype,"text",2);import{Property as RN,isObject as _N}from"ag-charts-core";var ps=class extends Ur{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return _N(e)&&e.type==="text"}};u([RN],ps.prototype,"type",2);function _s(e){return Wt.is(e)}function il(e){return hs.is(e)||yt.is(e)||zi.is(e)||cs.is(e)||yy(e)}function gs(e){return hi.is(e)||di.is(e)}function yy(e){return us.is(e)||Bi.is(e)}function Vi(e){return vi.is(e)||_i.is(e)||Pt.is(e)||ps.is(e)}function _n(e){return li.is(e)||ci.is(e)||ls.is(e)||Wt.is(e)}function sd(e){return Vi(e)&&!Pt.is(e)}function zs(e){return il(e)||gs(e)||_n(e)&&!Wt.is(e)}function zN(e){return il(e)||gs(e)||_n(e)||vi.is(e)||Pt.is(e)}function BN(e){return Pt.is(e)}function VN(e){return gs(e)||_n(e)||vi.is(e)||_i.is(e)||td.is(e)}function FN(e){return Vi(e)&&!Pt.is(e)}function va(e){return(il(e)||gs(e)||_n(e))&&!_s(e)&&K0(e.text)}function HN(e,t){"fontSize"in e&&(e.fontSize=t),va(e)&&(e.text.fontSize=t)}function fy(e,t){const i=t?.strokeWidth??e.strokeWidth??1,s=t?.type??e.lineStyle,o=s??Rn(e.lineDash,s),a=ay(i,o);e.strokeWidth=i,e.computedLineDash=a,e.lineStyle=o,e.lineCap=o==="dotted"?"round":void 0}function sl(e,t,i,s,o,a){switch(t){case"fill-color":{"fill"in e&&(e.fill=s),"fillOpacity"in e&&(e.fillOpacity=o),"background"in e&&(e.background.fill=s,e.background.fillOpacity=o);break}case"line-color":{"axisLabel"in e&&(e.axisLabel.fill=s,e.axisLabel.fillOpacity=o,e.axisLabel.stroke=s,e.axisLabel.strokeOpacity=o),"fill"in e&&"fillOpacity"in e&&BN(e)?(e.fill=s,e.fillOpacity=o):("strokeOpacity"in e&&(e.strokeOpacity=o),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=a,e.rangeStroke=s):"stroke"in e&&(e.stroke=s));break}case"text-color":{"color"in e&&(e.color=i),va(e)&&(e.text.color=s);break}}}var KN=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(Hh).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:ri(this.colors),fontSizes:ri(this.fontSizes),lineStyles:ri(this.lineStyles),lineTextAlignments:ri(this.lineTextAlignments),lineTextPositions:ri(this.lineTextPositions),fibonacciOptions:ri(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=ri(i.colors),this.fontSizes=ri(i.fontSizes),this.lineStyles=ri(i.lineStyles),this.lineTextAlignments=ri(i.lineTextAlignments),this.lineTextPositions=ri(i.lineTextPositions),this.fibonacciOptions=ri(i.fibonacciOptions)}setDefaultColor(e,t,i,s,o,a){this.colors.get(e)?.set(t,[i,s,o,a])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if(e!="fibonacci-retracement"&&e!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(e);s[t]=i,this.fibonacciOptions.set(e,s)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[s,[o,a,n,r]=[]]of i)o&&a&&n!=null&&r!=null&&sl(e,s,o,a,n,r);for(const[t,i]of this.fontSizes)e.type!==t||i==null||HN(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||fy(e,i);for(const[t,i]of this.lineTextPositions)e.type!==t||i==null||(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type!==t||i==null||(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)if(!(e.type!==t||i==null))for(const s of Object.keys(i)){const o=i[s];o!=null&&e.set({[s]:o})}}};import{_ModuleSupport as GN}from"ag-charts-community";import{BaseProperties as WN,CleanupRegistry as jN,Color as xy,EventEmitter as $N,PropertiesArray as UN,Property as wo}from"ag-charts-core";import{_ModuleSupport as YN}from"ag-charts-community";import{Color as od,attachListener as XN,clamp as ol,createElement as ZN,getWindow as Sy}from"ag-charts-core";var QN='<div class="ag-charts-color-picker__palette" role="slider" tabindex="0"></div><div class="ag-charts-color-picker__color-row" role="presentation"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button" role="switch"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field" role="presentation"><span class="ag-charts-color-picker__color-label" aria-hidden="true"></span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',by=e=>{try{const t=od.fromString(e),[i,s,o]=t.toHSB();return[i,s,o,t.a]}catch{return}},vy=class extends YN.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),s=this.showWithChildren([t],{initialFocus:i,...e});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(e){const{localeManager:t}=this.ctx;let i=e.isMultiColor??!1,[s,o,a,n]=by(e.color??"#f00")??[0,1,.5,1];n=e.opacity??n;const r=ZN("div","ag-charts-color-picker__content");r.innerHTML=QN,r.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=r.querySelector(".ag-charts-color-picker__palette"),c=r.querySelector(".ag-charts-color-picker__hue-input"),h=r.querySelector(".ag-charts-color-picker__multi-color-button"),d=r.querySelector(".ag-charts-color-picker__alpha-input"),p=r.querySelector(".ag-charts-color-picker__color-input"),g=r.querySelector(".ag-charts-color-picker__color-label"),m=f=>{const D={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[f];l.ariaValueText=t.t(D,{s:o,v:a})};this.i18nUpdater=()=>{l.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),l.ariaLabel=t.t("ariaLabelColorPickerPalette"),c.ariaLabel=t.t("ariaLabelColorPickerHue"),h.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),d.ariaLabel=t.t("ariaLabelColorPickerAlpha"),p.ariaLabel=t.t("ariaLabelColor"),m("s")},this.i18nUpdater(),h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const y=(f=!0)=>{const v=od.fromHSB(s,o,a,n).toHexString();if(r.style.setProperty("--h",`${s}`),r.style.setProperty("--s",`${o}`),r.style.setProperty("--v",`${a}`),r.style.setProperty("--a",`${n}`),r.style.setProperty("--color",v.slice(0,7)),r.style.setProperty("--color-a",v),c.value=`${s}`,d.value=`${n}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",n===1),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),g.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==p&&(h.ariaChecked=i.toString(),p.value=i?t.t("ariaLabelColorPickerMultiColor"):v.toUpperCase()),f||e.color==null){const M=od.fromHSB(s,o,a,1).toHexString();e.onChange?.(v,M,n,i)}f&&(this.hasChanged=!0)};y(!1);const S=f=>f.preventDefault(),x=f=>f.stopPropagation(),b=f=>{f.preventDefault();const D=f.currentTarget;D.focus();const v=D.getBoundingClientRect(),M=({clientX:I,clientY:k})=>{i=!1,o=Math.min(Math.max((I-v.left)/v.width,0),1),a=1-Math.min(Math.max((k-v.top)/v.height,0),1),y(),m("s")};M(f);const A=XN(Sy(),"pointermove",M);Sy().addEventListener("pointerup",A,{once:!0})};return r.addEventListener("mousedown",x),r.addEventListener("touchstart",x),r.addEventListener("touchmove",x),r.addEventListener("keydown",f=>{switch(f.stopPropagation(),f.key){case"Enter":case"Escape":this.hide();break;default:return}f.preventDefault()}),l.addEventListener("pointerdown",b),l.addEventListener("touchstart",S,{passive:!1}),l.addEventListener("touchmove",S,{passive:!1}),l.addEventListener("keydown",f=>{if(f.key==="ArrowLeft")o=ol(0,o-.01,1),m("s");else if(f.key==="ArrowRight")o=ol(0,o+.01,1),m("s");else if(f.key==="ArrowUp")a=ol(0,a+.01,1),m("v");else if(f.key==="ArrowDown")a=ol(0,a-.01,1),m("v");else return;f.preventDefault(),y()}),l.addEventListener("focus",()=>{m("s")}),h.addEventListener("click",()=>{i=!i,y()}),c.addEventListener("input",f=>{i=!1,s=f.currentTarget.valueAsNumber??0,y()}),d.addEventListener("input",f=>{i=!1,n=f.currentTarget.valueAsNumber??0,y()}),p.addEventListener("input",f=>{i=!1;const D=by(f.currentTarget.value);D!=null&&([s,o,a,n]=D,y())}),p.addEventListener("blur",()=>y()),p.addEventListener("keydown",f=>{f.key==="Enter"&&(f.currentTarget.blur(),y())}),{element:r,initialFocus:l}}};import{BaseProperties as qN,Property as al}from"ag-charts-core";var ms=class extends qN{};u([al],ms.prototype,"icon",2),u([al],ms.prototype,"label",2),u([al],ms.prototype,"ariaLabel",2),u([al],ms.prototype,"tooltip",2);import{_ModuleSupport as Dy}from"ag-charts-community";function My(e){return!(e instanceof Dy.LogScale)&&!(e instanceof Dy.BandScale)}var JN=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:My},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:My}],eL=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],tL=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],iL=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],sL=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],oL=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],ky=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],zn=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],Ay=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{FloatingToolbar:aL,Menu:ad,ToolbarButtonWidget:nL}=GN,Da=class extends ms{constructor(){super(...arguments),this.checkedOverrides=new ms}};u([wo],Da.prototype,"value",2),u([wo],Da.prototype,"checkedOverrides",2),u([wo],Da.prototype,"color",2),u([wo],Da.prototype,"strokeWidth",2),u([wo],Da.prototype,"isMultiColor",2);var rL=class extends nL{update(e){super.update(e),e.value==="line-stroke-width"&&this.updateLineStrokeWidth(e),(e.value==="fill-color"||e.value==="line-color"||e.value==="text-color")&&this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},lL=class extends aL{createButtonWidget(){return new rL(this.localeManager)}},nd=class extends WN{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new UN(Da),this.cleanup=new jN,this.events=new $N,this.visibleButtons=[],this.toolbar=new lL(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new vy(this.ctx),this.textSizeMenu=new ad(this.ctx,"text-size"),this.lineStyleTypeMenu=new ad(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new ad(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":zs(e),"line-stroke-width":zs(e),"line-color":zN(e),"text-color":FN(e),"fill-color":VN(e),"text-size":sd(e),settings:va(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>t[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(t!=null&&i!=null){const{r:o,g:a,b:n}=xy.fromString(t);t=xy.fromArray([o,a,n,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:e==null?void 0:String(e)})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}onButtonPress({event:e,button:t,buttonWidget:i}){const s=this.getActiveDatum();if(s)switch(this.hideOverlays(),t.value){case"line-style-type":{const o=zs(s)?Rn(s.lineDash,s.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:zn,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:o,onPress:a=>this.onLineStyleTypeMenuPress(a,s),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const o=zs(s)?s.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:ky,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:o,onPress:a=>this.onLineStrokeWidthMenuPress(a,s),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:s?.getDefaultColor(t.value),opacity:s?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in s,isMultiColor:"isMultiColor"in s&&s?.isMultiColor,onChange:s==null?void 0:this.onColorPickerChange.bind(this,t.value,s),onChangeHide:(o=>{this.events.emit("saved-color",{type:s.type,colorPickerType:t.value,color:s.getDefaultColor(o)})}).bind(this,t.value)});break}case"text-size":{const o=Vi(s)?s.fontSize:void 0;this.textSizeMenu.show(i,{items:Ay,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:o,onPress:a=>this.onTextSizeMenuPress(a,s),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{s.locked=!s.locked,this.refreshButtons(s),this.events.emit("pressed-lock",{locked:s.locked});break}case"settings":{this.toolbar.toggleActiveButtonByIndex(t.index),this.events.emit("pressed-settings",e);break}}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,s={x:i.x,y:i.y+i.height+4},o={y:i.y-4};this.colorPicker.setAnchor(s,o);for(const[a,n]of t.entries()){const r=this.visibleButtons.at(a);if(!r)continue;const l={x:n.x,y:n.y+n.height-1},c={y:n.y};switch(r.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(e,t,i,s,o,a){this.events.emit("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:s,opacity:o,isMultiColor:a}),this.updateColorPickerColor(e,i,o,a)}onTextSizeMenuPress(e,t){if(!sd(t))return;const i=e.value;this.events.emit("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!zs(t))return;const i=e.value;this.events.emit("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!zs(t))return;const i=e.value;this.events.emit("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,t),this.updateButtonByIndex(i,t?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!t));sd(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!zs(e))return;const t=e.strokeWidth??1,i=Rn(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(zn.find(s=>s.value===i)??zn[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(s=>s.value===e);i!==-1&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};u([wo],nd.prototype,"enabled",2),u([wo],nd.prototype,"buttons",2);import{Debug as cL,StateMachine as Iy,StateMachineProperty as rd,Vec2 as Ny}from"ag-charts-core";var we=class extends Iy{constructor(e){const t=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:i,context:s})=>{this.hasMoved=Ny.lengthSquared(Ny.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),e.update()},dragEnd:{target:Iy.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=cL.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};u([rd()],we.prototype,"snapping",2),u([rd()],we.prototype,"datum",2),u([rd()],we.prototype,"node",2);import{Property as hL,isObject as dL}from"ag-charts-core";var Bs=class extends td{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return dL(e)&&e.type==="arrow-down"}};u([hL],Bs.prototype,"type",2);import{_ModuleSupport as uL}from"ag-charts-community";import{_ModuleSupport as pL}from"ag-charts-community";import{_ModuleSupport as ld}from"ag-charts-community";import{ZIndexMap as gL,isObject as mL}from"ag-charts-core";import{_ModuleSupport as cd}from"ag-charts-community";import{_ModuleSupport as yL}from"ag-charts-community";var Ma=class extends yL.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}},Ly=class AA extends cd.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-i.x,y:t.y-i.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=AA.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,i){return this.handle.containsPoint(t,i)}};Ly.INACTIVE_STROKE_WIDTH=2;var Vs=Ly,hd=class IA extends Vs{constructor(){super(),this.handle=new Ma({shape:"circle"}),this.glow=new Ma({shape:"circle"}),this.append([this.handle]),this.handle.size=IA.HANDLE_SIZE,this.handle.strokeWidth=Vs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:Vs.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};hd.HANDLE_SIZE=7,hd.GLOW_SIZE=9;var Fs=hd,nl=class Kt extends Vs{constructor(){super(),this.handle=new cd.Rect,this.glow=new cd.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=Kt.CORNER_RADIUS,this.handle.width=Kt.HANDLE_SIZE,this.handle.height=Kt.HANDLE_SIZE,this.handle.strokeWidth=Vs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=Kt.CORNER_RADIUS,this.glow.width=Kt.GLOW_SIZE,this.glow.height=Kt.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const i=(Kt.HANDLE_SIZE-Fs.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=Fs.HANDLE_SIZE,this.handle.height=Fs.HANDLE_SIZE,this.glow.width=Fs.GLOW_SIZE,this.glow.height=Fs.GLOW_SIZE}else this.handle.cornerRadius=Kt.CORNER_RADIUS,this.handle.width=Kt.HANDLE_SIZE,this.handle.height=Kt.HANDLE_SIZE,this.glow.width=Kt.GLOW_SIZE,this.glow.height=Kt.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(Kt.HANDLE_SIZE-Fs.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};nl.HANDLE_SIZE=12,nl.GLOW_SIZE=16,nl.CORNER_RADIUS=4;var ka=nl,dd=class _r extends Vs{constructor(){super(),this.handle=new Ma({shape:"circle"}),this.glow=new Ma({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=_r.HANDLE_SIZE,this.handle.strokeWidth=Vs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=_r.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=Fs.HANDLE_SIZE,this.glow.size=Fs.GLOW_SIZE):(this.handle.size=_r.HANDLE_SIZE,this.glow.size=_r.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(t){this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked&&(delete t.fill,delete t.strokeWidth),this.handle.setProperties(t),this.glow.setProperties({...t,strokeWidth:0,fill:t.stroke})}getCursor(){return"pointer"}};dd.HANDLE_SIZE=11,dd.GLOW_SIZE=17;var be=dd,Ye=class extends ld.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=gL.CHART_ANNOTATION}static isCheck(e,t){return mL(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e,t,i){i!==!0&&this.toggleHandles(e||t)}computeBBoxWithoutHandles(){return ld.Transformable.toCanvas(this,ld.Group.computeChildrenBBox(this.excludeChildren({instance:Vs})))}updateNode(e,t,i){if(!i&&t){t.remove();return}return i&&t==null&&(t=new e,this.appendChild(t)),t}};import{Vec2 as fL}from"ag-charts-core";import{_ModuleSupport as xL}from"ag-charts-community";import{Vec2 as ui,entries as SL,toRadians as bL}from"ag-charts-core";var{ContinuousScale:vL}=xL;function Bn(e,t,i=!1,s,o=1){if(!i)return It(e,t);const a=s?Se(s,t):ui.origin();return It(rl(e,a,o),t)}function rl(e,t,i){const s=ui.sub(e,t),o=bL(i),a=Math.round(ui.angle(s)/o)*o;return ui.rotate(s,a,t)}function ll(e,t){const i={};for(const[s,o]of SL(e))i[s]=Se(o,t);return i}function ys(e,t,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:o,yAxis:a}=i,n=Object.keys(e),r=[],l=[],c=new Set(s.translateVectors??n),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),p=ui.multiply(t,ui.from(1,-1));for(const x of n)d.has(x)&&(e[x]=ui.add(e[x],h.has(x)?p:t),s.snap&&(e[x]=rl(e[x],s.snap.vectors[x],s.snap.angle))),r.push(o.getRangeOverflow(e[x].x)),l.push(a.getRangeOverflow(e[x].y));const g=(x,b)=>Math.abs(x)-Math.abs(b),m=(x,b,f)=>s.overflowContinuous===0||!vL.is(x)?f.toSorted(g).at(-1)??0:n.length===d.size?f.toSorted(g).at(-s.overflowContinuous-1)??0:f.filter(v=>v!==0).length<=s.overflowContinuous?0:f.filter((v,M)=>v!==0&&Math.abs(v)<=Math.abs(b)&&d.has(n[M])).toSorted(g).at(-1)??0,y=ui.from(m(o.scale,t.x,r),m(a.scale,t.y,l));if(!ui.equal(y,ui.origin()))for(const x of n)d.has(x)&&(e[x]=ui.round(ui.sub(e[x],y),4));const S={};for(const x of n)S[x]=It(e[x],i);return S}var Ty=class extends Ye{constructor(){super(...arguments),this.handle=new be,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Se(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...ll({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(!e.isWriteable()||!s)return;const{point:o}=ys({point:s.handle},fL.sub(t,s.offset),i);e.x=o.x,e.y=o.y}translate(e,t,i){if(!e.isWriteable())return;const{point:s}=ys({point:Se(e,i)},t,i);e.x=s.x,e.y=s.y}toggleHandles(e){this.handle.visible=!!e,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const s=Se(e,i),o=It({x:s.x-30,y:s.y-30},i);return t.x=o.x,t.y=o.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:s,y:o}=this.getHandleCoords(e,t,i),a=this.getHandleStyles(e);this.handle.update({...a,x:s,y:o}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const s=this.getHandleCoords(e,t);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},Cy=class extends Ty{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=Se(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},wy=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function Oy(e){pL.drawMarkerUnitPolygon(e,wy)}Oy.anchor={x:.5,y:0};var cl=class extends Cy{constructor(){super(),this.type="arrow-up",this.shape=new Ma({shape:Oy}),this.append([this.shape])}static is(e){return Ye.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=be.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y-=i,s}},DL=wy.map(([e,t])=>[e,1-t]);function Ey(e){uL.drawMarkerUnitPolygon(e,DL)}Ey.anchor={x:.5,y:1};var hl=class extends Cy{constructor(){super(),this.type="arrow-down",this.shape=new Ma({shape:Ey}),this.append([this.shape])}static is(e){return Ye.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i);return s.y-=e.size,s}getHandleCoords(e,t){const i=be.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y+=i,s}};import{Debug as ML,StateMachine as dl,StateMachineProperty as kL}from"ag-charts-core";var ud=class extends dl{constructor(e){const t=({point:s})=>{const o=this.createDatum();o.set({x:s.x,y:s.y}),e.create(o)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:dl.parent,reset:dl.parent},"waiting-first-render":{render:{target:dl.parent,action:i}}}),this.debug=ML.create(!0,"annotations")}};u([kL()],ud.prototype,"node",2);var AL=class extends ud{createDatum(){return new Bs}},Py={type:"arrow-down",datum:Bs,scene:hl,isDatum:Bs.is,translate:(e,t,i,s)=>{Bs.is(t)&&hl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Bs.is(t)&&Bs.is(i)&&hl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Bs.is(t)&&hl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new AL({...e,create:t("arrow-down")}),dragState:e=>new we(e)};import{Property as IL,isObject as NL}from"ag-charts-core";var Hs=class extends td{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return NL(e)&&e.type==="arrow-up"}};u([IL],Hs.prototype,"type",2);var LL=class extends ud{createDatum(){return new Hs}},Ry={type:"arrow-up",datum:Hs,scene:cl,isDatum:Hs.is,translate:(e,t,i,s)=>{Hs.is(t)&&cl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Hs.is(t)&&Hs.is(i)&&cl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Hs.is(t)&&cl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new LL({...e,create:t("arrow-up")}),dragState:e=>new we(e)};import{_ModuleSupport as TL}from"ag-charts-community";import{_ModuleSupport as CL}from"ag-charts-community";import{Vec4 as _y}from"ag-charts-core";import{Vec2 as wL,Vec4 as zy,entries as OL}from"ag-charts-core";import{Vec2 as EL,Vec4 as By}from"ag-charts-core";var Vy=class extends Ye{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:s},o,a){const n={x1:e,y1:t,x2:i,y2:s};if(!o.extendStart&&!o.extendEnd)return n;const[r,l]=cN(n,a.yAxis.bounds),c=n.x2<n.x1,h=n.y1>=n.y2,d=n.x2===n.x1;return o.extendEnd&&(d?n.y2=h?l.y:r.y:(n.x2=c?r.x:l.x,n.y2=c?r.y:l.y)),o.extendStart&&(d?n.y1=h?r.y:l.y:(n.x1=c?l.x:r.x,n.y1=c?l.y:r.y)),n}dragStart(e,t,i){this.dragState={offset:t,...ll({start:e.start,end:e.end},i)}}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,EL.sub(t,s.offset),i)}translate(e,t,i){e.isWriteable()&&this.translatePoints(e,Se(e.start,i),Se(e.end,i),t,i)}copy(e,t,i){const s=At(e,i);if(!s)return;const o=this.computeBBoxWithoutHandles(),a={x:-o.width/2,y:-o.height/2};return this.translatePoints(t,By.start(s),By.end(s),a,i),t}translatePoints(e,t,i,s,o){const a=this.getTranslatePointsVectors(t,i),n=ys(a,s,o,{overflowContinuous:this.overflowContinuous});e.start.x=n.start.x,e.end.x=n.end.x,e.start.y=n.start.y,e.end.y=n.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},pd=class extends Vy{constructor(){super(...arguments),this.start=new be,this.end=new be,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=At(e,t);i!=null&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of OL(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:o,dragState:a}=this;if(!o||!a)return;this[o].toggleDragging(!0);const n=o==="start"?"end":"start",r=s?{vectors:{[o]:Se(e[n],i)},angle:e.snapToAngle}:void 0,{[o]:l}=ys({[o]:a[o]},wL.sub(t,a.offset),i,{overflowContinuous:0,snap:r});e[o].x=l.x,e[o].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):!1}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,s){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return i==="start"?zy.start(t):zy.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},PL=class extends pd{constructor(){super(...arguments),this.label=new CL.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=At(e,t);if(i==null)return;const s=this.getTextBBox(e,i);this.updateLabel(e,s,i),this.updateHandles(e,i,s),this.updateShape(e,s,i),this.updateAnchor(e,i,t,s)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return ed(e,i,_y.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:s,isPlaceholder:o}=e.getText();ly(this.label,s,o,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return _y.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:RL,Path:_L}=TL,ul=class extends PL{constructor(){super(),this.type="callout",this.shape=new _L,this.append([this.shape,this.label,this.start,this.end])}static is(e){return Ye.isCheck(e,"callout")}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle==="end"?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const s=e.getPadding(),{bodyBounds:o={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:o.x+s.left,y:o.y-s.bottom}}getHandleStyles(e,t){return t==="start"?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,s){const{bodyBounds:o}=this.getDimensions(e,s,t)??{},a=o??s;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:s}=this;s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeWidth=e.strokeWidth??1,s.strokeOpacity=e.strokeOpacity??1;const{tailPoint:o,bodyBounds:a}=this.getDimensions(e,t,i)??{};!o||!a||this.updatePath(o,a)}updatePath(e,t){const{x:i,y:s}=e,{x:o,y:a,width:n,height:r}=t,l=a-r,c=o+n,h=this.calculateCalloutPlacement({x:i,y:s},t),d=8,p=[{coordinates:{x0:o,x1:o+d,y0:l+d,y1:l,cx:h==="topLeft"?i:o+d,cy:h==="topLeft"?s:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:o+d,x1:c-d,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?s:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:a-d,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:a-d,y1:a,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?s:a-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:o+d,y0:a,y1:a,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:o+d,x1:o,y0:a,y1:a-d,cx:h==="bottomLeft"?i:o+d,cy:h==="bottomLeft"?s:a-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:o,x1:o,y0:a-d,y1:l+d,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:g}=this.shape;g.clear(),g.moveTo(o,l+d);for(const{coordinates:m,type:y}of p)this.drawPath(g,m,d,y);g.closePath()}drawPath(e,{x0:t,y0:i,x1:s,y1:o,cx:a,cy:n},r,l){switch(l){case"calloutCorner":{e.lineTo(a,n),e.lineTo(s,o);break}case"corner":{RL(e,{x0:t,x1:s,y0:i,y1:o,cx:a,cy:n},r,!1);break}case"calloutSide":{if(t===s){const h=i>o?-1:1,d=Math.min(i,o)+Math.abs(i-o)/2;e.lineTo(t,d-6*h),e.lineTo(a,n),e.lineTo(t,d+6*h),e.lineTo(s,o)}else{const h=t>s?-1:1,d=Math.min(t,s)+Math.abs(s-t)/2;e.lineTo(d-6*h,i),e.lineTo(a,n),e.lineTo(d+6*h,i),e.lineTo(s,o)}break}case"side":default:{e.lineTo(s,o);break}}}calculateCalloutPlacement(e,t){const i=t.x+t.width,s=t.y-t.height;let o,a;return e.x>i?o="right":e.x<t.x&&(o="left"),e.y>t.y?a="bottom":e.y<s&&(a="top"),o&&a?`${a}${o[0].toUpperCase()}${o.substring(1)}`:a??o}getDimensions(e,t,i){const{fontSize:s}=e,o=e.getPadding(),a=o.left+o.right,n=o.top+o.bottom,r=t.width+a,l=Math.max(t.height+n,s+n);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:r,height:l}}}containsPoint(e,t){const{start:i,end:s,shape:o}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const a=s.containsPoint(e,t)||o.containsPoint(e,t);return a&&(this.activeHandle="end"),a}};import"ag-charts-community";import{Debug as zL,StateMachine as Di,StateMachineProperty as Fy}from"ag-charts-core";function gd({key:e}){return e==="Escape"}function md({key:e,shiftKey:t}){return!t&&e==="Enter"}var yd=class extends Di{constructor(e){const t=({point:p})=>{const g=this.createDatum();g.set({start:p,end:p,visible:!0}),e.create(g)},i=()=>{const{node:p}=this;p?.toggleActive(!0),p?.toggleHandles({start:!0})},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},o=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},a=p=>{this.node?.setTextInputBBox(p),e.update()},n=({point:p})=>{const{datum:g,node:m}=this;g?.set({end:p}),m?.toggleActive(!0),m?.toggleHandles({end:!1}),e.update()},r=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:p,colorOpacity:g,color:m,opacity:y,isMultiColor:S})=>{const{datum:x}=this;x&&(p==="text-color"&&e.updateTextInputColor(m),sl(x,p,g,m,y,S),e.update())},c=p=>{const{datum:g,node:m}=this;!g||!m||!Vi(g)||(g.fontSize=p,e.updateTextInputFontSize(p),e.update())},h=()=>{e.delete()},d=({textInputValue:p,bbox:g})=>{const{datum:m}=this;if(g!=null&&p!=null&&p.length>0){if(!Vi(m))return;const y=Qr(m,p,g.width);m?.set({text:y}),e.update(),e.recordAction(`Create ${m?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Di.parent,reset:Di.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:n,drag:n,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:Di.parent,action:h},cancel:{target:Di.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:gd,target:Di.parent,action:h},{guard:md,target:Di.parent,action:d}],click:{target:Di.parent,action:d},dragStart:{target:Di.parent,action:d},resize:{target:Di.parent,action:d},onExit:o,cancel:{target:Di.parent,action:h}}}),this.debug=zL.create(!0,"annotations")}};u([Fy()],yd.prototype,"datum",2),u([Fy()],yd.prototype,"node",2);var BL=class extends yd{createDatum(){return new vi}},Hy={type:"callout",datum:vi,scene:ul,isDatum:vi.is,translate:(e,t,i,s)=>{if(vi.is(t)&&ul.is(e))return e.translate(t,i,s)},copy:(e,t,i,s)=>{if(vi.is(t)&&vi.is(i)&&ul.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{vi.is(t)&&ul.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new BL({...e,create:t("callout")}),dragState:e=>new we(e)};import{_ModuleSupport as Ky}from"ag-charts-community";import{calcLineHeight as VL}from"ag-charts-core";import{_ModuleSupport as FL}from"ag-charts-community";var fd=class extends Ty{constructor(){super(...arguments),this.label=new FL.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=Se(e,t),s=this.getTextBBox(e,i,t);this.updateLabel(e,s),this.updateHandle(e,i,s),this.updateShape(e,s),this.anchor=this.updateAnchor(e,s,t)}copy(e,t,i){const s=Se(e,i),o=this.getTextBBox(e,s,i),a=e.getPadding(),n=a.left+a.right,r=a.top+a.bottom,l=(o.width+n)/2,c=o.height+r,h=It({x:s.x-l,y:s.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:s}=e.getText();return ed(e,s,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:s}=e.getText();ly(this.label,i,s,e,this.getLabelCoords(e,t),this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return e.position=="center"?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:xd}=Ky,pl=class extends fd{constructor(){super(),this.type="comment",this.shape=new Ky.Path,this.append([this.shape,this.label,this.handle])}static is(e){return Ye.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i),o=e.getPadding();return s.y-=o.bottom+o.top,s}updatePath(e,t){const i=e.getPadding(),{x:s,y:o}=t;let{width:a,height:n}=t;const{fontSize:r}=e,l=i.left+i.right,c=i.top+i.bottom;a=a+l,n=Math.max(n+c,r+c);const h=o-n,d=s+a,p=(VL(r,Zr)+c)/2,{path:g}=this.shape;g.clear(),g.moveTo(s,o),g.lineTo(s,h+p),xd(g,{x0:s,x1:s+p,y0:h+p,y1:h,cx:s+p,cy:h+p},p,!1),g.lineTo(d-p,h),xd(g,{x0:d-p,x1:d,y0:h,y1:h+p,cx:d-p,cy:h+p},p,!1),g.lineTo(d,o-p),xd(g,{x0:d,x1:d-p,y0:o-p,y1:o,cx:d-p,cy:o-p},p,!1),g.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}};import"ag-charts-community";import{Debug as HL,StateMachine as fs,StateMachineProperty as Gy}from"ag-charts-core";var Vn=class extends fs{constructor(e){const t=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),e.create(d)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},o=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},a=h=>{this.node?.setTextInputBBox(h),e.update()},n=({colorPickerType:h,colorOpacity:d,color:p,opacity:g,isMultiColor:m})=>{this.datum&&(h==="text-color"&&e.updateTextInputColor(p),sl(this.datum,h,d,p,g,m),e.update())},r=h=>{const{datum:d,node:p}=this;!d||!p||!Vi(d)||(d.fontSize=h,e.updateTextInputFontSize(h),e.update())},l=()=>{e.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:p}=this;if(!Vi(p))return;const g=Qr(p,h,d.width);p?.set({text:g}),e.update(),e.recordAction(`Create ${p?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:fs.parent,reset:fs.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:a,color:n,fontSize:r,textInput:[{guard:gd,target:fs.parent,action:l},{guard:md,target:fs.parent,action:c}],click:{target:fs.parent,action:c},dragStart:{target:fs.parent,action:c},resize:{target:fs.parent,action:c},onExit:o,cancel:{target:fs.parent,action:l}}}),this.debug=HL.create(!0,"annotations")}};u([Gy()],Vn.prototype,"datum",2),u([Gy()],Vn.prototype,"node",2);var KL=class extends Vn{createDatum(){return new _i}},Wy={type:"comment",datum:_i,scene:pl,isDatum:_i.is,translate:(e,t,i,s)=>{_i.is(t)&&pl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(_i.is(t)&&_i.is(i)&&pl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{_i.is(t)&&pl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new KL({...e,create:t("comment")}),dragState:e=>new we(e)};import"ag-charts-community";import{ChartAxisDirection as GL,Vec2 as Oo,Vec4 as Sd}from"ag-charts-core";import{_ModuleSupport as gl}from"ag-charts-community";var{calculateLabelTranslation:WL}=gl,jy=class extends gl.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new gl.Text({zIndex:1}),this.rect=new gl.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:s,fontSize:o,fontStyle:a,fontFamily:n,textAlign:r,color:l="white",formatter:c}=t,h=c?c({value:e}):i.formatScaleValue(e,"annotation-label");this.label.setProperties({fontWeight:s,fontSize:o,fontStyle:a,fontFamily:n,textAlign:r,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:s,fillOpacity:o,stroke:a,strokeOpacity:n}=e;t.fill=s,t.fillOpacity=o??1,t.stroke=a,t.strokeOpacity=n??1,t.cornerRadius=i??0}updatePosition({x:e,y:t,context:i,styles:{padding:s}}){const{label:o,rect:a}=this,n=o.getBBox()?.clone(),r=s??8,l=s??4,{xTranslation:c,yTranslation:h}=WL({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:n});n.grow(r,"horizontal"),n.grow(l,"vertical");const d=e+c,p=t+h;o.x=d,o.y=p,a.y=p-Math.round(n.height/2),a.x=d-Math.round(n.width/2),a.height=n.height,a.width=n.width}};jy.className="AxisLabel";import{_ModuleSupport as $y}from"ag-charts-community";import{Vec2 as Fi,jsonDiff as jL}from"ag-charts-core";var Rt=class extends $y.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e){return super.setProperties(e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:s,x2:o,y2:a}=this;let n=t+e;n%2===0&&(n+=1);const r=Fi.from(i,s-Math.floor(n/2)),l=Fi.from(o,a),c=Fi.distance(r,l);this.collisionBBox=new $y.BBox(r.x,r.y,c,n)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:o,x2:a,y2:n}=this;if(!i)return!1;const r=Fi.from(s,o),l=Fi.from(a,n),c=Fi.sub(Fi.from(e,t),r),h=Fi.sub(l,r),d=Fi.rotate(c,Fi.angle(c,h),r);return i.containsPoint(d.x,d.y)??!1}render(e){const{clipMask:t}=this,{ctx:i}=e;if(t.size===0){super.render(e);return}i.save();try{for(const s of this.clipMask.values()){const{x:o,y:a,radius:n}=s;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(o,a,n,n,0,Math.PI*2,0,!0),i.clip()}super.render(e)}finally{i.restore()}}setClipMask(e,t){const i=this.clipMask.get(e);jL(i,t)!=null&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}};import{_ModuleSupport as $L}from"ag-charts-community";var Eo=class extends $L.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}};import{Vec2 as ft}from"ag-charts-core";function Aa(e,t,i,s,o,a,n){if(!a||!o||!s){t.setClipMask(e);return}const{alignment:r,position:l}=s,c=Yy(i,s.fontSize,n),{point:h,textBaseline:d}=Xy(c,l,r);Zy(o,a,s,h,c.angle,d);const{x:p,y:g,width:m,height:y}=o.getBBox(),S=ft.length(ft.from(m,y)),x={x:p+m/2,y:g+y/2,radius:S/2+ft.length(c.offset)};return l==="center"?t.setClipMask(e,x):t.setClipMask(e),{clipMask:x,numbers:c}}function Uy(e,t,i,s,o,a,n){if(!n||!a)return;const{alignment:r,position:l}=s,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let d=c;l==="bottom"?d=h:l==="inside"&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const p=Yy(d,s.fontSize,o),{point:g,textBaseline:m}=Xy(p,l==="inside"?"center":l,r,e);Zy(a,n,s,g,p.angle,m)}function Yy(e,t,i){let[s,o]=ft.from(e);s.x>o.x&&([s,o]=[o,s]);const a=ft.normalized(ft.sub(o,s)),n=ft.angle(a),r=ft.multiply(a,be.HANDLE_SIZE/2+(t??14)/2),l=ft.multiply(a,(i??2)/2+(t??14)/3);return{left:s,right:o,normal:a,angle:n,inset:r,offset:l}}function Xy({left:e,right:t,normal:i,angle:s,inset:o,offset:a},n,r,l){let c;r==="right"?c=ft.sub(t,o):r==="center"?c=ft.add(e,ft.multiply(i,ft.distance(e,t)/2)):c=ft.add(e,o);let h="bottom";return n==="bottom"?(c=ft.rotate(a,s+Math.PI/2,c),h="top"):n==="center"&&!l?h="middle":c=ft.rotate(a,s-Math.PI/2,c),{point:c,textBaseline:h}}function Zy(e,t,i,s,o,a){e.setProperties({text:t,x:s.x,y:s.y,rotation:o,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var Ks=class extends Ye{constructor(){super(),this.type="cross-line",this.line=new Rt,this.middle=new ka,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return Ye.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=yt.is(e);const s=this.isHorizontal?t.yAxis:t.xAxis,o=this.convertCrossLine(e,s);if(o==null){this.visible=!1;return}this.visible=e.visible??!0,this.visible&&(this.updateLine(e,o),this.updateHandle(e,o),this.updateText(e,o),this.updateAxisLabel(e,s,o))}updateLine(e,t){const{line:i}=this,{lineDashOffset:s,stroke:o,strokeWidth:a,strokeOpacity:n}=e,{x1:r,y1:l,x2:c,y2:h}=t;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:o,strokeWidth:a,strokeOpacity:n,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:o,strokeWidth:a,strokeOpacity:n}=e,r={fill:e.handle.fill,stroke:e.handle.stroke??o,strokeOpacity:e.handle.strokeOpacity??n,strokeWidth:e.handle.strokeWidth??a},l=Oo.sub(Sd.center(t),Oo.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(Eo,this.text,!!e.text.label),Aa(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new jy;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:o}=this,{direction:a,position:n}=t;if(e.axisLabel.enabled){s.visible=this.visible;const r=n==="left"||n==="top"?Sd.start(i):Sd.end(i),l=a===GL.X?r.x:r.y;if(!t.inRange(l)){s.visible=!1;return}const c=Be(e.value);s.update({...Oo.add(r,Oo.required(o)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const s=yt.is(e)?{x:t.x,y:rs(e.value,i.yAxis)}:{x:rs(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:s}}drag(e,t,i){const{activeHandle:s,dragState:o}=this;!e.isWriteable()||!o||(s&&this[s].toggleDragging(!0),this.translatePoint(e,o.middle,Oo.sub(t,o.offset),i))}translate(e,t,i){if(!e.isWriteable())return;const s=yt.is(e)?Oo.from(0,rs(e.value,i.yAxis)):Oo.from(rs(e.value,i.xAxis),0);this.translatePoint(e,s,t,i)}translatePoint(e,t,i,s){const o=yt.is(e);o?i.x=0:i.y=0;const{point:a}=ys({point:t},i,s);e.value=o?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const s=yt.is(e),o=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(e,o);if(!a)return;const n=s?-30:0,r=s?0:-30,l=It({x:a.x1+r,y:a.y1+n},i);return t.set({value:s?l.y:l.x}),t}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:s,text:o}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):s.isPointInPath(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.line.isPointInPath(e,t))return"line";if(this.middle.containsPoint(e,t))return"handle"}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(e.value==null)return;let i=0,s=0,o,a;const{bounds:n}=t,r=rs(e.value,t);return yt.is(e)?(o=n.width,s=r,a=r):(i=r,o=r,a=n.height),{x1:i,y1:s,x2:o,y2:a}}};import"ag-charts-community";import{Debug as UL,StateMachine as ml,StateMachineProperty as YL}from"ag-charts-core";var bd=class extends ml{constructor(e,t){const i=({point:o})=>{const a=e==="horizontal",n=a?new yt:new zi;n.set({value:a?o.y:o.x}),t.create(n),t.recordAction(`Create ${a?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:ml.parent,cancel:ml.parent},"waiting-first-render":{render:{target:ml.parent,action:s}}}),this.debug=UL.create(!0,"annotations")}};u([YL()],bd.prototype,"node",2);var Qy={type:"horizontal-line",datum:yt,scene:Ks,isDatum:yt.is,translate:(e,t,i,s)=>{yt.is(t)&&Ks.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(yt.is(t)&&yt.is(i)&&Ks.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{yt.is(t)&&Ks.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bd("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new we(e)},qy={type:"vertical-line",datum:zi,scene:Ks,isDatum:zi.is,translate:(e,t,i,s)=>{zi.is(t)&&Ks.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(zi.is(t)&&zi.is(i)&&Ks.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{zi.is(t)&&Ks.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bd("vertical",{...e,create:t("vertical-line")}),dragState:e=>new we(e)};import{Vec2 as pi,Vec4 as Gs}from"ag-charts-core";import{_ModuleSupport as Jy}from"ag-charts-community";import{Vec4 as XL}from"ag-charts-core";var ef=class{static updateBackground(e,t,i,s){const{background:o}=this,{seriesRect:a}=s;o.path.clear(!0);const n=XL.from(0,0,a.width,a.height),r=this.getBackgroundPoints(e,t,i,n);for(let c=0;c<r.length;c++){const h=r[c];c===0?o.path.moveTo(h.x,h.y):o.path.lineTo(h.x,h.y)}o.path.closePath(),o.checkPathDirty();const l=this.getBackgroundStyles?.(e)??e.background;o.fill=l.fill,o.fillOpacity=l.fillOpacity??1}},tf=class extends Vy{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new Rt,this.bottomLine=new Rt,this.background=new Jy.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=ef.updateBackground.bind(this)}update(e,t){const{locked:i,visible:s}=e,o=At(e,t),a=At(e.bottom,t);if(o==null||a==null){this.visible=!1;return}else this.visible=s??!0;const n=this.extendLine(o,e,t),r=this.extendLine(a,e,t);this.updateLines(e,n,r,t,o,a),this.updateHandles(e,o,a),this.updateText(e,o,a),this.updateBackground(e,n,r,t),this.updateAnchor(o,a);for(const l of Object.values(this.handles))l.toggleLocked(i??!1)}toggleHandles(e){const{handles:t}=this;if(typeof e=="boolean"){for(const[i,s]of Object.entries(t))s.visible=e,s.toggleHovered(this.activeHandle===i);return}for(const[i,s]of Object.entries(e)){const o=t[i];o.visible=s??!0,o.toggleHovered(this.activeHandle===i)}}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;e!=null&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return this.activeHandle==null?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:s,bottomLine:o,text:a}=this;this.activeHandle=void 0;for(const[n,r]of Object.entries(i))if(r.containsPoint(e,t))return this.activeHandle=n,!0;return s.containsPoint(e,t)||o.containsPoint(e,t)||!!a?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[,i]of Object.entries(this.handles))if(i.containsPoint(e,t))return"handle"}updateAnchor(e,t){const{x:i,y:s}=Jy.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i,this.anchor.y=s}},yl=class extends tf{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new be,topRight:new be,bottomLeft:new be,bottomRight:new ka},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Ye.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,s){const{activeHandle:o,handles:a}=this;if(o==null)return;const{offset:n}=a[o].drag(t);a[o].toggleDragging(!0),o==="bottomRight"&&(n.x=0);let r=[],l=[],c=s;switch(o){case"topLeft":r=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":r=["bottomLeft"],l=["topLeft"];break;case"topRight":r=["topRight"],l=["bottomRight"];break;case"bottomRight":r=["bottomLeft","bottomRight"],c=!1;break}const h=At(e,i),d=At(e.bottom,i);if(!h||!d)return;const p={topLeft:Gs.start(h),topRight:Gs.end(h),bottomLeft:Gs.start(d),bottomRight:Gs.end(d)},g={vectors:{topLeft:p.topRight,bottomLeft:p.bottomRight,topRight:p.topLeft,bottomRight:p.bottomLeft},angle:e.snapToAngle},m=ys(p,n,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,invertYVectors:l,snap:c?g:void 0});e.start.x=m.topLeft.x,e.start.y=m.topLeft.y,e.end.x=m.topRight.x,e.end.y=m.topRight.y,e.startHeight=m.topLeft.y-m.bottomLeft.y,e.endHeight=m.topRight.y-m.bottomRight.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,bottomRight:s,topLeft:o,topRight:a}=this.handles,n=i.getBBox().y-o.getBBox().y,r=s.getBBox().y-a.getBBox().y,l=pi.add(e,pi.from(0,n)),c=pi.add(t,pi.from(0,r));return{start:e,end:t,bottomStart:l,bottomEnd:c}}updateLines(e,t,i){const{topLine:s,bottomLine:o}=this,{lineDashOffset:a,stroke:n,strokeOpacity:r,strokeWidth:l}=e,c={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:a,stroke:n,strokeOpacity:r,strokeWidth:l};s.setProperties({...t,...c}),o.setProperties({...i,...c})}updateHandles(e,t,i){const{handles:{topLeft:s,topRight:o,bottomLeft:a,bottomRight:n}}=this,r={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...r,...Gs.start(t)}),o.update({...r,...Gs.end(t)}),a.update({...r,...Gs.start(i)}),n.update({...r,...pi.sub(Gs.end(i),pi.from(n.handle.width/2,n.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Eo,this.text,!!e.text.label),Uy(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const o=t.x1>t.x2,a=t.y1>t.y2,n=a?s.y2:s.y1,r=a?s.y1:s.y2,l=pi.from(t);return e.extendEnd&&t.y2===r&&l.push(pi.from(o?s.x1:s.x2,a?s.y1:s.y2)),e.extendEnd&&i.y2===n&&l.push(pi.from(o?s.x1:s.x2,a?s.y2:s.y1)),l.push(...pi.from(i).reverse()),e.extendStart&&i.y1===r&&l.push(pi.from(o?s.x2:s.x1,a?s.y1:s.y2)),e.extendStart&&t.y1===n&&l.push(pi.from(o?s.x2:s.x1,a?s.y2:s.y1)),l}};import{Debug as ZL,StateMachine as Ws,StateMachineProperty as vd,isNumber as Ia}from"ag-charts-core";var fl=class extends Ws{constructor(e){const t=({point:l})=>{const c=new hi;c.set({start:l,end:l,startHeight:0,endHeight:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:Bn(l,c,d,h.start,h.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,d=Be(c?.end.y),p=Be(c?.start.y),{y:g}=l;if(c==null||!Ia(p)||!Ia(d)||!Ia(g))return;const m=d-(g??0),y=(p-d)*2+m,S={x:c?.start.x,y:p-y},x={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(S,{overflowContinuous:!0})||!e.validatePoint(x,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:m}),e.update())},n=({point:l})=>{const{datum:c,node:h}=this,d=Be(c?.end.y),p=Be(c?.start.y),{y:g}=l;if(c==null||!Ia(p)||!Ia(d)||!Ia(g))return;const m=d-(g??0),y=(p-d)*2+m,S={x:c.start.x,y:p-m},x={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!e.validatePoint(S,{overflowContinuous:!0})||!e.validatePoint(x,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:m}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Ws.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:o},dragEnd:{target:"height",action:o},reset:{target:Ws.parent,action:r},cancel:{target:Ws.parent,action:r}},height:{hover:a,click:{target:Ws.parent,action:n},drag:{target:Ws.parent,action:n},reset:{target:Ws.parent,action:r},cancel:{target:Ws.parent,action:r}}}),this.debug=ZL.create(!0,"annotations"),this.snapping=!1}};u([vd()],fl.prototype,"datum",2),u([vd()],fl.prototype,"node",2),u([vd()],fl.prototype,"snapping",2);var sf={type:"disjoint-channel",datum:hi,scene:yl,isDatum:hi.is,translate:(e,t,i,s)=>{hi.is(t)&&yl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(hi.is(t)&&hi.is(i)&&yl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{hi.is(t)&&yl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new fl({...e,create:t("disjoint-channel")}),dragState:e=>new we(e)};import{Vec2 as QL,Vec4 as Po,entries as qL}from"ag-charts-core";import{_ModuleSupport as js}from"ag-charts-community";import{Vec2 as JL,Vec4 as of}from"ag-charts-core";var Dd=[0,23.6,38.2,50,61.8,78.6,100],eT=[161.8,261.8,361.8,423.6],tT=[...Dd,...eT],iT={10:tT,6:Dd,4:Dd.filter(e=>e!==78.6&&e!==23.6)},sT=10;function oT(e,t){const{x2:i,y1:s,y2:o}=e,a=s-o;return t==null?{x1:i,x2:i,y1:o-a,y2:o}:{x1:t.x1,x2:t.x2,y1:t.y2-a,y2:t.y2}}function af({x1:e,y1:t,x2:i,y2:s},o,a,n,r=10){const l=t-s,c=a?-1:1;let h=n;const d=[];for(const[p,g]of iT[r].entries()){const m=n+l*(g/100)*c,y=o.yAxis.scaleInvert(m);d.push({id:p,x1:e,x2:i,y1:h,y2:m,tag:g==100?0:1,label:{x1:Math.min(e,i)-sT,x2:i,y1:m,y2:m,text:`${(g/100).toFixed(3)} (${y.toFixed(2)})`}}),h=m}return d}var nf=class extends Ye{constructor(){super(),this.trendLine=new Rt,this.rangeFillsGroup=new js.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=js.Selection.select(this.rangeFillsGroup,js.Range),this.rangeStrokesGroup=new js.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=js.Selection.select(this.rangeStrokesGroup,Rt),this.labelsGroup=new js.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=js.Selection.select(this.labelsGroup,Eo),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=At(e,t);if(i==null){this.visible=!1;return}if(i=of.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,o=this.extendLine(i,e,t),a=s?o.y1:o.y2,n=s?o.y2:o.y1,r=af(o,t,e.reverse,a,e.bands);this.updateRanges(e,r,t);const l={...o,y1:n,y2:n};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:s},o,a){const n={x1:e,y1:t,x2:i,y2:s};if(!o.extendStart&&!o.extendEnd)return n;const{x:r,width:l}=a.xAxis.bounds;return o.extendEnd&&(n[e>i?"x1":"x2"]=r+l),o.extendStart&&(n[e>i?"x2":"x1"]=r),n}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:s,strokeWidth:o,strokeOpacity:a,stroke:n}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:o,strokeOpacity:a,fillOpacity:0,stroke:n})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:o,rangeStroke:a,isMultiColor:n}=e;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:d},p)=>{const g=h,m=n?o[p%o.length]:a;r.setProperties({x1:l,x2:c,y1:g,y2:g,stroke:m,strokeOpacity:s,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:d})})}updateRanges(e,t,i){const s=o=>o.id;this.rangeFillsGroupSelection.update(t,void 0,s),this.rangeStrokesGroupSelection.update(t,void 0,s),this.labelsGroupSelection.update(t,void 0,s),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:o,rangeStroke:a,showFill:n,isMultiColor:r}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:p},g)=>{const m=r?o[g%o.length]:a;if(!n){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:p,startLine:!1,endLine:!1,stroke:m,strokeOpacity:s,fill:m,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:o,rangeStroke:a,isMultiColor:n,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=e,p={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},g=this.checkWithinBounds(t,p,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((m,y,S)=>{const x=d??(n?s[S%s.length]:a),b=i.at(S);if(!b)return;const{text:f,...D}=y.label;if(g)m.setProperties({...p,text:f,x:D.x1,y:D.y1,textBaseline:"middle",textAlign:"end",fill:x}),Aa(m.id,b,D);else{const v={...p,label:f,position:"center",alignment:"left",color:x};Aa(m.id,b,D,v,m,f,o)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:s,...o}=i.datum.label;i.setProperties({...t,text:s,x:o.x1,y:o.y1,textBaseline:"middle",textAlign:"end"});const{x:a}=i.getBBox();return a>=e.bounds.x&&a<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:o}=e;this.text=this.updateNode(Eo,this.text,!!s.label),Aa(i.id,i,t,s,this.text,s.label,o)}updateAnchor(e,t,i,s){const o=of.topCenter(t);JL.apply(this.anchor,js.Transformable.toCanvasPoint(this.trendLine,o.x,o.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:s,text:o}=this;let a=!1;return s.each(n=>a||(a=n.isPointInPath(e,t))),a||i.isPointInPath(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.trendLine.isPointInPath(e,t))return"line"}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}};import{_ModuleSupport as aT}from"ag-charts-community";import{Logger as rf}from"ag-charts-core";var{ContinuousScale:lf}=aT;function xl(e,t,i={overflowContinuous:!1},s){if(t.x==null||t.y==null)return s&&rf.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:o,yAxis:a}=e,n=i.overflowContinuous&&lf.is(o.scale),r=i.overflowContinuous&&lf.is(a.scale),l=n||cf(t.x,o),c=r||cf(t.y,a);if(l&&c)return!0;if(s){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=Be(t.x),p=Be(t.y);rf.warnOnce(`${s}is outside the ${h}, ignoring. - x: [${d}], y: ${p}]`)}return!1}function cf(e,t){const{domain:i}=t.scale,s=Be(e);return i&&s!=null&&t.continuous?s>=i[0]&&s<=i.at(-1):!0}var Sl=class extends nf{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new Rt,this.start=new be,this.end=new be,this.endRetracement=new be,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return Ye.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(i==null||s==null){this.visible=!1;return}if(i=Po.round(i),s=Po.round(s),this.visible=e.visible??!0,!this.visible)return;(e.endRetracement.x==null||e.endRetracement.y==null)&&(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:o,bands:a}=e,n=oT(i,s),r=this.extendLine(n,e,t),l=r.y2,c=r.y1,h=s?af(r,t,o,l,a):[];this.updateRanges(e,h,t);const d={...r,y1:c,y2:c};this.updateText(e,d)}containsPoint(e,t){const{start:i,end:s,endRetracement:o,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):o.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):a.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ll({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:QL.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:o,dragState:a}=this;if(!o||!a)return;this[o].toggleDragging(!0);const n=s?this.snapToAngle(e,t,i):It(this[o].drag(t).point,i);!n||!xl(i,n)||(e[o].x=n.x,e[o].y=n.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,o=["start","end","endRetracement"];if(!s)return;const a=(o.indexOf(s)+1)%o.length,n=o[a];this[s].toggleDragging(!0);const r=Se(e[n],i);return It(rl(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:s,translation:o,context:a}){const n=ys({start:t,end:i,endRetracement:s},o,a,{overflowContinuous:2});e.start.x=n.start.x,e.end.x=n.end.x,e.endRetracement.x=n.endRetracement.x,e.start.y=n.start.y,e.end.y=n.end.y,e.endRetracement.y=n.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:Se(e.start,i),end:Se(e.end,i),endRetracement:Se(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:o}=this.getCoords(e,i);if(!s||!o)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:Po.start(s),end:Po.end(s),endRetracement:Po.end(o),translation:{x:-a.width/2,y:-a.height/2},context:i}),t}getCoords(e,t){return{coords1:At(e,t),coords2:At({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of qL(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?Po.start(t):Po.end(t)}};import{Debug as nT,StateMachine as $s,StateMachineProperty as Md}from"ag-charts-core";var bl=class extends $s{constructor(e){const t=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),e.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},s=({offset:c,context:h})=>{const{datum:d,snapping:p}=this;d&&(d.set({end:Bn(c,h,p,d.start,d.snapToAngle)}),e.update())},o=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),e.update())},a=({offset:c,context:h})=>{const{datum:d,snapping:p}=this;d&&(d.set({endRetracement:Bn(c,h,p,d.end,d.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},r=()=>e.delete(),l=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:$s.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:o},drag:s,dragEnd:{target:"endRetracement",action:o},reset:{target:$s.parent,action:r},cancel:{target:$s.parent,action:r},onExit:l},endRetracement:{hover:a,click:{target:$s.parent,action:n},drag:{target:$s.parent,action:n},reset:{target:$s.parent,action:r},cancel:{target:$s.parent,action:r}}}),this.debug=nT.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Bi}};u([Md()],bl.prototype,"datum",2),u([Md()],bl.prototype,"node",2),u([Md()],bl.prototype,"snapping",2);var hf={type:"fibonacci-retracement-trend-based",datum:Bi,scene:Sl,isDatum:Bi.is,translate:(e,t,i,s)=>{Bi.is(t)&&Sl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Bi.is(t)&&Bi.is(i)&&Sl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Bi.is(t)&&Sl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bl({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new we(e)};import{Vec2 as rT,Vec4 as df,entries as lT}from"ag-charts-core";var vl=class extends nf{constructor(){super(),this.type="fibonacci-retracement",this.start=new be,this.end=new be,this.append([this.start,this.end])}static is(e){return Ye.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...ll({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:rT.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:o,dragState:a}=this;if(!o||!a)return;this[o].toggleDragging(!0);const n=s?this.snapToAngle(e,t,i):It(this[o].drag(t).point,i);!n||!xl(i,n)||(e[o].x=n.x,e[o].y=n.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,a=["start","end"].find(r=>r!==s);if(!s||!a)return;this[s].toggleDragging(!0);const n=Se(e[a],i);return It(rl(t,n,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:s,context:o}){const a=ys({start:t,end:i},s,o,{overflowContinuous:1});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}translate(e,t,i){this.translatePoints({datum:e,start:Se(e.start,i),end:Se(e.end,i),translation:t,context:i})}copy(e,t,i){const s=At(e,i);if(!s)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-o.width/2,y:-o.height/2},context:i}),t}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of lT(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?df.start(t):df.end(t)}};import{Debug as cT,StateMachine as Na,StateMachineProperty as kd}from"ag-charts-core";var La=class extends Na{constructor(e){const t=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),e.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},s=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:Bn(r,l,h,c.start,c.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({end:!0}),e.update()},a=()=>e.delete(),n=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Na.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:Na.parent,action:o},drag:s,dragEnd:{target:Na.parent,action:o},reset:{target:Na.parent,action:a},cancel:{target:Na.parent,action:a},onExit:n}}),this.debug=cT.create(!0,"annotations"),this.snapping=!1}};u([kd()],La.prototype,"datum",2),u([kd()],La.prototype,"node",2),u([kd()],La.prototype,"snapping",2);var hT=class extends La{createDatum(){return new cs}},dT=class extends La{createDatum(){return new hs}},uT=class extends La{createDatum(){return new us}},uf={type:"fibonacci-retracement",datum:us,scene:vl,isDatum:us.is,translate:(e,t,i,s)=>{us.is(t)&&vl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(us.is(t)&&us.is(i)&&vl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{us.is(t)&&vl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new uT({...e,create:t("fibonacci-retracement")}),dragState:e=>new we(e)};import{_ModuleSupport as pT}from"ag-charts-community";import{Vec2 as Mi,Vec4 as pf}from"ag-charts-core";import{_ModuleSupport as gf}from"ag-charts-community";import{Vec2 as Fn}from"ag-charts-core";var gT=class extends gf.Group{},Dl=class extends gT{constructor(){super(),this.type="arrow",this.path=new gf.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:o,...a}=e,n=Fn.from(i,s),r=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=Fn.rotate(Fn.from(0,l),o+r,n),h=Fn.rotate(Fn.from(l,0),o-r,n);t.setProperties(a),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(n.x,n.y),t.path.lineTo(h.x,h.y)}},{Transformable:mT}=pT,Us=class extends pd{constructor(){super(),this.type="line",this.line=new Rt,this.append([this.line,this.start,this.end])}static is(e){return Ye.isCheck(e,"line")}update(e,t){let i=At(e,t);if(i==null){this.visible=!1;return}i=pf.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))}updateLine(e,t,i){const{line:s}=this,{lineDashOffset:o,stroke:a,strokeWidth:n,strokeOpacity:r}=e,l=this.extendLine(t,e,i);s.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:o,stroke:a,strokeWidth:n,strokeOpacity:r,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(Eo,this.text,!!e.text.label),Aa(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!e.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:o}=e,[a,n]=Mi.from(t),r=Mi.angle(Mi.sub(n,a));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.startCap.remove(),this.startCap=void 0),this.startCap==null&&(this.startCap=new Dl,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:o})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.endCap.remove(),this.endCap=void 0),this.endCap==null&&(this.endCap=new Dl,this.append([this.endCap])),this.endCap.update({x:n.x,y:n.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:o}))}updateAnchor(e,t,i,s){const o=pf.topCenter(t);Mi.apply(this.anchor,mT.toCanvasPoint(this.line,o.x,o.y))}containsPoint(e,t){const{line:i,text:s}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:o,endCap:a}=this;let[n,r]=Mi.from(t);const l=Mi.angle(Mi.sub(r,n));return o&&(n=Mi.rotate(Mi.from(0,-be.HANDLE_SIZE/2),l,n)),a&&(r=Mi.rotate(Mi.from(0,be.HANDLE_SIZE/2),l,r)),i==="start"?n:r}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},mf={type:"line",datum:hs,scene:Us,isDatum:hs.is,translate:(e,t,i,s)=>{hs.is(t)&&Us.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(hs.is(t)&&hs.is(i)&&Us.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{hs.is(t)&&Us.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new dT({...e,create:t("line")}),dragState:e=>new we(e)},yf={type:"arrow",datum:cs,scene:Us,isDatum:cs.is,translate:(e,t,i,s)=>{cs.is(t)&&Us.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(cs.is(t)&&cs.is(i)&&Us.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{cs.is(t)&&Us.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new hT({...e,create:t("arrow")}),dragState:e=>new we(e)};import{_ModuleSupport as ff}from"ag-charts-community";import{Vec2 as Hi,Vec4 as Ro,isDate as xf,isNumber as Ml}from"ag-charts-core";import{_ModuleSupport as ki}from"ag-charts-community";import{Vec4 as Ad}from"ag-charts-core";import{_ModuleSupport as Sf}from"ag-charts-community";function bf(e,t=0,i=0){let s=t;for(const o of e)if(Array.isArray(o)){for(const a of o)vf(a,s);s+=Sf.Group.computeChildrenBBox(o).width+i}else vf(o,s),s+=o.getBBox().width+i}function yT(e,t=0,i=0){let s=t;for(const o of e)if(Array.isArray(o)){for(const a of o)Df(a,s);s+=Sf.Group.computeChildrenBBox(o).height+i}else Df(o,s),s+=o.getBBox().height+i}function vf(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function Df(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function Mf(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function kf(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var Af=class extends ki.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new ki.Rect,this.dateRangeBarsText=new ki.Text,this.dateRangeDivider=new ki.Line,this.dateRangeValueText=new ki.Text,this.priceRangeValueText=new ki.Text,this.priceRangeDivider=new ki.Line,this.priceRangePercentageText=new ki.Text,this.volumeText=new ki.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,s,o,a,n){this.verticalDirection=a;const r=this.updateStatistics(e,t,i,n),l=ki.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(e,l,c),this.reposition(r,c,o),this.checkVisibility(e,o,s)}checkVisibility(e,t,i){const s=Ad.from(t.seriesRect);this.visible=Ad.collides(i,s)&&(e.visible??!0)}updateStatistics(e,t,i,s){const{dateRangeBarsText:o,dateRangeDivider:a,dateRangeValueText:n,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,p=6,g=e.statistics.fontSize+3,m=-2,y=this.getTextStyles(e),S={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:g},x=[o,a,n],b=[r,l,c],f=[];return t.priceRange&&(r.setProperties({...y,text:this.formatPriceRangeValue(t.priceRange.value,s)}),l.setProperties(S),c.setProperties({...y,text:this.formatPriceRangePercentage(t.priceRange.percentage,s)}),bf(b,i.x,d),f.push(b)),t.dateRange&&(o.setProperties({...y,text:this.formatDateRangeBars(t.dateRange.bars,s)}),a.setProperties(S),n.setProperties({...y,text:this.formatDateRangeValue(t.dateRange.value)}),bf(x,i.x,d),f.push(x)),t.volume==null?h.visible=!1:(h.setProperties({...y,x:i.x,text:this.formatVolume(t.volume,s),visible:!0}),f.push(h)),yT(f,i.y,p),l.y1+=m,l.y2+=m,a.y1+=m,a.y2+=m,f}updateBackground(e,t,i){const s=this.getBackgroundStyles(e);this.background.setProperties({...s,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:s,height:o}=i.seriesRect,a=Ad.from(this.background.getBBox());let n=0;a.x1<0&&(n=-a.x1),a.x2>s&&(n=s-a.x2);const r=Math.min(t,o-a.y2);for(const l of e)if(Array.isArray(l)){const c=ki.Group.computeChildrenBBox(l).width;for(const h of l)Mf(h,n-c/2),kf(h,r)}else Mf(l,n-l.getBBox().width/2),kf(l,r);this.background.x+=n,this.background.y+=r}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const s=1e3*60,o=s*60,a=o*24,n=Math.floor(e/s),r=Math.floor(e/o),l=Math.floor(e/a),c=r%(a/o),h=n%(o/s);return l>=1&&t.push(`${l}d`),r>=1&&(e<a||c!==0)&&t.push(`${c}h`),(e<o||h!==0)&&t.push(`${h}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i=Number.isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},fT=class extends Af{getDirectionStyles(e){return this.verticalDirection==="down"?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},jt=class extends pd{constructor(){super(),this.type="measurer",this.horizontalLine=new Rt,this.verticalLine=new Rt,this.horizontalStartLine=new Rt,this.horizontalEndLine=new Rt,this.verticalStartLine=new Rt,this.verticalEndLine=new Rt,this.horizontalEndCap=new Dl,this.verticalEndCap=new Dl,this.background=new ff.Path({zIndex:-1}),this.updateBackground=ef.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return Ye.isCheck(e,"measurer")}createStatisticsScene(){return new Af}update(e,t){const i=At(e,t);if(i==null){this.visible=!1;return}if(this.visible=e.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,e,t),o={...s,y2:s.y1},a={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,s),this.updateBackground(e,o,a,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const s={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[o,a]=Hi.from(i.yAxis.bounds);return li.is(t)?(t.extendAbove&&(s.y1=o.y),t.extendBelow&&(s.y2=a.y)):ci.is(t)&&(t.extendLeft&&(s.x1=o.x),t.extendRight&&(s.x2=a.x)),s}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:o,verticalEndLine:a,verticalEndCap:n}=this,{direction:r}=e;o.visible=r!=="vertical",a.visible=r!=="vertical",s.visible=r!=="vertical",t.visible=r!=="horizontal",i.visible=r!=="horizontal",n.visible=r!=="horizontal"}updateLines(e,t){const{horizontalLine:i,verticalLine:s}=this,{direction:o}=e,{x1:a,y1:n,x2:r,y2:l}=t,c=Hi.round(Ro.center(t),0),h=this.getLineStyles(e);o!=="vertical"&&i.setProperties({...h,x1:a,x2:r,y1:c.y,y2:c.y}),o!=="horizontal"&&s.setProperties({...h,x1:c.x,x2:c.x,y1:n,y2:l})}updateText(e,t){const{direction:i}=e,s=Hi.round(Ro.center(t),0);let o;const a={...t};i==="vertical"?(o=this.verticalLine,a.x1=s.x,a.x2=s.x):(o=this.horizontalLine,a.y1=s.y,a.y2=s.y),this.text=this.updateNode(Eo,this.text,!!e.text.label);const{id:n}=o,r=Aa(n,o,a,e.text,this.text,e.text.label,e.strokeWidth);let l;if(i==="both"&&r&&this.text){const c=Ro.from(this.text.getBBox()),{offset:h}=r.numbers;c.x1<=s.x+h.x&&c.x2>=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Hi.length(h)})}this.verticalLine.setClipMask(n,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:o}=e,{x1:a,y1:n,x2:r,y2:l}=t,c=Hi.round(Ro.center(t),0),{stroke:h,strokeWidth:d,strokeOpacity:p}=this.getLineStyles(e),g={stroke:h,strokeWidth:d,strokeOpacity:p};if(o!=="vertical"){const m=a<=r?0:Math.PI;let y=r;o==="horizontal"&&(y+=a<=r?-2:2),i.update({...g,x:y,y:c.y,angle:m})}if(o!=="horizontal"){const m=n<=l?Math.PI/2:Math.PI/-2;let y=l;o==="vertical"&&(y+=n<=l?-2:2),s.update({...g,x:c.x,y,angle:m})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:o,horizontalEndLine:a}=this,{direction:n}=e,{x1:r,y1:l,x2:c,y2:h}=t,d=this.getLineStyles(e);n==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),n==="vertical"&&(o.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),a.setProperties({...d,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const s=Hi.add(Ro.bottomCenter(t),Hi.from(0,10)),o={volume:this.getVolume(e)};e.hasPriceRange&&(o.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(o.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,o,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,s){const o=Ro.topCenter(t);Hi.apply(this.anchor,ff.Transformable.toCanvasPoint(this.horizontalLine,o.x,o.y))}getBackgroundPoints(e,t,i,s){const[o,a]=Hi.from(t),[n,r]=Hi.from(i);return[o,a,r,n]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:o}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:o,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:s,verticalLine:o,horizontalStartLine:a,horizontalEndLine:n,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||o.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||n.visible&&n.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(Ro.width(e)/i)*s:0}getDateRangeValue(e){const t=Be(e.start.x),i=Be(e.end.x);if(!xf(t)||!xf(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Be(e.end.y),i=Be(e.start.y);if(!Ml(t)||!Ml(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Be(e.end.y),i=Be(e.start.y);if(!Ml(t)||!Ml(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},kl=class extends jt{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return Ye.isCheck(e,"quick-measurer")}createStatisticsScene(){return new fT}getDirectionStyles(e){return this.verticalDirection==="down"?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}};import{Debug as xT,StateMachine as Ta,StateMachineProperty as If}from"ag-charts-core";var Ca=class extends Ta{constructor(e){const t=({point:n})=>{const r=this.createDatum();r.set({start:n,end:n}),e.create(r)},i=({point:n})=>{const{datum:r,node:l}=this;r?.set({end:n}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},o=()=>e.delete(),a=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:Ta.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:Ta.parent,action:s},dragEnd:{target:Ta.parent,action:s},reset:{target:Ta.parent,action:o},cancel:{target:Ta.parent,action:o},onExit:a}}),this.debug=xT.create(!0,"annotations")}};u([If()],Ca.prototype,"datum",2),u([If()],Ca.prototype,"node",2);var ST=class extends Ca{createDatum(){return new li}},bT=class extends Ca{createDatum(){return new ci}},vT=class extends Ca{createDatum(){return new ls}},DT=class extends Ca{createDatum(){return new Wt}},Nf={type:"date-range",datum:li,scene:jt,isDatum:li.is,translate:(e,t,i,s)=>{li.is(t)&&jt.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(li.is(t)&&li.is(i)&&jt.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{li.is(t)&&jt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ST({...e,create:t("date-range")}),dragState:e=>new we(e)},Lf={type:"price-range",datum:ci,scene:jt,isDatum:ci.is,translate:(e,t,i,s)=>{ci.is(t)&&jt.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ci.is(t)&&ci.is(i)&&jt.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ci.is(t)&&jt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bT({...e,create:t("date-range")}),dragState:e=>new we(e)},Tf={type:"date-price-range",datum:ls,scene:jt,isDatum:ls.is,translate:(e,t,i,s)=>{ls.is(t)&&jt.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ls.is(t)&&ls.is(i)&&jt.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ls.is(t)&&jt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new vT({...e,create:t("date-range")}),dragState:e=>new we(e)},Cf={type:"quick-date-price-range",datum:Wt,scene:kl,isDatum:Wt.is,translate:(e,t,i,s)=>{Wt.is(t)&&kl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Wt.is(t)&&Wt.is(i)&&kl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Wt.is(t)&&kl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new DT({...e,create:t("quick-date-price-range")}),dragState:e=>new we(e)};import{_ModuleSupport as Al}from"ag-charts-community";import{ZIndexMap as wf,calcLineHeight as MT,clamp as kT,wrapText as AT}from"ag-charts-core";var Il=class extends fd{constructor(){super(),this.type="note",this.shape=new Al.Rect,this.iconBackground=new Al.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new Al.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new Al.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return Ye.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=kT(0,s.x,i.seriesRect.width-e.width);const o=e.getPadding().top,a=s.y-hy-o*2,n=s.y+be.HANDLE_SIZE+o*2;return a-s.height-dy<0?(s.y=n,e.position="top"):(s.y=a+o,e.position="bottom"),s}updateLabel(e,t){const i=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=AT(e.text,{maxWidth:200,font:e,textWrap:"always",avoidOrphans:!1})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const s=e.getPadding().top,o=e.position==="top";i.x=t.x-s,i.width=e.width+s*2,i.height=t.height+s*2,i.y=t.y+(o?0:-t.height)-s}updateIcon(e,t){const{active:i,iconBackground:s,iconLines:o}=this,{x:a,y:n}=Se(e,t);s.translationX=a-vN/2,s.translationY=n-cy,o.translationX=s.translationX,o.translationY=s.translationY,s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeOpacity=e.strokeOpacity??1,s.strokeWidth=e.strokeWidth??1,o.fill=e.stroke,i?s.fillShadow.color=e.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const s=e.getPadding().top,o=e.position==="top",a=o?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+a*(t.height+s),position:o?"below":"above"}}getLabelCoords(e,t){const i=e.position==="top",s=e.getPadding().top+MT(e.fontSize,Zr)/2;return{x:t.x,y:t.y+(i?s/2:0)}}getTextBaseline(e){return e.position==="top"?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+be.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e,t,i){super.toggleHovered(e,t,i);const s=e||t&&!i;this.label.visible=s,this.shape.visible=s,this.zIndex=s?wf.CHART_ANNOTATION_FOCUSED:wf.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return this.shape.visible&&this.shape.containsPoint(e,t)||this.iconBackground.containsPoint(e,t)?!0:super.containsPoint(e,t)}},IT=class extends Vn{createDatum(){return new Pt}},Of={type:"note",datum:Pt,scene:Il,isDatum:Pt.is,translate:(e,t,i,s)=>{Pt.is(t)&&Il.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Pt.is(t)&&Pt.is(i)&&Il.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Pt.is(t)&&Il.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new IT({...e,create:t("note")}),dragState:e=>new we(e)};import{Vec2 as gi,Vec4 as Ki}from"ag-charts-core";var Nl=class extends tf{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new be,topMiddle:new ka,topRight:new be,bottomLeft:new be,bottomMiddle:new ka,bottomRight:new be},this.middleLine=new Rt,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Ye.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:o,handles:a}=this;if(o==null)return;const{offset:n}=a[o].drag(t);a[o].toggleDragging(!0),(o==="topMiddle"||o==="bottomMiddle")&&(n.x=0);let r=[],l=s;switch(o){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],n.y-=ka.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],n.y-=ka.HANDLE_SIZE/2,l=!1;break}const c=At(e,i),h=At(e.bottom,i);if(!c||!h)return;const d={topLeft:Ki.start(c),topRight:Ki.end(c),bottomLeft:Ki.start(h),bottomRight:Ki.end(h)},p={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:e.snapToAngle},g=ys(d,n,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?p:void 0});e.start.x=g.topLeft.x,e.start.y=g.topLeft.y,e.end.x=g.topRight.x,e.end.y=g.topRight.y,e.height=g.topLeft.y-g.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:s}=this.handles,o=i.getBBox().y-s.getBBox().y,a=gi.add(e,gi.from(0,o)),n=gi.add(t,gi.from(0,o));return{start:e,end:t,bottomStart:a,bottomEnd:n}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,s,o,a){const{topLine:n,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:p}=e,g=e.getLineDash(),m={lineCap:e.getLineCap(),lineDash:g,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:p};n.setProperties({...t,...m}),l.setProperties({...i,...m});const y=this.extendLine({x1:o.x1,y1:a.y1+(o.y1-a.y1)/2,x2:o.x2,y2:a.y2+(o.y2-a.y2)/2},e,s);r.setProperties({...y,lineDash:e.middle.lineDash??g,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??d,strokeWidth:e.middle.strokeWidth??p,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:o,topRight:a,bottomLeft:n,bottomMiddle:r,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...Ki.start(t)}),a.update({...c,...Ki.end(t)}),n.update({...c,...Ki.start(i)}),l.update({...c,...Ki.end(i)}),o.update({...c,...gi.sub(Ki.center(t),gi.from(o.handle.width/2,o.handle.height/2))}),r.update({...c,...gi.sub(Ki.center(i),gi.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Eo,this.text,!!e.text.label),Uy(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const o=t.x1>t.x2,a=t.y1>t.y2,n=t.x1!==i.x1&&t.y1!==i.y1,r=t.x2!==i.x2&&t.y2!==i.y2,l=gi.from(t);return e.extendEnd&&r&&l.push(gi.from(o?s.x1:s.x2,a?s.y1:s.y2)),l.push(...gi.from(i).reverse()),e.extendStart&&n&&l.push(gi.from(o?s.x2:s.x1,a?s.y2:s.y1)),l}};import{Debug as NT,StateMachine as Ys,StateMachineProperty as Id,isNumber as wa}from"ag-charts-core";var Ll=class extends Ys{constructor(e){const t=({point:l})=>{const c=new di;c.set({start:l,end:l,height:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:Bn(l,c,d,h.start,h.snapToAngle)}),e.update())},o=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,d=Be(c?.end.y),p=Be(c?.start.y),{y:g}=l;if(c==null||!wa(p)||!wa(d)||!wa(g))return;const m=d-(g??0),y=p-m;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:m}),e.update())},n=({point:l})=>{const{datum:c,node:h}=this,d=Be(c?.end.y),p=Be(c?.start.y),{y:g}=l;if(c==null||!wa(p)||!wa(d)||!wa(g))return;const m=d-(g??0),y=p-m;h?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:m}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Ys.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:o},dragEnd:{target:"height",action:o},reset:{target:Ys.parent,action:r},cancel:{target:Ys.parent,action:r}},height:{hover:a,click:{target:Ys.parent,action:n},drag:{target:Ys.parent,action:n},reset:{target:Ys.parent,action:r},cancel:{target:Ys.parent,action:r}}}),this.debug=NT.create(!0,"annotations"),this.snapping=!1}};u([Id()],Ll.prototype,"datum",2),u([Id()],Ll.prototype,"node",2),u([Id()],Ll.prototype,"snapping",2);var Ef={type:"parallel-channel",datum:di,scene:Nl,isDatum:di.is,translate:(e,t,i,s)=>{di.is(t)&&Nl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(di.is(t)&&di.is(i)&&Nl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{di.is(t)&&Nl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ll({...e,create:t("parallel-channel")}),dragState:e=>new we(e)},Tl=class extends fd{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return Ye.isCheck(e,"text")}getHandleCoords(e,t){const i=be.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},LT=class extends Vn{createDatum(){return new ps}},Pf={type:"text",datum:ps,scene:Tl,isDatum:ps.is,translate:(e,t,i,s)=>{ps.is(t)&&Tl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ps.is(t)&&ps.is(i)&&Tl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ps.is(t)&&Tl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new LT({...e,create:t("text")}),dragState:e=>new we(e)},$t={[mf.type]:mf,[Qy.type]:Qy,[qy.type]:qy,[Ef.type]:Ef,[sf.type]:sf,[uf.type]:uf,[hf.type]:hf,[Hy.type]:Hy,[Wy.type]:Wy,[Of.type]:Of,[Pf.type]:Pf,[yf.type]:yf,[Ry.type]:Ry,[Py.type]:Py,[Nf.type]:Nf,[Lf.type]:Lf,[Tf.type]:Tf,[Cf.type]:Cf};function _o(e){for(const{isDatum:t}of Object.values($t))if(t(e))return e}import"ag-charts-community";import{ActionOnSet as TT,Debug as CT,ParallelStateMachine as wT,StateMachine as Nd,StateMachineProperty as Gi}from"ag-charts-core";var Cl=class extends wT{constructor(e){super(new OT(t=>{this.snapping=t}),new ET(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new Xs(e,t=>{this.active=t,this.datum=this.active==null?void 0:e.datum(this.active),this.node=this.active==null?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};u([Gi()],Cl.prototype,"snapping",2),u([Gi()],Cl.prototype,"datum",2),u([Gi()],Cl.prototype,"node",2);var OT=class extends Nd{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},ET=class extends Nd{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},Xs=class extends Nd{constructor(e,t){const i=f=>D=>{e.create(f,D),this.active=e.selectLast()},s=()=>{this.active!=null&&e.delete(this.active),this.active=void 0,e.select()},o={createDatum:i},a={...e,delete:s,showTextInput:()=>{this.active!=null&&e.showTextInput(this.active)},deselect:()=>{const f=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,f)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},n=Object.fromEntries(Object.entries($t).map(([f,D])=>[f,D.createState(a,o)])),r=Object.fromEntries(Object.entries($t).map(([f,D])=>[f,D.dragState(e,o)])),l=({colorPickerType:f,colorOpacity:D,color:v,opacity:M,isMultiColor:A})=>{this.datum&&(f==="text-color"&&e.updateTextInputColor(v),sl(this.datum,f,D,v,M,A),e.update())},c=f=>{const{datum:D,node:v}=this;!D||!v||(Vi(D)?(D.fontSize=f,e.updateTextInputFontSize(f)):va(D)&&(D.text.fontSize=f),e.update())},h=f=>{const{datum:D,node:v}=this;!D||!v||!zs(D)||(fy(D,f),e.update())},d=f=>{const{node:D}=this;!D||!("setTextInputBBox"in D)||(D.setTextInputBBox(f),e.update())},p=({textInputValue:f,bbox:D})=>{const{datum:v}=this;if(D!=null&&f!=null&&f.length>0){if(!Vi(v))return;const M=Qr(v,f,D.width);v.set({text:M}),e.update(),e.recordAction(`Change ${v.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${v?.type} annotation`)},g=()=>{e.updateTextInputBBox(void 0)},m=()=>this.active!=null,y=()=>this.copied!=null,S=()=>{const{active:f,datum:D}=this;return f==null||!D?!1:va(D)&&D.isWriteable()},x=()=>this.active!=null&&!_s(this.datum),b=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:f})=>{this.hovered=e.hoverAtCoords(f,this.active,this.hovered),this.hoverCoords=f},translate:{guard:m,target:"translating",action:({translation:f})=>{e.startInteracting(),e.translate(this.active,f),e.update()}},copy:{guard:x,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:x,action:()=>{this.copied=e.copy(this.active),s()}},paste:{guard:y,action:()=>{e.paste(this.copied)}},selectLast:()=>{const f=this.active;this.active=e.selectLast(),e.select(this.active,f)},click:[{guard:()=>{const{active:f,hovered:D,datum:v}=this;return f==null||D!==f||!v?!1:Vi(v)&&v.isWriteable()},target:"text-input"},{action:()=>{const f=this.active;this.active=this.hovered,e.select(this.active,f)}}],dblclick:{guard:S,action:({offset:f})=>{const D=e.getNodeAtCoords(f,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,D)}},dragStart:[{guard:b,target:"dragging",action:()=>{const f=this.active;this.active=this.hovered,e.select(this.active,f),e.startInteracting()}},{action:()=>{const f=this.active;this.active=this.hovered,e.select(this.active,f)}}],color:{guard:m,action:l},fontSize:{guard:m,action:c},lineProps:{guard:m,action:f=>{const D=_o(this.datum);D?.set(f),e.update(),e.recordAction(`Change ${D?.type} ${Object.entries(f).map(([v,M])=>`${v} to ${M}`).join(", ")}`)}},lineStyle:{guard:m,action:h},lineText:{guard:m,action:f=>{const D=_o(this.datum);va(D)&&(gs(D)&&f.position==="center"&&(f.position="inside"),D.text.set(f),e.update())}},updateTextInputBBox:{guard:m,action:d},toolbarPressSettings:{guard:S,action:f=>{e.showAnnotationSettings(this.active,f)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!_s(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...n},dragging:{onEnter:(f,D)=>{if(this.active==null)return;const v=e.getAnnotationType(this.active);v&&(this.transitionRoot(v),this.transitionRoot("dragStart",D))},...r},translating:{onEnter:()=>{},translate:{guard:m,target:"translating",action:({translation:f})=>{e.startInteracting(),e.translate(this.active,f),e.update()}},translateEnd:{guard:m,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const f=_o(this.datum);!f||!("getTextInputCoords"in f)||(e.startInteracting(),e.showTextInput(this.active),f.visible=!1,e.update())},updateTextInputBBox:{guard:m,action:d},resize:{target:"idle",action:p},click:{target:"idle",action:p},drag:{target:"idle",action:p},textInput:[{guard:gd,target:"idle",action:g},{guard:md,target:"idle",action:p}],color:{guard:m,action:l},fontSize:{guard:m,action:c},cancel:{target:"idle",action:g},onExit:()=>{e.stopInteracting(),e.hideTextInput();const f=this.active;if(this.active=this.hovered=void 0,e.select(this.active,f),f==null)return;const D=e.datum(f),v=e.node(f);!D||!v||(D.visible=!0)}}}),this.setActive=t,this.debug=CT.create(!0,"annotations"),this.snapping=!1}};u([TT({changeValue(e){this.setActive(e)}}),Gi()],Xs.prototype,"active",2),u([Gi()],Xs.prototype,"hovered",2),u([Gi()],Xs.prototype,"hoverCoords",2),u([Gi()],Xs.prototype,"copied",2),u([Gi()],Xs.prototype,"snapping",2),u([Gi()],Xs.prototype,"datum",2),u([Gi()],Xs.prototype,"node",2);import{_ModuleSupport as PT}from"ag-charts-community";import{ActionOnSet as RT,BaseProperties as _T,ChartAxisDirection as zT,CleanupRegistry as BT,EventEmitter as VT,PropertiesArray as FT,Property as wl}from"ag-charts-core";var{LayoutElement:HT,Menu:KT}=PT,Rf=class extends ms{};u([wl],Rf.prototype,"value",2);var Ol=class extends _T{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new FT(Rf),this.events=new VT,this.annotationMenu=new KT(this.ctx,"annotations"),this.cleanup=new BT,this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(HT.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i,buttonWidget:s}){const o=this.ctx.axisManager.getAxisContext(zT.Y)[0].scale;switch(t.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsLineAnnotations",JN.filter(a=>a.visible?a.visible(o):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsFibonacciAnnotations",eL);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsTextAnnotations",iL);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsShapeAnnotations",sL);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsMeasurerAnnotations",oL);break}}onToolbarButtonPressShowMenu(e,t,i,s,o,a){this.events.emit("pressed-show-menu",null);const n=this.buttons.findIndex(r=>r.value===s);this.toolbar.toggleActiveButtonByIndex(n),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show(i,{items:a,ariaLabel:this.ctx.localeManager.t(o),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,s)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(s=>s.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.events.emit("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){e.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};u([wl,RT({changeValue(e){this.toolbar?.setHidden(!e)}})],Ol.prototype,"enabled",2),u([wl],Ol.prototype,"padding",2),u([wl],Ol.prototype,"buttons",2);import{_ModuleSupport as GT,_Widget as WT}from"ag-charts-community";import{AbstractModuleInstance as jT,ChartAxisDirection as $T,Property as UT,getIconClassNames as YT}from"ag-charts-core";var{InteractionState:Hn}=GT,Kn="ag-charts-annotations__axis-button",_f=class extends jT{constructor(e,t,i,s){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!t.scale.bandwidth,e.domManager.addEventListener("focusin",({target:o})=>{const a=o instanceof HTMLElement?o:void 0;!(a&&e.domManager.contains(a,"series-area"))&&a!==this.button.getElement()&&this.hide()}),this.cleanup.register(e.widgets.seriesWidget.addListener("drag-move",o=>this.onMouseDrag(o)),e.widgets.seriesWidget.addListener("mousemove",o=>this.onMouseMove(o)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter?.events.on("click",o=>this.onClick(o)),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.hide()),e.eventsHub.on("zoom:change-complete",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new WT.ButtonWidget;return e.addClass(Kn),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",Kn)}onMouseMove(e){this.ctx.interactionManager.isState(Hn.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(Hn.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(Hn.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(Hn.Clickable)&&e.device==="touch"&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:s}=e;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(t.target))){this.hide();return}this.toggleVisibility(!0);const o=this.getButtonCoordinates({x:i,y:s});this.coords={x:o.x+this.button.clientWidth/2,y:o.y+this.button.clientHeight/2},this.updatePosition(o)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Hn.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:o,snap:a,axisCtx:n,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,o.height],[p,g]=[0,o.width];if(a&&(e=rs($r(e-o.x,n),n)+o.x,t=rs($r(t-o.y,n),n)+o.y),i===$T.X){const y=c-Math.max(0,r-5);e=e-l/2,t=s==="top"?h-c+y:d-y}else{const y=l-Math.max(0,r-9);e=s==="left"?p-l+y:g-y,t=t-c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(t==null)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${Kn}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(`<span class="${YT("zoom-in")} ${Kn}-icon"></span>`)}};u([UT],_f.prototype,"enabled",2);import"ag-charts-community";import{EventEmitter as XT,focusCursorAtEnd as ZT}from"ag-charts-core";import{_ModuleSupport as QT}from"ag-charts-community";import{Color as zf,Vec2 as Ve,createButton as El,createCheckbox as qT,createElement as xs,createElementId as Ld,createSelect as JT,createTextArea as e2,entries as Bf,getIconClassNames as t2,getWindow as i2,initRovingTabIndex as Vf,mapValues as Td,setAttribute as Ff,setAttributes as Cd}from"ag-charts-core";var{DraggablePopover:s2,NativeWidget:wd}=QT,Hf=class am extends s2{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new vy(this.ctx,{detached:!0}),this.cleanup.register(t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,i){const s=super.showWithChildren(t,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",o=>{o.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),i2().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(t){super.updatePosition(t);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(t,i,s){const o=xs("div","ag-charts-dialog__tabs"),a=Td(s,()=>Ld()),n=Td(s,()=>Ld());for(const[g,m]of Bf(s))Cd(m.panel,{id:n[g],role:"tabpanel","aria-labelledby":a[g]});const r=g=>{for(const[m,y]of Bf(s))y.panel.classList.toggle("ag-charts-dialog__tab-panel--active",m===g),h[m].classList.toggle("ag-charts-dialog__tab-button--active",m===g),Ff(h[m],"aria-selected",m===g),m===g&&y.onShow?.()},l=new wd(xs("div","ag-charts-dialog__header"));l.addListener("drag-start",g=>{const{sourceEvent:m}=g;m.target instanceof Element&&m.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(g)}),l.addListener("drag-move",g=>this.onDragMove(g)),l.addListener("drag-end",()=>this.onDragEnd());const c=new a2;this.setDragHandle(c);const h=Td(s,(g,m)=>El({label:this.ctx.localeManager.t(g.label),onPress:()=>r(m)},{id:a[m],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":n[m]})),d=xs("div","ag-charts-dialog__tab-list");Cd(d,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),d.append(...Object.values(h));const p=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,p),o.append(l.getElement(),...Object.values(s).map(g=>g.panel)),r(i),Vf({orientation:"horizontal",buttons:Object.values(h)}),{tabs:o,initialFocus:h[i]}}createTabPanel(){return xs("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return xs("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:s,onChange:o}){const a=this.createInputGroup(t);Cd(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const n="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,d=this.ctx.localeManager.t(h),p=El({icon:c,altText:d,onPress:()=>{for(const g of Array.from(a.children))g.classList.remove(n),g.ariaChecked="false";p.classList.add(n),p.ariaChecked="true",o(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===s&&p.classList.add(n),a.appendChild(p),r.push(p)}return Vf({orientation:"horizontal",buttons:r}),a}createSelect({altText:t,label:i,options:s,value:o,onChange:a}){const n=this.createInputGroup(i),r=this.ctx.localeManager.t(t),l=JT({value:o,options:s,onChange:a},{class:"ag-charts-dialog__select","aria-label":r,title:r});return n.append(l),n}createTextArea({placeholder:t,value:i,onChange:s}){const o=t?this.ctx.localeManager.t(t):void 0;return e2({value:i,onChange:s},{placeholder:o})}createCheckbox({label:t,checked:i,onChange:s}){const o=Ld(),a=this.createInputGroup(t,{for:o}),n=qT({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:o});return a.append(n),a}createColorPicker({color:t,opacity:i,label:s,altText:o,onChange:a,onChangeHide:n,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(o),d=El({label:h,onPress:p=>{const{anchor:g,fallbackAnchor:m}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:g,fallbackAnchor:m,color:t,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:p,onChange:(y,S,x,b)=>{d.style.setProperty("--color",y),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",b),a(y,S,x,b)},onChangeHide:n})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const p=zf.fromString(t),g=new zf(p.r,p.g,p.b,i);d.style.setProperty("--color",g.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return El({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const s=xs("div","ag-charts-dialog__input-group"),o=xs("label","ag-charts-dialog__input-group-label");return o.innerText=this.ctx.localeManager.t(t),Ff(o,"for",i?.for),s.appendChild(o),s}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||t.key!=="Escape"||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=this.getPopoverElement();if(!t||!s)return;const o=i.domManager.getBoundingClientRect(),a=Ve.from(0,t.y),n=Ve.from(o.width,t.height),r=Ve.from(s),l=Ve.from(.5,1);let c;if(t.width>1e3){const h=Ve.sub(Ve.add(a,Ve.multiply(n,l)),Ve.multiply(r,l));c=Ve.sub(h,Ve.from(0,am.offset))}else{const h=Ve.sub(Ve.add(a,n),r);c=Ve.sub(h,am.offset)}this.updatePosition(c)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),o=Ve.sub(Ve.from(i.x,i.y),Ve.from(s.left,s.top)),a=Ve.add(o,Ve.from(0,i.height+5)),n=Ve.sub(o,Ve.from(0,5));return{anchor:a,fallbackAnchor:n}}};Hf.offset=60;var o2=Hf,a2=class extends wd{constructor(){super(xs("div","ag-charts-dialog__drag-handle"));const e=new wd(xs("span",t2("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},n2=class extends o2{constructor(e){super(e,"settings"),this.events=new XT,this.hideFns.push(()=>this.events.emit("hidden",null))}show(e,t){const i=this.createLinearLineTab(e,t),s=this.createLinearTextTab(e,t);let o="dialogHeaderLine";gs(e)?o="dialogHeaderChannel":yy(e)?o="dialogHeaderFibonacciRange":e.type==="date-range"?o="dialogHeaderDateRange":e.type==="price-range"?o="dialogHeaderPriceRange":e.type==="date-price-range"&&(o="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:n}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:o,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});t.initialFocus=n,this.showWithChildren([a],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),s=this.createInputGroupLine(),o=this.createInputGroupLine(),a="isMultiColor"in e,n=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),a?e.isMultiColor:!1,a,t.onChangeLineColor,t.onChangeHideLineColor),r=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(s.append(n),"background"in e){const c=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);s.append(c),o.append(r)}else"showFill"in e?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:c=>t.onChangeLine({showFill:c})})),o.append(r)):s.append(r);return o.append(l),i.append(s,o),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,c=>t.onChangeLine({bands:c}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:gs(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:gs(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:c=>t.onChangeLine({extendEnd:c})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:c=>t.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:c=>t.onChangeLine({extendBelow:c})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:c=>t.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:c=>t.onChangeLine({extendRight:c})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:c=>t.onChangeLine({reverse:c})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:h=>t.onChangeText({label:h})}),o=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),a=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),n=e.text.position==="inside"?"center":e.text.position,r=this.createPositionRadioGroup(n??"top",h=>t.onChangeText({position:h})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",h=>t.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(o,a,r,l),i.append(s,c),{panel:i,onShow:()=>ZT(s)}}createColorPickerInput(e,t,i,s,o,a,n){const r=e==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=e==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:t,opacity:i,isMultiColor:s,hasMultiColorOption:o,onChange:a,onChangeHide:n})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:ky.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:tL.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:Ay.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(e),onChange:i=>t(Number(i))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function Od(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function r2(e,t,i){for(const{update:s}of Object.values($t))s(e,t,i)}var{InteractionState:_t,keyProperty:l2,valueProperty:c2,Selection:h2,BBox:d2}=jr,Oa=class NA extends N0{constructor(t){super(),this.ctx=t,this.toolbar=new Ol(this.ctx),this.optionsToolbar=new nd(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return _o(this.annotationData.at(i))}),this.axesButtons=new Fh,this.enabled=!0,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new C0(NA.createAnnotationDatum),this.defaults=new KN,this.container=new jr.Group({name:"static-annotations"}),this.annotations=new h2(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new n2(this.ctx),this.textInput=new B0(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy(),this.textInput.destroy()})}setupStateMachine(){const{ctx:t}=this;return new Cl({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(_t.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,o)=>{let a;return this.annotations.each((n,r,l)=>{if(!r.isHoverable())return;const c=n.containsPoint(i.x,i.y);c&&(a??(a=l)),n.toggleHovered(c,s===l,r.readOnly)}),a!=null?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),(a==null||!this.annotationData.at(a)?.readOnly)&&this.ctx.domManager.updateCursor("annotations",a==null?void 0:this.annotations.at(a)?.getCursor()),a!==o&&this.update(),a},getNodeAtCoords:(i,s)=>{const o=this.annotations.at(s);if(o)return o.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const o=this.annotations.at(i),a=_o(this.annotationData.at(i));if(!(!o||!a))return this.translateNode(o,a,s)},copy:i=>{const s=this.annotations.at(i),o=_o(this.annotationData.at(i));if(!(!s||!o))return this.createAnnotationDatumCopy(s,o)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:o,optionsToolbar:a,toolbar:n}=this;this.hideOverlays(),n.clearActiveButton(),n.resetButtonIcons();const r=i==null?null:o.at(i),l=s==null?null:o.at(s),c=i==null?null:this.annotationData.at(i);l===r&&r!=null||(l?.toggleActive(!1),a.hide(),r&&!c?.readOnly?(this.pushAnnotationState(_t.AnnotationsSelected),r.toggleActive(!0),_s(c)||(a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(r)}))):(this.popAnnotationState(_t.AnnotationsSelected),this.popAnnotationState(_t.Annotations)),_s(c)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(_t.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(_t.Annotations)},stopInteracting:()=>{this.popAnnotationState(_t.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(s=>{if(s.readOnly===!0)return s});this.annotationData.splice(0,this.annotationData.length);for(const s of i)this.annotationData.push(s)},validatePoint:(i,s)=>{const o=this.getAnnotationContext();return o?xl(o,i,s):!0},getAnnotationType:i=>H0(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),s=i==null?null:this.annotations.at(i);s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=_o(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const a={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},n=this.getAnnotationContext(),r=c=>Ao.add(s.getTextInputCoords(n,c),Ao.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:a,layout:{getTextInputCoords:r,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||_s(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,o="line")=>{const a=this.annotationData.at(i);if(!il(a)&&!gs(a)&&!_n(a)||_s(a))return;const n=c=>(h,d,p,g)=>{this.setColorAndDefault(a.type,c,h,d,p,g),this.optionsToolbar.updateColorPickerColor(c,d,p,g)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${a.type} ${c} to ${a.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:o,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(a.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(a.type,c.position),this.recordActionAfterNextUpdate(`Change ${a.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:n("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:n("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(a.type,c),this.optionsToolbar.updateLineStyleType(zn.find(h=>h.value===c)??zn[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(a.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:n("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(a.type,c)}};this.settingsDialog.show(a,l)}})}setupListeners(){const{ctx:t,optionsToolbar:i,settingsDialog:s,toolbar:o}=this,{seriesWidget:a,seriesDragInterpreter:n,chartWidget:r}=t.widgets;n&&this.cleanup.register(n.events.on("click",this.hoverTouchPreHandler.bind(this)),n.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),n.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),n.events.on("mousemove",this.onHover.bind(this)),n.events.on("click",this.onClick.bind(this)),n.events.on("dblclick",this.onDoubleClick.bind(this)),n.events.on("drag-start",this.onDragStart.bind(this)),n.events.on("drag-move",this.onDrag.bind(this)),n.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(a.addListener("keydown",this.onKeyDown.bind(this)),a.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),t.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.eventsHub.on("zoom:change-complete",()=>this.onResize()),t.eventsHub.on("dom:resize",()=>this.onResize()),o.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),o.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(_t.Annotations),this.state.transition(l),this.update()}),o.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),o.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),o.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",({locked:l})=>{this.recordActionAfterNextUpdate(l?"Locked":"Unlocked"),this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:d,opacity:p,isMultiColor:g})=>{this.setColorAndDefault(l,c,h,d,p,g)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:i,optionsToolbar:s}=this;this.cleanup.register(t.annotationManager.attachNode(this.container),()=>{t.domManager.removeStyles(Kn),i.destroy(),s.destroy()})}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[l2(this.xKey,void 0,{id:"date"}),c2(this.volumeKey,"number",{id:"volume"})],s=jr.DataSet.wrap(this.data)??jr.DataSet.empty(),{dataModel:o,processedData:a}=await t.request("annotations",s,{props:i});this.dataModel=o,this.processedData=a}createAnnotationScene(t){if(t.type in $t)return new $t[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys($t)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in $t)return new $t[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys($t)}], ignoring.`)}createAnnotation(t,i,s=!0){if(this.annotationData.push(i),s){const o=this.ctx.annotationManager.getAnnotationTypeStyles(t);o&&i.set(o),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,i){const{dataModel:s,processedData:o}=this;let a=Be(t),n=Be(i);if(!Vh(a)||!Vh(n)||!s||!o||this.volumeKey==null)return;a>n&&([a,n]=[n,a]);const r=s.resolveKeysById({id:"annotations"},"date",o),l=s.resolveColumnById({id:"annotations"},"volume",o);let c=0;for(let h=0;h<o.input.count;h++){const d=r[h];Vh(d)&&d>=a&&d<=n&&(c+=l[h])}return c}translateNode(t,i,s){const o=this.getAnnotationConfig(i),a=this.getAnnotationContext();a&&o.translate(t,i,s,a)}createAnnotationDatumCopy(t,i){const s=this.getAnnotationConfig(i),o=new s.datum;o.set(i.toJson());const a=this.getAnnotationContext();if(a)return s.copy(t,i,o,a)}getAnnotationConfig(t){if(t.type in $t)return $t[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys($t)}], ignoring.`)}onRestoreAnnotations(t){this.enabled&&(this.clear(),this.annotationData.set(t.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(t){if(!this.enabled)return;const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i),this.xAxis=this.getAxis(t.axes[Bh.X],i,this.xAxis?.button),this.yAxis=this.getAxis(t.axes[Bh.Y],i,this.yAxis?.button),this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(o=>o.hasData),s=this.yAxis.context.seriesIds().some(o=>this.ctx.chartService.series.find(n=>n.id===o)?.visible);return t&&s}animateAnnotations({from:t,to:i,phase:s}){const{annotations:o}=this;this.ctx.animationManager?.animate({from:t,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(a){o.each(n=>{n.opacity=a,"setAxisLabelOpacity"in n&&n.setAxisLabelOpacity(a)})},onStop(){o.each(a=>{a.opacity=i,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(i)})}})}onPreRender(){this.enabled&&(this.updateAnnotations(),this.state.transition("render"))}getAxis(t,i,s){const o=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:a="bottom",direction:n}=o,r=t.gridPadding+t.seriesAreaPadding,l=new d2(0,0,i.width,i.height).grow(r,a),c=n===Bh.X?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===n)){s??(s=new _f(this.ctx,{...o,snapToGroup:d},m=>this.onAxisButtonClick(m,c),i));const g=Od(t);s.update(i,g)}else s?.destroy(),s=void 0;return{layout:t,context:o,bounds:l,button:s}}recordActionAfterNextUpdate(t,i=["annotations"]){const{defaults:s,ctx:{annotationManager:o,historyManager:a}}=this,n=i.map(r=>r==="defaults"?s:o);this.postUpdateFns.push(()=>{a.record(t,...n),o.fireChangedEvent()})}setColorAndDefault(t,i,s,o,a,n){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:o,opacity:a,isMultiColor:n}),this.defaults.setDefaultColor(t,i,s,o,a,n)}setFontSizeAndDefault(t,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(t,i),this.recordActionAfterNextUpdate(`Change ${t} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(t,i),this.recordActionAfterNextUpdate(`Change ${t} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(t,i),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:i,seriesRect:s,ctx:{annotationManager:o}}=this,a=this.getAnnotationContext();if(!s||!a)return;o.updateData(t.toJson());const n=this.showAnnotations();this.toolbar.refreshButtonsEnabled(n),this.toolbar.toggleClearButtonEnabled(t.length>0&&n),i.update(t??[],void 0,r=>r.id).each((r,l)=>{if(!n){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),r2(r,l,a)});for(const r of this.postUpdateFns)r();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:s,snap:o}=this;if(t&&i&&s)return{seriesRect:t,xAxis:{...i.context,bounds:i.bounds,labelPadding:Od(i.layout),snapToGroup:o},yAxis:{...s.context,bounds:s.bounds,labelPadding:Od(i.layout),snapToGroup:o}}}onHover(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const o=t.sourceEvent.shiftKey,a=Ao.from(t),n=It(a,s);i.transition("hover",{offset:a,point:n,shiftKey:o,context:s})}onClick(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const o=t.sourceEvent.shiftKey,a=It(Ao.from(t),s),n=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:a,shiftKey:o,textInputValue:n,bbox:r})}onDoubleClick(t){const{state:i}=this;if(!this.getAnnotationContext())return;const o=Ao.from(t);i.transition("dblclick",{offset:o})}onAxisButtonClick(t,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:o}=this;this.pushAnnotationState(_t.Annotations);const a=i==="horizontal";if(o.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const n=It(t,s);xl(s,n)&&(o.transition("click",{point:n,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:i})}hoverTouchPreHandler(t){t.device==="touch"&&this.onHover(t)}dragMoveTouchPreHandler(t){t.device==="touch"&&this.ctx.interactionManager.isState(_t.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(_t.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Ao.from(t),o=It(s,i),a=this.textInput.getValue(),n=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:o,textInputValue:a,bbox:n})}onDrag(t){if(!this.ctx.interactionManager.isState(_t.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Ao.from(t),o=It(s,i),a=t.sourceEvent.shiftKey,n=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:o,shiftKey:a,textInputValue:n,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:i}=t??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:o,shiftKey:a}=t,n=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:o,shiftKey:a,textInputValue:n,bbox:r,context:s})}onKeyDown(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:o}=t,{shiftKey:a,ctrlKey:n,metaKey:r}=o,l=n||r,c=n||a;i.transition("keyDown",{shiftKey:a,context:s});const h={x:0,y:0},d=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),p=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(o.key){case"ArrowDown":h.y=p;break;case"ArrowUp":h.y=-p;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),o.stopPropagation(),o.preventDefault()),!!l)switch(o.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(t){const{shiftKey:i}=t.sourceEvent,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let t=!1;for(const[i,s]of this.annotationData.entries())_s(s)&&(this.annotationData.splice(i,1),t=!0);t&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(t){this.ctx.interactionManager.pushState(t),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(t){this.ctx.interactionManager.popState(t),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(_t.Annotations)||this.ctx.interactionManager.isState(_t.AnnotationsSelected)}update(t=L0.PRE_SCENE_RENDER){this.ctx.updateService.update(t)}};u([On],Oa.prototype,"toolbar",2),u([On],Oa.prototype,"optionsToolbar",2),u([On],Oa.prototype,"axesButtons",2),u([On,T0((e,t)=>{const i=t??!0;e.toolbar.enabled=i,e.optionsToolbar.enabled=i,e.axesButtons.enabled=i})],Oa.prototype,"enabled",2),u([On],Oa.prototype,"snap",2);var u2=Oa;import"ag-charts-community";import*as st from"ag-charts-core";import{FONT_SIZE_RATIO as Ed}from"ag-charts-core";var mi={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},ot={fill:st.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},zo={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:Ed.LARGE},fontFamily:{$ref:"fontFamily"}},Kf={...zo,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Pl={...zo,textAlign:"left"},Bo={...zo,position:"top",alignment:"center",color:{$ref:"textColor"}},Gf={...zo,position:"top",alignment:"center",color:{$ref:"textColor"}},Pd={...zo,fontSize:{$ref:"fontSize"},color:st.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:st.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:st.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:st.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},Rd={...mi,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ot},text:{...Bo},statistics:{...Pd}},p2={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},g2={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}},m2={enabled:!1,line:{...mi,handle:{...ot},text:{...Bo}},"horizontal-line":{...mi,handle:{...ot},axisLabel:{...Kf},text:{...Bo}},"vertical-line":{...mi,handle:{...ot},axisLabel:{...Kf},text:{...Bo}},"disjoint-channel":{...mi,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ot},text:{...Gf}},"parallel-channel":{...mi,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ot},text:{...Gf}},"fibonacci-retracement":{...mi,strokes:st.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ot},text:{...Bo,position:"center"},label:{...zo,color:void 0,fontSize:{$rem:Ed.SMALLER}}},"fibonacci-retracement-trend-based":{...mi,strokes:st.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ot},text:{...Bo,position:"center"},label:{...zo,color:void 0,fontSize:{$rem:Ed.SMALLER}}},callout:{...mi,...Pl,color:{$ref:"textColor"},handle:{...ot},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Pl,fontWeight:700,handle:{...ot},fill:{$ref:"foregroundColor"}},note:{...Pl,color:st.DEFAULT_TEXTBOX_COLOR,fill:st.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ot},background:{fill:st.DEFAULT_TEXTBOX_FILL,stroke:st.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...Pl,color:{$ref:"textColor"},handle:{...ot}},arrow:{...mi,handle:{...ot},text:{...Bo}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...ot,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...ot,stroke:{$ref:"foregroundColor"}}},"date-range":{...Rd},"price-range":{...Rd},"date-price-range":{...Rd},"quick-date-price-range":{up:{...mi,fill:st.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...ot},statistics:{...Pd,color:"#fff",fill:st.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...mi,stroke:st.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:st.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...ot,stroke:st.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...Pd,color:"#fff",fill:st.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:p2,optionsToolbar:g2},_d={type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,version:M0,options:k0.annotationOptionsDef,themeTemplate:m2,create:e=>new u2(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new Um(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}};import{VERSION as y2}from"ag-charts-community";import{_ModuleSupport as f2}from"ag-charts-community";import{AbstractModuleInstance as x2,ChartAxisDirection as S2,ChartUpdateType as Wf,Property as Ai,ZIndexMap as b2,createId as v2}from"ag-charts-core";var{Range:D2,TranslatableGroup:M2,BBox:k2,FillGradientDefaults:A2,FillImageDefaults:I2,FillPatternDefaults:N2,getShapeFill:L2,InteractionState:Rl}=f2,Ut=class extends x2{constructor(e){super(),this.ctx=e,this.id=v2(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new A2,this.fillPatternDefaults=new N2,this.fillImageDefaults=new I2,this.bounds=new k2(0,0,0,0),this.bandHighlightGroup=new M2({name:"bandHighlight",zIndex:b2.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new D2),this.activeAxisHighlight=void 0,this.axisCtx=e.parent,this.hideBand(),e.domManager.addEventListener("focusin",({target:a})=>{const n=a instanceof HTMLElement&&e.domManager.contains(a,"series-area");this.bandHighlightGroup.visible&&!n&&(this.hideBand(),this.ctx.updateService.update(Wf.SCENE_RENDER))});const{widgets:{seriesWidget:t,seriesDragInterpreter:i},animationManager:s,eventsHub:o}=e;this.cleanup.register(e.scene.attachNode(this.bandHighlightGroup),t.addListener("mousemove",a=>this.onHoverLikeEvent(a)),t.addListener("mouseleave",()=>this.clearAllHighlight()),s.addListener("animation-start",()=>this.clearAllHighlight()),o.on("layout:complete",a=>this.layout(a)),o.on("series:focus-change",()=>this.onKeyPress()),o.on("zoom:pan-start",()=>this.clearAllHighlight()),o.on("zoom:change-complete",()=>this.clearAllHighlight()),o.on("dom:resize",()=>this.clearAllHighlight()),o.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",a=>this.onHoverLikeEvent(a)),i.events.on("click",a=>this.onClick(a)))}axisChange(){this.onHighlightChange()}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(e){e.device==="touch"&&this.onHoverLikeEvent(e)}clearAllHighlight(){this.ctx.interactionManager.isState(Rl.Clickable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(Rl.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?Rl.Clickable:Rl.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&this.handleHoverHighlight(e)}handleHoverHighlight(e){if(!e)return;const{currentX:t,currentY:i}=e;this.onHighlightChange(this.axisCtx.pickBand({x:t,y:i}))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;const{position:s="left",axisId:o}=this.axisCtx,a=i[o];if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding,s);const{bandHighlightGroup:n,bounds:r}=this;n.translationX=Math.round(r.x),n.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,fill:a,fillOpacity:n,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:h,axisLayout:d}=this;d&&(e.stroke=t,e.strokeWidth=i,e.strokeOpacity=s,e.lineDash=o,e.lineDashOffset=h,e.fill=L2(a,r,l,c),e.fillOpacity=n,e.startLine=!0,e.endLine=!0)}isVertical(){return this.axisCtx.direction===S2.X}onHighlightChange(e){this.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.updateService.update(Wf.SCENE_RENDER))}updateBandPosition(){const{rangeNode:e,bounds:t}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let s=Math.min(...i),o=Math.max(...i);if(o-s<1){const a=(s+o)/2;s=a-.5,o=a+.5}this.isVertical()?(e.y1=0,e.y2=t.height,e.x1=s,e.x2=o,e.horizontal=!0):(e.y1=s,e.y2=o,e.x1=0,e.x2=t.width,e.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};Ut.className="BandHighlight",u([Ai],Ut.prototype,"enabled",2),u([Ai],Ut.prototype,"stroke",2),u([Ai],Ut.prototype,"lineDash",2),u([Ai],Ut.prototype,"lineDashOffset",2),u([Ai],Ut.prototype,"strokeWidth",2),u([Ai],Ut.prototype,"strokeOpacity",2),u([Ai],Ut.prototype,"fill",2),u([Ai],Ut.prototype,"fillOpacity",2),u([Ai],Ut.prototype,"fillGradientDefaults",2),u([Ai],Ut.prototype,"fillPatternDefaults",2),u([Ai],Ut.prototype,"fillImageDefaults",2);var zd={type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",axisTypes:["category","ordinal-time","unit-time","grouped-category"],enterprise:!0,version:y2,themeTemplate:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}},create:e=>new Ut(e)};import{VERSION as T2}from"ag-charts-community";import{boolean as C2}from"ag-charts-core";import{_ModuleSupport as w2}from"ag-charts-community";import{AbstractModuleInstance as O2,ActionOnSet as E2,Logger as P2,Property as R2}from"ag-charts-core";var{LayoutElement:_2,Menu:z2}=w2,Bd=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],jf=class extends O2{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new z2(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(_2.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t,buttonWidget:i}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show(i,{items:Bd,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:s=>{this.setChartType(s.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=Bd.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>P2.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!Bd.some(t=>t.value===e)?"candlestick":e}};u([R2,E2({changeValue(e){this.toolbar?.setHidden(!e)}})],jf.prototype,"enabled",2);var _l={type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,version:T2,options:{enabled:C2},create:e=>new jf(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new Um(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}};import{VERSION as B2}from"ag-charts-community";import{IS_DARK_THEME as V2,boolean as $f,callbackOf as F2,contextMenuItemsArray as Uf,undocumented as H2}from"ag-charts-core";import{_ModuleSupport as Vd,_Widget as Yf}from"ag-charts-community";import{AbstractModuleInstance as K2,Logger as zl,Property as Bl,callWithContext as Vl,clamp as Xf,createElement as Gn,getIconClassNames as G2,toPlainText as Zf}from"ag-charts-core";import{isKeyOf as Qf}from"ag-charts-core";function Fd(e,t){return e==="always"?!0:e==="series-area"?t==="series-area"||t==="series-node":e===t}function qf(e,t,i){let s=!0;if(t.type==="separator"){const o=i.at(-1);s=o!==void 0&&o.type!=="separator"}if(s&&(s=Fd(t.showOn??"always",e)),s){const o=new $2(t);return i.push(o),o}}function Jf(e,t,i,s){t.isVisible(i)&&qf(e,t.builtins.items[i],s)}function W2(e,t,i,s){const{builtins:o}=t;if(Qf(i,o.lists))for(const a of o.lists[i])Jf(e,t,a,s);else Jf(e,t,i,s)}function j2(e,t,i){const s=[],{builtins:o}=i;for(const a of t)if(typeof a=="string"&&Qf(a,o.lists))for(const n of o.lists[a])s.push(n);else s.push(a);return s.filter(a=>{if(typeof a=="string"){const n=i.builtins.items[a].showOn??"always";return i.isVisible(a)&&Fd(n,e)}else return Fd(a.showOn??"always",e)})}function ex(e,t,i,s){for(const o of i)if(typeof o=="string")W2(e,t,o,s);else{const a=qf(e,o,s);o.items&&a&&o.items.length>0&&ex(e,t,o.items,a.items)}s.at(-1)?.type==="separator"&&s.pop()}var $2=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)e[t]!==void 0&&this.setField(t,this,e[t])}},Ss="ag-charts-context-menu",{ContextMenuRegistry:Wn}=Vd,Hd="context-menu",U2=["angleKey","calloutLabelKey","colorKey","labelKey","radiusKey","sectorLabelKey","sizeKey","xKey","yKey"],jn=class extends K2{constructor(e){if(super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new Yf.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",Hd),this.element.classList.add(Ss),this.element.style.display="none",this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:t})=>{this.collapsingSubMenus>0||(t==null||t instanceof Node&&!this.element.contains(t))&&this.hide()}),this.cleanup.register(()=>this.element.remove(),()=>this.menuWidget.destroy(),e.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("collapse-widget",()=>this.onCollapse())),this.menuWidget.addClass(`${Ss}__menu`),typeof MutationObserver<"u"){const t=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.cleanup.register(()=>t.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&(i=t.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{zl.error("Unable to download chart",s)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",t=>this.onContext(t)))}makeGetItemsParams(e){const{showOn:t}=e,{context:i}=this.ctx.chartService,s=j2(t,this.items,this.ctx.contextMenuRegistry);switch(t){case"always":case"series-area":return{showOn:t,context:i,defaultItems:s};case"series-node":{if(this.pickedNode==null)throw new Error("this.pickedNode is null");const c={showOn:t,context:i,seriesId:this.pickedNode.series.id,datum:this.pickedNode.datum,defaultItems:s};for(const h of U2)this.pickedNode[h]!==void 0&&(c[h]=this.pickedNode[h]);return c}case"legend-item":if(this.pickedLegendItem==null)throw new Error("this.pickedLegendItem is null");const{itemId:o,seriesId:a,label:n,enabled:r}=this.pickedLegendItem,l=Zf(n.text);if(typeof o!="string")throw new Error(`unexpected itemId type: [${typeof o}] (expected [string])`);return{showOn:t,context:i,itemId:o,seriesId:a,text:l,visible:r,defaultItems:s};default:return t}}expandItemsOptions(e){const t=[];let i;if(this.getItems){const s=this.makeGetItemsParams(e);i=this.getItems(s)}return i??(i=this.items),ex(e.showOn,this.ctx.contextMenuRegistry,i,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,Wn.check("series-node",e)?this.pickedNode=e.context.pickedNode:Wn.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e);t.length!==0&&this.show(e.widgetEvent,t)}show(e,t){const{sourceEvent:i}=e;this.interactionManager.pushState(Vd.InteractionState.ContextMenu),this.element.style.display="block";const s=i.pointerType==="touch"?!1:void 0;s!==void 0&&this.ctx.chartService.overrideFocusVisible(s),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:s})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(Vd.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const s=this.ctx.domManager.getBoundingClientRect(),o=e.getBoundingClientRect(),a=s.right-o.right,n=o.left-s.left,{offsetWidth:r,offsetHeight:l}=t.getElement();let c=i.y;if(s.height>l){const h=s.bottom-o.top;h<l&&(c-=l-h)}if(a>=r)t.setBounds({x:i.x+i.width,y:c});else{const h=i.x-r,d=n+h;d>=0?t.setBounds({x:h,y:c}):t.setBounds({x:h-d,y:c})}}onSubMenuCollapse(e,t){e.setFocusOverride(void 0),this.collapsingSubMenus++,t.remove(),this.collapsingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":{e.addSeparator().classList.add(`${Ss}__divider`);break}case"action":{if(i.items.length===0){const s=new Yf.MenuItemWidget;this.initButtonElement(s,i),e.addChild(s)}else{const{subMenuButton:s,subMenu:o}=e.addSubMenu();o.addClass(`${Ss}__menu`),o.addListener("expand-widget",()=>this.onSubMenuExpand(s,o)),o.addListener("collapse-widget",()=>this.onSubMenuCollapse(s,o)),this.initButtonElement(s,i),this.createMenuItems(o,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return Wn.checkCallback("legend-item",e,t)?i=>{const s=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:o,itemId:a,label:n}=this.pickedLegendItem,{chartService:r}=this.ctx;if(typeof a!="string"){zl.error(`unexpected itemId type: [${typeof a}] (expected [string])`);return}const c=[r.series.find(d=>d.id===o)?.properties,r],h={type:"contextmenu",seriesId:o,itemId:a,text:Zf(n.text),event:s};Vl(c,t,h),this.hide()}else zl.error("legend item not found")}:Wn.checkCallback("series-area",e,t)?()=>{const i=this.ctx.chartService,s={type:"seriesContextMenuAction",event:this.showEvent};Vl(i,t,s),this.hide()}:Wn.checkCallback("series-node",e,t)?()=>{const{showEvent:i}=this,{chartService:s}=this.ctx,o=this.pickedNode,a=[o?.series.properties,s],n=o?.series.createNodeContextMenuActionEvent(i,o);n?Vl(a,t,n):zl.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,s={type:"contextMenuEvent",event:this.showEvent};Vl(i,t,s),this.hide()}}initTableCells(e){const t=Gn("div"),i=Gn("div"),s=Gn("div");return t.classList.toggle(`${Ss}__icon`,!0),i.classList.toggle(`${Ss}__cell`,!0),s.classList.toggle(`${Ss}__cell`,!0),t.ariaHidden="true",i.role="presentation",s.ariaHidden="true",e.append(t,i,s),{cellIcon:t,cellLabel:i,cellArrow:s}}initButtonElement(e,t){e.addClass(`${Ss}__item`),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),s=`${Ss}__cellpadding`,{cellIcon:o,cellLabel:a,cellArrow:n}=this.initTableCells(e.getElement());if(a.textContent=i,a.classList.add(s),t.iconUrl!=null){const c=Gn("img");c.src=t.iconUrl,o.append(c),o.classList.add(s)}if(t.items.length>0){const c=Gn("span",G2("chevron-right"));n.append(c),n.classList.add(s)}const{showOn:r,action:l}=t;l!=null&&e.addListener("click",this.createButtonOnClick(r,l)),t.items.length===0&&(e.addListener("mouseleave",()=>e.setFocusOverride(!1)),e.addListener("mouseenter",()=>e.setFocusOverride(void 0)))}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:o}=this.element;e=Xf(0,e,i.width-s),t=Xf(0,t,i.height-o),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(Hd),this.ctx.domManager.removeChild("canvas-overlay",Hd)}};u([Bl],jn.prototype,"enabled",2),u([Bl],jn.prototype,"darkTheme",2),u([Bl],jn.prototype,"items",2),u([Bl],jn.prototype,"getItems",2);var $n={type:"plugin",name:"contextMenu",enterprise:!0,version:B2,options:{enabled:$f,items:Uf,getItems:F2(Uf,"a menu items array")},themeTemplate:{enabled:!0,darkTheme:V2},create:e=>new jn(e)};$n.options.darkTheme=H2($f);import{VERSION as Y2}from"ag-charts-community";import{_ModuleSupport as tx}from"ag-charts-community";import{AbstractModuleInstance as X2,ChartAxisDirection as ix,ChartUpdateType as Kd,Property as Zs,ZIndexMap as sx,createId as Z2,toPlainText as Q2}from"ag-charts-core";function Un(e){return typeof e?.datum=="object"?e.datum:null}import{_ModuleSupport as ox}from"ag-charts-community";import{BaseProperties as q2,Property as Ea,createId as J2,setAttribute as eC}from"ag-charts-core";var{FormatManager:tC}=ox,iC="ag-charts-crosshair-label",Qs=class extends q2{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:o,format:a}=this,{domain:n,boundSeries:r}=s;let l;if(o!=null){const c=s.type==="number"?s.fractionDigits:void 0,h=s.type==="date"?s.unit:void 0,d=s.type==="date"?s.step:void 0;l=e(o,{value:i,domain:n,fractionDigits:c,unit:h,step:d,boundSeries:r})}if(a!=null){let c=this._cachedFormatter;(c?.type!==t||c?.format!==a)&&(c={type:t,format:a,formatter:tC.getFormatter(t,a)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};u([Ea],Qs.prototype,"enabled",2),u([Ea],Qs.prototype,"xOffset",2),u([Ea],Qs.prototype,"yOffset",2),u([Ea],Qs.prototype,"formatter",2),u([Ea],Qs.prototype,"format",2),u([Ea],Qs.prototype,"renderer",2);var ax=class extends Qs{constructor(e,t,i){super(),this.domManager=e,this.id=J2(this),this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(iC),eC(this.element,"aria-hidden",!0),this.element.dataset.key=t,this.element.dataset.axisId=i}show(e){const{element:t}=this,i=e.x+this.xOffset,s=e.y+this.yOffset;t.style.top=`${Math.round(s)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:e,styles:t}){if(e!==void 0&&(this.element.innerHTML=e),t!==void 0){const i=this.element.children[0]??this.element;Object.assign(i.style,t)}}getBBox(){const{element:e}=this;return new ox.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if(typeof e=="string")return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:s=t.color,backgroundColor:o=t.backgroundColor,opacity:a=t.opacity??1}=e,n={opacity:a,"background-color":o?.toLowerCase(),color:s};return{html:`<div class="ag-charts-crosshair-label-content">
|
|
<span>${i}</span>
|
|
</div>`,styles:n}}};ax.className="CrosshairLabel";var{Group:sC,TranslatableGroup:oC,Line:aC,BBox:nx,InteractionState:Yn}=tx,Wi=class extends X2{constructor(e){super(),this.ctx=e,this.id=Z2(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new Qs,this.seriesRect=new nx(0,0,0,0),this.bounds=new nx(0,0,0,0),this.crosshairGroup=new oC({name:"crosshairs",zIndex:sx.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new sC({name:`${this.id}-crosshair-lines`,zIndex:sx.SERIES_CROSSHAIR})),this.lineGroupSelection=tx.Selection.select(this.lineGroup,aC,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:i})=>{if(this.checkInteractionState())return;const s=i instanceof HTMLElement&&e.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!s&&(this.hideCrosshairs(),this.ctx.updateService.update(Kd.SCENE_RENDER))});const{seriesDragInterpreter:t}=e.widgets;this.cleanup.register(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),e.eventsHub.on("zoom:change-complete",()=>this.onMouseOut()),e.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),e.eventsHub.on("layout:complete",i=>this.layout(i)),()=>{for(const i of Object.values(this.labels))i.destroy()}),t&&this.cleanup.register(t.events.on("drag-move",i=>this.onMouseHoverLike(i)),t.events.on("click",i=>this.onClick(i)))}checkInteractionState(){return this.ctx.interactionManager.isState(Yn.Frozen)}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:o}=this.axisCtx,a=i[o];if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding+a.seriesAreaPadding,s);const{crosshairGroup:n,bounds:r}=this;n.translationX=Math.round(r.x),n.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l),this.refreshPositions()}updateSelections(e){this.lineGroupSelection.update(e,void 0,t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new ax(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s])}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:o,renderer:a}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=o,e.renderer=a}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,axisLayout:r}=this;if(!r)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=o,c.lineDash=a,c.lineDashOffset=n,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===ix.X}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){return Q2(this.axisCtx.formatScaleValue(e,"crosshair",this.label))}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?Yn.Clickable:Yn.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(Kd.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(Yn.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(Kd.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(Yn.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:o}=e.currentHighlight??{},a=s&&(o?.axes.x?.id===i.axisId||o?.axes.y?.id===i.axisId);if(this.activeHighlight=a?e.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const n=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(n),t.visible=!0}}isInRange(e){return this.axisCtx.inRange(e)}refreshPositions(){this.activeHighlight&&this.updatePositions(this.getActiveHighlightData(this.activeHighlight))}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((s,o)=>{const a=e[o];if(!a){s.visible=!1,this.hideLabel(o);return}s.visible=!0;const{value:n,position:r}=a;let l=0,c=0;this.isVertical()?(l=r,s.x=Math.round(l)):(c=r,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,n,o):this.hideLabel(o)})}getData(e){const{axisCtx:t}=this,i="pointer",{xKey:s="",yKey:o=""}=this.activeHighlight??{},{currentX:a,currentY:n}=e,r=Un(this.activeHighlight),l=this.isVertical(),c=l?a:n;let h=r?.[l?s:o]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{series:i,xKey:s="",aggregatedValue:o,cumulativeValue:a,midPoint:n}=e,r=Un(e),l=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=i.axes[t.direction]?.id===t.axisId,d=l.includes("yKey")&&h,p=l.includes("xKey")&&h,g=o??a;if(d&&g!==void 0){const y=t.scale.convert(g)+c;return this.isInRange(y)?{yKey:{value:g,position:y}}:{}}if(p){const y=(this.isVertical()?n?.x:n?.y)??0,S=t.continuous?t.scaleInvert(y):r?.[s];return this.isInRange(y)?{xKey:{value:S,position:y}}:{}}const m={};for(const y of l){const S=i.properties[y],x=r?.[S],b=t.scale.convert(x)+c;this.isInRange(b)&&(m[y]={value:x,position:b})}return m}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:o}=this,a=this.labels[s],n=this.getLabelHtml(i,a);a.setLabelHtml(n);const{width:r,height:l}=a.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===ix.X?(h-=4,a.show({x:e-r/2,y:c==="bottom"?o.y+o.height+h:o.y-l-h})):(h-=8,a.show({x:c==="right"?o.x+o.width+h:o.x-r-h,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};Wi.className="Crosshair",u([Zs],Wi.prototype,"enabled",2),u([Zs],Wi.prototype,"stroke",2),u([Zs],Wi.prototype,"lineDash",2),u([Zs],Wi.prototype,"lineDashOffset",2),u([Zs],Wi.prototype,"strokeWidth",2),u([Zs],Wi.prototype,"strokeOpacity",2),u([Zs],Wi.prototype,"snap",2),u([Zs],Wi.prototype,"label",2);var Gd={type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,version:Y2,themeTemplate:{enabled:{$if:[{$or:[{$eq:[{$path:"../type"},"number"]},{$eq:[{$path:"../type"},"log"]},{$eq:[{$path:"../type"},"time"]},{$eq:[{$path:"../type"},"unit-time"]},{$eq:[{$path:"../type"},"ordinal-time"]}]},!0,!1]},snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}},create:e=>new Wi(e)};import{VERSION as nC}from"ag-charts-community";import{boolean as rC,callback as lC,positiveNumber as rx,undocumented as Wd}from"ag-charts-core";import"ag-charts-community";import{AbstractModuleInstance as cC,ActionOnSet as Xn,Property as lx}from"ag-charts-core";var Pa=class extends cC{constructor(e){super(),this.enabled=!0,this.getData=()=>Promise.resolve(),this.dataService=e.dataService;let t=!1;this.cleanup.register(e.eventsHub.on("data:load",()=>{t=!0}),e.eventsHub.on("layout:complete",()=>{t&&e.zoomManager.updateZoom({source:"data-update",sourceDetail:"dataSource"})}))}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};u([Xn({newValue(e){this.updateCallback(e,this.getData)}}),lx],Pa.prototype,"enabled",2),u([Xn({newValue(e){this.updateCallback(this.enabled,e)}}),lx],Pa.prototype,"getData",2),u([Xn({newValue(e){this.dataService.requestThrottle=e}})],Pa.prototype,"requestThrottle",2),u([Xn({newValue(e){this.dataService.dispatchThrottle=e}})],Pa.prototype,"updateThrottle",2),u([Xn({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],Pa.prototype,"updateDuringInteraction",2);var Fl={type:"plugin",name:"dataSource",enterprise:!0,version:nC,options:{getData:lC,requestThrottle:Wd(rx),updateThrottle:Wd(rx),updateDuringInteraction:Wd(rC)},create:e=>new Pa(e)};import{VERSION as hC}from"ag-charts-community";import{errorBarOptionsDefs as dC}from"ag-charts-core";import{_ModuleSupport as cx}from"ag-charts-community";import{AbstractModuleInstance as uC,ChartAxisDirection as Zn,Logger as pC,isDefined as zt,mergeDefaults as gC}from"ag-charts-core";import{_ModuleSupport as Qn}from"ag-charts-community";import{mergeDefaults as hx,nearestSquared as mC,nearestSquaredInContainer as yC,partialAssign as fC}from"ag-charts-core";var{BBox:qs}=Qn,xC=class{constructor(e){this.components=e,this.union=qs.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},SC=class extends Qn.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new Qn.Path,this.capsPath=new Qn.Path,this.bboxes=new xC([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:o,lengthMax:a}=t,n=s??i*o;return Math.min(n,a)}getItemStylerParams(e,t,i,s){const{datum:o}=this;if(o==null||e.itemStyler==null)return;const{xLowerKey:a,xUpperKey:n,yLowerKey:r,yUpperKey:l}=e;return{...t,datum:o.datum,seriesId:o.series.id,xKey:o.xKey,yKey:o.yKey,xLowerKey:a,xUpperKey:n,yLowerKey:r,yUpperKey:l,highlighted:i,highlightState:s}}formatStyles(e,t,i,s,o){let{cap:a,...n}=e;const r=this.getItemStylerParams(t,e,s,o);if(r!=null&&t.itemStyler!=null){const l=i.callWithContext(t.itemStyler,r);n=hx(l,n),a=hx(l?.cap,l,a)}return{whiskerStyle:n,capsStyle:a}}applyStyling(e,t){fC(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,s,o){if(this.datum===void 0)return;const{whiskerStyle:a,capsStyle:n}=this.formatStyles(e,t,i,s,o),{xBar:r,yBar:l,capDefaults:c}=this.datum,h=this.whiskerPath;this.applyStyling(h,a),h.path.clear(!0),l!==void 0&&(h.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),h.path.lineTo(l.upperPoint.x,l.upperPoint.y)),r!==void 0&&(h.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),h.path.lineTo(r.upperPoint.x,r.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(n??{},c);const d=this.capLength/2,p=this.capsPath;this.applyStyling(p,n),p.path.clear(!0),l!==void 0&&(p.path.moveTo(l.lowerPoint.x-d,l.lowerPoint.y),p.path.lineTo(l.lowerPoint.x+d,l.lowerPoint.y),p.path.moveTo(l.upperPoint.x-d,l.upperPoint.y),p.path.lineTo(l.upperPoint.x+d,l.upperPoint.y)),r!==void 0&&(p.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-d),p.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+d),p.path.moveTo(r.upperPoint.x,r.upperPoint.y-d),p.path.lineTo(r.upperPoint.x,r.upperPoint.y+d)),p.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:o}=this.datum??{},a=e/2,n=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;n.push(new qs(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,r),new qs(s.lowerPoint.x-a,s.lowerPoint.y,e,i.strokeWidth),new qs(s.upperPoint.x-a,s.upperPoint.y,e,i.strokeWidth))}if(o!==void 0){const r=o.upperPoint.x-o.lowerPoint.x;n.push(new qs(o.lowerPoint.x,o.upperPoint.y,r,t.strokeWidth),new qs(o.lowerPoint.x,o.lowerPoint.y-a,i.strokeWidth,e),new qs(o.upperPoint.x,o.upperPoint.y-a,i.strokeWidth,e))}this.bboxes.components=n,this.bboxes.union=qs.merge(n)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:o}=mC(e,t,s.components);return{nearest:this,distanceSquared:o}}},bC=class extends Qn.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=yC(e,t,{children:this.children()});if(i!==void 0&&!Number.isNaN(s))return{datum:i.datum,distanceSquared:s}}};import"ag-charts-community";import{BaseProperties as dx,Property as pe}from"ag-charts-core";var bs=class extends dx{};u([pe],bs.prototype,"visible",2),u([pe],bs.prototype,"stroke",2),u([pe],bs.prototype,"strokeWidth",2),u([pe],bs.prototype,"strokeOpacity",2),u([pe],bs.prototype,"lineDash",2),u([pe],bs.prototype,"lineDashOffset",2),u([pe],bs.prototype,"length",2),u([pe],bs.prototype,"lengthRatio",2);var at=class extends dx{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new bs}};u([pe],at.prototype,"yLowerKey",2),u([pe],at.prototype,"yLowerName",2),u([pe],at.prototype,"yUpperKey",2),u([pe],at.prototype,"yUpperName",2),u([pe],at.prototype,"xLowerKey",2),u([pe],at.prototype,"xLowerName",2),u([pe],at.prototype,"xUpperKey",2),u([pe],at.prototype,"xUpperName",2),u([pe],at.prototype,"visible",2),u([pe],at.prototype,"stroke",2),u([pe],at.prototype,"strokeWidth",2),u([pe],at.prototype,"strokeOpacity",2),u([pe],at.prototype,"lineDash",2),u([pe],at.prototype,"lineDashOffset",2),u([pe],at.prototype,"itemStyler",2),u([pe],at.prototype,"cap",2);var{fixNumericExtent:vC,groupAccumulativeValueProperty:DC,valueProperty:Hl}=cx,MC=class zr extends uC{constructor(t){super(),this.properties=new at;const i=t.series,{annotationGroup:s,annotationSelections:o}=i;this.cartesianSeries=i,this.groupNode=new bC({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=cx.Selection.select(this.groupNode,()=>this.errorBarFactory()),o.add(this.selection),i.addEventListener("seriesVisibilityChange",a=>this.onToggleSeriesItem(a)),this.cleanup.register(i.events.on("data-processed",a=>this.onDataProcessed(a)),i.events.on("data-update",a=>this.onDataUpdate(a)),t.eventsHub.on("highlight:change",a=>this.onHighlightChange(a)),()=>this.groupNode.remove(),()=>o.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o}=this.properties;return zt(t)&&zt(i)||zt(s)&&zt(o)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:s,xUpperKey:o,yLowerKey:a,yUpperKey:n,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=t;return a!=null&&n!=null&&i.push(Hl(a,h,{id:`${l}-lower`}),Hl(n,h,{id:`${l}-upper`})),s!=null&&o!=null&&i.push(Hl(s,c,{id:`${r}-lower`}),Hl(o,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:s}=this,{xLowerKey:o,xUpperKey:a,yLowerKey:n,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=t,p=s.seriesGrouping?.groupIndex??s.id,g={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},m=(S,x,b,f)=>DC(S,"normal",{id:`${x}-${b}`,groupId:`errorGroup-${p}-${b}`,...g},f),y=(S,x,b,f)=>{i.push(...m(S,b,"lower",f),...m(x,b,"upper",f))};return n!=null&&r!=null&&y(n,r,c,d),o!=null&&a!=null&&y(o,a,l,h),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:s,xErrorsID:o,yLowerKey:a,yUpperKey:n,yErrorsID:r}=this.getMaybeFlippedKeys();if(t===Zn.X?zt(i)&&zt(s):zt(a)&&zt(n)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const p={x:o,y:r}[t],g=c.getDomain(d,`${p}-lower`,"value",h).domain,m=c.getDomain(d,`${p}-upper`,"value",h).domain,y=[Math.min(...g,...m),Math.max(...g,...m)];return vC(y)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,zt(t.dataModel)&&zt(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes[Zn.X]?.scale,s=this.cartesianSeries.axes[Zn.Y]?.scale;if(!(!i||!s||!t))for(let o=0;o<t.length;o++){const{midPoint:a,xLower:n,xUpper:r,yLower:l,yUpper:c}=this.getDatum(t,o);if(a!=null){let h,d;zt(n)&&zt(r)&&(h={lowerPoint:{x:this.convert(i,n),y:a.y},upperPoint:{x:this.convert(i,r),y:a.y}}),zt(l)&&zt(c)&&(d={lowerPoint:{x:a.x,y:this.convert(s,l)},upperPoint:{x:a.x,y:this.convert(s,c)}}),t[o].xBar=h,t[o].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o}=this.properties,[a,n]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([t,s]=[s,t],[i,o]=[o,i],[a,n]=[n,a]),{xLowerKey:t,xUpperKey:i,xErrorsID:a,yLowerKey:s,yUpperKey:o,yErrorsID:n}}static getDatumKey(t,i,s){if(i==null)return;const a=Un(t)?.[i];if(a!=null){if(typeof a!="number"){pC.warnOnce(`Found [${i}] error value of type ${typeof a}. Expected number type`);return}return a+s}}getDatum(t,i){const{xLowerKey:s,xUpperKey:o,yLowerKey:a,yUpperKey:n}=this.getMaybeFlippedKeys(),r=t[i],l=r.cumulativeValue==null||!this.isStacked()?0:r.cumulativeValue-r.yValue,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:zr.getDatumKey(r,s,c),xUpper:zr.getDatumKey(r,o,c),yLower:zr.getDatumKey(r,a,h),yUpper:zr.getDatumKey(r,n,h)}}convert(t,i){const s=(t.bandwidth??0)/2;return t.convert(i)+s}update(){const t=this.getNodeData();t!=null&&(this.selection.update(t),this.selection.each((i,s,o)=>this.updateNode(i,s,o)))}updateNode(t,i,s){t.datum=i,t.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1,"none"),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:s}=t,o=this.groupNode.pickNode(i,s);if(o!=null)return{datum:o.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t,i){let s,o=[1/0,1/0];const a=[t.x,t.y];i===Zn.Y&&a.reverse();for(const n of this.groupNode.children()){const r=n.getBBox(),l=[r.x+r.width/2,r.y+r.height/2];i===Zn.Y&&l.reverse();const c=[];for(let h=0;h<a.length;h++)c.push(Math.abs(a[h]-l[h]));(c[0]<o[0]||c[0]==o[0]&&c[1]<o[1])&&(s=n.datum,o=c)}if(s)return{datum:s,distanceSquared:Math.pow(o[0],2)+Math.pow(o[1],2)}}getTooltipParams(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:o,xLowerName:a=t,xUpperName:n=i,yLowerName:r=s,yUpperName:l=o}=this.properties;return{xLowerKey:t,xLowerName:a,xUpperKey:i,xUpperName:n,yLowerKey:s,yLowerName:r,yUpperKey:o,yUpperName:l}}onToggleSeriesItem(t){this.groupNode.visible=t.visible}makeStyle(t){return{visible:t.visible,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity,cap:gC(this.properties.cap,t)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(t,i,s){const o=this.getNodeData();if(o!=null){for(let a=0;a<o.length;a++)if(t===o[a]){this.selection.at(a)?.update(i,this.properties,this.cartesianSeries,s,s?"highlighted-item":"unhighlighted-item");break}}}onHighlightChange(t){const{previousHighlight:i,currentHighlight:s}=t;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new SC}getWhiskerProperties(){const{stroke:t,strokeWidth:i,visible:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this.properties;return{stroke:t,strokeWidth:i,visible:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}}},jd={type:"series:plugin",name:"errorBar",chartType:"cartesian",seriesTypes:["bar","line","scatter"],enterprise:!0,version:hC,options:dC,themeTemplate:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{lengthRatio:{$if:[{$eq:[{$path:"../../type"},"bar"]},.3,1]}}},create:e=>new MC(e)};import{VERSION as kC}from"ag-charts-community";import{boolean as AC,color as IC,positiveNumber as ux,ratio as NC,strictUnion as LC}from"ag-charts-core";import{_ModuleSupport as TC}from"ag-charts-community";import{BaseProperties as CC,ChartAxisDirection as $d,CleanupRegistry as wC,Property as Ra,createElement as OC,setAttribute as EC,setElementBBox as PC,setElementStyle as RC}from"ag-charts-core";function _C(e){for(const t of[$d.X,$d.Y])for(const i of e.axisManager.getAxisContext(t))if(TC.BandScale.is(i.scale))return i}var Js=class extends CC{constructor(e){super(),this.ctx=e,this.enabled=!1,this.item="chart",this.color="#cfeeff",this.opacity=1,this.flashDuration=100,this.fadeDuration=900,this.cleanup=new wC,this.element=this.ctx.domManager.addChild("canvas-background","flashOnUpdate"),this.element.role="presentation";let t=!0;const i=s=>{t?t=!1:this.onDataUpdate(s)};this.cleanup.register(this.ctx.eventsHub.on("data:update",i),this.ctx.eventsHub.on("datamodel:diff",s=>this.onDataModelDiff(s)))}destroy(){this.ctx.domManager.removeChild("canvas-background","flashOnUpdate"),this.cleanup.flush()}clearFlash(){this.element.innerHTML="",clearTimeout(this.animationTimeout),this.animationTimeout=void 0}flashElem(e){const{flashDuration:t,fadeDuration:i}=this,s=t+i;e.animate([{background:this.color,offset:0},{background:this.color,offset:t/s},{background:"transparent",offset:1}],{duration:s,easing:"ease-out"})}flashCategoryBands(e){const t=_C(this.ctx);if(!t)return;this.clearFlash();const i=this.computeCategoryFlashBounds(t,e);for(const o of i){const a=OC("div");EC(a,"role","presentation"),RC(a,"position","absolute"),PC(a,o),this.element.appendChild(a),this.flashElem(a)}const s=this.flashDuration+this.fadeDuration;this.animationTimeout=setTimeout(()=>this.clearFlash(),s)}computeCategories(e){const t=new Set;for(const i of Object.keys(e))for(const s of["updated","added","moved"])for(const o of e[i][s])t.add(o);return t}computeCategoryFlashBounds(e,t){const i=this.ctx.widgets.seriesWidget.getBounds(),s=e.direction===$d.X?([n,r])=>({x:i.x+n,y:i.y,width:r-n,height:i.height}):([n,r])=>({x:i.x,y:i.y+n,width:i.width,height:r-n}),o=[],a=this.computeCategories(t);for(const n of a){const r=e.measureBand(n);r?.band&&o.push(s(r.band))}return o}onDataUpdate(e){!this.enabled||this.item!=="chart"||!e||this.flashElem(this.ctx.widgets.containerWidget.getElement())}onDataModelDiff(e){!this.enabled||this.item!=="category"||this.flashCategoryBands(e.diff)}};Js.className="FlashOnUpdate",u([Ra],Js.prototype,"enabled",2),u([Ra],Js.prototype,"item",2),u([Ra],Js.prototype,"color",2),u([Ra],Js.prototype,"opacity",2),u([Ra],Js.prototype,"flashDuration",2),u([Ra],Js.prototype,"fadeDuration",2);var px={type:"plugin",name:"flashOnUpdate",enterprise:!0,version:kC,options:{enabled:AC,item:LC()("chart","category"),color:IC,opacity:NC,flashDuration:ux,fadeDuration:ux},themeTemplate:{enabled:!1,item:"chart",color:"#cfeeff",opacity:1,flashDuration:100,fadeDuration:900},create:e=>new Js(e)};import{VERSION as zC}from"ag-charts-community";import{_ModuleSupport as gx}from"ag-charts-community";import{AbstractModuleInstance as BC,Logger as VC,ObserveChanges as Ud,Property as Kl,clamp as Yd}from"ag-charts-core";import{_ModuleSupport as Gl}from"ag-charts-community";import{AbstractModuleInstance as FC,ActionOnSet as mx,Logger as HC,Padding as KC,Property as Xd,ProxyProperty as yx,ZIndexMap as Vo,calcLineHeight as GC}from"ag-charts-core";import{_ModuleSupport as WC}from"ag-charts-community";import{SceneChangeDetection as fx,getPath2D as jC}from"ag-charts-core";var{TranslatableGroup:$C}=WC,Zd=class extends $C{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:o,y:a,width:n,height:r}=t,l=jC(),c=new l;c.roundRect(o+s,a+s,n-2*s,r-2*s,i),e.clip(c)}};u([fx()],Zd.prototype,"inset",2),u([fx()],Zd.prototype,"cornerRadius",2);var{CategoryAxis:UC,Group:Fo,BBox:xx,stackCartesianSeries:YC}=Gl,Qd=class{constructor(){this.top=0,this.bottom=0}};u([Xd],Qd.prototype,"top",2),u([Xd],Qd.prototype,"bottom",2);var _a=class extends FC{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new Qd,this.root=new Fo({name:"root"}),this.seriesRoot=this.root.appendChild(new Zd({name:"Series-root",zIndex:Vo.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Fo({name:"Axes-Grids",zIndex:Vo.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Fo({name:"Axes-Grids",zIndex:Vo.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Fo({name:"Axes-Labels",zIndex:Vo.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Fo({name:"Axes-Crosslines-Range",zIndex:Vo.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Fo({name:"Axes-Crosslines-Line",zIndex:Vo.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Fo({name:"Axes-Crosslines-Label",zIndex:Vo.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=new Gl.ChartAxes,this.series=[],this.cleanup.register(this.ctx.eventsHub.on("data:update",t=>this.updateData(t)))}destroy(){this._destroyed||(super.destroy(),this.destroySeries(this.series),this.axes.destroy(),this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(s=>!e.includes(s))??[];this.destroySeries(i);for(const s of e)t?.includes(s)||(s.attachSeries(this.seriesRoot,this.seriesRoot,void 0),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!1}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled"));this.seriesRect=void 0}destroySeries(e){if(e)for(const t of e)t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)}assignAxesToSeries(){const e={};for(const t of this.axes){const i=t.direction;(e[i]??(e[i]=[])).push(t)}for(const t of this.series)for(const i of t.directions){const s=t.getKeyAxis(i)??i,o=this.axes.findById(s);if(!o){HC.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}t.axes[i]=o}}updateData(e){for(const t of this.series)t.setChartData(e);this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready";for(const t of this.series)t.resetAnimation("disabled")})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(async t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new KC;if(!this.enabled)return e;for(const{position:t,thickness:i,line:s,label:o}of this.axes){if(t==null)continue;let a;i?a=i:a=(s.enabled?s.width:0)+(o.enabled?GC(o.fontSize??0)+o.spacing:0),e[t]=Math.ceil(a)}return e}async layout(e,t){var i;const{padding:s}=this,o=this.seriesRect!=null,a=new xx(0,0,e,t-(s.top+s.bottom)),n=this.seriesRect?.width!==e||this.seriesRect?.height!==t;this.seriesRect=a,this.seriesRoot.translationY=s.top,this.seriesRoot.setClipRectCanvasSpace(new xx(0,-s.top,e,t));for(const r of this.axes){const{position:l="left"}=r;switch(l){case"top":case"bottom":r.range=[0,a.width],r.gridLength=a.height;break;case"right":case"left":{const c=r instanceof UC;r.range=c?[0,a.height]:[a.height,0],r.gridLength=a.width;break}}if(r.gridPadding=0,r.translation.x=0,r.translation.y=0,l==="right"?r.translation.x=e:l==="bottom"&&(r.translation.y=t),o||r.resetAnimation("initial"),r.crossLines)for(const c of r.crossLines)c instanceof Gl.CartesianCrossLine&&(c.position=r.position??"top",(i=c.label).parallel??(i.parallel=r.label?.parallel));r.calculateLayout(),r.update()}n&&YC(this.series),await Promise.all(this.series.map(async r=>r.update({seriesRect:a})))}};u([Xd],_a.prototype,"enabled",2),u([yx(["seriesRoot","inset"])],_a.prototype,"inset",2),u([yx(["seriesRoot","cornerRadius"])],_a.prototype,"cornerRadius",2),u([mx({changeValue(e,t=new Gl.ChartAxes){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],_a.prototype,"axes",2),u([mx({changeValue(e,t){this.onSeriesChange(e,t)}})],_a.prototype,"series",2);import{_ModuleSupport as XC}from"ag-charts-community";import{clamp as ZC}from"ag-charts-core";var{SliderWidget:Sx}=XC,QC=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const o=this.sliders[i];o.step=Sx.STEP_HUNDRETH,o.keyboardStep=Sx.STEP_ONE,o.orientation="horizontal",o.setPreventsDefault(!1),o.addListener("drag-start",a=>this.onDragStart(i,a,s)),o.addListener("drag-move",a=>this.onDrag(o,a,s)),o.addListener("drag-end",()=>this.updateSliderRatios()),o.addListener("contextmenu",a=>this.onContextMenu(o,a))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;e==null||t==null||this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"navigatorDOM"},{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(e*100)/100,t=Math.round(t*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const s=this.sliders[e],o=this.toolbar.cssLeft(),a=s.cssLeft();this.dragStartX=o+a+t.offsetX,this.moveToFront(e),t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:s}=t,{x:o,y:a}=this.toolbar.getBounds(),{x:n,y:r}=e.getBounds(),l=i+o+n,c=s+a+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=ZC(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}};import{_ModuleSupport as bx}from"ag-charts-community";import{Property as Wl,SceneChangeDetection as jl}from"ag-charts-core";var{BBox:qC,ExtendedPath2D:JC}=bx,eo=class extends bx.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new JC}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,s,o,a,n,r,l){const c=e.align(i+o*n)+l,h=c+e.align(i+o*n,o*(r-n))-2*l,d=e.align(s+a/2);e.setCenter(c,d),t.setCenter(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this,o=e-i/2,a=t-s/2;return new qC(o,a,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:o,cornerRadius:a,grip:n}=this,r=o/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(e-c+r,t-h+r,2*(c-r),2*(h-r),a);const d=3;if(n)for(let p=-.5;p<=.5;p+=1)for(let g=-1;g<=1;g+=1)s.arc(e+p*d,t+g*d,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};eo.className="RangeHandle",u([Wl,jl()],eo.prototype,"width",2),u([Wl,jl()],eo.prototype,"height",2),u([Wl,jl()],eo.prototype,"cornerRadius",2),u([Wl,jl()],eo.prototype,"grip",2);import{_ModuleSupport as ew}from"ag-charts-community";import{Property as tw,SceneChangeDetection as iw}from"ag-charts-core";var{Path:sw,BBox:qd,ExtendedPath2D:ow,clippedRoundRect:aw}=ew,Jd=class extends sw{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new ow}layout(e,t,i,s,o,a){o=Number.isNaN(o)?this.min:o,a=Number.isNaN(a)?this.max:a,(e!==this.x||t!==this.y||i!==this.width||this.height!==s||o!==this.min||a!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=s,this.min=o,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new qd(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:o,max:a}=this,n=e+i*o,r=e+i*a;return new qd(n,t,r-n,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:o,height:a,min:n,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const d=this.align(i)+h,p=this.align(s)+h,g=this.align(i,o)-2*h,m=this.align(s,a)-2*h,y=this.align(i+o*n)+h,S=y+this.align(i+o*n,o*(r-n))-2*h,x={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},b=(f,D,v)=>{if(v-D<1)return;const M=new qd(D,p,v-D,m);aw(f,d,p,g,m,x,M)};b(e,d,y),b(e,S,g+d),b(t,y,S)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};Jd.className="RangeMask",u([tw,iw()],Jd.prototype,"cornerRadius",2);import{_ModuleSupport as eu}from"ag-charts-community";import{ZIndexMap as nw}from"ag-charts-core";var rw=class extends eu.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:nw.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new eu.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,o,a){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=o,this.rOffset=a,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){e?.remove(),t!=null&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:o,rOffset:a}=this;return new eu.BBox(e-o,t,i+(o+a),s)}},za=class extends BC{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new Jd,this.minHandle=new eo,this.maxHandle=new eo,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new rw([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",()=>this.updateZoom()),e.layoutManager.registerElement(gx.LayoutElement.Navigator,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",t=>this.onZoomChange(t))),this.domProxy=new QC(e,this),this.updateGroupVisibility(),this.miniChart=new _a(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"navigator"},{x:{min:0,max:1}}))}onLayoutStart({layoutBox:e}){if(this.enabled){const t=this.height+this.spacing;e.shrink(t,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:o}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:a,_max:n}=this.domProxy;this.layoutNodes(t,s,i,o,a,n),this.domProxy.updateBounds({x:t,y:s,width:i,height:o})}this.x=t,this.width=i,this.miniChart?.layout(i,o).catch(a=>VC.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(gx.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:o}=this,{minRange:a}=this.domProxy;let{_min:n,_max:r}=this.domProxy;const l=(t-s)/o;if(e==="min")n=Yd(0,l,r-a);else if(e==="max")r=Yd(n+a,l,1);else if(e==="pan"&&i!=null){const c=r-n;n=Yd(0,l-i,1-c),r=n+c}this.domProxy._min=n,this.domProxy._max=r,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:o,height:a}=this,{min:n,max:r}=t;this.domProxy.updateMinMax(n,r),this.layoutNodes(i,s,o,a,n,r)}layoutNodes(e,t,i,s,o,a){const{rangeSelector:n,mask:r,minHandle:l,maxHandle:c}=this;r.layout(e,t,i,s,o,a),n.layout(e,t,i,s,l.width/2,c.width/2),eo.align(l,c,e,t,i,s,o,a,r.strokeWidth/2),o+(a-o)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3);for(const[h,d]of[l,this.maskVisibleRange,c].entries()){const p=d.getBBox(),g={x:p.x-e,y:p.y-t,height:p.height,width:p.width};this.domProxy.updateSliderBounds(h,g)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}async processData(e){return this.miniChart?.processData(e)}};u([Ud((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],za.prototype,"miniChart",2),u([Kl,Ud((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],za.prototype,"enabled",2),u([Kl],za.prototype,"height",2),u([Kl,Ud((e,t)=>{e.mask.cornerRadius=t})],za.prototype,"cornerRadius",2),u([Kl],za.prototype,"spacing",2);import{AreaSeriesModule as lw,BarSeriesModule as cw,BubbleSeriesModule as hw,HistogramSeriesModule as dw,LineSeriesModule as uw,ScatterSeriesModule as pw}from"ag-charts-community";import{array as gw,arrayOfDefs as mw,boolean as qn,callbackOf as yw,color as $l,fontOptionsDef as fw,number as vx,numberFormatValidator as xw,positiveNumber as yi,ratio as Sw,textOrSegments as bw,typeUnion as vw,without as Yt}from"ag-charts-core";import{CartesianChartModule as Dw,VERSION as Mw,_ModuleSupport as kw}from"ag-charts-community";import{ChartAxisDirection as Ul,DIRECTION_SWAP_AXES as Aw}from"ag-charts-core";import{_ModuleSupport as to}from"ag-charts-community";import{ChartAxisDirection as Iw,deepClone as Nw,mergeDefaults as tu}from"ag-charts-core";function Lw(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function Tw(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as Cw}from"ag-charts-community";import{SceneArrayChangeDetection as ww,SceneChangeDetection as nt}from"ag-charts-core";var{Path:Ow,Scalable:Ew,ExtendedPath2D:Pw,BBox:Ho,clippedRoundRect:Dx}=Cw,We=class extends Ew(Ow){constructor(){super(...arguments),this.wickPath=new Pw,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:e,center:t,thickness:i,min:s,max:o}=this;return e?new Ho(Math.min(s,o),t-i/2,Math.abs(o-s),i):new Ho(t-i/2,Math.min(s,o),i,Math.abs(o-s))}computeDefaultGradientFillBBox(){const{horizontal:e,center:t,thickness:i,q1:s,q3:o}=this;return e?new Ho(Math.min(s,o),t-i/2,Math.abs(o-s),i):new Ho(t-i/2,Math.min(s,o),i,Math.abs(o-s))}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:e,crisp:t}=this;let{center:i,min:s,q1:o,median:a,q3:n,max:r}=this,l=i-e/2,c=i+e/2;if(t&&e>1){s=this.align(s),o=this.align(o),a=this.align(a),n=this.align(n),r=s+this.align(s,r-s);const h=this.align(e/2);i=this.align(i),l=i-h,c=i+h}return{center:i,x0:l,x1:c,min:s,max:r,q1:o,median:a,q3:n}}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,wickStroke:n,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d,cornerRadius:p,capLengthRatio:g,horizontal:m}=this,{center:y,x0:S,x1:x,min:b,max:f,q1:D,median:v,q3:M}=this.alignedCoordinates(),A=this.layerManager?.canvas.pixelRatio??1,I=this.wickStrokeAlignment>0?A/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const N=n!=null&&n!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==o||h!=null&&h!==a?this.wickPath:e;if(Math.abs(x-S)<=3){Ba(N,m,y,b),Va(N,m,y,f);return}const L=Math.min(b,f),T=Math.max(b,f),P=Math.min(D,M),O=Math.max(D,M),C=y-Math.abs((x-S)*g)/2,R=y+Math.abs((x-S)*g)/2;Ba(N,m,C,L-I),Va(N,m,R,L-I),Ba(N,m,y-I,L-I),Va(N,m,y-I,P+i/2),Ba(N,m,y-I,T+I),Va(N,m,y-I,O-i/2),Ba(N,m,C,T+I),Va(N,m,R,T+I);const V=i/2+d,E=i/2-d,w=O-P-2*E;if(w>0){const z=S+V,B=P+E,K=x-S-2*V,_={topLeft:p,topRight:p,bottomRight:p,bottomLeft:p};Mx(e,m,z,B,K,w,_,new Ho(z,B,K,v-B)),Mx(e,m,z,B,K,w,_,new Ho(z,v,K,B+w-v))}else{const z=(P+O)/2;Ba(e,m,S,z),Va(e,m,x,z)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=o,wickLineDash:h=a,wickLineDashOffset:d=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};u([nt()],We.prototype,"horizontal",2),u([nt()],We.prototype,"center",2),u([nt()],We.prototype,"thickness",2),u([nt()],We.prototype,"min",2),u([nt()],We.prototype,"q1",2),u([nt()],We.prototype,"median",2),u([nt()],We.prototype,"q3",2),u([nt()],We.prototype,"max",2),u([nt()],We.prototype,"cornerRadius",2),u([nt()],We.prototype,"crisp",2),u([nt()],We.prototype,"strokeAlignment",2),u([nt()],We.prototype,"wickStroke",2),u([nt()],We.prototype,"wickStrokeWidth",2),u([nt()],We.prototype,"wickStrokeOpacity",2),u([ww()],We.prototype,"wickLineDash",2),u([nt()],We.prototype,"wickLineDashOffset",2),u([nt()],We.prototype,"capLengthRatio",2),u([nt()],We.prototype,"wickStrokeAlignment",2);function Ba(e,t,i,s){t?e.moveTo(s,i):e.moveTo(i,s)}function Va(e,t,i,s){t?e.lineTo(s,i):e.lineTo(i,s)}function Mx(e,t,i,s,o,a,n,r){t?Dx(e,s,i,a,o,n,r==null?void 0:new Ho(r.y,r.x,r.height,r.width)):Dx(e,i,s,o,a,n,r)}import{_ModuleSupport as Rw}from"ag-charts-community";import{BaseProperties as kx,Property as J,mergeDefaults as _w}from"ag-charts-core";var{AbstractBarSeriesProperties:zw,makeSeriesTooltip:Bw}=Rw,Ax=class extends kx{constructor(){super(...arguments),this.lengthRatio=.5}};u([J],Ax.prototype,"lengthRatio",2);var Fa=class extends kx{};u([J],Fa.prototype,"stroke",2),u([J],Fa.prototype,"strokeWidth",2),u([J],Fa.prototype,"strokeOpacity",2),u([J],Fa.prototype,"lineDash",2),u([J],Fa.prototype,"lineDashOffset",2);var le=class extends zw{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new Ax,this.whisker=new Fa,this.tooltip=Bw()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}=this,a=super.toJson();return a.whisker=_w(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}),a}};u([J],le.prototype,"xKey",2),u([J],le.prototype,"minKey",2),u([J],le.prototype,"q1Key",2),u([J],le.prototype,"medianKey",2),u([J],le.prototype,"q3Key",2),u([J],le.prototype,"maxKey",2),u([J],le.prototype,"xName",2),u([J],le.prototype,"yName",2),u([J],le.prototype,"minName",2),u([J],le.prototype,"q1Name",2),u([J],le.prototype,"medianName",2),u([J],le.prototype,"q3Name",2),u([J],le.prototype,"maxName",2),u([J],le.prototype,"fill",2),u([J],le.prototype,"fillOpacity",2),u([J],le.prototype,"stroke",2),u([J],le.prototype,"strokeWidth",2),u([J],le.prototype,"strokeOpacity",2),u([J],le.prototype,"lineDash",2),u([J],le.prototype,"lineDashOffset",2),u([J],le.prototype,"cornerRadius",2),u([J],le.prototype,"styler",2),u([J],le.prototype,"itemStyler",2),u([J],le.prototype,"cap",2),u([J],le.prototype,"whisker",2),u([J],le.prototype,"tooltip",2);var{fixNumericExtent:Vw,keyProperty:Fw,SeriesNodePickMode:Ix,SMALLEST_KEY_INTERVAL:Hw,valueProperty:Jn,diff:Kw,animationValidation:Gw,computeBarFocusBounds:Ww,createDatumId:Nx,HighlightState:iu,motion:Lx,getItemStyles:jw,calculateSegments:$w,toHighlightString:Uw,processedDataIsAnimatable:Yw,upsertNodeDatum:Xw}=to,Zw=class extends to.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},su=class extends to.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Ix.NEAREST_NODE,Ix.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new le,this.NodeEvent=Zw}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:o,q3Key:a,maxKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:p}=this.getScaleInformation({xScale:l,yScale:c}),g=[];this.needsDataModelDiff()&&this.processedData&&g.push(Kw(this.id,this.processedData)),r&&g.push(Gw());const m=this.properties.allowNullKeys??!1,{processedData:y}=await this.requestDataModel(e,this.data,{props:[Fw(t,d,{id:"xValue",allowNullKey:m}),Jn(i,p,{id:"minValue"}),Jn(s,p,{id:"q1Value"}),Jn(o,p,{id:"medianValue"}),Jn(a,p,{id:"q3Value"}),Jn(n,p,{id:"maxValue"}),...h?[Hw]:[],...g]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{index:o,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[o];if(a.type==="key"&&a.valueType==="category"){const r=i.getKeySortMetadata(this,"xValue",t);return{domain:n,sortMetadata:r}}return{domain:this.padBandExtent(n)}}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return{domain:Vw(s)}}getSeriesRange(e,t){return this.domainForVisibleRange(Iw.Y,["maxValue","minValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:o}=this;if(!i||!s)return;const a=o?.nodeData!=null&&s.changeDescription!=null,n=!this.ctx.animationManager.isSkipped(),{groupOffset:r,barOffset:l,barWidth:c}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:s.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",s),minValues:i.resolveColumnById(this,"minValue",s),q1Values:i.resolveColumnById(this,"q1Value",s),medianValues:i.resolveColumnById(this,"medianValue",s),q3Values:i.resolveColumnById(this,"q3Value",s),maxValues:i.resolveColumnById(this,"maxValue",s),xScale:e.scale,yScale:t.scale,groupOffset:r,barOffset:l,barWidth:c,isVertical:this.isVertical(),xKey:this.properties.xKey,animationEnabled:n,canIncrementallyUpdate:a,nodes:a?o.nodeData:[],nodeIndex:0}}validateBoxPlotValues(e,t,i,s,o){return[e,t,i,s,o].every(a=>typeof a=="number")&&e<=t&&t<=i&&i<=s&&s<=o}computeScaledValues(e,t,i){const s=e.xScale.convert(e.xValues[i]);return Number.isFinite(s)?(t.xValue=s+e.groupOffset+e.barOffset+e.barWidth/2,t.minValue=e.yScale.convert(e.minValues[i]),t.q1Value=e.yScale.convert(e.q1Values[i]),t.medianValue=e.yScale.convert(e.medianValues[i]),t.q3Value=e.yScale.convert(e.q3Values[i]),t.maxValue=e.yScale.convert(e.maxValues[i]),!0):!1}createSkeletonNodeDatum(e,t){return{series:this,datum:t.datum,datumIndex:t.datumIndex,xKey:e.xKey,bandwidth:e.barWidth,scaledValues:{xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},midPoint:{x:0,y:0},focusRect:{x:0,y:0,width:0,height:0}}}updateNodeDatum(e,t,i){const{isVertical:s,barWidth:o}=e,a=i.scaledValues,n=t;n.datum=i.datum,n.datumIndex=i.datumIndex,n.bandwidth=o;const r=n.scaledValues;r.xValue=a.xValue,r.minValue=a.minValue,r.q1Value=a.q1Value,r.medianValue=a.medianValue,r.q3Value=a.q3Value,r.maxValue=a.maxValue;const l=Math.abs(a.q3Value-a.q1Value),c=a.xValue,h=Math.min(a.q3Value,a.q1Value)+l/2,d=s?c:h,p=s?h:c;n.midPoint?(n.midPoint.x=d,n.midPoint.y=p):n.midPoint={x:d,y:p};const g=n.focusRect;s?(g.x=d-o/2,g.y=a.minValue,g.width=o,g.height=a.maxValue-a.minValue):(g.x=a.minValue,g.y=p-o/2,g.width=a.maxValue-a.minValue,g.height=o)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}initializeResult(e){return{itemId:this.properties.xKey,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),visible:this.visible,groupScale:void 0,styles:void 0,segments:void 0}}populateNodeData(e){const t={xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},i={datumIndex:0,datum:void 0,scaledValues:t};for(let s=0;s<e.rawData.length;s++){const o=e.rawData[s];if(e.xValues[s]===void 0&&!this.properties.allowNullKeys)continue;const n=e.minValues[s],r=e.q1Values[s],l=e.medianValues[s],c=e.q3Values[s],h=e.maxValues[s];this.validateBoxPlotValues(n,r,l,c,h)&&this.computeScaledValues(e,t,s)&&(i.datumIndex=s,i.datum=o,Xw(e,i,(d,p)=>this.createNodeDatum(d,p),(d,p,g)=>this.updateNodeDatum(d,p,g)))}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}assembleResult(e,t){const i=$w(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene);return t.groupScale=this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),t.styles=jw(this.getItemStyle.bind(this)),t.segments=i,t}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this.getStyle(!1,iu.None);return{marker:{fill:Nw(e),fillOpacity:s,stroke:t,strokeOpacity:o,strokeWidth:i,lineDash:a,lineDashOffset:n}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:a,showInLegend:n,legendItemName:r}=this.properties;return!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:r??a??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!n}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:p,q3Name:g,minKey:m,minName:y,maxKey:S,maxName:x,legendItemName:b,tooltip:f}=o,D=this.getCategoryAxis(),v=this.getValueAxis();if(!i||!s||!D||!v)return;const M=s.dataSources.get(this.id)?.data[e],A=i.resolveKeysById(this,"xValue",s)[e],I=i.resolveColumnById(this,"minValue",s)[e],k=i.resolveColumnById(this,"q1Value",s)[e],N=i.resolveColumnById(this,"medianValue",s)[e],L=i.resolveColumnById(this,"q3Value",s)[e],T=i.resolveColumnById(this,"maxValue",s)[e],P=this.properties.allowNullKeys??!1;if(A===void 0&&!P)return;const O=this.getItemStyle(e,!1),C=[{label:y,fallbackLabel:m,value:this.getAxisValueText(v,"tooltip",I,M,m,b),missing:to.isTooltipValueMissing(I)},{label:d,fallbackLabel:h,value:this.getAxisValueText(v,"tooltip",k,M,h,b),missing:to.isTooltipValueMissing(k)},{label:c,fallbackLabel:l,value:this.getAxisValueText(v,"tooltip",N,M,l,b),missing:to.isTooltipValueMissing(N)},{label:g,fallbackLabel:p,value:this.getAxisValueText(v,"tooltip",L,M,p,b),missing:to.isTooltipValueMissing(L)},{label:x,fallbackLabel:S,value:this.getAxisValueText(v,"tooltip",T,M,S,b),missing:to.isTooltipValueMissing(T)}];return this.formatTooltipWithContext(f,{heading:this.getAxisValueText(D,"tooltip",A,M,a,b),title:b??r,symbol:this.legendItemSymbol(),data:C},{seriesId:t,datum:M,title:r,xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:p,q3Name:g,minKey:m,minName:y,maxKey:S,maxName:x,...O})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=Lw(t);Lx.resetMotion([e],Tw(t)),Lx.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return Yw(this.processedData)?e.datumSelection.update(t,void 0,i=>Nx(i.datumIndex)):e.datumSelection.update(t)}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,cap:{lengthRatio:s},fill:o,fillOpacity:a,lineDash:n,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,maxKey:d,maxName:p,medianKey:g,medianName:m,minKey:y,minName:S,q1Key:x,q1Name:b,q3Key:f,q3Name:D,whisker:{lineDash:v,lineDashOffset:M,stroke:A,strokeOpacity:I,strokeWidth:k},xKey:N,xName:L,yName:T}=this.properties,P=Uw(e??iu.None);return{cap:{lengthRatio:s},cornerRadius:i,fill:o,fillOpacity:a,highlightState:P,lineDash:n,lineDashOffset:r,maxKey:d,maxName:p??d,medianKey:g,medianName:m??g,minKey:y,minName:S??y,q1Key:x,q1Name:b??x,q3Key:f,q3Name:D??f,seriesId:t,stroke:l,strokeOpacity:c,strokeWidth:h,whisker:{lineDash:v??n,lineDashOffset:M??r,stroke:A??l,strokeOpacity:I??c,strokeWidth:k??h},xKey:N,xName:L??N,yName:T}}getStyle(e,t){const{cap:i,cornerRadius:s,fill:o,fillOpacity:a,lineDash:n,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,styler:d,whisker:p}=this.properties;let g={};if(!e&&d){const m=this.makeStylerParams(t);g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(d,m)??{},{pick:!1})??{}}return{cornerRadius:g.cornerRadius??s,fill:g.fill??o,fillOpacity:g.fillOpacity??a,lineDash:g.lineDash??n,lineDashOffset:g.lineDashOffset??r,opacity:1,stroke:g.stroke??l,strokeOpacity:g.strokeOpacity??c,strokeWidth:g.strokeWidth??h,cap:{lengthRatio:g.cap?.lengthRatio??i.lengthRatio},whisker:{lineDash:g.whisker?.lineDash??p.lineDash,lineDashOffset:g.whisker?.lineDashOffset??p.lineDashOffset,stroke:g.whisker?.stroke??p.stroke,strokeOpacity:g.whisker?.strokeOpacity??p.strokeOpacity,strokeWidth:g.whisker?.strokeWidth??p.strokeWidth}}}getItemStyle(e,t,i){const{properties:s}=this,{itemStyler:o}=s,a=this.getHighlightStyle(t,e,i);let n=tu(a,this.getStyle(e===void 0,i));if(o!=null&&e!=null){const p=this.cachedDatumCallback(Nx(e,t?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,t,n);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,g))});p&&(n=tu(p,n))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=n;return n.whisker=tu(n.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}),n}makeItemStylerParams(e,t,i){const{id:s}=this,{xKey:o,minKey:a,q1Key:n,medianKey:r,q3Key:l,maxKey:c}=this.properties,h=this.processedData?.dataSources.get(s)?.data[e],d=this.ctx.highlightManager?.getActiveHighlight(),p=this.getHighlightStateString(d,t,e),g=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:h,xKey:o,minKey:a,q1Key:n,medianKey:r,q3Key:l,maxKey:c,highlightState:p,...i,fill:g}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex);o.style=this.getItemStyle(o.datumIndex,t,a)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const o=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),n=this.getShapeFillBBox(),r=this.getStyle(!1,iu.None).strokeWidth/2,l=s.whisker.strokeWidth??s.strokeWidth;e.each((c,h)=>{const d=h.style??i.styles[this.getHighlightState(a,t,h.datumIndex)];c.setFillProperties(d.fill,n);const p=d.opacity??1,g=d.whisker?.strokeOpacity??d.strokeOpacity;c.fill=d.fill,c.fillOpacity=d.fillOpacity*p,c.stroke=d.stroke,c.strokeWidth=d.strokeWidth,c.strokeOpacity=d.strokeOpacity*p,c.lineDash=d.lineDash,c.lineDashOffset=d.lineDashOffset,c.wickStroke=d.whisker.stroke,c.wickStrokeWidth=d.whisker.strokeWidth,c.wickStrokeOpacity=g*p,c.wickLineDash=d.whisker.lineDash,c.wickLineDashOffset=d.whisker.lineDashOffset,c.cornerRadius=d.cornerRadius,c.crisp=!0,c.horizontal=!o,c.center=h.scaledValues.xValue,c.thickness=h.bandwidth,c.min=h.scaledValues.minValue,c.q1=h.scaledValues.q1Value,c.median=h.scaledValues.medianValue,c.q3=h.scaledValues.q3Value,c.max=h.scaledValues.maxValue,c.capLengthRatio=d.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new We}computeFocusBounds({datumIndex:e}){return Ww(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};su.className="BoxPlotSeries",su.type="box-plot";import{_ModuleSupport as Qw}from"ag-charts-community";import{boolean as qw,commonSeriesOptionsDefs as Jw,constant as eO,positiveNumberNonZero as tO,ratio as iO,required as Ko,shapeSegmentation as sO,string as xt}from"ag-charts-core";var{boxPlotSeriesThemeableOptionsDef:oO}=Qw,aO={...Jw,...oO,type:Ko(eO("box-plot")),xKey:Ko(xt),minKey:Ko(xt),q1Key:Ko(xt),medianKey:Ko(xt),q3Key:Ko(xt),maxKey:Ko(xt),xKeyAxis:xt,yKeyAxis:xt,xName:xt,yName:xt,minName:xt,q1Name:xt,medianName:xt,q3Name:xt,maxName:xt,grouped:qw,legendItemName:xt,segmentation:sO,width:tO,widthRatio:iO};import{CARTESIAN_AXIS_TYPE as Tx,FILL_GRADIENT_LINEAR_DEFAULTS as nO,FILL_IMAGE_DEFAULTS as rO,FILL_PATTERN_DEFAULTS as lO,SAFE_FILL_OPERATION as cO,SEGMENTATION_DEFAULTS as hO}from"ag-charts-core";var dO={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[cO,{$ref:"chartBackgroundColor"},.7]}]},["gradient",nO],["image",rO],["pattern",lO]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:{unhighlightedItem:{opacity:.5},unhighlightedSeries:{opacity:.1}},segmentation:hO},axes:{[Tx.NUMBER]:{crosshair:{snap:!1}},[Tx.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{predictCartesianNonPrimitiveAxis:uO}=kw,ou={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,groupable:!0,version:Mw,dependencies:[Dw],options:aO,matchingKeys:["xKey","lowKey","q1Key","medianKey","q3Key","highKey","outlierKey","normalizedTo"],predictAxis:uO,defaultAxes:Aw,axisKeys:{[Ul.X]:"xKeyAxis",[Ul.Y]:"yKeyAxis"},axisKeysFlipped:{[Ul.X]:"yKeyAxis",[Ul.Y]:"xKeyAxis"},themeTemplate:dO,create:e=>new su(e)};import{CartesianChartModule as pO,VERSION as gO,_ModuleSupport as mO}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as Cx,CARTESIAN_POSITION as wx,ChartAxisDirection as Ox}from"ag-charts-core";import"ag-charts-community";import{isGradientFill as Ex,isImageFill as au,isPatternFill as nu}from"ag-charts-core";import{_ModuleSupport as Go}from"ag-charts-community";import{AGGREGATION_INDEX_X_MAX as yO,AGGREGATION_INDEX_X_MIN as fO,AGGREGATION_INDEX_Y_MAX as xO,AGGREGATION_INDEX_Y_MIN as SO,AGGREGATION_SPAN as bO,ChartAxisDirection as ru,DebugMetrics as vO,Logger as Px,mergeDefaults as Rx}from"ag-charts-core";import"ag-charts-community";import{aggregationDomain as lu,computeExtremesAggregation as _x,computeExtremesAggregationPartial as DO,simpleMemorize2 as MO}from"ag-charts-core";function kO(e,t,i,s,o,a,n,r){const[l,c]=lu(e,o);return _x([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:n,yNeedsValueOf:r})}var AO=MO(kO);function IO(e,t,i,s,o){const a=t.resolveKeysById(s,"xValue",i),n=t.resolveColumnById(s,"highValue",i),r=t.resolveColumnById(s,"lowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i);if(o){const[d,p]=lu(e,l);return _x([d,p],a,n,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:o})}return AO(e,a,n,r,l,i.reduced?.smallestKeyInterval,c,h)}function NO(e,t,i,s,o,a){const n=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"highValue",i),l=t.resolveColumnById(s,"lowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i),[p,g]=lu(e,c);return DO([p,g],n,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:o,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:a})}import{_ModuleSupport as LO}from"ag-charts-community";import{DeclaredSceneChangeDetection as io}from"ag-charts-core";var{Path:TO,BBox:CO}=LO,vs=class extends TO{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}setStaticProperties(e,t,i,s,o,a,n){this.__centerX=e,this.__width=t,this.__y=i,this.__height=s,this.__yOpen=o,this.__yClose=a,this.__crisp=n,this.dirtyPath=!0,this.markDirty()}computeBBox(){const{__centerX:e,__y:t,__width:i,__height:s}=this;return new CO(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.__centerX,y:this.__y+this.__height/2}}alignedCoordinates(){const{__y:e,__width:t,__height:i,__crisp:s}=this;let{__centerX:o,__yOpen:a,__yClose:n}=this,r=o-t/2,l=o+t/2,c=e,h=e+i;if(s&&t>1){if(o=this.align(o),a<=n){const p=this.align(a,n-a);a=this.align(a),n=a+p}else{const p=this.align(n,a-n);n=this.align(n),a=n+p}const d=this.align(t/2);r=o-d,l=o+d,c=this.align(e),h=c+this.align(c,i)}return{centerX:o,x0:r,x1:l,y0:c,y1:h,yOpen:a,yClose:n}}executeStroke(e,t){const{__width:i,strokeWidth:s}=this;i<s&&(e.lineWidth=i),super.executeStroke(e,t)}};u([io()],vs.prototype,"centerX",2),u([io()],vs.prototype,"y",2),u([io()],vs.prototype,"width",2),u([io()],vs.prototype,"height",2),u([io()],vs.prototype,"yOpen",2),u([io()],vs.prototype,"yClose",2),u([io()],vs.prototype,"crisp",2);var zx=class extends vs{constructor(){super(...arguments),this.strokeAlignment=0}updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:s,y0:o,y1:a,yOpen:n,yClose:r}=this.alignedCoordinates(),l=this.layerManager?.canvas.pixelRatio??1,c=this.__strokeAlignment>0?l/this.__strokeAlignment/2%1:0;e.clear(),e.moveTo(t-c,o),e.lineTo(t-c,a),Math.abs(s-i)>1&&(e.moveTo(i,n-c),e.lineTo(t-c,n-c),e.moveTo(t-c,r-c),e.lineTo(s,r-c))}};u([io()],zx.prototype,"strokeAlignment",2);var wO=fO,OO=xO,EO=SO,Bx=yO,Vx=bO,{AggregationManager:PO,fixNumericExtent:RO,keyProperty:_O,createDatumId:cu,SeriesNodePickMode:Fx,SMALLEST_KEY_INTERVAL:zO,valueProperty:Yl,diff:BO,animationValidation:VO,computeBarFocusBounds:FO,visibleRangeIndices:Hx,BandScale:HO,processedDataIsAnimatable:hu,getItemStylesPerItemId:KO}=Go,GO=class extends Go.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}};function WO(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const o of i){const a=o.datum;a!=null&&o.setStaticProperties(a.centerX,a.width,a.y,a.height,a.yOpen,a.yClose,a.crisp)}t.cleanup()})}}var Kx=class extends Go.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Fx.AXIS_ALIGNED,Fx.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=GO,this.aggregationManager=new PO}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:o,lowKey:a}=this.properties,n=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),p=[];this.needsDataModelDiff()&&this.processedData&&p.push(BO(this.id,this.processedData)),n&&p.push(VO()),i&&p.push(Yl(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const g=this.properties.allowNullKeys??!1,{dataModel:m,processedData:y}=await this.requestDataModel(e,this.data,{props:[_O(t,h,{id:"xValue",allowNullKey:g}),Yl(s,d,{id:"closeValue"}),Yl(o,d,{id:"highValue"}),Yl(a,d,{id:"lowValue"}),...c?[zO]:[],...p]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.aggregateData(m,y),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||hu(t))return;const i=this.axes[ru.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>NO(i.scale.type,e,t,this,s,a),computeFull:a=>IO(i.scale.type,e,t,this,a),targetRange:s});const o=this.aggregationManager.filters;o&&o.length>0&&vO.record(`${this.type}:aggregation`,o.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes[ru.X];if(!e)return-1;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return o.type==="key"&&o.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}const s=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return{domain:RO(s)}}getSeriesRange(e,t){return this.domainForVisibleRange(ru.Y,["highValue","lowValue"],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}buildDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const o=s.dataSources.get(this.id)?.data??[];if(o.length===0)return;const a=e.scale,n=t.scale,r=HO.is(a),[l,c]=a.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const d=this.aggregationManager.getFilterForRange(h),p=d==null,g=this.contextNodeData?.nodeData!=null&&(s.changeDescription!=null||!hu(s)||d!=null),{groupOffset:m,barWidth:y}=this.getBarDimensions();return{rawData:o,xValues:i.resolveKeysById(this,"xValue",s),openValues:i.resolveColumnById(this,"openValue",s),closeValues:i.resolveColumnById(this,"closeValue",s),highValues:i.resolveColumnById(this,"highValue",s),lowValues:i.resolveColumnById(this,"lowValue",s),xScale:a,yScale:n,xAxis:e,yAxis:t,groupOffset:m,barWidth:y,applyWidthOffset:r,crisp:p,xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey,dataAggregationFilter:d,range:h,nodeDatumStateScratch:{datum:void 0,xValue:void 0,openValue:0,closeValue:0,highValue:0,lowValue:0,isRising:!0,itemType:"up"},canIncrementallyUpdate:g,nodeIndex:0,nodeData:g?this.contextNodeData.nodeData:[]}}prepareOhlcNodeDatumState(e,t){const i=e.xValues[t];if(i===void 0&&!this.properties.allowNullKeys)return;const s=e.openValues[t],o=e.closeValues[t],a=e.highValues[t],n=e.lowValues[t],r=n!=null&&n<=s&&n<=o,l=a!=null&&a>=s&&a>=o;if(!r){Px.warnOnce(`invalid low value for key [${e.lowKey}] in data element, low value cannot be higher than datum open or close values`);return}if(!l){Px.warnOnce(`invalid high value for key [${e.highKey}] in data element, high value cannot be lower than datum open or close values.`);return}const c=e.rawData[t],h=o>s,d=h?"up":"down",p=e.nodeDatumStateScratch;return p.datum=c,p.xValue=i,p.openValue=s,p.closeValue=o,p.highValue=a,p.lowValue=n,p.isRising=h,p.itemType=d,p}createSkeletonNodeDatum(e,t,i,s,o,a){const n=e.applyWidthOffset?o/2:0,r=s+n,l=e.yScale.convert(t.openValue),c=e.yScale.convert(t.closeValue),h=e.yScale.convert(t.highValue),d=e.yScale.convert(t.lowValue),p=Math.min(h,d),g=Math.max(h,d)-p;return{series:this,itemType:t.itemType,datum:t.datum,datumIndex:i,xKey:e.xKey,xValue:t.xValue,openValue:t.openValue,closeValue:t.closeValue,highValue:t.highValue,lowValue:t.lowValue,midPoint:{x:r,y:p+g/2},aggregatedValue:t.closeValue,isRising:t.isRising,centerX:r,width:o,y:p,height:g,yOpen:l,yClose:c,crisp:a}}updateNodeDatum(e,t,i,s,o,a,n){const r=t,l=e.applyWidthOffset?a/2:0,c=o+l,h=e.yScale.convert(i.openValue),d=e.yScale.convert(i.closeValue),p=e.yScale.convert(i.highValue),g=e.yScale.convert(i.lowValue),m=Math.min(p,g),y=Math.max(p,g)-m;r.datum=i.datum,r.datumIndex=s,r.itemType=i.itemType,r.xValue=i.xValue,r.openValue=i.openValue,r.closeValue=i.closeValue,r.highValue=i.highValue,r.lowValue=i.lowValue,r.aggregatedValue=i.closeValue,r.isRising=i.isRising,r.centerX=c,r.width=a,r.y=m,r.height=y,r.yOpen=h,r.yClose=d,r.crisp=n;const S=r.midPoint;S.x=c,S.y=m+y/2}upsertNodeDatum(e,t,i,s,o){const a=this.prepareOhlcNodeDatumState(e,t);if(!a)return;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodeData.length)this.updateNodeDatum(e,e.nodeData[e.nodeIndex],a,t,i,s,o);else{const r=this.createSkeletonNodeDatum(e,a,t,i,s,o);e.nodeData.push(r)}e.nodeIndex++}createNodeData(){const{visible:e}=this,t=this.getCategoryAxis(),i=this.getValueAxis();if(!t||!i)return;const s=this.buildDatumContext(t,i),o={itemId:this.properties.xKey,nodeData:s?.nodeData??[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:KO(this.getItemStyle.bind(this),"up","down")};if(!e||!s)return o;const a=n=>{const r=s.xScale.convert(s.xValues[n]);return Number.isFinite(r)?r+s.groupOffset:Number.NaN};if(s.dataAggregationFilter==null){const n=this.processedData.invalidData?.get(this.id);let[r,l]=Hx(1,s.rawData.length,s.xAxis.range,c=>{const h=s.applyWidthOffset?0:-s.barWidth/2,d=a(c)+h;return[d,d+s.barWidth]});this.processedData.input.count<1e3&&(r=0,l=this.processedData.input.count);for(let c=r;c<l;c+=1){if(n?.[c]===!0)continue;const h=a(c);this.upsertNodeDatum(s,c,h,s.barWidth,s.crisp)}s.canIncrementallyUpdate&&s.nodeIndex<s.nodeData.length&&(s.nodeData.length=s.nodeIndex)}else{const{maxRange:n,indexData:r,midpointIndices:l}=s.dataAggregationFilter,[c,h]=Hx(1,n,s.xAxis.range,d=>{const p=d*Vx,g=r[p+Bx],m=l[d];if(m===-1)return;const y=s.applyWidthOffset?0:-s.barWidth/2;return[a(m)+y,a(g)+y+s.barWidth]});for(let d=c;d<h;d+=1){const p=d*Vx,g=r[p+wO],m=r[p+Bx],y=r[p+OO],S=r[p+EO],x=l[d];if(x===-1)continue;const b=this.prepareOhlcNodeDatumState(s,x);if(!b)continue;b.openValue=s.openValues[g],b.closeValue=s.closeValues[m],b.highValue=s.highValues[y],b.lowValue=s.lowValues[S],b.isRising=b.closeValue>b.openValue,b.itemType=b.isRising?"up":"down";const f=a(x),D=Math.abs(a(m)-a(g))+s.barWidth;if(s.canIncrementallyUpdate&&s.nodeIndex<s.nodeData.length)this.updateNodeDatum(s,s.nodeData[s.nodeIndex],b,x,f,D,!1);else{const M=this.createSkeletonNodeDatum(s,b,x,f,D,!1);s.nodeData.push(M)}s.nodeIndex++}s.canIncrementallyUpdate&&s.nodeIndex<s.nodeData.length&&(s.nodeData.length=s.nodeIndex)}return o}isVertical(){return!0}isLabelEnabled(){return!1}resetDatumAnimation(e){WO([e.datumSelection])}updateDatumSelection(e){const t=e.nodeData??[];return hu(this.processedData)?e.datumSelection.update(t,void 0,i=>cu(i.xValue)):e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemStyle(e,t,i,s="up"){const{properties:o,dataModel:a,processedData:n}=this,{itemStyler:r}=o,l=this.getHighlightStyle(t,e,i);let h=Rx(l,o.getStyle(s));if(r&&a!=null&&n!=null&&e!=null){const d=a.resolveKeysById(this,"xValue",n)[e],p=this.cachedDatumCallback(cu(cu(d),t?"highlight":"node"),()=>{const g=this.makeItemStylerParams(s,e,t,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",s],this.callWithContext(r,g))});p&&(h=Rx(p,h))}return h}makeItemStylerParams(e,t,i,s){const{id:o,properties:a,processedData:n}=this,{xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:d}=a,p=n.dataSources.get(o)?.data[t],g=this.ctx.highlightManager?.getActiveHighlight(),m=this.getHighlightStateString(g,i,t),y={seriesId:o,datum:p,itemType:e,xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:d,highlightState:m,...s};return"fill"in y&&"fill"in s&&(y.fill=this.filterItemStylerFillParams(s.fill)??s.fill),y}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:p,lowName:g,closeKey:m,closeName:y,legendItemName:S,tooltip:x}=o,b=this.getCategoryAxis(),f=this.getValueAxis();if(!i||!s||!b||!f)return;const D=s.dataSources.get(this.id)?.data[e],v=i.resolveKeysById(this,"xValue",s)[e],M=i.resolveColumnById(this,"openValue",s)[e],A=i.resolveColumnById(this,"highValue",s)[e],I=i.resolveColumnById(this,"lowValue",s)[e],k=i.resolveColumnById(this,"closeValue",s)[e],N=this.properties.allowNullKeys??!1;if(v===void 0&&!N)return;const L=k>=M?"up":"down",T=this.properties.item[L],P=this.getItemStyle(e,!1),O={fill:T.fill??T.stroke,fillOpacity:T.fillOpacity??T.strokeOpacity??1,stroke:T.stroke,strokeWidth:T.strokeWidth??1,strokeOpacity:T.strokeOpacity??1,lineDash:T.lineDash??[0],lineDashOffset:T.lineDashOffset??0};return this.formatTooltipWithContext(x,{heading:this.getAxisValueText(b,"tooltip",v,D,a,S),title:S,symbol:{marker:O},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",M,D,l,S),missing:Go.isTooltipValueMissing(M)},{label:d,fallbackLabel:h,value:this.getAxisValueText(f,"tooltip",A,D,h,S),missing:Go.isTooltipValueMissing(A)},{label:g,fallbackLabel:p,value:this.getAxisValueText(f,"tooltip",I,D,p,S),missing:Go.isTooltipValueMissing(I)},{label:y,fallbackLabel:m,value:this.getAxisValueText(f,"tooltip",k,D,m,S),missing:Go.isTooltipValueMissing(k)}]},{seriesId:t,datum:D,title:r,itemType:L,xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:p,lowName:g,closeKey:m,closeName:y,...P})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:o,height:a}=t,n={x:i-o/2,y:s,width:o,height:a};return FO(this,n)}};import{_ModuleSupport as jO}from"ag-charts-community";import{DeclaredSceneChangeDetection as er,SceneArrayChangeDetection as $O}from"ag-charts-core";var{ExtendedPath2D:UO,BBox:YO}=jO,Wo=class extends vs{constructor(){super(...arguments),this.wickPath=new UO,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}setWickProperties(e,t,i,s,o){this.__wickStroke=e,this.__wickStrokeWidth=t,this.__wickStrokeOpacity=i,this.wickLineDash=s,this.__wickLineDashOffset=o,this.dirtyPath=!0,this.markDirty()}computeDefaultGradientFillBBox(){const{__width:e,__centerX:t,__yOpen:i,__yClose:s}=this,o=Math.min(i,s),n=Math.max(i,s)-o,r=t-e/2,l=t+e/2;return new YO(r,o,l-r,n)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,__wickStroke:n,__wickStrokeWidth:r,__wickStrokeOpacity:l,wickLineDash:c,__wickLineDashOffset:h}=this,{centerX:d,x0:p,x1:g,y0:m,y1:y,yOpen:S,yClose:x}=this.alignedCoordinates(),b=this.layerManager?.canvas.pixelRatio??1,f=this.__wickStrokeAlignment>0?b/this.__wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const v=n!=null&&n!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==o||h!=null&&h!==a?this.wickPath:e;if(Math.abs(g-p)<=3){v.moveTo(d-f,m),v.lineTo(d-f,y);return}const M=Math.min(S,x),A=Math.max(S,x),I=i/2;v.moveTo(d-f,m),v.lineTo(d-f,M+I),v.moveTo(d-f,y),v.lineTo(d-f,A-I);const k=A-M-2*I;if(k>0)e.rect(p+I,M+I,g-p-2*I,k);else{const N=(M+A)/2;e.moveTo(p,N),e.lineTo(g,N)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,__wickStroke:r=i,__wickStrokeWidth:l=s,__wickStrokeOpacity:c=o,wickLineDash:h=a,__wickLineDashOffset:d=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};u([er()],Wo.prototype,"wickStroke",2),u([er()],Wo.prototype,"wickStrokeWidth",2),u([er()],Wo.prototype,"wickStrokeOpacity",2),u([$O()],Wo.prototype,"wickLineDash",2),u([er()],Wo.prototype,"wickLineDashOffset",2),u([er()],Wo.prototype,"wickStrokeAlignment",2);import{_ModuleSupport as XO}from"ag-charts-community";import{BaseProperties as du,Property as je}from"ag-charts-core";import{_ModuleSupport as ZO}from"ag-charts-community";import{BaseProperties as Gx,Property as Oe}from"ag-charts-core";var{AbstractBarSeriesProperties:QO,makeSeriesTooltip:qO}=ZO,jo=class extends Gx{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};u([Oe],jo.prototype,"stroke",2),u([Oe],jo.prototype,"strokeWidth",2),u([Oe],jo.prototype,"strokeOpacity",2),u([Oe],jo.prototype,"lineDash",2),u([Oe],jo.prototype,"lineDashOffset",2);var uu=class extends Gx{constructor(){super(...arguments),this.up=new jo,this.down=new jo}};u([Oe],uu.prototype,"up",2),u([Oe],uu.prototype,"down",2);var Xt=class extends QO{};u([Oe],Xt.prototype,"xKey",2),u([Oe],Xt.prototype,"openKey",2),u([Oe],Xt.prototype,"closeKey",2),u([Oe],Xt.prototype,"highKey",2),u([Oe],Xt.prototype,"lowKey",2),u([Oe],Xt.prototype,"xName",2),u([Oe],Xt.prototype,"yName",2),u([Oe],Xt.prototype,"openName",2),u([Oe],Xt.prototype,"closeName",2),u([Oe],Xt.prototype,"highName",2),u([Oe],Xt.prototype,"lowName",2);var Xl=class extends Xt{constructor(){super(...arguments),this.tooltip=qO(),this.item=new uu}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:s,lineDash:o,lineDashOffset:a}=this.item[e];return{stroke:s,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:a,opacity:1}}};u([Oe],Xl.prototype,"tooltip",2),u([Oe],Xl.prototype,"item",2),u([Oe],Xl.prototype,"itemStyler",2);var{makeSeriesTooltip:JO}=XO,Ha=class extends du{};u([je],Ha.prototype,"stroke",2),u([je],Ha.prototype,"strokeWidth",2),u([je],Ha.prototype,"strokeOpacity",2),u([je],Ha.prototype,"lineDash",2),u([je],Ha.prototype,"lineDashOffset",2);var Ii=class extends du{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Ha}};u([je],Ii.prototype,"fill",2),u([je],Ii.prototype,"fillOpacity",2),u([je],Ii.prototype,"stroke",2),u([je],Ii.prototype,"strokeWidth",2),u([je],Ii.prototype,"strokeOpacity",2),u([je],Ii.prototype,"lineDash",2),u([je],Ii.prototype,"lineDashOffset",2),u([je],Ii.prototype,"cornerRadius",2),u([je],Ii.prototype,"wick",2);var pu=class extends du{constructor(){super(...arguments),this.up=new Ii,this.down=new Ii}};u([je],pu.prototype,"up",2),u([je],pu.prototype,"down",2);var Zl=class extends Xt{constructor(){super(...arguments),this.item=new pu,this.tooltip=JO()}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:s,strokeOpacity:o,stroke:a,lineDash:n,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[e];return{fill:t,fillOpacity:i,stroke:a,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};u([je],Zl.prototype,"item",2),u([je],Zl.prototype,"tooltip",2),u([je],Zl.prototype,"itemStyler",2);var gu=class extends Kx{constructor(){super(...arguments),this.properties=new Zl}nodeFactory(){const e=new Wo;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:n}=s.item,r=this.getShapeFillBBox(),l=this;e.each(function(h,d){const{centerX:p,width:g,y:m,height:y,yOpen:S,yClose:x,crisp:b}=d,f=d.isRising?a:n,D=l.getHighlightState(o,t,d.datumIndex),v=d.style??i.styles[d.itemType][D];h.setStaticProperties(p,g,m,y,S,x,b),h.setStyleProperties(v,r);const M=v?.wick;h.setWickProperties(M?.stroke,M?.strokeWidth,M?.strokeOpacity,M?.lineDash,M?.lineDashOffset),h.wickStrokeAlignment=f.wick.strokeWidth??f.strokeWidth})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=Ex(e.fill)?e.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:nu(e.fill)||au(e.fill)?e.stroke:e.fill,stop:0},{color:nu(e.fill)||au(e.fill)?e.stroke:e.fill,stop:.5}],s=Ex(t.fill)?t.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:nu(t.fill)||au(t.fill)?t.stroke:t.fill,stop:.5}],o={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...s],reverse:!1},a={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:o,fillOpacity:e.fillOpacity,stroke:a,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:o}}=this,{xKey:a,yName:n,showInLegend:r,legendItemName:l}=this.properties;return!i?.data.length||!a||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&o.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??n??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};gu.className="CandleStickSeries",gu.type="candlestick";import{_ModuleSupport as eE}from"ag-charts-community";import{boolean as tE,commonSeriesOptionsDefs as iE,constant as sE,number as oE,required as Ka,string as Zt,undocumented as Wx}from"ag-charts-core";var{candlestickSeriesThemeableOptionsDef:aE}=eE,mu={...iE,...aE,type:Ka(sE("candlestick")),xKey:Ka(Zt),openKey:Ka(Zt),highKey:Ka(Zt),lowKey:Ka(Zt),closeKey:Ka(Zt),xName:Zt,yName:Zt,openName:Zt,highName:Zt,lowName:Zt,closeName:Zt,xKeyAxis:Zt,yKeyAxis:Zt};mu.pickOutsideVisibleMinorAxis=Wx(tE),mu.focusPriority=Wx(oE);import"ag-charts-community";import{CARTESIAN_AXIS_TYPE as jx,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS as nE,FILL_IMAGE_DEFAULTS as rE,FILL_PATTERN_KEYED_DEFAULTS as lE,MULTI_SERIES_HIGHLIGHT_STYLE as cE}from"ag-charts-core";function $x(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",nE(e)],["image",rE],["pattern",lE(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}var hE={series:{item:{up:$x("up"),down:$x("down")},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:cE},animation:{enabled:!1},axes:{[jx.NUMBER]:{crosshair:{snap:!1}},[jx.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{predictCartesianFinancialAxis:dE}=mO,Ql={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,groupable:!1,version:gO,dependencies:[pO],options:mu,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:dE,defaultAxes:{y:{type:Cx.NUMBER,position:wx.LEFT},x:{type:Cx.ORDINAL_TIME,position:wx.BOTTOM}},axisKeys:{[Ox.X]:"xKeyAxis",[Ox.Y]:"yKeyAxis"},themeTemplate:hE,create:e=>new gu(e)};import{CartesianChartModule as uE,VERSION as pE}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as Ux,CARTESIAN_POSITION as Yx,ChartAxisDirection as Xx}from"ag-charts-core";import{_ModuleSupport as yu}from"ag-charts-community";import{ChartAxisDirection as ji,Logger as gE,extent as mE,formatValue as yE,mergeDefaults as Zx,toPlainText as fE}from"ag-charts-core";import{Logger as xE,cachedTextMeasurer as ql,findMaxValue as Qx,wrapLines as qx}from"ag-charts-core";function SE(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:o,minimumFontSize:a=o}=t,n=i-s,r=o-a;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:o}];for(;l>s||c>a;){const d=n>0?(l-s)/n:-1,p=r>0?(c-a)/r:-1;d>p?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function Jx(e,t,i,s,{padding:o},a){const{spacing:n=0}=t,r=2*o,l=2*o+n,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>a(c+l,!1).height-l)return;const h=SE(t,s),d={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},p={fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let g,m;return Qx(0,h.length-1,y=>{const{labelFontSize:S,secondaryLabelFontSize:x}=h[y],b=y===0,f={...d,fontSize:S},D={...p,fontSize:x},v=ql(f).lineHeight(),M=ql(D).lineHeight(),A=a(v+M+l,b),I=A.width-r,k=A.height-l;if(v+M>k||(g?.fontSize!==S&&(g=tS(t,e,I,k,f,t.wrapping,b?t.overflowStrategy:"hide")),g==null||g.width>I||g.height>k)||(m?.fontSize!==x&&(m=tS(s,i,I,k,D,s.wrapping,b?s.overflowStrategy:"hide")),m==null))return;const N=g.height+m.height;if(!(m.width>I||N>k))return{width:Math.max(g.width,m.width),height:N+n,meta:A.meta,label:g,secondaryLabel:m}})}function tr(e,t,{padding:i},s){const o=2*i,a=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),n={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return Qx(a,t.fontSize,r=>{const l={...n,fontSize:r},c=ql(l),h=r===a,d=t.lineHeight??c.lineHeight(),p=s(d+o,h),g=p.width-o,m=p.height-o;if(d>m||g<0)return;const y=qx(e,{maxWidth:g,maxHeight:m,font:l,textWrap:t.wrapping,overflow:(h?t.overflowStrategy:null)??"hide"});if(!y.length)return;const{width:S,height:x}=c.measureLines(y),b=y.join(`
|
|
`);return[{width:S,height:x,text:b,fontSize:r,lineHeight:d},p.meta]})}function eS(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function fu(e,t,i,s,o,a){const n=t.enabled?e:void 0,r=s.enabled?i:void 0;(eS(t)||eS(s))&&xE.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;n!=null&&r!=null&&(l=Jx(n,t,r,s,o,a));let c;if(l==null&&n!=null&&(c=tr(n,t,o,a)),c!=null){const[d,p]=c;l={width:d.width,height:d.height,meta:p,label:d,secondaryLabel:void 0}}let h;if(l==null&&n==null&&r!=null&&(h=tr(r,s,o,a)),h!=null){const[d,p]=h;l={width:d.width,height:d.height,meta:p,label:void 0,secondaryLabel:d}}return l}function tS(e,t,i,s,o,a,n){const r=qx(t,{maxWidth:i,maxHeight:s,font:o,textWrap:a,overflow:n});if(!r.length)return;const l=ql(o),c=e.lineHeight??l.lineHeight(),{width:h}=l.measureLines(r);return{width:h,lineHeight:c,text:r.join(`
|
|
`),height:r.length*c,fontSize:o.fontSize}}import{_ModuleSupport as bE}from"ag-charts-community";import{Property as rt}from"ag-charts-core";import{_ModuleSupport as vE}from"ag-charts-community";import{Property as ir}from"ag-charts-core";var Ga=class extends vE.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};u([ir],Ga.prototype,"wrapping",2),u([ir],Ga.prototype,"overflowStrategy",2),u([ir],Ga.prototype,"lineHeight",2),u([ir],Ga.prototype,"minimumFontSize",2);var Wa=class extends Ga{constructor(){super(...arguments),this.spacing=0}};u([ir],Wa.prototype,"spacing",2);var Jl=class extends Ga{},{CartesianSeriesProperties:DE,makeSeriesTooltip:ME}=bE,Xe=class extends DE{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new Wa,this.tooltip=ME()}};u([rt],Xe.prototype,"title",2),u([rt],Xe.prototype,"xKey",2),u([rt],Xe.prototype,"yKey",2),u([rt],Xe.prototype,"colorKey",2),u([rt],Xe.prototype,"xName",2),u([rt],Xe.prototype,"yName",2),u([rt],Xe.prototype,"colorName",2),u([rt],Xe.prototype,"colorRange",2),u([rt],Xe.prototype,"stroke",2),u([rt],Xe.prototype,"strokeOpacity",2),u([rt],Xe.prototype,"strokeWidth",2),u([rt],Xe.prototype,"textAlign",2),u([rt],Xe.prototype,"verticalAlign",2),u([rt],Xe.prototype,"itemPadding",2),u([rt],Xe.prototype,"itemStyler",2),u([rt],Xe.prototype,"label",2),u([rt],Xe.prototype,"tooltip",2);var{SeriesNodePickMode:iS,computeBarFocusBounds:kE,getMissCount:AE,valueProperty:xu,DEFAULT_CARTESIAN_DIRECTION_KEYS:IE,DEFAULT_CARTESIAN_DIRECTION_NAMES:NE,createDatumId:LE,ColorScale:TE,Rect:CE,PointerEvents:wE,addHitTestersToQuadtree:OE,findQuadtreeMatch:sS,updateLabelNode:EE,upsertNodeDatum:PE}=yu,RE=class extends yu.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},_E={left:-.5,center:0,right:-.5},zE={top:-.5,middle:0,bottom:-.5},Su=class extends yu.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...IE,color:["colorKey"]},propertyNames:{...NE,color:["colorName"]},categoryKey:void 0,pickModes:[iS.NEAREST_NODE,iS.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new Xe,this.NodeEvent=RE,this.colorScale=new TE}async processData(e){const t=this.axes[ji.X],i=this.axes[ji.Y];if(!t||!i)return;const{xKey:s,yKey:o,colorRange:a,colorKey:n}=this.properties,r=this.axes[ji.X]?.scale,l=this.axes[ji.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,p=this.properties.allowNullKeys??!1,{dataModel:g,processedData:m}=await this.requestDataModel(e,this.data,{props:[xu(s,c,{id:"xValue",allowNullKey:p}),xu(o,h,{id:"yValue",allowNullKey:p}),...n?[xu(n,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const y=g.resolveProcessedDataIndexById(this,"colorValue"),S=m.domain.values[y].filter(b=>b!=null),x=mE(S);if(this.colorScale.domain=x??[],x?.length&&x[0]===x[1]){const b=Math.floor(a.length/2);this.colorScale.range=[a[b],a[b]]}else this.colorScale.range=a;this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=AE(this,i.defs.values[s].missing),n=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[n].filter(c=>c!=null).length;return!(o===0||o===a||r===0)}xCoordinateRange(e,t){const i=this.axes[ji.X].scale,s=t*(i.bandwidth??0)/2,o=i.convert(e)+s,a=t*(i.bandwidth??10);return[o,o+a]}yCoordinateRange(e,t){const i=this.axes[ji.Y].scale,s=t*(i.bandwidth??0)/2,o=i.convert(e[0])+s,a=t*(i.bandwidth??10);return[o,o+a]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?{domain:[]}:e===ji.X?{domain:t.getDomain(this,"xValue","value",i).domain}:{domain:t.getDomain(this,"yValue","value",i).domain}}getSeriesRange(){return[Number.NaN,Number.NaN]}validateCreateNodeDataPreconditions(){const e=super.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e;if(t.type!=="category"||i.type!=="category"){gE.warnOnce(`Heatmap series expected axes to have "category" type, but received "${t.type}" and "${i.type}" instead.`);return}return e}populateNodeData(e){for(const[t,i]of e.rawData.entries()){const s=PE(e,{datumIndex:t,datum:i},(o,a)=>this.createNodeDatum(o,a.datumIndex,a.datum),(o,a,n)=>this.updateNodeDatum(o,a,n.datumIndex,n.datum));if(s){const o=this.createLabelDatum(e,t,i,s);o&&e.labels.push(o)}}}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:o}=this;if(!i||!s)return;const{xKey:a,xName:n,yKey:r,yName:l,colorKey:c,colorName:h,textAlign:d,verticalAlign:p,itemPadding:g}=this.properties,m=e.scale,y=t.scale,S=i.resolveColumnById(this,"xValue",s),x=i.resolveColumnById(this,"yValue",s),b=c?i.resolveColumnById(this,"colorValue",s):void 0,f=c?i.getDomain(this,"colorValue","value",s).domain:[],D=m.bandwidth??10,v=y.bandwidth??10,M=s.dataSources.get(this.id)?.data??[],A=o?.nodeData!=null&&s.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:m,yScale:y,rawData:M,xValues:S,xKey:a,yKey:r,xName:n,yName:l,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:A,nodes:A?o.nodeData:[],nodeIndex:0,xOffset:(m.bandwidth??0)/2,yOffset:(y.bandwidth??0)/2,width:D,height:v,textAlignFactor:(D-2*g)*_E[d],verticalAlignFactor:(v-2*g)*zE[p],yValues:x,colorKey:c,colorName:h,colorValues:b,colorDomain:f,itemPadding:g,labels:[],labelIndex:0}}createSkeletonNodeDatum(e,t,i){const{xKey:s,yKey:o,width:a,height:n,colorValues:r}=e,l=e.xValues[t],c=e.yValues[t],h=r?.[t];return{series:this,datumIndex:t,yKey:o,xKey:s,xValue:l,yValue:c,colorValue:h,datum:i,point:{x:0,y:0,size:0},width:a,height:n,midPoint:{x:0,y:0},missing:r!=null&&h==null,style:{}}}updateNodeDatum(e,t,i,s){const{xScale:o,yScale:a,xOffset:n,yOffset:r,width:l,height:c,xKey:h,yKey:d,colorValues:p}=e,g=t,m=e.xValues[i],y=e.yValues[i],S=o.convert(m)+n,x=a.convert(y)+r;if(!Number.isFinite(S)||!Number.isFinite(x))return;const b=p?.[i];g.datumIndex=i,g.datum=s,g.yKey=d,g.xKey=h,g.xValue=m,g.yValue=y,g.colorValue=b,g.width=l,g.height=c,g.missing=p!=null&&b==null;const f=g.point;f.x=S,f.y=x,f.size=0,g.midPoint.x=S,g.midPoint.y=x,g.style=this.getItemStyle({datumIndex:i,datum:s,colorValue:b},!1)}createNodeDatum(e,t,i){const{xScale:s,yScale:o,xOffset:a,yOffset:n}=e,r=e.xValues[t],l=e.yValues[t],c=s.convert(r)+a,h=o.convert(l)+n;if(!Number.isFinite(c)||!Number.isFinite(h))return;const d=this.createSkeletonNodeDatum(e,t,i);return this.updateNodeDatum(e,d,t,i),d}createLabelDatum(e,t,i,s){const{label:o}=this.properties,{width:a,height:n,textAlignFactor:r,verticalAlignFactor:l,itemPadding:c,colorKey:h,colorName:d,colorDomain:p,xKey:g,yKey:m,xName:y,yName:S}=e,x=e.colorValues?.[t],b=o.enabled&&x!=null?this.getLabelText(x,i,h,"color",p,o,{value:x,datum:i,colorKey:h,colorName:d,xKey:g,yKey:m,xName:y,yName:S}):void 0,f=()=>({width:a,height:n,meta:null}),D=fu(fE(b),this.properties.label,void 0,this.properties.label,{padding:c},f);if(D?.label==null)return;const{text:v,fontSize:M,lineHeight:A,height:I}=D.label,{fontStyle:k,fontFamily:N,fontWeight:L,color:T}=this.properties.label,{textAlign:P,verticalAlign:O}=this.properties,C=s.point.x+r*(a-2*c),R=s.point.y+l*(n-2*c)-(D.height-I)*.5;return{series:this,datum:i,datumIndex:t,text:v,fontSize:M,lineHeight:A,fontStyle:k,fontFamily:N,fontWeight:L,color:T,textAlign:P,textBaseline:O,x:C,y:R,style:s.style}}nodeFactory(){return new CE}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle({datumIndex:e,datum:t,colorValue:i},s,o){const{properties:a}=this,{itemStyler:n,stroke:r,strokeWidth:l,strokeOpacity:c}=a,h=this.getHighlightStyle(s,e,o),d=Zx(h,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:r,strokeWidth:l,strokeOpacity:c,opacity:1});let p;return n!=null&&e!=null&&(p=this.cachedDatumCallback(LE(e,s?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,e,s,d);return this.callWithContext(n,g)})),p?Zx(p,d):d}makeItemStylerParams(e,t,i,s){const{id:o,properties:a}=this,{xKey:n,yKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,xKey:n,yKey:r,highlightState:c,...s,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager?.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex);o.style=this.getItemStyle(o,t,a)})}updateDatumNodes({datumSelection:e}){const t=this.axes[ji.X],[i,s]=t?.visibleRange??[],a=!(i!==0||s!==1);e.each((n,r)=>{const{point:l,width:c,height:h,style:d}=r;n.setStyleProperties(d),n.crisp=a,n.x=Math.floor(l.x-c/2),n.y=Math.floor(l.y-h/2),n.width=Math.ceil(c),n.height=Math.ceil(h)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,o=s?t:[];return i.update(o)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,o)=>{s.pointerEvents=wE.None,s.text=o.text,s.fillOpacity=this.getHighlightStyle(t,o.datumIndex)?.opacity??1,EE(this,s,this.properties,this.properties.label,o,t,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a,colorScale:n,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:h,yKey:d,yName:p,colorKey:g,colorName:m,colorRange:y,title:S,legendItemName:x,tooltip:b}=a,f=o[ji.X],D=o[ji.Y];if(!i||!s||!f||!D)return;const v=s.dataSources.get(this.id)?.data[e],M=i.resolveColumnById(this,"xValue",s)[e],A=i.resolveColumnById(this,"yValue",s)[e],I=g!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[e]:void 0,k=this.properties.allowNullKeys??!1;if(M===void 0&&!k)return;const N=[];let L;if(I==null)L=y[0];else{L=n.convert(I);const O=i.getDomain(this,"colorValue","value",s).domain,C=l.format(this.callWithContext.bind(this),{type:"number",value:I,datum:v,seriesId:t,legendItemName:x,key:g,source:"tooltip",property:"color",domain:O,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});N.push({label:m,fallbackLabel:g,value:C??yE(I)})}N.push({label:h,fallbackLabel:c,value:this.getAxisValueText(f,"tooltip",M,v,c,x)},{label:p,fallbackLabel:d,value:this.getAxisValueText(D,"tooltip",A,v,d,x)});const T=this.getItemStyle({datumIndex:e,datum:v,colorValue:I},!1);T.fill!=null&&(L=T.fill);const P=L==null?void 0:{marker:{shape:"square",fill:L,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(b,{title:S??x,symbol:P,data:N},{seriesId:t,datum:v,title:S,xKey:c,xName:h,yKey:d,yName:p,colorKey:g,colorName:m,...T})}getLegendData(e){return e!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:s,midPoint:o}=t,a={x:o.x-i/2,y:o.y-s/2,width:i,height:s};return kE(this,a)}initQuadTree(e){OE(e,this.datumNodesIter())}pickNodesExactShape(e){const t=sS(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return sS(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null||this.isColorScaleValid()}};Su.className="HeatmapSeries",Su.type="heatmap";import{_ModuleSupport as BE}from"ag-charts-community";import{arrayOf as VE,color as FE,commonSeriesOptionsDefs as HE,constant as KE,required as bu,string as so,without as oS}from"ag-charts-core";var{heatmapSeriesThemeableOptionsDef:GE}=BE,WE={...oS(GE,["showInLegend"]),...oS(HE,["showInLegend"]),type:bu(KE("heatmap")),xKey:bu(so),yKey:bu(so),xKeyAxis:so,yKeyAxis:so,colorKey:so,xName:so,yName:so,colorName:so,colorRange:VE(FE)};import{LABEL_BOXING_DEFAULTS as jE,SAFE_RANGE2_OPERATION as $E}from"ag-charts-core";var aS={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},label:{...jE,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:{unhighlightedItem:{opacity:.6}}},gradientLegend:{enabled:!0}};aS.series.colorRange={$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},$E]};var vu={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,version:pE,dependencies:[uE],options:WE,defaultAxes:{y:{type:Ux.CATEGORY,position:Yx.LEFT},x:{type:Ux.CATEGORY,position:Yx.BOTTOM}},axisKeys:{[Xx.X]:"xKeyAxis",[Xx.Y]:"yKeyAxis"},themeTemplate:aS,create:e=>new Su(e)};import{CartesianChartModule as UE,VERSION as YE,_ModuleSupport as XE}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as ec,CARTESIAN_POSITION as nS,ChartAxisDirection as rS,MULTI_SERIES_HIGHLIGHT_STYLE as ZE}from"ag-charts-core";import"ag-charts-community";var Du=class extends Kx{constructor(){super(...arguments),this.properties=new Xl}nodeFactory(){const e=new zx;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:n}=s.item,r=this;e.each(function(c,h){const{centerX:d,width:p,y:g,height:m,yOpen:y,yClose:S,crisp:x}=h,b=h.isRising?a:n;c.setStaticProperties(d,p,g,m,y,S,x);const f=h.style??i.styles[h.itemType][r.getHighlightState(o,t,h.datumIndex)];c.setStyleProperties(f),c.strokeAlignment=b.strokeWidth})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:s},visible:o}=this,{xKey:a,yName:n,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.data.length||!a||e!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:o&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??n??t},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};Du.className="ohlc",Du.type="ohlc";import{_ModuleSupport as QE}from"ag-charts-community";import{boolean as qE,commonSeriesOptionsDefs as JE,constant as eP,number as tP,required as ja,string as Qt,undocumented as lS}from"ag-charts-core";var{ohlcSeriesThemeableOptionsDef:iP}=QE,Mu={...JE,...iP,type:ja(eP("ohlc")),xKey:ja(Qt),openKey:ja(Qt),highKey:ja(Qt),lowKey:ja(Qt),closeKey:ja(Qt),xKeyAxis:Qt,yKeyAxis:Qt,xName:Qt,yName:Qt,openName:Qt,highName:Qt,lowName:Qt,closeName:Qt};Mu.pickOutsideVisibleMinorAxis=lS(qE),Mu.focusPriority=lS(tP);var{predictCartesianFinancialAxis:sP}=XE,oP={animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:ZE},axes:{[ec.NUMBER]:{crosshair:{snap:!1}},[ec.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},tc={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,version:YE,dependencies:[UE],options:Mu,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:sP,defaultAxes:{y:{type:ec.NUMBER,position:nS.LEFT},x:{type:ec.ORDINAL_TIME,position:nS.BOTTOM}},axisKeys:{[rS.X]:"xKeyAxis",[rS.Y]:"yKeyAxis"},themeTemplate:oP,create:e=>new Du(e)};import{CartesianChartModule as aP,VERSION as nP,_ModuleSupport as rP}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as cS,CARTESIAN_POSITION as hS,ChartAxisDirection as dS}from"ag-charts-core";import{_ModuleSupport as $a}from"ag-charts-community";import{AGGREGATION_INDEX_UNSET as uS,AGGREGATION_INDEX_Y_MAX as lP,AGGREGATION_INDEX_Y_MIN as cP,AGGREGATION_SPAN as hP,ChartAxisDirection as Fe,DebugMetrics as dP,extent as uP,findMinMax as pP,mergeDefaults as gP}from"ag-charts-core";import"ag-charts-community";import{aggregationDomain as ku,computeExtremesAggregation as pS,computeExtremesAggregationPartial as mP,simpleMemorize2 as yP}from"ag-charts-core";function fP(e,t,i,s,o,a,n,r){const[l,c]=ku(e,o);return pS([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:n,yNeedsValueOf:r})}var xP=yP(fP);function SP(e,t,i,s,o){const a=t.resolveKeysById(s,"xValue",i),n=t.resolveColumnById(s,"yHighValue",i),r=t.resolveColumnById(s,"yLowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i);if(o){const[d,p]=ku(e,l);return pS([d,p],a,n,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:o})}return xP(e,a,n,r,l,i.reduced?.smallestKeyInterval,c,h)}function bP(e,t,i,s,o,a){const n=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i),l=t.resolveColumnById(s,"yLowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),[p,g]=ku(e,c);return mP([p,g],n,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:o,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:a})}import"ag-charts-community";import{spanRange as vP}from"ag-charts-core";function gS({span:e},t){switch(e.type){case"linear":case"step":case"multi-line":{const i=(t-e.x0)/(e.x1-e.x0);return e.y0+i*(e.y1-e.y0)}case"cubic":{const{cp0x:i,cp0y:s,cp1x:o,cp1y:a,cp2x:n,cp2y:r,cp3x:l,cp3y:c}=e;let h=.5;const d=1e-6;for(let g=0;g<10;g++){const m=1-h,S=m*m*m*i+3*m*m*h*o+3*m*h*h*n+h*h*h*l-t;if(Math.abs(S)<d)break;const x=3*m*m*(o-i)+6*m*h*(n-o)+3*h*h*(l-n);if(Math.abs(x)<1e-12)break;h=h-S/x,h=Math.max(0,Math.min(1,h))}const p=1-h;return p*p*p*s+3*p*p*h*a+3*p*h*h*r+h*h*h*c}}}function mS(e,t,i=0){for(let s=i;s<e.length;s++){const o=e[s],[a,n]=vP(o.span);if(t>=a.x&&t<=n.x)return{span:o,index:s};if(t<a.x)break}return{span:null,index:i}}function DP(e,t,i,s,o){const a=mS(e,i,o),n=mS(t,i,o);if(!a.span||!n.span)return{intersection:null,spanIndex:a.index,isInverted:s};const r=gS(a.span,i),l=gS(n.span,i),c=r>l;return{intersection:s===c?null:{x:i,y:r},spanIndex:a.index,isInverted:c}}function MP(e,t,i,s,o=!1){if(e.length===0||t.length===0)return[];const a=[];let n=o,r=0;for(let l=i;l<=s;l+=.5){const c=DP(e,t,l,n,r);c.intersection&&a.push(c.intersection.x),r=c.spanIndex,n=c.isInverted}return a}function kP(e,t,i,s,o={}){const a=Math.max(t.x,i.width-(t.x+t.width)),n=Math.max(t.y,i.height-(t.y+t.height)),r=[],l=(h,d)=>({x0:h,y0:-n,x1:d,y1:t.height+n});s&&r.push({clipRect:l(-a,e[0]??t.width+a),...o});const c=s?1:0;for(let h=c;h<e.length;h+=2)r.push({clipRect:l(e[h],e[h+1]??t.width+a),...o});return r}import{_ModuleSupport as AP}from"ag-charts-community";import{BaseProperties as Au,InterpolationProperties as IP,Property as W}from"ag-charts-core";var{CartesianSeriesProperties:NP,SeriesMarker:LP,makeSeriesTooltip:TP,DropShadow:CP,Label:wP}=AP,Iu=class extends wP{constructor(){super(...arguments),this.placement="outside",this.spacing=0}};u([W],Iu.prototype,"placement",2),u([W],Iu.prototype,"spacing",2);var ic=class{constructor(){this.enabled=!1,this.fillOpacity=1}};u([W],ic.prototype,"enabled",2),u([W],ic.prototype,"fill",2),u([W],ic.prototype,"fillOpacity",2);var oo=class extends Au{constructor(){super(...arguments),this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new LP}};u([W],oo.prototype,"stroke",2),u([W],oo.prototype,"strokeWidth",2),u([W],oo.prototype,"strokeOpacity",2),u([W],oo.prototype,"lineDash",2),u([W],oo.prototype,"lineDashOffset",2),u([W],oo.prototype,"marker",2);var Nu=class extends Au{constructor(){super(...arguments),this.low=new oo,this.high=new oo}};u([W],Nu.prototype,"low",2),u([W],Nu.prototype,"high",2);var fi=class extends Au{};u([W],fi.prototype,"enabled",2),u([W],fi.prototype,"shape",2),u([W],fi.prototype,"size",2),u([W],fi.prototype,"fill",2),u([W],fi.prototype,"fillOpacity",2),u([W],fi.prototype,"stroke",2),u([W],fi.prototype,"strokeWidth",2),u([W],fi.prototype,"strokeOpacity",2),u([W],fi.prototype,"lineDash",2),u([W],fi.prototype,"lineDashOffset",2),u([W],fi.prototype,"itemStyler",2);var ge=class extends NP{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new IP,this.item=new Nu,this.invertedStyle=new ic,this.shadow=new CP().set({enabled:!1}),this.marker=new fi,this.label=new Iu,this.tooltip=TP(),this.connectMissingData=!1}};u([W],ge.prototype,"xKey",2),u([W],ge.prototype,"yLowKey",2),u([W],ge.prototype,"yHighKey",2),u([W],ge.prototype,"xName",2),u([W],ge.prototype,"yName",2),u([W],ge.prototype,"yLowName",2),u([W],ge.prototype,"yHighName",2),u([W],ge.prototype,"fill",2),u([W],ge.prototype,"fillOpacity",2),u([W],ge.prototype,"stroke",2),u([W],ge.prototype,"strokeWidth",2),u([W],ge.prototype,"strokeOpacity",2),u([W],ge.prototype,"lineDash",2),u([W],ge.prototype,"lineDashOffset",2),u([W],ge.prototype,"interpolation",2),u([W],ge.prototype,"styler",2),u([W],ge.prototype,"item",2),u([W],ge.prototype,"invertedStyle",2),u([W],ge.prototype,"shadow",2),u([W],ge.prototype,"marker",2),u([W],ge.prototype,"label",2),u([W],ge.prototype,"tooltip",2),u([W],ge.prototype,"connectMissingData",2);import{_ModuleSupport as OP}from"ag-charts-community";import{areScalingEqual as yS,isScaleValid as fS}from"ag-charts-core";var{CollapseMode:sc,pairUpSpans:oc,prepareAreaFillAnimationFns:EP,plotInterpolatedLinePathStroke:Ua,prepareLinePathPropertyAnimation:PP}=OP;function RP(e,t,i,s){const o=(l,c)=>{Ua(l,c,t.removed),Ua(l,c,i.removed)},a=(l,c)=>{Ua(l,c,t.moved),Ua(l,c,i.moved)},n=(l,c)=>{Ua(l,c,t.added),Ua(l,c,i.added)},r=PP(e,s);return{status:e,path:{addPhaseFn:n,updatePhaseFn:a,removePhaseFn:o},pathProperties:r}}function _P(e,t,i){const s=e.scales.x?.type==="category",o=t.scales.x?.type==="category";if(s!==o||!fS(e.scales.x)||!fS(t.scales.x))return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const n=oc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},sc.Split);if(n==null)return;const r=oc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},sc.Split);if(r==null)return;const l=oc({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},sc.Split);if(l==null)return;const c=oc({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},sc.Split);if(c==null)return;const h="fade",d=EP(a,n,r,h),p=RP(a,l,c,h),g=(i?.changed??!0)||!yS(e.scales.x,t.scales.x)||!yS(e.scales.y,t.scales.y)||a!=="updated";return{status:a,fill:d,stroke:p,hasMotion:g}}var zP=lP,BP=cP,VP=hP,{valueProperty:xS,keyProperty:FP,updateLabelNode:HP,fixNumericExtent:SS,buildResetPathFn:KP,resetLabelFn:GP,resetMarkerFn:WP,resetMarkerPositionFn:bS,pathSwipeInAnimation:jP,resetMotion:$P,markerSwipeScaleInAnimation:UP,seriesLabelFadeInAnimation:Lu,animationValidation:YP,diff:XP,updateClipPath:Tu,computeMarkerFocusBounds:vS,plotAreaPathFill:ZP,plotLinePathStroke:DS,interpolatePoints:MS,pathFadeInAnimation:Cu,markerFadeInAnimation:kS,fromToMotion:wu,pathMotion:Ou,PointerEvents:ac,Marker:QP,BBox:qP,processedDataIsAnimatable:Eu,markerEnabled:JP,getMarkerStyles:e1,calculateSegments:t1,toHighlightString:i1,HighlightState:s1,AggregationManager:o1,resetMarkerSelectionsDirect:a1,createDatumId:n1,visibleRangeIndices:AS}=$a,r1=class extends $a.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Pu=class extends $a.CartesianSeries{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[$a.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[Fe.X]:["xKey"],[Fe.Y]:["yLowKey","yHighKey"]},propertyNames:{[Fe.X]:["xName"],[Fe.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:KP({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:GP,datum:(t,i)=>({...WP(t),...bS(t,i)})},clipFocusBox:!1}),this.properties=new ge,this.NodeEvent=r1,this.aggregationManager=new o1}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,o=this.axes[Fe.X]?.scale,a=this.axes[Fe.Y]?.scale,{xScaleType:n,yScaleType:r}=this.getScaleInformation({xScale:o,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();this.needsDataModelDiff()&&this.processedData&&l.push(XP(this.id,this.processedData)),c&&l.push(YP());const h=this.properties.allowNullKeys??!1,{dataModel:d,processedData:p}=await this.requestDataModel(e,this.data,{props:[FP(t,n,{id:"xValue",allowNullKey:h}),xS(i,r,{id:"yLowValue"}),xS(s,r,{id:"yHighValue"}),...l]});this.aggregateData(d,p),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||Eu(t))return;const i=this.axes[Fe.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>bP(i.scale.type,e,t,this,s,a),computeFull:a=>SP(i.scale.type,e,t,this,a),targetRange:s});const o=this.aggregationManager.filters;o&&o.length>0&&dP.record(`${this.type}:aggregation`,o.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes[Fe.X];if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const o=s.dataSources.get(this.id)?.data??[],a=e.scale,n=t.scale,r=e.range,[l,c]=a.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const d=this.aggregationManager.getFilterForRange(h),p=this.contextNodeData?.nodeData,g=!this.ctx.animationManager.isSkipped(),m=p!=null&&(s.changeDescription!=null||!Eu(s)||d!=null);return{xAxis:e,yAxis:t,rawData:o,xValues:i.resolveKeysById(this,"xValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s),xScale:a,yScale:n,xAxisRange:r,xOffset:(a.bandwidth??0)/2,dataAggregationFilter:d,range:h,labelsEnabled:this.properties.label.enabled,animationEnabled:g,canIncrementallyUpdate:m,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,item:this.properties.item,yDomain:this.getSeriesDomain(Fe.Y).domain,connectMissingData:this.properties.connectMissingData,interpolation:this.properties.interpolation,nodes:m?p:[],labelData:[],spanPoints:[],nodeIndex:0}}xCoordinateRange(e){const t=this.axes[Fe.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[Fe.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};const{domain:{keys:[s]}}=t;if(e===Fe.X){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:a}}return{domain:SS(uP(s))}}else{const o=this.domainForClippedRange(Fe.Y,["yHighValue","yLowValue"],"xValue"),a=pP(o);return{domain:SS(a)}}}getSeriesRange(e,t){return this.domainForVisibleRange(Fe.Y,["yHighValue","yLowValue"],"xValue",t)}handleDatumPoint(e,t,i,s,o){if(t.xValue=e.xValues[i],t.xValue===void 0&&!this.properties.allowNullKeys)return;t.datum=e.rawData[i],t.yHighValue=s??e.yHighValues[i],t.yLowValue=o??e.yLowValues[i];const a=e.spanPoints.at(-1);if(Number.isFinite(t.yHighValue)&&Number.isFinite(t.yLowValue)){if(t.inverted=t.yLowValue>t.yHighValue,t.x=e.xScale.convert(t.xValue)+e.xOffset,!Number.isFinite(t.x))return;t.yHighCoordinate=e.yScale.convert(t.yHighValue),t.yLowCoordinate=e.yScale.convert(t.yLowValue),this.upsertMarkerDatum(e,t,i,"high",t.yHighValue,t.yHighCoordinate),this.upsertMarkerDatum(e,t,i,"low",t.yLowValue,t.yLowCoordinate);const n={high:{point:{x:t.x,y:t.yHighCoordinate},xDatum:t.xValue,yDatum:t.yHighValue},low:{point:{x:t.x,y:t.yLowCoordinate},xDatum:t.xValue,yDatum:t.yLowValue}};Array.isArray(a)?a.push(n):a==null?e.spanPoints.push([n]):(a.skip+=1,e.spanPoints.push([n]))}else e.connectMissingData||(Array.isArray(a)||a==null?e.spanPoints.push({skip:0}):a.skip+=1)}upsertMarkerDatum(e,t,i,s,o,a){const{size:n}=e.item[s].marker;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const l=e.nodes[e.nodeIndex];l.index=i,l.itemType=s,l.datum=t.datum,l.datumIndex=i,l.midPoint={x:t.x,y:a},l.yHighValue=t.yHighValue,l.yLowValue=t.yLowValue,l.xValue=t.xValue,l.point={x:t.x,y:a,size:n}}else e.nodes.push({index:i,series:this,itemType:s,datum:t.datum,datumIndex:i,midPoint:{x:t.x,y:a},yHighValue:t.yHighValue,yLowValue:t.yLowValue,xValue:t.xValue,xKey:e.xKey,yLowKey:e.yLowKey,yHighKey:e.yHighKey,point:{x:t.x,y:a,size:n},enabled:!0});if(e.nodeIndex++,e.labelsEnabled){const l=this.createLabelData({datumIndex:i,point:{x:t.x,y:a},value:o,yLowValue:t.yLowValue,yHighValue:t.yHighValue,itemType:s,inverted:t.inverted,datum:t.datum,series:this});e.labelData.push(l)}}populateNodeData(e){const{processedData:t}=this;if(!t)return;const i={datum:void 0,xValue:void 0,yHighValue:0,yLowValue:0,x:0,yHighCoordinate:0,yLowCoordinate:0,inverted:!1},s=o=>e.xScale.convert(e.xValues[o])+e.xOffset;if(t.input.count<1e3||e.dataAggregationFilter==null){let[o,a]=AS(1,e.xValues.length,e.xAxisRange,n=>{const r=s(n);return[r,r]});t.input.count<1e3&&(o=0,a=t.input.count),o=Math.max(o-1,0),a=Math.min(a+1,e.xValues.length);for(let n=o;n<a;n+=1)this.handleDatumPoint(e,i,n)}else{const{maxRange:o,indexData:a,midpointIndices:n}=e.dataAggregationFilter,[r,l]=AS(1,o,e.xAxisRange,c=>{const h=n[c];if(h!==uS)return[s(h),s(h)]});for(let c=r;c<l;c+=1){if(n[c]===uS)continue;const d=c*VP,p=a[d+zP],g=a[d+BP];this.handleDatumPoint(e,i,p,e.yHighValues[p],e.yLowValues[g])}}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){return{itemId:`${e.yLowKey}-${e.yHighKey}`,labelData:e.labelData,nodeData:e.nodes,fillData:{itemType:"high",spans:[],phantomSpans:[]},highStrokeData:{itemType:"high",spans:[]},lowStrokeData:{itemType:"low",spans:[]},scales:this.calculateScaling(),visible:this.visible,styles:{low:this.getLowOrHighMarkerStyles("low"),high:this.getLowOrHighMarkerStyles("high")},segments:void 0,intersectionSegments:void 0}}assembleResult(e,t){const i=this.axes[Fe.X],s=this.axes[Fe.Y];if(!i||!s||!this.chart?.seriesRect)return t;const o=e.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(h=>h.high);return MS(c,e.interpolation)}),a=e.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(h=>h.low);return MS(c,e.interpolation)}),n=t1(this.properties.segmentation,i,s,this.chart.seriesRect,this.ctx.scene,!1);let r;if(this.properties.invertedStyle.enabled){const l=e.yHighValues[0]<e.yLowValues[0],c=MP(o,a,e.xScale.range[0],e.xScale.range[1],l);r=kP(c,this.chart.seriesRect,this.ctx.scene,l,this.properties.invertedStyle)}return t.fillData={itemType:"high",spans:o,phantomSpans:a},t.highStrokeData={itemType:"high",spans:o},t.lowStrokeData={itemType:"low",spans:a},t.segments=n,t.intersectionSegments=r,t}getLowOrHighMarkerStyles(e){const{fill:t,fillOpacity:i,item:s}=this.properties,o=s[e],{stroke:a,strokeWidth:n,strokeOpacity:r}=o,l={fill:t,fillOpacity:i,stroke:a,strokeWidth:n,strokeOpacity:r};return e1(this,o,o.marker,l)}createLabelData({datumIndex:e,point:t,value:i,itemType:s,inverted:o,datum:a,series:n}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:p,yHighName:g,legendItemName:m,label:y}=this.properties,{placement:S}=y,x=y.spacing+(typeof y.padding=="number"?y.padding:0);let b=s;o&&(b=s==="low"?"high":"low");const f=S==="outside"&&b==="high"||S==="inside"&&b==="low"?-1:1,D=this.getSeriesDomain(Fe.Y).domain;return{x:t.x,y:t.y+x*f,series:n,itemType:s,datum:a,datumIndex:e,text:this.getLabelText(i,a,s==="high"?c:l,"y",D,y,{value:i,datum:a,itemType:s,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:p,yHighName:g,yName:d,legendItemName:m}),textAlign:"center",textBaseline:f===-1?"bottom":"top"}}isPathOrSelectionDirty(){const{low:e,high:t}=this.properties.item;return e.marker.isDirty()||t.marker.isDirty()}strokewidthChange(){const e=t=>{const i=this.properties.item[t].strokeWidth??0,s=this.properties.highlight.highlightedSeries.item?.[t]?.strokeWidth??i,o=this.properties.highlight.highlightedItem.item?.[t]?.strokeWidth??i;return i>o||s>o};return e("low")||e("high")}updatePathNodes(e){const{visible:t}=e,[i,s,o]=e.paths,a=this.contextNodeData?.segments,n=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightState(n,!1),l=this.getHighlightStyle(),{item:c,fill:h,fillOpacity:d,opacity:p}=gP(l,this.getStyle(r));s.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:ac.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:p,visible:t}),o.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:ac.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:p,visible:t});const g=this.getShapeFillBBox();i.setFillProperties(h,g),i.setStyleProperties({stroke:void 0,fill:h,fillOpacity:d,opacity:p},g);const m=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:m,pointerEvents:ac.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:p,visible:t}),i.datum=m,Tu(this,i),Tu(this,s),Tu(this,o)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),ZP(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,s]=e;i.path.clear(),s.path.clear(),DS(i,t.lowStrokeData.spans),DS(s,t.highStrokeData.spans),i.markDirty("RangeArea"),s.markDirty("RangeArea")}resetDatumAnimation(e){a1([e.datumSelection])}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{processedData:s,axes:o,properties:a}=this,n=a.styler?this.getStylerMarkerOptions().item:a.item,{low:r,high:l}=n,c=JP(s.input.count,o[Fe.X].scale,{enabled:r.marker.enabled||l.marker.enabled});(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let h;if(c)if(r.marker.enabled&&l.marker.enabled)h=t;else{h=[];for(const d of t)n[d.itemType].marker.enabled&&h.push(d)}else h=[];return Eu(this.processedData)?i.update(h,void 0,d=>n1(d.xValue,d.itemType)):i.update(h)}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex),n=this.getStyle(a),{fill:r,fillOpacity:l,item:c}=n,{stroke:h,strokeWidth:d,strokeOpacity:p}=c[o.itemType],{marker:g}=this.properties.item[o.itemType],m=this.makeItemStylerParams(o.itemType);o.style=this.getMarkerStyle(g,o,m,{isHighlight:t,highlightState:a,resolveMarkerSubPath:["item",o.itemType,"marker"]},n.item[o.itemType].marker,{fill:r,fillOpacity:l,stroke:h,strokeWidth:d,strokeOpacity:p})})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,o=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),n=this.getDrawingMode(s,e.drawingMode);i.each((r,l)=>{const{itemType:c}=l,h=l.style??t.styles[c][this.getHighlightState(a,s,l.datumIndex)];this.applyMarkerStyle(h,r,l.point,o),r.drawingMode=n}),s||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=ac.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:s=!1,labelSelection:o}=e;o.each((a,n)=>{a.fillOpacity=this.getHighlightStyle(s,n.datumIndex).opacity??1,HP(this,a,t,this.properties.label,n,s,i)})}getHighlightLabelData(e,t){return e?.length?e.filter(i=>i.datum===t.datum):[]}getHighlightData(e,t){const i=e.filter(s=>s.datum===t.datum).map(s=>({...s}));return i.length>0?i:void 0}getStyle(e){return this.getStylerCouple(e)[0]}getStylerMarkerOptions(){return this.getStylerCouple()[1]}getStylerCouple(e){const{fill:t,fillOpacity:i,item:s,styler:o}=this.properties;let a={};if(o){const c=this.makeStylerParams(e);a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(o,c)??{},{pick:!1})??{}}const n={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},r=c=>{const h=a.item?.[c],{lineDash:d,lineDashOffset:p,marker:g,stroke:m,strokeOpacity:y,strokeWidth:S}=s[c];return n.item[c].marker.enabled=h?.marker?.enabled??g.enabled,{marker:{fill:h?.marker?.fill??g.fill??t,fillOpacity:h?.marker?.fillOpacity??g.fillOpacity,shape:h?.marker?.shape??g.shape,size:h?.marker?.size??g.size,lineDash:h?.marker?.lineDash??g.lineDash,lineDashOffset:h?.marker?.lineDashOffset??g.lineDashOffset,stroke:h?.marker?.stroke??g.stroke??m,strokeOpacity:h?.marker?.strokeOpacity??g.strokeOpacity,strokeWidth:h?.marker?.strokeWidth??g.strokeWidth},lineDash:h?.lineDash??d,lineDashOffset:h?.lineDashOffset??p,stroke:h?.stroke??m,strokeOpacity:h?.strokeOpacity??y,strokeWidth:h?.strokeWidth??S}};return[{fill:a.fill??t,fillOpacity:a.fillOpacity??i,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:r("low"),high:r("high")}},n]}makeStylerParams(e){const{id:t}=this,{fill:i,fillOpacity:s,item:o,xKey:a,yHighKey:n,yLowKey:r}=this.properties,l=i1(e??s1.None),c=h=>{const{lineDash:d,lineDashOffset:p,marker:g,stroke:m,strokeOpacity:y,strokeWidth:S}=o[h];return{marker:{fill:g.fill??i,fillOpacity:g.fillOpacity,size:g.size,shape:g.shape,stroke:g.stroke??m,strokeOpacity:g.strokeOpacity,strokeWidth:g.strokeWidth,lineDash:g.lineDash,lineDashOffset:g.lineDashOffset},lineDash:d,lineDashOffset:p,stroke:m,strokeOpacity:y,strokeWidth:S}};return{item:{low:c("low"),high:c("high")},fill:i,fillOpacity:s,highlightState:l,seriesId:t,xKey:a,yLowKey:r,yHighKey:n}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties;return{xKey:t,yLowKey:i,yHighKey:s,itemType:e}}getTooltipContent(e,t){const i=t?.itemType??"high",{id:s,dataModel:o,processedData:a,axes:n,properties:r}=this,{xName:l,yName:c,yLowKey:h,yLowName:d,xKey:p,yHighKey:g,yHighName:m,tooltip:y,legendItemName:S}=r,x=n[Fe.X],b=n[Fe.Y];if(!o||!a||!x||!b)return;const f=a.dataSources.get(this.id)?.data[e],D=o.resolveKeysById(this,"xValue",a)[e],v=o.resolveColumnById(this,"yHighValue",a)[e],M=o.resolveColumnById(this,"yLowValue",a)[e],A=this.properties.allowNullKeys??!1;if(D===void 0&&!A)return;const I=this.getStyle(),k=this.makeItemStylerParams(i),N=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:f},k,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},I.item[i].marker),L=`${this.getAxisValueText(b,"tooltip",M,f,h,S)} - ${this.getAxisValueText(b,"tooltip",v,f,g,S)}`;return this.formatTooltipWithContext(y,{heading:this.getAxisValueText(x,"tooltip",D,f,p,S),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${d??h} - ${m??g}`,value:L,missing:$a.isTooltipValueMissing(v)&&$a.isTooltipValueMissing(M)}]},{seriesId:s,datum:f,title:c,itemType:i,xName:l,yName:c,yLowKey:h,yLowName:d,xKey:p,yHighKey:g,yHighName:m,legendItemName:S,...N})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(),{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,marker:n}=t;return{marker:{shape:n.shape,fill:n.fill??e,stroke:n.stroke??i,fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},line:{enabled:!0,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yLowKey:s,yHighKey:o,yName:a,yLowName:n,yHighName:r,legendItemName:l,showInLegend:c}=this.properties,h=l??a??`${n??s} - ${r??o}`,d=`${s}-${o}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new QP}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:o}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(o,s),jP(this,a,...o),$P([t],bS),UP(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),Lu(this,"labels",a,i,this.highlightLabelSelection)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:o,paths:a,previousContextData:n}=e,[r,l,c]=a;if(r==null&&l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,o)},d=()=>{t.skipCurrentBatch(),h()};if(o==null||n==null){h(),kS(this,t,"added",this.getAnimationDrawingModes(),i),Cu(this,"fill_path_properties",t,"add",r),Cu(this,"low_stroke_path_properties",t,"add",l),Cu(this,"high_stroke_path_properties",t,"add",c),Lu(this,"labels",t,s,this.highlightLabelSelection);return}const p=_P(o,n,this.processedData?.reduced?.diff?.[this.id]);if(p===void 0){d();return}else if(p.status==="no-op")return;wu(this.id,"fill_path_properties",t,[r],p.fill.pathProperties),wu(this.id,"low_stroke_path_properties",t,[l],p.stroke.pathProperties),wu(this.id,"high_stroke_path_properties",t,[c],p.stroke.pathProperties),p.status==="added"?this.updateAreaPaths(a,o):p.status==="removed"?this.updateAreaPaths(a,n):(Ou(this.id,"fill_path_update",t,[r],p.fill.path),Ou(this.id,"low_stroke_path_update",t,[l],p.stroke.path),Ou(this.id,"high_stroke_path_update",t,[c],p.stroke.path)),p.hasMotion&&(kS(this,t,void 0,this.getAnimationDrawingModes(),i),Lu(this,"labels",t,s,this.highlightLabelSelection)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,o)})}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(e.itemType);return this.getMarkerStyle(this.properties.item[e.itemType].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemType,"marker"]},void 0,t)}getMarkerStyle(e,t,i,s,o,a){return e.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(e,t,i,s,o,a)}computeFocusBounds(e){const t=vS(this,e),i=vS(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return qP.merge([t,i])}isDatumEnabled(e,t){return t%2===0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Pu.className="RangeAreaSeries",Pu.type="range-area";import{_ModuleSupport as l1}from"ag-charts-community";import{boolean as IS,commonSeriesOptionsDefs as c1,constant as h1,fillOptionsDef as d1,number as u1,required as nc,shapeSegmentation as p1,string as $i,undocumented as NS}from"ag-charts-core";var{rangeAreaSeriesThemeableOptionsDef:g1}=l1,Ru={...c1,...g1,type:nc(h1("range-area")),xKey:nc($i),yLowKey:nc($i),yHighKey:nc($i),xKeyAxis:$i,yKeyAxis:$i,xName:$i,yName:$i,yLowName:$i,yHighName:$i,legendItemName:$i,segmentation:p1,invertedStyle:{enabled:IS,...d1}};Ru.pickOutsideVisibleMinorAxis=NS(IS),Ru.focusPriority=NS(u1);import"ag-charts-community";import{CARTESIAN_AXIS_TYPE as m1,FILL_GRADIENT_LINEAR_DEFAULTS as LS,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as _u,FILL_IMAGE_DEFAULTS as rc,FILL_PATTERN_DEFAULTS as sr,LABEL_BOXING_DEFAULTS as y1,MARKER_SERIES_HIGHLIGHT_STYLE as f1,SEGMENTATION_DEFAULTS as x1}from"ag-charts-core";var TS={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",_u],["image",rc],["pattern",sr]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",_u],["image",rc],["pattern",sr]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},S1={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",LS],["pattern",sr]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",_u],["image",rc],["pattern",sr]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:TS,high:TS},label:{...y1,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:f1,segmentation:x1,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",LS],["image",rc],["pattern",sr]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{[m1.NUMBER]:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:b1}=rP,lc={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,version:nP,dependencies:[aP],options:Ru,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:b1,defaultAxes:{y:{type:cS.NUMBER,position:hS.LEFT},x:{type:cS.CATEGORY,position:hS.BOTTOM}},axisKeys:{[dS.X]:"xKeyAxis",[dS.Y]:"yKeyAxis"},themeTemplate:S1,create:e=>new Pu(e)};import{CartesianChartModule as v1,VERSION as D1,_ModuleSupport as M1}from"ag-charts-community";import{ChartAxisDirection as cc,DIRECTION_SWAP_AXES as k1}from"ag-charts-core";import{_ModuleSupport as Ya}from"ag-charts-community";import{AGGREGATION_INDEX_X_MAX as CS,AGGREGATION_INDEX_X_MIN as A1,AGGREGATION_INDEX_Y_MAX as I1,AGGREGATION_INDEX_Y_MIN as N1,AGGREGATION_SPAN as wS,ChartAxisDirection as Xa,DebugMetrics as L1,areScalingEqual as T1,findMinMax as C1,mergeDefaults as OS}from"ag-charts-core";import"ag-charts-community";import{aggregationDomain as zu,computeExtremesAggregation as ES,computeExtremesAggregationPartial as w1,simpleMemorize2 as O1}from"ag-charts-core";function E1(e,t,i,s,o,a,n,r){const[l,c]=zu(e,o);return ES([l,c],t,i,s,{smallestKeyInterval:a,xNeedsValueOf:n,yNeedsValueOf:r})}var P1=O1(E1);function R1(e,t,i,s,o){const a=t.resolveKeysById(s,"xValue",i),n=t.resolveColumnById(s,"yHighValue",i),r=t.resolveColumnById(s,"yLowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i);if(o){const[d,p]=zu(e,l);return ES([d,p],a,n,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:o})}return P1(e,a,n,r,l,i.reduced?.smallestKeyInterval,c,h)}function _1(e,t,i,s,o,a){const n=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i),l=t.resolveColumnById(s,"yLowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),[p,g]=zu(e,c);return w1([p,g],n,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:o,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:a})}import{_ModuleSupport as z1}from"ag-charts-community";import{Property as ke}from"ag-charts-core";var{AbstractBarSeriesProperties:B1,makeSeriesTooltip:V1,DropShadow:F1,Label:H1}=z1,Bu=class extends H1{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};u([ke],Bu.prototype,"placement",2),u([ke],Bu.prototype,"spacing",2);var Ee=class extends B1{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new F1().set({enabled:!1}),this.label=new Bu,this.tooltip=V1()}};u([ke],Ee.prototype,"xKey",2),u([ke],Ee.prototype,"yLowKey",2),u([ke],Ee.prototype,"yHighKey",2),u([ke],Ee.prototype,"xName",2),u([ke],Ee.prototype,"yName",2),u([ke],Ee.prototype,"yLowName",2),u([ke],Ee.prototype,"yHighName",2),u([ke],Ee.prototype,"fill",2),u([ke],Ee.prototype,"fillOpacity",2),u([ke],Ee.prototype,"stroke",2),u([ke],Ee.prototype,"strokeWidth",2),u([ke],Ee.prototype,"strokeOpacity",2),u([ke],Ee.prototype,"lineDash",2),u([ke],Ee.prototype,"lineDashOffset",2),u([ke],Ee.prototype,"cornerRadius",2),u([ke],Ee.prototype,"styler",2),u([ke],Ee.prototype,"itemStyler",2),u([ke],Ee.prototype,"shadow",2),u([ke],Ee.prototype,"label",2),u([ke],Ee.prototype,"tooltip",2);var{SeriesNodePickMode:PS,valueProperty:RS,keyProperty:K1,checkCrisp:G1,updateLabelNode:W1,SMALLEST_KEY_INTERVAL:j1,LARGEST_KEY_INTERVAL:$1,diff:U1,prepareBarAnimationFunctions:_S,midpointStartingBarPosition:zS,resetBarSelectionsFn:Y1,resetBarSelectionsDirect:X1,fixNumericExtent:Z1,seriesLabelFadeInAnimation:BS,resetLabelFn:Q1,animationValidation:q1,computeBarFocusBounds:J1,visibleRangeIndices:eR,createDatumId:tR,Rect:iR,PointerEvents:sR,motion:VS,processedDataIsAnimatable:Vu,getItemStyles:oR,calculateSegments:aR,toHighlightString:nR,HighlightState:FS,AggregationManager:rR,upsertNodeDatum:Fu}=Ya,lR=class extends Ya.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Hu=class extends Ya.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[PS.AXIS_ALIGNED,PS.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:Y1,label:Q1}}),this.properties=new Ee,this.aggregationManager=new rR,this.NodeEvent=lR}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,o=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:n,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:o,yScale:a}),c=[];this.needsDataModelDiff()&&this.processedData&&c.push(U1(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||c.push(q1());const h=this.visible?{}:{forceValue:0},d=this.properties.allowNullKeys??!1,{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[K1(t,r,{id:"xValue",allowNullKey:d}),RS(i,l,{id:"yLowValue",invalidValue:null,...h}),RS(s,l,{id:"yHighValue",invalidValue:null,...h}),...n?[j1,$1]:[],...c],groupByKeys:!1});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||Vu(t))return;const i=this.axes[Xa.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>_1(i.scale.type,e,t,this,s,a),computeFull:a=>R1(i.scale.type,e,t,this,a),targetRange:s});const o=this.aggregationManager.filters;o&&o.length>0&&L1.record(`${this.type}:aggregation`,o.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes[Xa.X];if(e?.scale==null)return 0;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:a}}return{domain:this.padBandExtent(s)}}else{const o=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),a=C1(o);return{domain:Z1(a)}}}getSeriesRange(e,t){return this.domainForVisibleRange(Xa.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const o=s.dataSources?.get(this.id)?.data;if(o==null)return;const a=e.scale,n=t.scale,r=this.getBarDirection()===Xa.X,l=G1(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval),[c,h]=a.range,d=Math.abs(h-c);this.aggregationManager.ensureLevelForRange(d);const p=this.aggregationManager.getFilterForRange(d),g=!this.ctx.animationManager.isSkipped(),m=this.contextNodeData?.nodeData!=null&&(s.changeDescription!=null||!Vu(s)||p!=null),{groupOffset:y,barOffset:S,barWidth:x}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:o,xValues:i.resolveKeysById(this,"xValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s),xScale:a,yScale:n,groupOffset:y,barOffset:S,barWidth:x,barAlongX:r,crisp:l,dataAggregationFilter:p,animationEnabled:g,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,labelEnabled:this.properties.label.enabled,labelPlacement:this.properties.label.placement,labelPadding:(this.properties.label.spacing+(typeof this.properties.label.padding=="number"?this.properties.label.padding:0))*(this.properties.label.placement==="outside"?1:-1),canIncrementallyUpdate:m,nodes:m?this.contextNodeData.nodeData:[],nodeIndex:0}}prepareNodeDatumState(e,t,i){const s=e.rawData[i],o=e.xValues[i];if(o===void 0&&!this.properties.allowNullKeys)return;const a=e.yLowValues[i],n=e.yHighValues[i];if(!Number.isFinite(a?.valueOf())||!Number.isFinite(n?.valueOf()))return;const[r,l]=a<n?[a,n]:[n,a];return t.datum=s,t.xValue=o,t.yLowValue=r,t.yHighValue=l,t.rawLowValue=a,t.rawHighValue=n,t}createSkeletonNodeDatum(e,t){const i=t.nodeDatumScratch;return{index:t.groupedDataIndex,series:this,datum:i.datum,datumIndex:t.datumIndex,xValue:i.xValue,yLowValue:0,yHighValue:0,yLowKey:e.yLowKey,yHighKey:e.yHighKey,xKey:e.xKey,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:t.crisp,labels:[]}}createNodeDatum(e,t,i,s){const o=this.prepareNodeDatumState(e,t.nodeDatumScratch,t.datumIndex);if(!o)return;const a=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,a,t,s,o),a}updateNodeDatum(e,t,i,s,o){if(o??(o=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex)),!o)return;const a=t;a.index=i.groupedDataIndex,a.datum=o.datum,a.datumIndex=i.datumIndex,a.xValue=o.xValue,a.yLowValue=o.rawLowValue,a.yHighValue=o.rawHighValue,a.crisp=i.crisp;const n=Math.round(e.yScale.convert(i.yHigh)),r=Math.round(e.yScale.convert(i.yLow)),l=Math.max(s,Math.abs(r-n)),c={x:e.barAlongX?Math.min(n,r):i.x,y:e.barAlongX?i.x:Math.min(n,r),width:e.barAlongX?l:i.width,height:e.barAlongX?i.width:l};a.x=c.x,a.y=c.y,a.width=c.width,a.height=c.height;const h=a.midPoint;h.x=c.x+c.width/2,h.y=c.y+c.height/2;const d=a.clipBBox;d&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height);const p=i.labelParamsScratch;p.labels=a.labels,p.datumIndex=i.datumIndex,p.rectX=c.x,p.rectY=c.y,p.rectWidth=c.width,p.rectHeight=c.height,p.yLowValue=o.yLowValue,p.yHighValue=o.yHighValue,p.datum=o.datum,this.updateLabelData(e,p)}createNodeDataWithAggregation(e,t,i,s,o,a){const{maxRange:n,indexData:r,midpointIndices:l}=a,[c,h]=eR(1,n,e.xAxis.range,d=>{const p=d*wS,g=r[p+CS],m=l[d];if(m!==-1)return[t(m),t(g)+e.barWidth]});for(let d=c;d<h;d+=1){const p=d*wS,g=r[p+A1],m=r[p+CS],y=r[p+N1],S=r[p+I1],x=l[d];x===-1||e.xValues[x]===void 0&&!this.properties.allowNullKeys||(i.datumIndex=x,i.groupedDataIndex=0,i.x=t(x),i.width=Math.abs(t(g)-t(m))+e.barWidth,i.yLow=e.yLowValues[y],i.yHigh=e.yHighValues[S],i.crisp=!1,Fu(e,i,(f,D)=>this.createNodeDatum(f,D,s,o),(f,D,v)=>this.updateNodeDatum(f,D,v,o)))}}createNodeDataSimple(e,t,i,s,o,a){const n=a.invalidData?.get(this.id);let[r,l]=this.visibleRangeIndices("xValue",e.xAxis.range);a.input.count<1e3&&(r=0,l=a.input.count);for(let c=r;c<l;c+=1)n?.[c]!==!0&&(i.datumIndex=c,i.groupedDataIndex=0,i.x=t(c),i.width=e.barWidth,i.yLow=e.yLowValues[c],i.yHigh=e.yHighValues[c],i.crisp=e.crisp,Fu(e,i,(h,d)=>this.createNodeDatum(h,d,s,o),(h,d,p)=>this.updateNodeDatum(h,d,p,o)))}createNodeDataGrouped(e,t,i,s,o){const a=this.processedData;for(const{datumIndex:n,groupIndex:r}of this.dataModel.forEachGroupDatum(this,a))i.datumIndex=n,i.groupedDataIndex=r,i.x=t(n),i.width=e.barWidth,i.yLow=e.yLowValues[n],i.yHigh=e.yHighValues[n],i.crisp=e.crisp,Fu(e,i,(l,c)=>this.createNodeDatum(l,c,s,o),(l,c,h)=>this.updateNodeDatum(l,c,h,o))}populateNodeData(e){const{processedData:t}=this;if(!t)return;const{yLowKey:i,yHighKey:s,strokeWidth:o}=this.properties,a=`${i}-${s}`,n=l=>{const c=e.xScale.convert(e.xValues[l]);return Number.isFinite(c)?Math.round(c)+e.groupOffset+e.barOffset:Number.NaN},r={nodeDatumScratch:{datum:void 0,xValue:void 0,yLowValue:0,yHighValue:0,rawLowValue:void 0,rawHighValue:void 0},labelParamsScratch:{labels:[],datumIndex:0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,yLowValue:0,yHighValue:0,datum:void 0},datumIndex:0,groupedDataIndex:0,x:0,width:0,yLow:0,yHigh:0,crisp:!1};e.dataAggregationFilter!=null?this.createNodeDataWithAggregation(e,n,r,a,o,e.dataAggregationFilter):t.type==="ungrouped"?this.createNodeDataSimple(e,n,r,a,o,t):this.createNodeDataGrouped(e,n,r,a,o)}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){const{yLowKey:t,yHighKey:i}=this.properties,s=`${t}-${i}`,o=this.getCategoryAxis(),a=this.getValueAxis(),n=o&&a&&this.chart?.seriesRect?aR(this.properties.segmentation,o,a,this.chart.seriesRect,this.ctx.scene):void 0;return{itemId:s,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:oR(this.getItemStyle.bind(this)),segments:n}}assembleResult(e,t){for(const i of e.nodes)t.labelData.push(...i.labels);return t}updateLabelData(e,t){const i=t.labels;if(!e.labelEnabled){i.length>0&&(i.length=0);return}const{xKey:s,yLowKey:o,yHighKey:a,xName:n,yLowName:r,yHighName:l,yName:c,legendItemName:h,label:d}=this.properties,p=e.barAlongX,g=e.labelPlacement,m=e.labelPadding,y=t.rectX,S=t.rectY,x=t.rectWidth,b=t.rectHeight,f=y+(p?-m:x/2),D=S+(p?b/2:b+m);let v;g==="outside"?v=p?"right":"center":v=p?"left":"center";let M;g==="outside"?M=p?"middle":"top":M=p?"middle":"bottom";const A=y+(p?x+m:x/2),I=S+(p?b/2:-m);let k;g==="outside"?k=p?"left":"center":k=p?"right":"center";let N;g==="outside"?N=p?"middle":"bottom":N=p?"middle":"top";const L=t.datum,T=t.yLowValue,P=t.yHighValue,O=t.datumIndex,C={datum:L,xKey:s,yLowKey:o,yHighKey:a,xName:n,yLowName:r,yHighName:l,yName:c,legendItemName:h},R=this.getSeriesDomain(Xa.Y).domain,V=this.getLabelText(T,L,o,"y",R,d,{itemType:"low",value:T,...C}),E=this.getLabelText(P,L,a,"y",R,d,{itemType:"high",value:P,...C});if(i.length>0&&i[0].itemType==="low"){const w=i[0];w.datumIndex=O,w.x=f,w.y=D,w.textAlign=v,w.textBaseline=M,w.text=V,w.datum=L}else i[0]={datumIndex:O,x:f,y:D,textAlign:v,textBaseline:M,text:V,itemType:"low",datum:L,series:this};if(i.length>1&&i[1].itemType==="high"){const w=i[1];w.datumIndex=O,w.x=A,w.y=I,w.textAlign=k,w.textBaseline=N,w.text=E,w.datum=L}else i[1]={datumIndex:O,x:A,y:I,textAlign:k,textBaseline:N,text:E,itemType:"high",datum:L,series:this};i.length=2}nodeFactory(){return new iR}getStyle(e,t){const{cornerRadius:i,fill:s,fillOpacity:o,lineDash:a,lineDashOffset:n,stroke:r,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!e&&h){const p=this.makeStylerParams(t);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,p)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??s,fillOpacity:d.fillOpacity??o,lineDash:d.lineDash??a,lineDashOffset:d.lineDashOffset??n,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,fill:s,fillOpacity:o,lineDash:a,lineDashOffset:n,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:d,yHighKey:p}=this.properties,g=nR(e??FS.None);return{cornerRadius:i,fill:s,fillOpacity:o,highlightState:g,lineDash:a,lineDashOffset:n,seriesId:t,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:d,yHighKey:p}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return Vu(this.processedData)?i.update(s,void 0,o=>this.getDatumId(o)):i.update(s)}getItemStyle(e,t,i){const{properties:s,dataModel:o,processedData:a}=this,{itemStyler:n}=s,r=this.getHighlightStyle(t,e,i);let l=OS(r,this.getStyle(e===void 0,i));if(n&&o!=null&&a!=null&&e!=null){const c=o.resolveKeysById(this,"xValue",a)[e],h=this.cachedDatumCallback(tR(this.getDatumId({xValue:c}),t?"highlight":"node"),()=>{const d=this.makeItemStylerParams(e,t,l);return this.callWithContext(n,d)});h&&(l=OS(h,l))}return l}makeItemStylerParams(e,t,i){const{id:s,properties:o,processedData:a}=this,{xKey:n,yHighKey:r,yLowKey:l}=o,c=a.dataSources.get(s)?.data[e],h=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(h,t,e),p=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:c,xKey:n,yHighKey:r,yLowKey:l,highlightState:d,...i,fill:p}}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight();e.datumSelection.each((i,s)=>{if(!e.datumSelection.isGarbage(i)){const o=this.getHighlightState(t,e.isHighlight,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,e.isHighlight,o)}})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),o=this.getCategoryDirection()===Xa.X,a=this.getShapeFillBBox(),n=this;e.each(function(l,c){const h=c.style??i.styles[n.getHighlightState(s,t,c.datumIndex)];l.setStyleProperties(h,a),l.setStaticProperties("overlay",h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,o?c.width>0:c.height>0,c.crisp,void 0)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=sR.None})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},s=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,a)=>{o.fillOpacity=this.getHighlightStyle(t,a?.datumIndex).opacity??1,W1(this,o,i,this.properties.label,a,t,s)})}getHighlightLabelData(e,t){return t.labels?.length?t.labels:super.getHighlightLabelData(e,t)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:p,legendItemName:g}=o,m=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!s||!m||!y)return;const S=s.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yHighValue",s)[e],f=i.resolveColumnById(this,"yLowValue",s)[e],D=this.properties.allowNullKeys??!1;if(x===void 0&&!D)return;const v=this.getItemStyle(e,!1),M=`${this.getAxisValueText(y,"tooltip",f,S,l,g)} - ${this.getAxisValueText(y,"tooltip",b,S,c,g)}`;return this.formatTooltipWithContext(p,{heading:this.getAxisValueText(m,"tooltip",x,S,a,g),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${d??c}`,value:M,missing:Ya.isTooltipValueMissing(b)&&Ya.isTooltipValueMissing(f)}]},{seriesId:t,datum:S,title:r,xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,legendItemName:g,...v})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this.getStyle(!1,FS.None);return{marker:{fill:e,stroke:t,fillOpacity:s,strokeOpacity:o,strokeWidth:i,lineDash:a,lineDashOffset:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yName:s,yLowName:o,yHighName:a,yLowKey:n,yHighKey:r,legendItemName:l,showInLegend:c}=this.properties,h=l??s??`${o??n} - ${a??r}`,d=`${n}-${r}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}resetDatumAnimation(e){X1([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=_S(zS(this.isVertical(),"normal"),"unknown");VS.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),BS(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,previousContextData:o}=e,a=Ya.calculateDataDiff(this.id,t,this.getDatumId.bind(this),s,o,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const n=o==null?"fade":"normal",r=_S(zS(this.isVertical(),n),"added");VS.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),a),(a?.changed||!T1(s.groupScale,o?.groupScale))&&BS(this,"labels",this.ctx.animationManager,i,this.highlightLabelSelection)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return J1(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Hu.className="RangeBarSeries",Hu.type="range-bar";import{_ModuleSupport as cR}from"ag-charts-community";import{boolean as hR,commonSeriesOptionsDefs as dR,constant as uR,number as pR,positiveNumberNonZero as gR,ratio as mR,required as hc,shapeSegmentation as yR,string as Ui,undocumented as HS}from"ag-charts-core";var{rangeBarSeriesThemeableOptionsDef:fR}=cR,Ku={...dR,...fR,type:hc(uR("range-bar")),xKey:hc(Ui),yLowKey:hc(Ui),yHighKey:hc(Ui),xKeyAxis:Ui,yKeyAxis:Ui,xName:Ui,yName:Ui,yLowName:Ui,yHighName:Ui,legendItemName:Ui,segmentation:yR,width:gR,widthRatio:mR};Ku.pickOutsideVisibleMinorAxis=HS(hR),Ku.focusPriority=HS(pR);import"ag-charts-community";import{CARTESIAN_AXIS_TYPE as xR,FILL_GRADIENT_LINEAR_DEFAULTS as SR,FILL_IMAGE_DEFAULTS as bR,FILL_PATTERN_DEFAULTS as vR,LABEL_BOXING_DEFAULTS as DR,MULTI_SERIES_HIGHLIGHT_STYLE as MR,SEGMENTATION_DEFAULTS as kR}from"ag-charts-core";var AR={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",SR],["image",bR],["pattern",vR]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...DR,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:MR,segmentation:kR},axes:{[xR.NUMBER]:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:IR}=M1,dc={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,groupable:!0,version:D1,dependencies:[v1],options:Ku,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:IR,defaultAxes:k1,axisKeys:{[cc.X]:"xKeyAxis",[cc.Y]:"yKeyAxis"},axisKeysFlipped:{[cc.X]:"yKeyAxis",[cc.Y]:"xKeyAxis"},themeTemplate:AR,create:e=>new Hu(e)};import{CartesianChartModule as NR,VERSION as LR}from"ag-charts-community";import{ChartAxisDirection as uc,DIRECTION_SWAP_AXES as TR}from"ag-charts-core";import{_ModuleSupport as Za}from"ag-charts-community";import{ChartAxisDirection as pc,easeOut as KS,isContinuous as GS,mergeDefaults as WS}from"ag-charts-core";import{_ModuleSupport as CR}from"ag-charts-community";import{BaseProperties as or,PropertiesArray as wR,Property as q}from"ag-charts-core";var{AbstractBarSeriesProperties:OR,makeSeriesTooltip:ER,DropShadow:PR,Label:RR}=CR,gc=class extends or{};u([q],gc.prototype,"totalType",2),u([q],gc.prototype,"index",2),u([q],gc.prototype,"axisLabel",2);var jS=class extends or{};u([q],jS.prototype,"renderer",2);var Gu=class extends RR{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};u([q],Gu.prototype,"placement",2),u([q],Gu.prototype,"spacing",2);var St=class extends or{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new PR().set({enabled:!1}),this.label=new Gu,this.tooltip=new jS}};u([q],St.prototype,"name",2),u([q],St.prototype,"fill",2),u([q],St.prototype,"stroke",2),u([q],St.prototype,"fillOpacity",2),u([q],St.prototype,"strokeOpacity",2),u([q],St.prototype,"lineDash",2),u([q],St.prototype,"lineDashOffset",2),u([q],St.prototype,"strokeWidth",2),u([q],St.prototype,"cornerRadius",2),u([q],St.prototype,"itemStyler",2),u([q],St.prototype,"shadow",2),u([q],St.prototype,"label",2),u([q],St.prototype,"tooltip",2);var $o=class extends or{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};u([q],$o.prototype,"enabled",2),u([q],$o.prototype,"stroke",2),u([q],$o.prototype,"strokeOpacity",2),u([q],$o.prototype,"lineDash",2),u([q],$o.prototype,"lineDashOffset",2),u([q],$o.prototype,"strokeWidth",2);var mc=class extends or{constructor(){super(...arguments),this.positive=new St,this.negative=new St,this.total=new St}};u([q],mc.prototype,"positive",2),u([q],mc.prototype,"negative",2),u([q],mc.prototype,"total",2);var Ds=class extends OR{constructor(){super(...arguments),this.item=new mc,this.totals=new wR(gc),this.line=new $o,this.tooltip=ER()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:s,fill:o,stroke:a,lineDash:n,lineDashOffset:r,cornerRadius:l}=this.item[e==="subtotal"?"total":e];return{fill:o,fillOpacity:t,stroke:a,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:r,cornerRadius:l,opacity:1}}};u([q],Ds.prototype,"xKey",2),u([q],Ds.prototype,"yKey",2),u([q],Ds.prototype,"xName",2),u([q],Ds.prototype,"yName",2),u([q],Ds.prototype,"item",2),u([q],Ds.prototype,"totals",2),u([q],Ds.prototype,"line",2),u([q],Ds.prototype,"tooltip",2);var{adjustLabelPlacement:_R,SeriesNodePickMode:$S,fixNumericExtent:zR,valueProperty:US,keyProperty:BR,accumulativeValueProperty:yc,trailingAccumulatedValueProperty:VR,createDatumId:Wu,checkCrisp:FR,updateLabelNode:HR,prepareBarAnimationFunctions:KR,collapsedStartingBarPosition:GR,resetBarSelectionsDirect:WR,resetBarSelectionsFn:jR,seriesLabelFadeInAnimation:$R,resetLabelFn:UR,animationValidation:YR,DEFAULT_CARTESIAN_DIRECTION_KEYS:XR,DEFAULT_CARTESIAN_DIRECTION_NAMES:ZR,computeBarFocusBounds:QR,Rect:qR,motion:JR,getItemStylesPerItemId:e_,DataSet:t_,processedDataIsAnimatable:i_,upsertNodeDatum:s_}=Za,ju=class extends Za.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:XR,propertyNames:ZR,categoryKey:void 0,pickModes:[$S.NEAREST_NODE,$S.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:jR,label:UR}}),this.properties=new Ds,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:s}=this.properties,{data:o}=this;if(!this.visible)return;const a=f=>GS(f)&&Number(f)>=0,n=f=>GS(f)&&Number(f)>=0,r=f=>f==="total"||f==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((f,D)=>{const v=f.get(D.index);return v?v.push(D):f.set(D.index,[D]),f},new Map);for(const[f,D]of o?.data.entries()??[]){c.push(D);const v=h.get(f);if(v)for(const M of v)c.push({...M.toJson(),[t]:M.axisLabel})}const d=[];this.ctx.animationManager.isSkipped()||d.push(YR());const p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:m,xScaleType:y,yScaleType:S}=this.getScaleInformation({xScale:p,yScale:g}),x=this.properties.allowNullKeys??!1,{processedData:b}=await this.requestDataModel(e,t_.wrap(c),{props:[BR(t,y,{id:"xValue",allowNullKey:x}),yc(i,S,{...l,id:"yCurrent"}),yc(i,S,{...l,missingValue:0,id:"yCurrentTotal"}),yc(i,S,{...l,id:"yCurrentPositive",validation:a}),yc(i,S,{...l,id:"yCurrentNegative",validation:n}),VR(i,S,{...l,id:"yPrevious"}),US(i,S,{id:"yRaw"}),US("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...m?[Za.SMALLEST_KEY_INTERVAL,Za.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=b.reduced?.smallestKeyInterval,this.largestDataInterval=b.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s],values:o}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category"){const l=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:l}}const n=e===pc.Y,r=this.getCategoryAxis().isReversed();return{domain:this.padBandExtent(s,r!==n)}}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),n=o[a],r=[Math.min(0,n[0]),Math.max(0,n[1])];return{domain:zR(r)}}}getSeriesRange(){return[Number.NaN,Number.NaN]}populateNodeData(e){let t=0;const i={datumIndex:0,datum:void 0,xDatum:void 0,value:void 0,cumulativeValue:void 0,trailingValue:void 0,datumType:void 0};for(const[s,o]of e.rawData.entries()){const a=e.totalTypeValues[s],n=this.isSubtotal(a),r=this.isTotal(a),l=r||n,c=e.xValues[s];if(c===void 0&&!this.properties.allowNullKeys)continue;const h=e.yRawValues[s],{cumulativeValue:d,trailingValue:p}=this.computeWaterfallValues(e,s,r,n,t);l&&(t=d??0);const g=this.computeDisplayValue(r,n,h,d,p);i.datumIndex=s,i.datum=o,i.xDatum=c,i.value=g,i.cumulativeValue=d,i.trailingValue=p,i.datumType=a;const m=s_(e,i,(y,S)=>this.createNodeDatum(y,S),(y,S,x)=>this.updateNodeDatum(y,S,x));if(m){const y=this.createPointDatum(e,m,d,p,l);e.pointData.push(y)}}}finalizeNodeData(e){e.nodeIndex<e.nodes.length&&(e.nodes.length=e.nodeIndex)}initializeResult(e){return{itemId:this.properties.yKey,nodeData:e.nodes,labelData:e.nodes,pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible,styles:e_(this.getItemStyle.bind(this),"total","subtotal","positive","negative")}}assembleResult(e,t){const i=this.properties.line.enabled;return e.yCurrValues!=null&&i&&(t.pointData=e.pointData),t}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s||s.type!=="ungrouped")return;const o=this.getCategoryAxis(),a=this.getValueAxis();if(!o||!a)return;const n=e.scale,r=t.scale,l=i.resolveKeysById(this,"xValue",s),c=i.resolveColumnById(this,"yRaw",s),h=i.resolveColumnById(this,"totalTypeValue",s),d=i.resolveColumnById(this,"yCurrent",s),p=i.resolveColumnById(this,"yPrevious",s),g=i.resolveColumnById(this,"yCurrentTotal",s),m=s.dataSources.get(this.id)?.data??[],{xKey:y,yKey:S,xName:x,yName:b,line:f}=this.properties,{contextNodeData:D}=this,v=!this.ctx.animationManager.isSkipped(),M=D?.nodeData!=null&&s.changeDescription!=null,{barWidth:A}=this.getBarDimensions();return{xAxis:e,yAxis:t,xScale:n,yScale:r,categoryAxis:o,valueAxis:a,barAlongX:this.getBarDirection()===pc.X,barWidth:A,categoryAxisReversed:o.isReversed(),valueAxisReversed:a.isReversed(),crisp:FR(o.scale,o.visibleRange,this.smallestDataInterval,this.largestDataInterval),animationEnabled:v,xKey:y,yKey:S,xName:x,yName:b,lineStrokeWidth:f.strokeWidth,yDomain:this.getSeriesDomain(pc.Y).domain,xValues:l,rawData:m,yRawValues:c,totalTypeValues:h,yCurrValues:d,yPrevValues:p,yCurrTotalValues:g,canIncrementallyUpdate:M,nodes:M?D.nodeData:[],nodeIndex:0,pointData:[]}}computeWaterfallValues(e,t,i,s,o){return i||s?{cumulativeValue:e.yCurrTotalValues[t],trailingValue:s?o:0}:{cumulativeValue:e.yCurrValues[t],trailingValue:e.yPrevValues[t]}}computeDisplayValue(e,t,i,s,o){return e?s:t?(s??0)-(o??0):i}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:s,crisp:o}=e,{datumIndex:a,datum:n,xDatum:r,value:l,cumulativeValue:c,datumType:h}=t,d=(l??0)>=0,p=this.getSeriesItemType(d,h);return{index:a,series:this,itemType:p,datum:n,datumIndex:a,cumulativeValue:c??0,xValue:r,yValue:l,yKey:s,xKey:i,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:o,label:{text:"",x:0,y:0,textAlign:"center",textBaseline:"middle"}}}updateNodeDatum(e,t,i){const{xScale:s,yScale:o,barAlongX:a,barWidth:n,valueAxisReversed:r,xKey:l,yKey:c,xName:h,yName:d,yDomain:p,crisp:g}=e,{datumIndex:m,datum:y,xDatum:S,value:x,cumulativeValue:b,trailingValue:f,datumType:D}=i,v=t,M=Math.round(s.convert(S));if(!Number.isFinite(M))return;const A=(x??0)>=0,I=this.getSeriesItemType(A,D),{strokeWidth:k,label:N}=this.getItemConfig(I),L=Math.round(o.convert(b)),T=Math.round(o.convert(f)),P=A?L:T,O=A?T:L,C=Math.max(k,Math.abs(O-P)),R=a?Math.min(P,O):M,V=a?M:Math.min(P,O),E=a?C:n,w=a?n:C;if(v.index=m,v.itemType=I,v.datum=y,v.datumIndex=m,v.cumulativeValue=b??0,v.xValue=S,v.yValue=x,v.x=R,v.y=V,v.width=E,v.height=w,v.crisp=g,v.midPoint?(v.midPoint.x=R+E/2,v.midPoint.y=V+w/2):v.midPoint={x:R+E/2,y:V+w/2},N.enabled){const z=I==="subtotal"?"total":I,B=this.getLabelText(x,y,c,"y",p,N,{itemType:z,value:x,datum:y,xKey:l,yKey:c,xName:h,yName:d}),K=N.spacing+(typeof N.padding=="number"?N.padding:0),_=_R({isUpward:(x??-1)>=0!==r,isVertical:!a,placement:N.placement,spacing:K,rect:{x:R,y:V,width:E,height:w}});v.label.text=B,v.label.x=_.x,v.label.y=_.y,v.label.textAlign=_.textAlign,v.label.textBaseline=_.textBaseline}else v.label.text=""}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}createPointDatum(e,t,i,s,o){const{yScale:a,barAlongX:n,categoryAxisReversed:r,lineStrokeWidth:l}=e,c=Math.round(a.convert(i)),h=Math.round(a.convert(s)),d=o?c:h,p=Math.floor(l)%2/2,g=r?c:d,m=r?d:c,y={x:t.x,y:t.y,width:t.width,height:t.height};let S,x;return n?(S={x:g+p,y:y.y},x={x:m+p,y:y.y+y.height}):(S={x:y.x,y:g+p},x={x:y.x+y.width,y:m+p}),{x:r?x.x:S.x,y:r?x.y:S.y,x2:r?S.x:x.x,y2:r?S.y:x.y,size:0}}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const s=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),o=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=e.resolveProcessedDataIndexById(this,"totalTypeValue"),n=i.domain.values[s]??[],r=i.domain.values[o]??[];n.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[a];if(l)for(const c of l)(c==="total"||c==="subtotal")&&t.add("total")}isSubtotal(e){return e==="subtotal"}isTotal(e){return e==="total"}nodeFactory(){return new qR}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i_(this.processedData)?i.update(s,void 0,o=>Wu(o.datumIndex)):i.update(s)}getItemStyle(e,t,i,s="total"){const{properties:o}=this,{datumIndex:a=0,datum:n}=e??{},r=s==="subtotal"?"total":s,l=o.item[r],c=this.getHighlightStyle(t,a,i),h=WS(c,o.getStyle(s)),{itemStyler:d}=l;let p=h;if(d!=null&&e!=null){const g=this.cachedDatumCallback(Wu(a,t?"highlight":"node"),()=>{const m=this.makeItemStylerParams(s,a,n,t,p);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(d,m))});g&&(p=WS(g,p))}return p}makeItemStylerParams(e,t,i,s,o){const{id:a,properties:n}=this,{xKey:r,yKey:l}=n,c=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(c,s,t),d=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:a,itemType:e,datum:i,xKey:r,yKey:l,highlightState:h,...o,fill:d}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),o=this.getCategoryDirection()===pc.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=r.style??i.styles[r.itemType][this.getHighlightState(s,t,r.datumIndex)];n.setStyleProperties(l,a),n.cornerRadius=l.cornerRadius??0,n.visible=o?r.width>0:r.height>0,n.crisp=r.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(t.length===0)return i.update([]);const s=t.filter(o=>{const{label:a}=this.getItemConfig(o.itemType);return a.enabled});return i.update(s)}updateLabelNodes({labelSelection:e,isHighlight:t}){const i={itemType:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},s=this.ctx.highlightManager?.getActiveHighlight();e.each((o,a)=>{i.itemType=a.itemType;const n=this.getHighlightStyle(t,a.datumIndex)?.opacity??1;o.visible=!0,o.fillOpacity=n;const r=this.getItemConfig(a.itemType).label;HR(this,o,i,r,a.label,t,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yKey:r,yName:l,tooltip:c,legendItemName:h}=o,d=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!d||!p)return;const g=s.dataSources.get(this.id)?.data[e],m=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yRaw",s)[e],S=i.resolveColumnById(this,"yCurrentTotal",s),x=i.resolveColumnById(this,"totalTypeValue",s),b=this.properties.allowNullKeys??!1;if(m===void 0&&!b)return;const f=x[e],D=(y??0)>=0,v=this.getSeriesItemType(D,f);let M;if(this.isTotal(f))M=S[e];else if(this.isSubtotal(f)){M=S[e];for(let k=e-1;k>=0;k-=1)if(this.isSubtotal(x[k])){M=M-S[k];break}}else M=y;const A=this.contextNodeData?.nodeData?.[e],I=this.getItemStyle(A,!1,void 0,A?.itemType);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",m,g,a,h),symbol:this.legendItemSymbol(v),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(p,"tooltip",M,g,r,h),missing:Za.isTooltipValueMissing(M)}]},{seriesId:t,datum:g,title:l,itemType:v,xKey:a,xName:n,yKey:r,yName:l,...I})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:s,strokeOpacity:o,strokeWidth:a,lineDash:n,lineDashOffset:r}=this.getItemConfig(e);return{marker:{fill:t,stroke:i,fillOpacity:s,strokeOpacity:o,strokeWidth:a,lineDash:n,lineDashOffset:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,seriesItemTypes:i}=this,s=[],o=n=>n.charAt(0).toUpperCase()+n.substring(1),{showInLegend:a}=this.properties;for(const n of i){const{name:r}=this.getItemConfig(n);s.push({legendType:"category",id:t,itemId:Wu(n),seriesId:t,enabled:!0,label:{text:r??o(n)},symbol:this.legendItemSymbol(n),hideInLegend:!a,isFixed:!0})}return s}toggleSeriesItem(){}resetDatumAnimation(e){WR([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s}=e,o=KR(GR(this.isVertical(),this.axes,"normal"),"unknown");JR.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o),$R(this,"labels",this.ctx.animationManager,i);const{pointData:a}=s;a&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const o=this.getValueAxis(),a=o?.isReversed(),n=a?(h,d)=>h<d:(h,d)=>h>d,r=o?.scale.convert(0),l=t.reduce((h,d)=>(n(d.x,h)&&(h=d.x),h),a?1/0:0),c=(h,d,p,g,m)=>(h-d)/(p-d)*(m-g)+g;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:KS,collapsable:!1,onUpdate(h){s.clear(!0);for(const[d,p]of t.entries()){const g=c(h,r,l,r,p.x),m=c(h,r,l,r,p.x2);d!==0&&s.lineTo(g,p.y),s.moveTo(m,p.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const o=this.getValueAxis(),a=o?.isReversed(),n=a?(h,d)=>h>d:(h,d)=>h<d,r=o?.scale.convert(0),l=t.reduce((h,d)=>(n(d.y,h)&&(h=d.y),h),a?0:1/0),c=(h,d,p,g,m)=>(h-d)/(p-d)*(m-g)+g;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:KS,collapsable:!1,onUpdate(h){s.clear(!0);for(const[d,p]of t.entries()){const g=c(h,r,l,r,p.y),m=c(h,r,l,r,p.y2);d!==0&&s.lineTo(p.x,g),s.moveTo(p.x2,m)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(t.length===0)return;const[i]=t;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:o}=e;if(o){for(const[a,n]of o.entries())a!==0&&s.lineTo(n.x,n.y),s.moveTo(n.x2,n.y2);i.checkPathDirty()}}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,lineJoin:"round",pointerEvents:Za.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}computeFocusBounds({datumIndex:e}){return QR(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return e.itemStyler!=null||e.label.itemStyler!=null||t.itemStyler!=null||t.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};ju.className="WaterfallSeries",ju.type="waterfall";import{_ModuleSupport as o_}from"ag-charts-community";import{arrayOfDefs as a_,commonSeriesOptionsDefs as n_,constant as r_,positiveNumber as l_,positiveNumberNonZero as c_,required as Qa,string as Uo,union as h_}from"ag-charts-core";var{waterfallSeriesThemeableOptionsDef:d_}=o_,u_={...d_,...n_,type:Qa(r_("waterfall")),xKey:Qa(Uo),yKey:Qa(Uo),xKeyAxis:Uo,yKeyAxis:Uo,xName:Uo,yName:Uo,totals:a_({totalType:Qa(h_("total","subtotal")),index:Qa(l_),axisLabel:Qa(Uo)},"a total definition options array"),width:c_};import"ag-charts-community";import{FILL_GRADIENT_LINEAR_KEYED_DEFAULTS as p_,FILL_IMAGE_DEFAULTS as g_,FILL_PATTERN_KEYED_DEFAULTS as m_,LABEL_BOXING_DEFAULTS as y_,SINGLE_SERIES_HIGHLIGHT_STYLE as f_}from"ag-charts-core";function $u(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",p_(e)],["image",g_],["pattern",m_(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...y_,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var x_={series:{item:{positive:$u("altUp",0),negative:$u("altDown",1),total:$u("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:f_},legend:{enabled:!0,toggleSeries:!1}},Uu={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,solo:!0,version:LR,dependencies:[NR],options:u_,defaultAxes:TR,axisKeys:{[uc.X]:"xKeyAxis",[uc.Y]:"yKeyAxis"},axisKeysFlipped:{[uc.X]:"yKeyAxis",[uc.Y]:"xKeyAxis"},themeTemplate:x_,create:e=>new ju(e)},YS={width:yi,height:yi,grip:qn,fill:$l,stroke:$l,strokeWidth:yi,cornerRadius:yi},Bt=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],XS=[...Bt,"errorBar","label","legendItemName"],ZS=[...Bt,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],QS=[...Bt,"title","label","labelKey","labelName","sizeName"],qS=[...Bt,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],JS=[...Bt,"label"],eb=[...Bt,"errorBar","title","label"],tb=[...Bt,"label","yLowName","yHighName"],ib=[...Bt,"direction","label","yLowName","yHighName"],sb=[...Bt,"errorBar","title","label","labelKey","labelName"],ob=[...Bt,"direction"],S_={enabled:qn,height:yi,spacing:yi,cornerRadius:vx,mask:{fill:$l,fillOpacity:Sw,stroke:$l,strokeWidth:yi},minHandle:YS,maxHandle:YS,miniChart:{enabled:qn,padding:{top:yi,bottom:yi},label:{enabled:qn,avoidCollisions:qn,spacing:yi,format:xw,formatter:yw(bw),interval:{minSpacing:yi,maxSpacing:yi,values:gw,step:vx},...fw},series:mw(vw({area:Yt(lw.options,[...Bt,"type"]),bar:Yt(cw.options,[...XS,"type"]),"box-plot":Yt(ou.options,[...ZS,"type"]),bubble:Yt(hw.options,[...QS,"type"]),candlestick:Yt(Ql.options,[...Bt,"type"]),heatmap:Yt(vu.options,[...qS,"type"]),histogram:Yt(dw.options,[...JS,"type"]),line:Yt(uw.options,[...eb,"type"]),ohlc:Yt(tc.options,[...Bt,"type"]),"range-area":Yt(lc.options,[...tb,"type"]),"range-bar":Yt(dc.options,[...ib,"type"]),scatter:Yt(pw.options,[...sb,"type"]),waterfall:Yt(Uu.options,[...ob,"type"])},"miniChart series options"))}};import"ag-charts-community";import{FONT_SIZE_RATIO as b_}from"ag-charts-core";var v_=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],D_=["itemStyler","simpleItemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function ab(e,t){return{$merge:[{$switch:[t,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[t,Bt,["bar",XS],["box-plot",ZS],["bubble",QS],["heatmap",qS],["histogram",JS],["line",[...eb,...D_]],["range-area",tb],["range-bar",ib],["scatter",sb],["waterfall",ob]]},e]}]}}var M_={enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:b_.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[ab({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:v_.map(e=>({$eq:[{$path:"/series/0/type"},e]}))},{$map:[ab({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},Yu={type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,version:zC,options:S_,themeTemplate:M_,create:e=>new za(e)};import{VERSION as k_}from"ag-charts-community";import{_ModuleSupport as A_}from"ag-charts-community";import{AbstractModuleInstance as I_,ChartAxisDirection as nb,ChartUpdateType as N_,Property as Yi,ZIndexMap as L_,clamp as qa}from"ag-charts-core";import{_ModuleSupport as T_}from"ag-charts-community";import{clamp as ar}from"ag-charts-core";var{SliderWidget:rb}=T_,lb=400,C_=50,w_=class{constructor(e){this.applyStep=e}start(e){this.setTarget(e),this.run(lb)}updateTarget(e){this.setTarget(e),this.isActive()||this.run(lb)}stop(e=!0){this.clearTimer(),e&&(this.target=void 0)}setTarget(e){this.target=ar(0,e,1)}run(e){if(this.target==null){this.stop();return}if(this.applyStep(this.target)){this.stop();return}this.schedule(e)}schedule(e){this.isActive()||(this.timer=setTimeout(()=>{this.timer=void 0,this.run(C_)},e))}clearTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=void 0)}isActive(){return this.timer!=null}},O_=class{constructor(){this.min=0,this.span=1,this.thumbSpan=1}update(e,t,i=this.thumbSpan){const s=ar(0,t-e,1);this.span=s,this.thumbSpan=ar(0,i,1),this.min=this.clampMin(e,s)}clampMin(e,t=this.span){return ar(0,e,1-t)}getThumbBounds(e=this.min,t=this.thumbSpan){const i=this.clampMin(e,t);return{start:i,end:i+t}}isWithinThumb(e){const{start:t,end:i}=this.getThumbBounds();return e>=t&&e<=i}getJumpRange(e){if(!this.canScroll())return;let t=this.clampMin(e-this.thumbSpan/2,this.thumbSpan);return t=this.clampMin(t),{min:t,max:t+this.span}}getStepRange(e){if(!this.canScroll())return;const t=ar(0,e,1),{start:i,end:s}=this.getThumbBounds();if(t>=i&&t<=s)return;const o=t<i,a=o?i-t:t-s,n=Math.min(this.span,a),r=this.clampMin(this.min+(o?-n:n));return{min:r,max:r+this.span}}canScroll(){return this.span>0&&this.span<1}},E_=class{constructor(e,t,i,s){this.ctx=e,this.orientation=t,this.onChange=i,this.onHoverChange=s,this.dragStartRatio=0,this.interactionMode="none",this.state=new O_,this.repeater=new w_(n=>this.applyStepToward(n)),this.container=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`scrollbar-${t}`,classList:["ag-charts-proxy-scrollbar",`ag-charts-proxy-scrollbar-${t}`],ariaLabel:void 0,role:"presentation"});const o=t==="horizontal"?"ariaLabelScrollbarHorizontal":"ariaLabelScrollbarVertical";this.slider=e.proxyInteractionService.createProxyElement({type:"slider",domIndex:0,tabIndex:0,ariaLabel:{id:o},role:"slider",parent:this.container,classList:["ag-charts-proxy-scrollbar-slider"]});const a=this.slider.getElement();a.ariaValueMin="0",a.ariaValueMax="100",this.slider.step=rb.STEP_HUNDRETH,this.slider.keyboardStep=rb.STEP_ONE,this.slider.orientation=t,this.slider.setPreventsDefault(!1),this.slider.addListener("change",()=>this.onSliderChange()),this.slider.addListener("keydown",n=>this.onSliderKeyDown(n)),this.slider.addListener("drag-start",n=>this.onDragStart(n)),this.slider.addListener("drag-move",n=>this.onDragMove(n)),this.slider.addListener("drag-end",n=>this.onDragEnd(n)),this.slider.addListener("mouseenter",n=>this.handleHoverEvent(n)),this.slider.addListener("mousemove",n=>this.handleHoverEvent(n)),this.slider.addListener("mouseleave",()=>this.onMouseLeave()),this.thumbFocus=e.proxyInteractionService.createProxyElement({type:"region",parent:this.container,classList:["ag-charts-proxy-scrollbar-thumb-focus"],role:"presentation"}),this.thumbFocus.setAriaHidden(!0),this.thumbFocus.setPointerEvents("none")}destroy(){this.interactionBounds=void 0,this.repeater.stop(),this.container.destroy()}updateBounds(e){this.interactionBounds=void 0,this.container.setBounds(e),this.slider.setBounds({x:0,y:0,width:e.width,height:e.height})}updateVisibility(e){this.container.setHidden(!e)}updateMinMax(e,t,i=this.state.thumbSpan,s){this.state.update(e,t,i);const o=this.ctx.localeManager.t("ariaValuePanRange",{min:Math.round(e*100)/100,max:Math.round(t*100)/100}),a=this.slider.getElement();a.ariaValueText=o,(!s?.skipSliderUpdate||Math.abs(this.slider.getValueRatio()-e)>1e-9)&&this.slider.setValueRatio(e,{ariaValueText:o})}updateThumbBounds(e,t,i){const s=Math.max(0,i??0);this.thumbFocus.getElement().style.borderRadius=`${s}px`,this.thumbFocus.setBounds({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height})}update(e,t,i){this.onChange(e,t),this.updateMinMax(e,t,void 0,i)}onSliderChange(){const e=this.state.clampMin(this.slider.getValueRatio()),t=e+this.state.span;this.update(e,t,{skipSliderUpdate:!0})}onSliderKeyDown(e){const{code:t}=e.sourceEvent,i=this.orientation==="vertical",s=i&&t==="ArrowUp"||!i&&t==="ArrowLeft",o=i&&t==="ArrowDown"||!i&&t==="ArrowRight";if(!s&&!o)return;e.sourceEvent.preventDefault();const a=this.slider.getElement();a.step=this.slider.keyboardStep?.attributeValue??"1",s?a.stepDown():o&&a.stepUp(),this.onSliderChange()}onDragMove(e){if(e.sourceEvent.preventDefault(),this.interactionMode==="drag"){const{isHorizontal:o,size:a,start:n}=this.getInteractionBounds()??{};if(n==null||a==null)return;const r=(o?e.originDeltaX:e.originDeltaY)/a,l=this.state.clampMin(this.dragStartRatio+r),c=l+this.state.span;this.update(l,c);return}if(this.interactionMode!=="step")return;const t=this.getPointerInfo(e);if(t==null||!Number.isFinite(t.ratio))return;const{ratio:i,inCrossBounds:s}=t;if(!s){this.repeater.stop();return}this.repeater.updateTarget(i)}onDragEnd(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0,this.setInteraction("none"),this.onHoverChange(!1)}onDragStart(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0;const t=this.getClickInfo(e);if(t?.inBounds){if(t.inThumb){this.dragStartRatio=this.slider.getValueRatio(),this.setInteraction("drag");return}if(e.sourceEvent.shiftKey){this.jumpTo(t.ratio),this.setInteraction("none");return}this.beginStepRepeat(t.ratio)}}onMouseLeave(){this.onHoverChange(!1)}getClickInfo(e){const t=this.getPointerRatio(e);return t==null?void 0:t>=0&&t<=1?{ratio:t,inBounds:!0,inThumb:this.isWithinThumb(t)}:{ratio:0,inBounds:!1,inThumb:!1}}getPointerRatio(e){return this.getPointerInfo(e)?.ratio}getPointerInfo(e){if(e.device==="keyboard")return;const{isHorizontal:t,size:i,start:s,crossStart:o,crossSize:a}=this.getInteractionBounds(),n=t?e.clientX:e.clientY,r=t?e.clientY:e.clientX,l=(n-s)/i,c=r>=o&&r<=o+a;return{ratio:l,inCrossBounds:c}}jumpTo(e){const t=this.state.getJumpRange(e);t&&this.update(t.min,t.max)}applyStepToward(e){const t=this.state.getStepRange(e);return t?(this.update(t.min,t.max),!1):!0}beginStepRepeat(e){this.setInteraction("step"),this.repeater.start(e)}setInteraction(e){this.interactionMode=e,e!=="step"&&this.repeater.stop()}getInteractionBounds(){if(this.interactionBounds)return this.interactionBounds;const{width:e,height:t,left:i,top:s}=this.container.getBoundingClientRect(),o=this.orientation==="horizontal",a=o?e:t,n=o?i:s,r=o?s:i,l=o?t:e;return this.interactionBounds={isHorizontal:o,size:a,start:n,crossStart:r,crossSize:l},this.interactionBounds}isWithinThumb(e){return this.state.isWithinThumb(e)}handleHoverEvent(e){if(this.interactionMode==="drag")return;const t=this.getPointerInfo(e);if(!t){this.onHoverChange(!1);return}const i=this.isWithinThumb(t.ratio);this.onHoverChange(i)}};import{ChangeDetectableProperties as Xu,Property as me,SceneChangeDetection as lt}from"ag-charts-core";var qt=class extends Xu{constructor(){super(...arguments),this.enabled=!1,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.opacity=1}};u([me,lt()],qt.prototype,"enabled",2),u([me,lt()],qt.prototype,"fill",2),u([me,lt()],qt.prototype,"fillOpacity",2),u([me,lt()],qt.prototype,"stroke",2),u([me,lt()],qt.prototype,"strokeWidth",2),u([me,lt()],qt.prototype,"strokeOpacity",2),u([me],qt.prototype,"lineDash",2),u([me],qt.prototype,"lineDashOffset",2),u([me],qt.prototype,"cornerRadius",2),u([me],qt.prototype,"opacity",2);var Zu=class extends Xu{};u([me,lt()],Zu.prototype,"fill",2),u([me,lt()],Zu.prototype,"stroke",2);var fc=class extends qt{constructor(){super(...arguments),this.minSize=20,this.hoverStyle=new Zu}};u([me,lt()],fc.prototype,"minSize",2),u([me],fc.prototype,"hoverStyle",2);var Xi=class extends Xu{constructor(){super(...arguments),this.enabled=!1,this.thickness=12,this.spacing=4,this.tickSpacing=0,this.placement="outer",this.visible="auto",this.track=new qt,this.thumb=new fc}};u([me,lt()],Xi.prototype,"enabled",2),u([me,lt()],Xi.prototype,"thickness",2),u([me,lt()],Xi.prototype,"spacing",2),u([me,lt()],Xi.prototype,"tickSpacing",2),u([me,lt()],Xi.prototype,"placement",2),u([me,lt()],Xi.prototype,"visible",2),u([me],Xi.prototype,"track",2),u([me],Xi.prototype,"thumb",2);var cb=class extends Xi{};u([me,lt()],cb.prototype,"position",2);var hb=class extends Xi{};u([me,lt()],hb.prototype,"position",2);var{BBox:Ja,Group:P_,Rect:db,LayoutElement:R_,InteractionState:__}=A_,Ni=class extends I_{constructor(e){super(),this.ctx=e,this.track=new qt,this.thumb=new fc,this.horizontal=new cb,this.vertical=new hb,this.state={horizontal:this.createOrientationState("horizontal"),vertical:this.createOrientationState("vertical")},this.cleanup.register(e.scene.attachNode(this.state.horizontal.group),e.scene.attachNode(this.state.vertical.group),e.layoutManager.registerElement(R_.Scrollbar,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",()=>this.updateThumbs()))}createOrientationState(e){const t=new P_({name:`scrollbar-${e}`,zIndex:L_.NAVIGATOR}),i=new db,s=new db;t.append(i),t.append(s);const o=new E_(this.ctx,e,(n,r)=>this.handleUserChange(e,n,r),n=>this.handleHoverChange(e,n)),a=this.resolveProperties(e);return{orientation:e,group:t,track:i,thumb:s,dom:o,properties:a,position:this.getDefaultPosition(e),positionHasAxis:!1,hovered:!1}}resolveProperties(e){return e==="horizontal"?this.horizontal:this.vertical}getDefaultPosition(e){return e==="horizontal"?"bottom":"left"}resolveAxis(e,t){const i=e==="horizontal"?nb.X:nb.Y,s=this.ctx.axisManager.getAxisContext(i);if(s.length===0)return{position:this.getDefaultPosition(e),positionHasAxis:!1};if(t==null){const a=s[0];return{axis:a,position:a.position??this.getDefaultPosition(e),positionHasAxis:!0}}const o=s.find(a=>a.position===t);return o?{axis:o,position:t,positionHasAxis:!0}:{axis:s[0],position:t,positionHasAxis:!1}}onLayoutStart({scrollbars:e,layoutBox:t}){for(const i of["horizontal","vertical"]){const s=this.state[i],o=this.resolveProperties(i),{min:a,max:n}=this.getZoomRange(s.orientation),r=qa(0,n-a,1),{axis:{axisId:l}={},position:c,positionHasAxis:h}=this.resolveAxis(i,o.position);s.properties=o,s.axisId=l,s.position=c,s.positionHasAxis=h;const d=this.updateVisibility(s,r);if(!d||l==null)continue;const{thickness:p,spacing:g,placement:m,tickSpacing:y}=o;h?e[l]={enabled:d,thickness:p,spacing:g,tickSpacing:y,placement:m}:t.shrink(g+p,c),this.updateStyles(s)}}onLayoutComplete(e){this.seriesRect=e.series.rect;for(const t of["horizontal","vertical"]){const i=this.state[t],{properties:{enabled:s,visible:o}}=i;if(!s||o==="never")continue;const a=this.getLayoutRect(i,t,e);i.layoutRect=a,a&&(this.updateTrack(i,a),this.updateThumb(i,a))}}getLayoutRect(e,t,i){const{properties:{thickness:s,spacing:o},position:a,positionHasAxis:n}=e,r=e.axisId?i.axes[e.axisId]:void 0;if(!r)return;const{x:l,y:c,width:h,height:d}=i.series.rect,p=t==="horizontal";if(!n)if(p){const S=a==="bottom"?c+d+o:c-o-s;return new Ja(l,S,h,s)}else{const S=a==="right"?l+h+o:l-o-s;return new Ja(S,c,s,d)}const{scrollbar:g,translation:m}=r;if(!g?.enabled)return;const y=p?m.y+g.offset:m.x+g.offset;return p?new Ja(l,y,h,s):new Ja(y,c,s,d)}updateStyles({track:e,thumb:t,properties:i,hovered:s}){e.setStyleProperties(i.track),e.cornerRadius=i.track.cornerRadius??0,e.opacity=i.track.opacity??1,t.setStyleProperties(i.thumb),t.cornerRadius=i.thumb.cornerRadius??0,t.opacity=i.thumb.opacity??1;const o=i.thumb.hoverStyle;t.fill=s?o?.fill??i.thumb.fill:i.thumb.fill,t.stroke=s?o?.stroke??i.thumb.stroke:i.thumb.stroke}updateTrack(e,t){e.track.x=t.x,e.track.y=t.y,e.track.width=t.width,e.track.height=t.height,e.dom.updateBounds(t)}updateThumb(e,t){const{min:i,max:s}=this.getZoomRange(e.orientation),o=qa(0,s-i,1);if(!this.updateVisibility(e,o)||t.width<=0||t.height<=0)return;const n=e.properties.thumb.minSize??0;let r;if(e.orientation==="horizontal"){const l=Math.min(Math.max(n,t.width*o),t.width),c=qa(t.x,t.x+t.width*i,t.x+t.width-l);e.thumb.x=c,e.thumb.y=t.y,e.thumb.width=l,e.thumb.height=t.height,r=qa(0,l/t.width,1)}else{const l=Math.min(Math.max(n,t.height*o),t.height),c=qa(t.y,t.y+t.height*i,t.y+t.height-l);e.thumb.x=t.x,e.thumb.y=c,e.thumb.width=t.width,e.thumb.height=l,r=qa(0,l/t.height,1)}e.dom.updateThumbBounds(e.thumb,t,e.properties.thumb.cornerRadius),e.dom.updateMinMax(i,s,r)}updateThumbs(){if(this.seriesRect)for(const e of["horizontal","vertical"]){const t=this.state[e],i=t.layoutRect;if(!i||!t.properties.enabled||t.properties.visible==="never")continue;const s=e==="horizontal"?new Ja(this.seriesRect.x,i.y,this.seriesRect.width,t.properties.thickness):new Ja(i.x,this.seriesRect.y,t.properties.thickness,this.seriesRect.height);this.updateThumb(t,s)}}updateVisibility(e,t){const i=e.properties.enabled&&e.axisId!=null&&e.properties.visible!=="never"&&(e.properties.visible==="always"||t<1);return e.group.visible=i,e.track.visible=i,e.thumb.visible=i,e.dom.updateVisibility(i),i}getZoomRange(e){const t=this.ctx.zoomManager.getZoom(),i=e==="horizontal",s=i?t?.x:t?.y;return!i&&s!=null?{min:1-(s.max??1),max:1-(s.min??0)}:{min:s?.min??0,max:s?.max??1}}handleUserChange(e,t,i){if(!this.ctx.interactionManager.isState(__.ZoomDraggable))return;const s=e==="horizontal";s||([t,i]=[1-i,1-t]);const o=s?{x:{min:t,max:i}}:{y:{min:t,max:i}};this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},o)}handleHoverChange(e,t){const i=this.state[e],s=t&&i.group.visible;i.hovered!==s&&(i.hovered=s,this.updateStyles(i),this.ctx.updateService.update(N_.SCENE_RENDER))}destroy(){super.destroy(),this.state.horizontal.dom.destroy(),this.state.vertical.dom.destroy()}};u([Yi],Ni.prototype,"enabled",2),u([Yi],Ni.prototype,"thickness",2),u([Yi],Ni.prototype,"spacing",2),u([Yi],Ni.prototype,"tickSpacing",2),u([Yi],Ni.prototype,"placement",2),u([Yi],Ni.prototype,"visible",2),u([Yi],Ni.prototype,"track",2),u([Yi],Ni.prototype,"thumb",2),u([Yi],Ni.prototype,"horizontal",2),u([Yi],Ni.prototype,"vertical",2);import{boolean as ub,fillOptionsDef as pb,lineDashOptionsDef as z_,positiveNumber as ao,ratio as B_,strokeOptionsDef as gb,union as en}from"ag-charts-core";var Qu={...pb,...gb,...z_,cornerRadius:ao,opacity:B_},mb={...Qu,minSize:ao,hoverStyle:{fill:pb.fill,stroke:gb.stroke}},yb={enabled:ub,thickness:ao,spacing:ao,tickSpacing:ao,visible:en("auto","always","never"),placement:en("outer","inner"),track:Qu,thumb:mb},V_={...yb,position:en("top","bottom")},F_={...yb,position:en("left","right")},H_={enabled:ub,thickness:ao,spacing:ao,tickSpacing:ao,visible:en("auto","always","never"),placement:en("outer","inner"),track:Qu,thumb:mb,horizontal:V_,vertical:F_},fb={enabled:{$path:"../enabled"},thickness:{$path:"../thickness"},spacing:{$path:"../spacing"},tickSpacing:{$path:"../tickSpacing"},placement:{$path:"../placement"},visible:{$path:"../visible"},track:{fill:{$path:"../../track/fill"},stroke:{$path:"../../track/stroke"},fillOpacity:{$path:"../../track/fillOpacity"},strokeWidth:{$path:"../../track/strokeWidth"},lineDash:{$path:"../../track/lineDash"},lineDashOffset:{$path:"../../track/lineDashOffset"},opacity:{$path:"../../track/opacity"},cornerRadius:{$path:"../../track/cornerRadius"}},thumb:{fill:{$path:"../../thumb/fill"},stroke:{$path:"../../thumb/stroke"},fillOpacity:{$path:"../../thumb/fillOpacity"},strokeWidth:{$path:"../../thumb/strokeWidth"},lineDash:{$path:"../../thumb/lineDash"},lineDashOffset:{$path:"../../thumb/lineDashOffset"},opacity:{$path:"../../thumb/opacity"},cornerRadius:{$path:"../../thumb/cornerRadius"},minSize:{$path:"../../thumb/minSize"},hoverStyle:{fill:{$path:"../../../thumb/hoverStyle/fill"},stroke:{$path:"../../../thumb/hoverStyle/stroke"}}}},K_={enabled:!1,thickness:12,spacing:16,tickSpacing:0,placement:"outer",visible:"auto",track:{fill:{$foregroundBackgroundMix:.03},stroke:{$foregroundBackgroundMix:.177},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6},thumb:{fill:{$foregroundBackgroundMix:.125},stroke:{$foregroundBackgroundMix:.364},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6,minSize:20,hoverStyle:{fill:{$mix:[{$path:"../fill"},{$ref:"foregroundColor"},.075]},stroke:{$mix:[{$path:"../stroke"},{$ref:"foregroundColor"},.075]}}},vertical:fb,horizontal:fb},xb={type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,version:k_,options:H_,themeTemplate:K_,create:e=>new Ni(e)};import{VERSION as G_}from"ag-charts-community";import{and as W_,arrayLength as j_,arrayOf as $_,arrayOfDefs as U_,boolean as Y_,callback as X_,date as Z_,number as Sb,or as bb,toolbarButtonOptionsDefs as Q_}from"ag-charts-core";import{_ModuleSupport as q_}from"ag-charts-community";import{AbstractModuleInstance as J_,ChartAxisDirection as qu,PropertiesArray as ez,Property as vb}from"ag-charts-core";import{Property as tz}from"ag-charts-core";var Db=class extends ms{};u([tz],Db.prototype,"value",2);var{userInteraction:iz,LayoutElement:sz,Toolbar:oz}=q_,Ju=class extends J_{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new ez(Db),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new oz(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(sz.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("zoom:change-complete",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.toolbar.getElement().remove(),this.toolbar.destroy()}onLayoutStart({layoutBox:e}){const{buttons:t,ctx:i,enabled:s,toolbar:o,verticalSpacing:a}=this;if(!s||!i.zoomManager.isZoomEnabled()){o.setHidden(!0);return}o.setHidden(!1),o.updateButtons(t);const n=o.getBounds().height;o.setBounds({x:e.x,y:e.y+e.height-n,width:e.width,height:n}),e.shrink({bottom:n+a})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i,o=iz(`zoom-range-button-${e}`);s==null?t.resetZoom(o):typeof s=="number"?t.extendToEnd(o,qu.X,s):Array.isArray(s)?t.updateWith(o,qu.X,()=>s):typeof s=="function"&&t.updateWith(o,qu.X,s),this.toolbar.toggleActiveButtonByIndex(e)}};u([vb],Ju.prototype,"enabled",2),u([vb],Ju.prototype,"buttons",2);var Mb=1e3*60*60*24,ep=Mb*30,az=Mb*365,tp={type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,version:G_,options:{enabled:Y_,buttons:U_({...Q_,value:bb(Sb,W_($_(bb(Sb,Z_)),j_(2,2)),X_)},"range button options array")},themeTemplate:{enabled:!1,buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:ep},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*ep},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*ep},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:az},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:void 0}]}},create:e=>new Ju(e)};import{VERSION as nz}from"ag-charts-community";import{DEFAULT_CAPTION_LAYOUT_STYLE as rz}from"ag-charts-core";import{_ModuleSupport as kb}from"ag-charts-community";import{AbstractModuleInstance as lz,BaseProperties as cz,ChartAxisDirection as hz,Property as Nt,ZIndexMap as dz,cachedTextMeasurer as ip,calcLineHeight as uz}from"ag-charts-core";var{LayoutElement:pz,Group:gz,Label:nr,Rect:mz,Text:Ze}=kb,Ab={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},yz={up:"positive",down:"negative"},fz={hlc:"altNeutral"},sp=class extends cz{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};u([Nt],sp.prototype,"fill",2),u([Nt],sp.prototype,"fillOpacity",2);var Vt=class extends lz{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new nr,this.positive=new nr,this.negative=new nr,this.neutral=new nr,this.altNeutral=new nr,this.background=new sp,this.layoutStyle="block",this.id="status-bar",this.layer=new gz({name:"StatusBar",zIndex:dz.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new kb.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new mz),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Ze),value:this.labelGroup.appendChild(new Ze),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(e.scene.attachNode(this.layer),e.layoutManager.registerElement(pz.Overlay,t=>this.startPerformLayout(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("highlight:change",()=>this.updateHighlight()),e.eventsHub.on("data:update",t=>{this.chartData=t}))}updateDomainsFromSeries(){if(!this.enabled)return;const e=this.ctx.chartService.series;if(e.length===0)return;let t,i;for(const s of e){const a=s.getDomain(hz.Y)?.domain;!Array.isArray(a)||a.length<2||(s.type==="bar"?i=[a[0],a.at(-1)]:t=[a[0],a.at(-1)])}for(const s of this.labels){if(this[s.key]==null){s.domain=void 0;continue}s.domain=s.key==="volumeKey"?i:t}}startPerformLayout({layoutBox:e}){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled){this.labelGroup.visible=!1;return}this.updateDomainsFromSeries();const t=4,i=12,s=0,o=8;this.labelGroup.translationY=e.y+s;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),n=uz(a),r=Ab[this.getChartType()]??0;let l=0,c,h="alphabetic";if(this.layoutStyle==="block")e.shrink(s+n+o,"top"),c=a+(n-a)/2;else{const{title:d}=this.ctx.chartService;if(h="top",c=s+d.padding,d.enabled){const p=d.node.getBBox();l=p.x+p.width+i}else l=d.padding}for(const{label:d,configuration:p,title:g,value:m,domain:y,formatter:S}of this.labels){if(y==null||!(r&p)){g.visible=!1,m.visible=!1;continue}const x=ip(this.positive),b=ip(this.negative),f=Math.max(x.textWidth(S.format(y[0])),x.textWidth(S.format(y[1])),b.textWidth(S.format(y[0])),b.textWidth(S.format(y[1])));g.visible=!0,m.visible=!0;const D=ip(this.title).measureLines(d);g.setFont(this.title),g.fill=this.title.color,g.text=d,g.textBaseline=h,g.y=c,g.x=l,l+=D.width+t,m.textBaseline=h,m.y=c,m.x=l,l+=f+i}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=l-i,this.backgroundNode.height=n+s+o,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.chartData?.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let s=i==null?void 0:yz[i];s==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]<t[this.closeKey]?s="positive":s="negative");for(const{domain:o,value:a,key:n,formatter:r,style:l}of this.labels){if(o==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=fz[this.getChartType()]??c);const h=this[n],d=h==null?void 0:t?.[h];a.setFont(this[c]),a.fill=this[c].color,a.text=typeof d=="number"?r.format(d):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(e==null||Ab[e]==null)&&(e="candlestick"),e}};u([Nt],Vt.prototype,"enabled",2),u([Nt],Vt.prototype,"openKey",2),u([Nt],Vt.prototype,"highKey",2),u([Nt],Vt.prototype,"lowKey",2),u([Nt],Vt.prototype,"closeKey",2),u([Nt],Vt.prototype,"volumeKey",2),u([Nt],Vt.prototype,"title",2),u([Nt],Vt.prototype,"positive",2),u([Nt],Vt.prototype,"negative",2),u([Nt],Vt.prototype,"neutral",2),u([Nt],Vt.prototype,"altNeutral",2),u([Nt],Vt.prototype,"background",2),u([Nt],Vt.prototype,"layoutStyle",2);var op={type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,version:nz,themeTemplate:{enabled:!1,layoutStyle:rz,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"chartBackgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}},create:e=>new Vt(e)};import{VERSION as xz}from"ag-charts-community";import{boolean as ap,string as Sz,union as bz}from"ag-charts-core";import{_ModuleSupport as vz}from"ag-charts-community";import{AsyncAwaitQueue as Dz,BaseProperties as Mz,ChartAxisDirection as Yo,ChartUpdateType as xc,Debug as kz,Logger as Ib,ObserveChanges as tn,Property as sn,arraysEqual as Nb,definedZoomState as Az,findMinMax as Lb,isDate as Iz,isDefined as Nz,isFiniteNumber as Sc,isObjectWithStringProperty as Lz,unique as Tz}from"ag-charts-core";var{CartesianAxis:np,ContinuousScale:Tb,TimeScale:Cz,UnitTimeScale:wz,TooltipManager:Oz}=vz,Zi=kz.create("sync");function Cb(e,t,i){const s=e.getKeys(t),o=e.getKeys(i);return e.shouldFlipXY?.()?[o,s]:[s,o]}function rp(e="x"){switch(e){case"x":return[Yo.X];case"y":return[Yo.Y];case"xy":return[Yo.X,Yo.Y]}}function Ez(e,t,i){return Cz.is(e)||wz.is(e)?!Nb(t.map(s=>s?.valueOf()),i.map(s=>s?.valueOf())):!Nb(t,i)}var no=class extends Mz{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="id",this.domainSync=new Dz}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))Zi("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=xc.PROCESS_DOMAIN){Zi("ChartSync.updateChart()",e.id,xc[t],e),t===xc.PROCESS_DOMAIN?e.ctx.updateService.update(t,{forceNodeDataRefresh:!0}):e.ctx.updateService.update(t)}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change-complete",t=>this.onZoom(t))}onZoom(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(this.groupId)){if(!i.modulesManager.getModule("sync")?.zoom)continue;const o=i.modulesManager.getModule("zoom");if(!o)continue;const a=this.prepareZoomUpdate();e.source!=="sync"&&(Zi("ChartsSyncManager.enabledZoomSync()",i.id,a),o.updateSyncZoom(a))}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.();const e=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this)),t=this.moduleContext.eventsHub.on("active:load-memento",this.onActiveLoadMemento.bind(this));this.disableNodeInteractionSync=()=>{e(),t()}}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;Zi("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[s]=rp(this.axes),o=s===Yo.X?Yo.Y:Yo.X,[a,n]=i?Cb(i,s,o):[],r=Un(e.currentHighlight);let l=a?.[0]?r?.[a[0]]:void 0,c=!1;if(Iz(l)&&(c=!0,l=l.getTime()),!e.currentHighlight?.datum){for(const d of t.getGroupSiblings(this.groupId))d.modulesManager.getModule("sync")?.nodeInteraction&&(d.ctx.highlightManager.updateHighlight(`${d.id}-sync`,void 0,!0),d.ctx.tooltipManager.removeTooltip(`${d.id}-sync`,void 0,!0));return}const h=t.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(s,o,h?n:[],c,l,e)}onActiveLoadMemento(e){const{activeItem:t,chartId:i}=e;if(t===void 0){this.moduleContext.highlightManager.updateHighlight(`${i}-sync`,void 0,!1),this.moduleContext.tooltipManager.removeTooltip(`${i}-sync`,void 0,!1);for(const s of this.moduleContext.syncManager.getGroupSiblings(this.groupId))s.onSyncActiveClear()}}findMatchingHighlightNodes(e,t,i,s,o,a){const{syncManager:n}=this.moduleContext;Zi("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const r of n.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let c=!1;for(const h of r.axes){if(!np.is(h)||h.direction!==e)continue;const d=r.series.filter(p=>{if(!p.visible)return!1;if(i.length>0){const[,g]=Cb(p,e,t);return i.every(m=>g.includes(m))}return!0}).map(this.findMatchingNodes(h,e,s,o)).filter(Nz);if(d.length===1&&d[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,d[0].nodeDatum),c=!0;break}}c||(Zi("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,a),this.dispatchHighlightUpdate(r))}}findMatchingNodes(e,t,i,s){return o=>{if(o.getKeyAxis(e.direction)!==e.id)return;const n=o.contextNodeData?.nodeData??[];if(!n?.length)return;const r=n[0],l=`${t}Key`;if(!Lz(r,l))return;const c=r[l],h=n.find(d=>{const p=d.datum[c];return i?p.getTime()===s:p===s});return h?{series:o,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){Zi("ChartSync.dispatchHighlightUpdate()",e.id,t);const i=t==null;e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t,i);const s=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&s){const o=e.seriesAreaBoundingBox,a=o.x+(t.midPoint?.x??t.point?.x??0),n=o.y+(t.midPoint?.y??t.point?.y??0),r=Oz.makeTooltipMeta({type:"pointermove",canvasX:a,canvasY:n},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,r,e.getTooltipContent(t.series,t.datumIndex,t,"tooltip"))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`,void 0,!0);this.updateChart(e,xc.SERIES_UPDATE)}async getSyncedDomain(e){if(!np.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,idDomains:s,positionDomains:o}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(e,o):this.domainMode==="direction"?this.calculateDerivedDomain(e,i):this.calculateDerivedDomain(e,s)}updateDomainState(e){var t,i,s,o,a;const{syncManager:n}=this.moduleContext,r=n.getChart().id,l=e.id,c=n.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),d=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0}),p=(i=d.sources)[r]??(i[r]={});p[l]=e.dataDomain.domain,d.dirty=!0;const g=c.domainsById??(c.domainsById={}),m=g[l]??(g[l]={derived:[],sources:{},dirty:!0}),y=(s=m.sources)[r]??(s[r]={});y[l]=e.dataDomain.domain,m.dirty=!0;const S=c.domainsByPosition??(c.domainsByPosition={}),x=S[o=e.position]??(S[o]={derived:[],sources:{},dirty:!0}),b=(a=x.sources)[r]??(a[r]={});return b[l]=e.dataDomain.domain,x.dirty=!0,{groupState:c,directionDomains:d,idDomains:m,positionDomains:x}}validateAxis(e,t){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";rp(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:s,nice:o,reverse:a}=e,n=new Set(e.boundSeries.flatMap(r=>r.getKeys(e.direction)));for(const r of t.members){const{axes:l,modulesManager:c}=r,h=c.getModule("sync"),d=rp(h?.axes),p=l.filter(m=>d.includes(m.direction)).filter(m=>m.boundSeries.some(y=>y.getKeys(m.direction).some(S=>n.has(S))));if(p.length===0)continue;const[g]=p;if(g.min!==i||g.max!==s||g.nice!==o||g.reverse!==a){Ib.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(e,t){const i=t.members,[{axes:s}]=i,{direction:o,min:a,max:n,nice:r,reverse:l}=e;for(const c of s)if(o===c.direction&&(r!==c.nice||l!==c.reverse||a!==c.min&&(Sc(a)||Sc(c.min))||n!==c.max&&(Sc(n)||Sc(c.max)))){Ib.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;let i=t.derived;const s=Object.values(t.sources).map(a=>Object.values(a));let o;return Tb.is(e.scale)?o=s.flat(2):o=s.flat().toSorted((a,n)=>a.length>n.length?-1:1).flat(),t.derived=Tz(o),Tb.is(e.scale)&&(i=Lb(i),t.derived=Lb(t.derived)),t.dirty=!1,Ez(e.scale,i,t.derived)&&(Zi(e.id,"updated",{before:i,after:t.derived}),this.updateSiblings()),t.derived}removeAxis(e){if(!np.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),s=t.getChart().id,o=e.id;delete i?.domains?.[e.direction]?.sources?.[s]?.[o],delete i?.domainsByPosition?.[e.position]?.sources?.[s]?.[o],delete i?.domainsById?.[o]?.sources?.[s]?.[o]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)Zi("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.waitForCompletion(),t++;t>0&&Zi("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:e}=this.moduleContext,t=e.getZoom();return this.axes==="x"?delete t?.y:this.axes==="y"&&delete t?.x,Az(t)}onEnabledChange(){const{syncManager:e,highlightManager:t}=this.moduleContext;this.enabled?(e.subscribe(this.groupId),t.unhighlightDelay=0):(e.unsubscribe(this.groupId),t.unhighlightDelay=100),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};no.className="Sync",u([sn,tn(e=>e.onEnabledChange())],no.prototype,"enabled",2),u([sn,tn((e,t,i)=>e.onGroupIdChange(t,i))],no.prototype,"groupId",2),u([sn,tn(e=>e.onAxesChange())],no.prototype,"axes",2),u([sn,tn(e=>e.onNodeInteractionChange())],no.prototype,"nodeInteraction",2),u([sn,tn(e=>e.onZoomChange())],no.prototype,"zoom",2),u([sn,tn(e=>e.onAxesChange())],no.prototype,"domainMode",2);var lp={type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,version:xz,options:{enabled:ap,groupId:Sz,axes:bz("x","y","xy"),nodeInteraction:ap,zoom:ap},themeTemplate:{enabled:!1},create:e=>new no(e)};import{VERSION as Pz}from"ag-charts-community";import{arrayOfDefs as Rz,boolean as Jt,or as _z,positiveNumber as zz,ratio as cp,strictUnion as Bz,string as Vz,toolbarButtonOptionsDefs as Fz,undocumented as hp,union as Xo}from"ag-charts-core";import{_ModuleSupport as on}from"ag-charts-community";import{AbstractModuleInstance as Hz,ActionOnSet as rr,ChartAxisDirection as bt,ChartUpdateType as dp,Property as Pe,ProxyProperty as Kz,UNIT_MAX as up,UNIT_MIN as Gz,debounce as Wz,definedZoomState as wb,entries as jz,roundTo as $z}from"ag-charts-core";import{_ModuleSupport as Uz}from"ag-charts-community";import{ZIndexMap as Yz}from"ag-charts-core";var Ob="#2196f3",Xz="#8a8a8a",Eb=class extends Uz.Rect{constructor(){super(),this.fill=Ob,this.fillOpacity=.2,this.zIndex=Yz.ZOOM_SELECTION}updateValid(){this.fill=Ob}updateInvalid(){this.fill=Xz}};Eb.className="ZoomRect";import"ag-charts-community";import{BaseProperties as Zz,ChartAxisDirection as Ft,Property as Pb,isFiniteNumber as Rb,objectsEqual as Qz,strictObjectKeys as qz}from"ag-charts-core";var pp=class extends Zz{constructor(){super(),this.enabled=!1,this.padding=0}};u([Pb],pp.prototype,"enabled",2),u([Pb],pp.prototype,"padding",2);var Jz=class{constructor(e,t,i,s,o){this.properties=e,this.zoomManager=t,this.deps=i,this.manuallyAdjusted=!1,o.register(s.on("zoom:save-memento",a=>this.onSaveMemento(a)),s.on("zoom:load-memento",a=>this.onLoadMemento(a)),s.on("zoom:change-request",a=>this.onChangeRequest(a)))}get enabled(){return this.deps.enabled&&this.properties.enabled&&!this.manuallyAdjusted}onManualAdjustment(e){e===Ft.Y&&(this.manuallyAdjusted=!0)}onChangeRequest(e){const t=this.hasYAxisChange(e);if(e.sourceDetail==="scrollbar"&&t&&(this.manuallyAdjusted=!0),e.isReset&&t&&(this.manuallyAdjusted=!1),this.enabled){const i=this.autoScaleYZoom(e.state);i&&e.constrainChanges(i)}}hasYAxisChange(e){for(const t of e.changedAxes)if(e.state[t]?.direction===Ft.Y)return!0;return!1}onSaveMemento(e){e.memento.autoScaledAxes=this.enabled?["y"]:void 0}onLoadMemento(e){const{zoom:t,memento:i,navigatorModule:s,zoomModule:o}=e;if(!s||o){let a=i?.autoScaledAxes?.includes("y");if(i?.rangeY)a??(a=!1),t.y=this.zoomManager.rangeToRatioDirection(Ft.Y,i.rangeY)??{min:0,max:1};else if(i?.ratioY)a??(a=!1),t.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{a??(a=!0);const n=a?this.getAutoScaleYZoom(t.x):void 0;t.y=n??{min:0,max:1}}a!=null&&(this.manuallyAdjusted=!a)}}getAutoScaleYZoom(e){if(!this.enabled)return;const{padding:t}=this.properties;let i;return this.deps.enableIndependentAxes?i=this.primaryAxisZoom(Ft.Y,e,{padding:t}):i=this.combinedAxisZoom(Ft.Y,e,{padding:t}),e.min===0&&e.max===1?i==null?void 0:{min:0,max:1}:i}autoScaleYZoom(e){const t=this.zoomManager.getZoom();if(t&&e){const s=this.zoomManager.getAxisZooms();for(const o of[Ft.X,Ft.Y])for(const a of qz(e))if(s[a]?.direction===o){t[o]=e[a];break}}if(t?.x==null)return;const i=this.getAutoScaleYZoom(t.x);if(!(i==null||Qz(t.y,i)))return this.zoomManager.toCoreZoomState({x:t.x,y:i})}zoomBounds(e,t,i,s){const o=e.scale,a=o.range;o.range=[0,1];const n=t.scale,r=n.range;n.range=[0,1];let l=1,c=!1,h=0,d=!1;for(const m of t.boundSeries){if(!m.visible)continue;const{connectsToYAxis:y}=m,S=m.getRange(Ft.Y,[i.min,i.max]);for(const x of S){const b=n.convert(x);Number.isFinite(b)&&(b<l&&(l=b,c=!y||x<0),b>h&&(h=b,d=!y||x>0))}}if(Rb(t.min)&&(l=0),Rb(t.max)&&(h=1),o.range=a,n.range=r,l>=h)return;const p=(c?s:0)+(d?s:0),g=Math.min((h-l)*(1+p),1);if(!(g<=0)){if(c&&d){const m=(h+l)/2;l=m-g/2,h=m+g/2}else!c&&d?h=l+g:c&&!d&&(l=h-g);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e===Ft.X?Ft.Y:Ft.X,o=this.zoomManager.getPrimaryAxis(s),a=this.zoomManager.getPrimaryAxis(e);if(!(o==null||a==null))return this.zoomBounds(o,a,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=this.zoomManager.getAxes(),o=e===Ft.X?Ft.Y:Ft.X,a=new Map;for(const c of s)if(c.direction===o)for(const h of c.boundSeries)a.set(h,c);let n=1,r=0;for(const c of s)if(c.direction===e)for(const h of c.boundSeries){const d=a.get(h);if(d==null)continue;const p=this.zoomBounds(d,c,t,i);if(p==null)return;n=Math.min(n,p.min),r=Math.max(r,p.max)}const l=1e-6;if(n<l&&(n=0),r>1-l&&(r=1),!(n>r))return{min:n,max:r}}};import{ChartAxisDirection as gp,definedZoomState as _b}from"ag-charts-core";import"ag-charts-community";import{UNIT_MAX as lr,UNIT_MIN as bc,clamp as eB,definedZoomState as tB,isNumberEqual as zb,jsonDiff as iB}from"ag-charts-core";var Zo=lr-bc,Bb="end",Vb="middle",Fb=300,vc=(e,t=bc,i=lr)=>eB(t,e,i);function Qe(e){return e.x.max-e.x.min}function ei(e){return e.y.max-e.y.min}function Hb(e,t){return zb(e.min,t.min)&&zb(e.max,t.max)}function Kb(e,t){return Hb(e.x,t.x)&&Hb(e.y,t.y)}function an(e){return Kb(e,tB())}function Ms(e,t,i){if(!e)return{x:0,y:0};const s=vc(t-e.x,0,e.x+e.width),o=vc(i-e.y,0,e.y+e.height),a=1/e.width*s,n=1-1/e.height*o;return{x:vc(a),y:vc(n)}}function Qo(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function Dc(e,t,i){return{x:{min:e.x.min,max:e.x.min+Qe(e)*t},y:{min:e.y.min,max:e.y.min+ei(e)*i}}}function Gb(e,t,i){const s=Qe(e),o=ei(e),a=e.x.min+s/2,n=e.y.min+o/2;return{x:{min:a-s*t/2,max:a+s*t/2},y:{min:n-o*i/2,max:n+o*i/2}}}function ti(e,t,i,s){const{min:o,max:a}=t,n=o+(a-o)/2,r=e.max-e.min;switch(i){case"start":return{min:o,max:t.min+r};case"end":return{min:t.max-r,max:a};case"middle":return{min:n-r/2,max:n+r/2};case"pointer":return sB(e,t,s??n);default:return{min:o,max:a}}}function sB(e,t,i){const s=e.max-e.min,o=t.max-t.min,a=i*(1-(o-s)),n=i-a,r=e.min+n,l=e.max+n;return{min:r,max:l}}function oB(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function xi(e){return{x:Mc(e.x),y:Mc(e.y)}}function Mc(e){const t=e.max-e.min;let i=e.max>lr?lr-t:e.min,s=e.min<bc?t:e.max;return i=Math.max(bc,i),s=Math.min(lr,s),{min:i,max:s}}function Wb(e){const t=e.getCoreZoom(),i=e.getRestoredZoom();return iB(t,i)!=null}var aB=class{update(e,t,i,s,o,a){return this.oldZoom??(this.oldZoom=_b(t===gp.X?{...o,x:a}:{...o,y:a})),this.updateCoords(e.offsetX,e.offsetY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:o}=this;let a=_b(o);if(!s||!o)return e===gp.X?a.x:a.y;const n=Ms(i,s.x1,s.y1),r=Ms(i,s.x2,s.y2);if(e===gp.X){const c=(r.x-n.x)*Qe(o);return a.x.max+=c,a.x=ti(a.x,o.x,t,n.x),a=xi(a),a.x}const l=(r.y-n.y)*ei(o);return a.y.max-=l,a.y=ti(a.y,o.y,t,n.y),a=xi(a),a.y}};import{_ModuleSupport as nB}from"ag-charts-community";import{definedZoomState as mp}from"ag-charts-core";var{userInteraction:yp}=nB,rB=class{constructor(e,t,i,s,o,a,n){this.eventsHub=e,this.contextMenuRegistry=t,this.zoomManager=i,this.getModuleProperties=s,this.getRect=o,this.updateZoom=a,this.isZoomValid=n}registerActions(e){const{contextMenuRegistry:t}=this,i=e?"show":"hide";if(t.toggle("zoom-to-cursor",i),t.toggle("pan-to-cursor",i),t.toggle("reset-zoom",i),!e)return;t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),t.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const s=n=>{const r=this.getRect();if(!r)return!0;const l=Ms(r,n.x,n.y);return this.iterateFindNextZoomAtPoint(l)!=null},o=()=>!an(mp(this.zoomManager.getZoom())),a=this.eventsHub.on("context-menu:setup",n=>{t.builtins.items["zoom-to-cursor"].enabled=s(n),t.builtins.items["pan-to-cursor"].enabled=o(),t.builtins.items["reset-zoom"].enabled=Wb(this.zoomManager)});return()=>{a(),t.toggle("zoom-to-cursor","hide"),t.toggle("pan-to-cursor","hide"),t.toggle("reset-zoom","hide")}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const s={x:0,y:0,width:t.width,height:t.height};return Ms(s,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(yp("contextmenu-zoom-to-cursor"),i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=mp(this.zoomManager.getZoom()),s=Qe(i),o=ei(i),a=t.x*s,n=t.y*o,r=Zo/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};l=Gb(l,s,o),l=Qo(l,i.x.min-t.x+a,i.y.min-t.y+n),this.updateZoom(yp("contextmenu-pan-to-cursor"),xi(l))}onResetZoom(e){this.zoomManager.resetZoom(yp("contextmenu-reset"))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const s=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),o=mp(this.zoomManager.getZoom()),a=e.x*Qe(o),n=e.y*ei(o),r=Zo/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};return l=Gb(l,i?Qe(o)*t:Zo,s?ei(o)*t:Zo),l=Qo(l,o.x.min-e.x+a,o.y.min-e.y+n),xi(l)}};import{_ModuleSupport as lB}from"ag-charts-community";import{ChartAxisDirection as jb,boxEmpty as cB}from"ag-charts-core";var hB=class{constructor(e){this.axesHandlers=e,this.axes=[],this.overlappingAxisIds=new Set}destroy(){for(const e of this.axes)e.div.destroy()}update(e,t,i,s,o){this.seriesRect=o;const a=!e||!t&&!i;for(const d of this.axes)d.div.setHidden(a);if(a)return;const{X:n,Y:r}=jb,l=[...s.axisManager.getAxisContext(n),...s.axisManager.getAxisContext(r)],{removed:c,added:h}=this.diffAxisIds(l);c.length>0&&(this.axes=this.axes.filter(d=>c.includes(d.axisId)?(d.div.destroy(),this.overlappingAxisIds.delete(d.axisId),this.hoveredAxisId===d.axisId&&(this.hoveredAxisId=void 0),this.activeAxisId===d.axisId&&(this.activeAxisId=void 0),!1):!0));for(const d of h){const{axisId:p,direction:g}=d;this.axes.push(this.initAxis(s,p,this.axesHandlers,g))}for(const d of this.axes){const g=l.find(m=>m.axisId===d.axisId).getCanvasBounds();d.div.setHidden(cB(g)),g==null?d.bounds=void 0:(d.div.setBounds(g),d.bounds=new lB.BBox(g.x,g.y,g.width,g.height))}this.updateOverlappingAxisPointerEvents(t,i)}setAxisCursor(e){this.cursor=e;for(const t of this.axes)t.div.setCursor(this.getCursor(t.direction))}toggleAxisDraggingCursor(e,t){for(const i of this.axes)i.direction===e&&i.div.setCursor(t?this.getCursor(e):void 0)}updateOverlappingAxisPointerEvents(e,t){this.overlappingAxisIds.clear();const i=(e||t)&&this.seriesRect;for(const s of this.axes){if(!i){s.div.setPointerEvents(void 0);continue}!!s.bounds?.collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(s.axisId),s.div.setPointerEvents("none")):s.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.activeAxisId&&!this.overlappingAxisIds.has(this.activeAxisId)&&(this.activeAxisId=void 0)}pickAxisAtPoint(e){for(const t of this.axes)if(this.overlappingAxisIds.has(t.axisId)&&t.bounds?.containsPoint(e.canvasX,e.canvasY))return{axisId:t.axisId,direction:t.direction}}setHoveredAxis(e){this.overlappingAxisIds.has(e)&&(this.hoveredAxisId=e)}clearHoveredAxis(){this.activeAxisId||(this.hoveredAxisId=void 0)}beginDelegatedAxisDrag(e){return this.overlappingAxisIds.has(e)?(this.activeAxisId=e,this.hoveredAxisId=void 0,!0):!1}endDelegatedAxisDrag(e){this.activeAxisId===e&&(this.activeAxisId=void 0),this.hoveredAxisId=void 0}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getHoveredAxis(){if(!this.hoveredAxisId)return;const e=this.axes.find(t=>t.axisId===this.hoveredAxisId);return e?{axisId:e.axisId,direction:e.direction}:void 0}getCursor(e){return this.cursor?this.cursor:e===jb.X?"ew-resize":"ns-resize"}initAxis(e,t,i,s){const o="afterend",a=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:o});return a.setCursor(this.getCursor(s)),a.addListener("drag-start",n=>{n.device==="touch"&&n.sourceEvent.preventDefault(),this.activeAxisId=t,i.onAxisDragStart(s)}),a.addListener("drag-move",n=>i.onAxisDragMove(t,s,n)),a.addListener("drag-end",()=>{this.activeAxisId=void 0,this.hoveredAxisId=void 0,i.onAxisDragEnd()}),a.addListener("dblclick",()=>i.onAxisDoubleClick(t,s)),a.addListener("wheel",n=>i.onAxisWheel(s,n)),{axisId:t,div:a,direction:s}}diffAxisIds(e){const t=this.axes.map(a=>a.axisId),i=e.map(a=>a.axisId),s=t.filter(a=>!i.includes(a)),o=e.filter(a=>!t.includes(a.axisId));return{removed:s,added:o}}};import{_ModuleSupport as dB}from"ag-charts-community";import{BaseProperties as uB,ChartAxisDirection as $b,Logger as pB,Property as Ub,clamp as Yb,definedZoomState as gB}from"ag-charts-core";var{userInteraction:mB}=dB;function yB(e){return e.x.min===0&&e.x.max===1&&e.y.min===0&&e.y.max===1}function fB(e,t){return e.stickToEnd&&t.x.max===1}function Xb(e,t,i){const{domainMin:s,domainMax:o}=t,a=o-s;return{axisId:e,visibleMin:s+a*i.min,visibleMax:s+a*i.max}}function Zb(e,t){const{domainMin:i,domainMax:s}=e,{visibleMin:o,visibleMax:a}=t,n=s-i;return{direction:"x",min:Yb(0,(o-i)/n,1),max:Yb(0,(a-i)/n,1)}}var fp=class extends uB{constructor(){super(...arguments),this.strategy="preserveDomain",this.stickToEnd=!1}};u([Ub],fp.prototype,"strategy",2),u([Ub],fp.prototype,"stickToEnd",2);var xB=class{constructor(e,t,i,s){this.onConstrainChangesCallback=e,this.properties=t,this.ctx=i;const o=()=>{i.eventsHub.off("layout:complete",o),s.register(i.eventsHub.on("data:load",a=>this.onDataLoad(a)),i.eventsHub.on("data:update",a=>this.onDataUpdate(a)))};s.register(i.eventsHub.on("layout:complete",o),i.eventsHub.on("zoom:change-request",a=>this.onZoomChangeRequest(a)))}destroy(){}onDataLoad(e){this.performUpdateStrategy()}onDataUpdate(e){this.performUpdateStrategy()}onZoomChangeRequest(e){e.sourceDetail==="internal-requiredWidth"&&(this.desiredChanges=void 0);const t=this.popDesiredChanges();t&&(e.constrainChanges(t),this.onConstrainChangesCallback(e))}computeDomainMinMax(e){const t=this.ctx.axisManager.getAxisIdContext(e);if(!t?.continuous||t.scale.domain.length===0)return;const[i,s]=t.scale.getDomainMinMax();if(typeof i=="number"&&typeof s=="number")return{domainMin:i,domainMax:s};if(i instanceof Date&&s instanceof Date)return{domainMin:i.getTime(),domainMax:s.getTime()};pB.error(`Unexpected range types: start (${typeof i}), end (${typeof s})`)}popDesiredChanges(){const{desiredChanges:e}=this;if(e)switch(this.desiredChanges=void 0,e.type){case"domain":{const i={};for(const s of e.domains){const o=this.computeDomainMinMax(s.axisId);o&&(i[s.axisId]=Zb(o,s))}return i}case"stickToEnd":{const{axisId:i,difference:s}=e,o=this.computeDomainMinMax(i);if(o){const a={axisId:i,visibleMin:o.domainMax-s,visibleMax:o.domainMax};return{[i]:Zb(o,a)}}break}default:return(i=>i)(e)}}performUpdateStrategy(){const e=gB(this.ctx.zoomManager.getZoom());if(!yB(e)){if(fB(this.properties,e))return this.performStickToEnd();switch(this.properties.strategy){case"reset":return this.ctx.zoomManager.resetZoom(mB("onDataChange-reset"));case"preserveRatios":return;case"preserveDomain":return this.performPreserveDomain();default:return(i=>i)(this.properties.strategy)}}}performPreserveDomain(){this.desiredChanges={type:"domain",domains:[]};const e=this.ctx.zoomManager.getAxes().filter(t=>t.direction===$b.X);for(const{id:t}of e){const i=this.computeDomainMinMax(t);if(i){const s=this.ctx.zoomManager.getAxisZoom(t),o=Xb(t,i,s);this.desiredChanges.domains.push(o)}}}performStickToEnd(){const e=this.ctx.zoomManager.getPrimaryAxisId($b.X);if(!e)return;const t=this.computeDomainMinMax(e);if(!t)return;const i=this.ctx.zoomManager.getAxisZoom(e);if(!i)return;const{visibleMin:s,visibleMax:o}=Xb(e,t,i),a=o-s;this.desiredChanges={type:"stickToEnd",axisId:e,difference:a}}};import"ag-charts-community";import{ChartAxisDirection as Qb,UNIT_MAX as SB,UNIT_MIN as bB,definedZoomState as vB,entries as DB,getWindow as MB}from"ag-charts-core";var qb=16,kB={off:1,short:.01,long:.002},AB=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:kB[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:o=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?t-s:0,deltaY:this.isPanningY()?i-o:0})}start(e){this.direction=e,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const o=this.zoomCoordsHistoryIndex%qb;let a=o-1;a<0&&(a=e.length-1);let n=o;n>=e.length&&(n=0);const r=e[a],l=e[n];t=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,s=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const o=t/s,a=i/s,n=Math.hypot(o,a),r=Math.atan2(a,o),l=performance.now();this.inertiaHandle=MB().requestAnimationFrame(c=>{this.animateInertia(c,c,l,n,r)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:o}=e,a=Date.now();t[i%qb]={x:s,y:o,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,o){const a=1-this.decelerationValue,n=-s/Math.log(a),r=s*(a**(t-i)-1)/Math.log(a),l=s*(a**(e-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(o)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(o)*(l-r):0}),!(l>=n-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,e,i,s,o)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}isPanningX(){return this.direction==null||this.direction===Qb.X}isPanningY(){return this.direction==null||this.direction===Qb.Y}translateZooms(e,t,i,s){const o=Ms(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),a=Math.sign(i)*o.x,n=-Math.sign(s)*o.y,r={};for(const[l,c]of DB(t)){if(c==null||c.min===bB&&c.max===SB)continue;const{direction:h}=c;let d=vB({[h]:c});d=xi(Qo(d,a*Qe(d),n*ei(d)));const{min:p,max:g}=d[h];r[l]={direction:h,min:p,max:g}}return r}};import"ag-charts-community";import{ChartAxisDirection as IB,definedZoomState as NB,entries as LB}from"ag-charts-core";var TB=200,CB=class{update(e,t,i,s){const o=e.deltaX*t*TB;return this.translateZooms(i,s,o)}translateZooms(e,t,i){const s={},o=Ms(e,e.x+Math.abs(i),0),a=i<0?-o.x:o.x;for(const[n,r]of LB(t)){if(r?.direction!==IB.X)continue;const{direction:l,min:c,max:h}=r;let d=NB({x:{min:c,max:h}});d=xi(Qo(d,a*Qe(d),0)),s[n]={direction:l,min:d.x.min,max:d.x.max}}return s}};import"ag-charts-community";import{ChartAxisDirection as Jb,definedZoomState as ev,entries as wB}from"ag-charts-core";var OB=class{updateAxes(e,t,i,s){const o=e.sourceEvent,a={},{anchorPointX:n,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=t,d=Ms(i,o.offsetX??o.clientX,o.offsetY??o.clientY);for(const[p,g]of wB(s)){if(g==null)continue;const{direction:m,min:y,max:S}=g;let x={min:y,max:S};const b=h*e.deltaY*(S-y);if(m===Jb.X&&l)x.max+=b,x=ti(x,g,n,d.x);else if(m===Jb.Y&&c)x.max+=b,x=ti(x,g,r,d.y);else continue;if(x.max<x.min)continue;const f=Mc(x);a[p]={direction:m,min:f.min,max:f.max}}return a}update(e,t,i,s){const{anchorPointX:o,anchorPointY:a,isScalingX:n,isScalingY:r,scrollingStep:l}=t,c=e.offsetX+i.x,h=e.offsetY+i.y,d=Ms(i,c,h),p=e.deltaY;let g=ev(s);if(g.x.max+=n?l*p*Qe(s):0,g.y.max+=r?l*p*ei(s):0,!(g.x.max<g.x.min||g.y.max<g.y.min))return n&&(g.x=ti(g.x,s.x,o,d.x)),r&&(g.y=ti(g.y,s.y,a,d.y)),g=xi(g),g}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:o,isScalingX:a,isScalingY:n,scrollingStep:r}=t;let l=ev(i);return l.x.max+=a?r*-e*Qe(i):0,l.y.max+=n?r*-e*ei(i):0,a&&(l.x=ti(l.x,i.x,s)),n&&(l.y=ti(l.y,i.y,o)),l=xi(l),l}};import{definedZoomState as tv}from"ag-charts-core";var EB=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const s=e.currentX+(i?.x??0),o=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,o,t,i),this.updateRect(i)}stop(e,t,i){let s=tv();if(!e||!t)return s;this.coords&&(s=this.createZoomFromCoords(t,i));const o=t.width/e.width,a=t.height/e.height;if(s=xi(oB(s,o,a)),this.reset(),this.isZoomValid(s))return s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:o}=this;if(o.x2=e,o.y2=t,!s)return;const{isScalingX:a,isScalingY:n,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&n){const c=s.width/s.height;o.y2<o.y1?o.y2=Math.min(o.y1-l.width/c,o.y1):o.y2=Math.max(o.y1+l.width/c,o.y1)}a||(o.x1=s.x,o.x2=s.x+s.width),n||(o.y1=s.y,o.y2=s.y+s.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:s,height:o}=i;let{x:a,y:n}=i;a=Math.max(a,e.x),a-=Math.max(0,a+s-(e.x+e.width)),n=Math.max(n,e.y),n-=Math.max(0,n+o-(e.y+e.height)),t.x=a,t.y=n,t.width=s,t.height=o;const r=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(r)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=tv(t),s=this.getNormalisedDimensions(),o=Ms(e,s.x,s.y+s.height),a=s.width/e.width,n=s.height/e.height;let r=Dc(i,a,n);const l=o.x*Qe(i),c=o.y*ei(i);return r=Qo(r,l,c),r=xi(r),r}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:s=0}=this.coords??{},o=Math.min(e,i),a=Math.min(t,s),n=e<=i?i-e:e-i,r=t<=s?s-t:t-s;return{x:o,y:a,width:n,height:r}}};import{_ModuleSupport as PB}from"ag-charts-community";import{ActionOnSet as iv,BaseProperties as RB,ChartAxisDirection as _B,CleanupRegistry as zB,PropertiesArray as BB,Property as qo,UNIT_MAX as cr,UNIT_MIN as sv,createElement as VB,debounce as FB,definedZoomState as xp,entries as HB}from"ag-charts-core";var{userInteraction:ov,NativeWidget:KB,Toolbar:GB}=PB,Sp=class extends ms{};u([qo],Sp.prototype,"value",2),u([qo],Sp.prototype,"section",2);var nn=class extends RB{constructor(e,t,i,s,o,a){super(),this.ctx=e,this.getModuleProperties=t,this.updateZoom=i,this.updateAxisZoom=s,this.resetZoom=o,this.isZoomValid=a,this.enabled=!1,this.buttons=new BB(Sp),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.cleanup=new zB,this.toggleButtonsDebounced=FB(this.toggleButtons.bind(this),Fb,{leading:!0,trailing:!0}),this.container=new KB(VB("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new GB(e,"ariaLabelZoomToolbar","horizontal"),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toolbar.setHidden(!this.enabled),this.toggleVisibility(this.visible==="always"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}toggleVisibleZoomed(e){this.visible==="zoomed"&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){if(!this.enabled)return;const{buttons:t,container:i}=this,{rect:s}=e.series;for(const a of t)if(a.tooltip==null&&a.label==null){const n={"pan-end":"toolbarZoomPanEnd","pan-left":"toolbarZoomPanLeft","pan-right":"toolbarZoomPanRight","pan-start":"toolbarZoomPanStart","zoom-in":"toolbarZoomZoomIn","zoom-out":"toolbarZoomZoomOut",reset:"toolbarZoomReset"};a.tooltip=n[a.value]}this.toolbar.updateButtons(t),this.toggleButtonsDebounced();const o=i.getBounds().height;i.setBounds({y:s.y+s.height-o})}onHover(e){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:s}}=this,{currentY:o,sourceEvent:{target:a}}=e,n=t.getElement(),r=n.offsetTop-i,l=o>r&&o<s.canvas.element.offsetHeight||a===n;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:s,verticalSpacing:o}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const a=s.getElement();a.style.transitionDuration=t?"0s":"",a.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+o}px)`}toggleButtons(){const e=xp(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&Kb(this.previousZoom,e))){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=e.x.min>sv;break;case"pan-end":s=e.x.max<cr;break;case"pan-left":s=e.x.min>sv;break;case"pan-right":s=e.x.max<cr;break;case"zoom-out":s=!an(e);break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=Wb(this.ctx.zoomManager);break}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&e.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,o]of HB(i)){if(o==null)continue;const{direction:a,min:n,max:r}=o;this.onButtonPressAxis(e,t,s,a,{min:n,max:r})}}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,o){const{isScalingX:a,isScalingY:n,scrollingStep:r}=t;let l={...o};const c=o.max-o.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=cr;break;case"pan-left":l.min-=c*r,l.max-=c*r;break;case"pan-right":l.min+=c*r,l.max+=c*r;break;case"zoom-in":case"zoom-out":{const h=s===_B.X,d=h&&a||!h&&n;let p=e.value==="zoom-in"?1-r:1+r;d||(p=1);const g=h?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*p,l=ti(l,o,g);break}}this.updateAxisZoom(ov(`zoom-button-${e.value}`),i,s,Mc(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=xp(this.ctx.zoomManager.getZoom());let o=xp(s);switch(e.value){case"reset":this.resetZoom("zoom-button-reset");return;case"pan-start":o.x.max=Qe(o),o.x.min=0;break;case"pan-end":o.x.min=cr-Qe(o),o.x.max=cr;break;case"pan-left":o=Qo(o,-Qe(o)*i,0);break;case"pan-right":o=Qo(o,Qe(o)*i,0);break;case"zoom-in":case"zoom-out":{o=this.getNextZoomStateUnified(e.value,s,t);break}}this.updateZoom(ov(`zoom-button-${e.value}`),xi(o))}getNextZoomStateUnified(e,t,i){const{isScalingX:s,isScalingY:o,scrollingStep:a}=i,n=e==="zoom-in"?1-a:1+a,r=Dc(t,s?n:1,o?n:1);return r.x=ti(r.x,t.x,this.getAnchorPointX(i)),r.y=ti(r.y,t.y,this.getAnchorPointY(i)),r}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return t==="pointer"?Bb:t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return t==="pointer"?Vb:t}};u([qo,iv({changeValue(e){this.toolbar?.setHidden(!e)}})],nn.prototype,"enabled",2),u([qo],nn.prototype,"buttons",2),u([qo,iv({changeValue(e,t){if(t==null)return;const i=e==="always",s=e==="zoomed"&&this.previousZoom!=null&&!an(this.previousZoom);this.toggleVisibility(i||s)}})],nn.prototype,"visible",2),u([qo],nn.prototype,"anchorPointX",2),u([qo],nn.prototype,"anchorPointY",2);var Jo=1e6;function kc({min:e,max:t},i,s,o){return o===0?0:Jo*((i-s)/o*(t-e)+e)}function WB(e,t,i,s,o,a){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,s]=[Math.min(i,s),Math.max(i,s)];const n=Jo*(i-o)/a,r=Jo*(s-o)/a,l=(i-o)/(s-o),c=(e-l*t)/(Jo-n+l*(r-Jo)),h=(t+(r-Jo)*c)/r;return{min:c,max:h}}function av(e,t,i,s){t===0&&(t=30),s===0&&(s=30);const o=e-t,a=e+t,n=i-s,r=i+s;return!(a<n||r<o)}var jB=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:Number.NaN,normalY:Number.NaN},{identifier:0,normalX:Number.NaN,normalY:Number.NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:Number.NaN,a2:Number.NaN,b1:Number.NaN,b2:Number.NaN}}start(e,t,i){if(e.sourceEvent.targetTouches.length!==2)return!1;e.sourceEvent.preventDefault();const s=Array.from(e.sourceEvent.targetTouches),{x:o,y:a,width:n,height:r}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1;for(const m of this.touchStart.origins)m.identifier=0;this.previous.a1=Number.NaN,this.previous.a2=Number.NaN,this.previous.b1=Number.NaN,this.previous.b2=Number.NaN;for(const m of[0,1]){const y=s[m].clientX,S=a+r-s[m].clientY;this.touchStart.origins[m].identifier=s[m].identifier,this.touchStart.origins[m].normalX=kc(this.initialZoom.x,y,o,n),this.touchStart.origins[m].normalY=kc(this.initialZoom.y,S,a,r)}const[l,c]=s,[h,d]=this.touchStart.origins,p=av(l.clientX,l.radiusX,c.clientX,c.radiusX);return av(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=d.normalY=(h.normalY+d.normalY)/2),p&&(h.normalX=d.normalX=(h.normalX+d.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:s,y:o,width:a,height:n}=t.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(x=>i.find(b=>b.identifier===r[x].identifier)),c=r[0].normalX,h=r[1].normalX,d=l[0].clientX,p=l[1].clientX,g=r[0].normalY,m=r[1].normalY,y=o+n-l[0].clientY,S=o+n-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,p,g,m,y,S,s,o,a,n)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,o,a,n,r,l,c,h,d){const{initialZoom:p,previous:g}=this,m=nv(e,t,i,s,g,"a1","a2",l,h,p.x),y=nv(o,a,n,r,g,"b1","b2",c,d,p.y);return{x:m,y}}};function nv(e,t,i,s,o,a,n,r,l,c){if(e==t){const h=kc(c,i,r,l),d=kc(c,s,r,l),p=(h+d)/2,g=(e-p)/Jo;return{min:c.min+g,max:c.max+g}}else{const h=o[a],d=o[n];return Math.abs(i-h)+Math.abs(s-d)<=1?(i=h,s=d):(o[a]=i,o[n]=s),WB(e,t,i,s,r,l)}}import{debounce as $B}from"ag-charts-core";var UB=class{constructor(){this.isFirstWheelEvent=!0,this.debouncedWheelReset=$B(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100)}onWheel(e,t){if(e.sourceEvent.cancelable===!1)return;const i=t();if(i==="abort")return;const s=i==="capped";this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==e.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=s,this.firstWheelEventDirection=e.deltaY<0,s||e.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}},{userInteraction:ea,InteractionState:hr}=on,Ac=e=>$z(e,10),rn="zoom-cursor",dr="zoom-tooltip",Ae=class extends Hz{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=Zo/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=Bb,this.anchorPointY=Vb,this.autoScaling=new pp,this.axisDraggingMode="zoom",this.buttons=new nn(this.ctx,this.getModuleProperties.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.onDataChange=new fp,this.axisDragger=new aB,this.panner=new AB,this.scroller=new OB,this.scrollPanner=new CB,this.twoFingers=new jB,this.deceleration="short",this.dragState=0,this.isState=s=>this.ctx.interactionManager.isState(s),this.destroyContextMenuActions=void 0,this.wheelSequencer=new UB,this.previousZoomValid=!0,this.previousAxisZoomValid={[bt.X]:!0,[bt.Y]:!0},this.toggleAxisDraggingCursorsDebounced=Wz(this.toggleAxisDraggingCursors.bind(this),Fb,{leading:!0,trailing:!0});const t=new Eb;this.selector=new EB(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new rB(e.eventsHub,e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this));const i=s=>{if(this.minVisibleItems>0){const o=s.stateAsDefinedZoom();s.constrainZoom(this.constrainZoom(o))}};this.dataChangeHandler=new xB(i,this.onDataChange,this.ctx,this.cleanup),this.domProxy=new hB({onAxisDragStart:s=>this.onAxisDragStart(s),onAxisDragMove:(s,o,a)=>this.onAxisDragMove(s,o,a),onAxisDragEnd:()=>this.onAxisDragEnd(),onAxisDoubleClick:s=>this.onAxisDoubleClick(s),onAxisWheel:(s,o)=>this.onAxisWheel(s,o)}),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",s=>this.onSeriesAreaDoubleClick(s)),e.widgets.seriesDragInterpreter.events.on("drag-move",s=>this.onSeriesAreaDragMove(s)),e.widgets.seriesDragInterpreter.events.on("drag-start",s=>this.onSeriesAreaDragStart(s)),e.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(e.scene.attachNode(t),e.eventsHub.on("series-area:hover",s=>this.onSeriesAreaHoverEvent(s)),e.eventsHub.on("series-area:click",s=>this.onSeriesAreaClickEvent(s)),e.eventsHub.on("series:keynav-zoom",s=>this.onNavZoom(s)),e.widgets.seriesWidget.addListener("wheel",s=>this.onWheel(s)),e.widgets.seriesWidget.addListener("touchstart",(s,o)=>this.onTouchStart(s,o)),e.widgets.seriesWidget.addListener("touchmove",(s,o)=>this.onTouchMove(s,o)),e.widgets.seriesWidget.addListener("touchend",s=>this.onTouchEnd(s)),e.widgets.seriesWidget.addListener("touchcancel",s=>this.onTouchEnd(s)),e.updateService.addListener("process-data",s=>this.onProcessData(s)),e.eventsHub.on("layout:complete",s=>this.onLayoutComplete(s)),e.eventsHub.on("zoom:change-request",s=>this.onZoomChangeRequested(s)),e.eventsHub.on("zoom:pan-start",s=>this.onZoomPanStart(s)),this.panner.addListener("update",s=>this.onPanUpdate(s)),()=>this.teardown()),this.autoScaler=new Jz(this.autoScaling,e.zoomManager,this,e.eventsHub,this.cleanup)}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.domProxy.destroy(),this.dataChangeHandler.destroy()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){return e?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?an(this.getZoom()):!0}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this;!t||!i||e?.preventZoomDblClick||!this.isState(hr.ZoomClickable)||this.resetZoom("zoom-seriesarea-dblclick")}onSeriesAreaHoverEvent(e){if(!this.shouldHandleAxisHover(e)){this.clearHoveredAxis();return}const t=this.domProxy.pickAxisAtPoint(e);t?(this.domProxy.setHoveredAxis(t.axisId),this.ctx.domManager.updateCursor(rn,this.domProxy.getCursor(t.direction))):this.clearHoveredAxis()}onSeriesAreaClickEvent(e){if(!this.shouldHandleAxisClick(e))return;const t=this.domProxy.pickAxisAtPoint(e);t&&e.sourceEvent?.type==="dblclick"&&this.onAxisDoubleClick(t.axisId)}shouldHandleAxisHover(e){const{enabled:t,enableAxisDragging:i,enableAxisScrolling:s,dragState:o}=this;return t&&(i||s)&&!e.consumed&&!this.activeAxis&&o===0&&this.domProxy.hasOverlappingAxes()}shouldHandleAxisClick(e){const{enabled:t,enableAxisDragging:i,enableAxisScrolling:s,enableDoubleClickToReset:o}=this;return t&&!this.activeAxis&&!e.consumed&&(i||s||o)}clearHoveredAxis(){this.activeAxis||(this.domProxy.clearHoveredAxis(),this.dragState===0&&this.ctx.domManager.updateCursor(rn))}tryBeginAxisDelegation(e){const t=this.domProxy.getHoveredAxis();if(!this.enabled||!this.enableAxisDragging||!t||!this.domProxy.beginDelegatedAxisDrag(t.axisId))return!1;this.activeAxis=t,this.onAxisDragStart(t.direction);const i=this.dragState===2?"grabbing":this.domProxy.getCursor(t.direction);return this.ctx.domManager.updateCursor(rn,i),e.device==="touch"&&e.sourceEvent.preventDefault(),!0}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:s,ctx:{domManager:o,zoomManager:a}}=this;if(!t||!this.isState(hr.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)||(this.panner.stopInteractions(),this.tryBeginAxisDelegation(e)))return;let n=0;const r=this.isPanningKeyPressed(e.sourceEvent);i&&(!s||r)?(o.updateCursor(rn,"grabbing"),n=2,this.panner.start()):s&&!r&&(n=3),(this.dragState=n)!==0&&a.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(e){const{dragState:t,enabled:i,paddedRect:s,panner:o,selector:a,ctx:{interactionManager:n,tooltipManager:r,updateService:l}}=this;if(this.activeAxis){this.onAxisDragMove(this.activeAxis.axisId,this.activeAxis.direction,e);return}if(!(!i||!s||!this.isState(hr.ZoomDraggable)||this.isIgnoredTouch(e))){switch(n.pushState(on.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault(),t){case 2:o.update(e);break;case 3:a.update(e,this.getModuleProperties(),s);break;case 0:return}r.updateTooltip(dr),l.update(dp.PERFORM_LAYOUT,{skipAnimations:!0})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:e}}=this;if(this.activeAxis){this.handleAxisDragEnd();return}e.popState(on.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState())}handleAxisDragEnd(){this.onAxisDragEnd(),this.domProxy.endDelegatedAxisDrag(this.activeAxis.axisId),this.activeAxis=void 0,this.clearHoveredAxis()}handleRegularDragEnd(){const{panner:e,selector:t}=this;switch(this.dragState){case 2:e.stop();break;case 3:if(t.didUpdate()){const i=t.stop(this.seriesRect,this.paddedRect,this.getZoom());i?this.updateZoom(ea("zoom-seriesarea-selector"),i):this.ctx.updateService.update()}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(rn),this.ctx.tooltipManager.removeTooltip(dr)}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,ctx:{zoomManager:s}}=this;!t||!i||!this.isState(hr.ZoomClickable)||(this.previousAxisZoomValid={[bt.X]:!0,[bt.Y]:!0},s.resetAxisZoom({source:"user-interaction",sourceDetail:"zoom-axis-dblclick"},e))}onAxisDragStart(e){const{axisDraggingMode:t,domProxy:i,enabled:s,enableAxisDragging:o,panner:a,ctx:{zoomManager:n}}=this;!s||!o||(a.stopInteractions(),t==="pan"?(i.setAxisCursor("grabbing"),this.dragState=2,this.panner.start(e),n.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(e,t,i){const{anchorPointX:s,anchorPointY:o,axisDragger:a,dragState:n,enabled:r,enableAxisDragging:l,seriesRect:c,shouldFlipXY:h,ctx:{interactionManager:d,tooltipManager:p,updateService:g,zoomManager:m}}=this;if(!r||!l||!c)return;d.pushState(on.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const y=this.getZoom();if(n===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let S=t===bt.X?s:o;h&&(S=t===bt.X?o:s);const x=m.getAxisZoom(e),b=a.update(i,t,S,c,y,x);this.autoScaler.onManualAdjustment(t),this.updateAxisZoom(ea("zoom-axis-drag"),e,t,b,{directional:!0})}p.updateTooltip(dr),g.update(dp.PERFORM_LAYOUT,{skipAnimations:!0})}onAxisDragEnd(){const{axisDraggingMode:e,axisDragger:t,dragState:i,domProxy:s,enabled:o,enableAxisDragging:a,ctx:{domManager:n,interactionManager:r,tooltipManager:l}}=this;r.popState(on.InteractionState.ZoomDrag),!(!o||!a||i===0)&&(this.dragState=0,e==="pan"&&(s.setAxisCursor("grab"),this.panner.stop()),t.stop(),n.updateCursor(rn),l.removeTooltip(dr))}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(on.InteractionState.Default)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(ea(`keyboard(${e.delta})`),s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:o}=this;if(!t||!s||!o||!this.isState(hr.ZoomWheelable))return;const{deltaX:a,deltaY:n}=e.sourceEvent,r=a!=null&&n!=null&&Math.abs(a)>Math.abs(n);i&&r?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,ctx:{zoomManager:o}}=this;if(!s)return;e.sourceEvent.preventDefault();const a=i.update(e,t,s,o.getAxisZooms());this.updateChanges(ea("zoom-seriesarea-wheel"),a)}onWheelScrolling(e){const t=this.getZoom(),i=e.deltaY>0&&an(t);this.wheelSequencer.onWheel(e,()=>this.handleWheelScrolling(e,i))}onAxisWheel(e,t){if(!this.enableAxisScrolling||e!==bt.X&&e!==bt.Y)return;const i=e===bt.X,s=!i,o=this.getModuleProperties({isScalingX:i,isScalingY:s}),a=this.getZoom(),n=t.deltaY>0&&a[e].min===Gz&&a[e].max===up;this.autoScaler.onManualAdjustment(e),this.wheelSequencer.onWheel(t,()=>this.handleWheelScrolling(t,n,o))}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{enableIndependentAxes:s,scroller:o,seriesRect:a,ctx:{zoomManager:n}}=this;if(!a)return"abort";let r=!0;const l=ea("zoom-axis-wheel");if(s===!0){const c=o.updateAxes(e,i,a,n.getAxisZooms());for(const[h,{direction:d,min:p,max:g}]of jz(c)){const m=d===bt.X?this.constrainZoom({x:{min:p,max:g},y:{min:up,max:up}}).x:{min:p,max:g};r&&(r=this.updateAxisZoom(l,h,d,m))}}else{const c=o.update(e,i,a,this.getZoom());if(c==null)return"abort";r=this.updateUnifiedZoom(l,c,{directional:!0})}return t||e.deltaY<0&&!r?"capped":"uncapped"}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(ea("zoom-seriesarea-twofingers"),xi(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enabled,this.enableAxisDragging,this.enableAxisScrolling,this.ctx,e.series.rect),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursorsDebounced())}onZoomChangeRequested(e){e.sourceDetail!=="zoom-seriesarea-panner"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(an(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:o}}=this;if(!i)return;const a=t.translateZooms(i,o.getAxisZooms(),e.deltaX,e.deltaY);this.updateChanges(ea("zoom-seriesarea-panner"),a),s.updateTooltip(dr)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}constrainZoom(e){return this.ctx.zoomManager.constrainZoomToItemCount(e,this.minVisibleItems,this.autoScaler.enabled)}isZoomValid(e,t){const{minVisibleItems:i,ctx:{zoomManager:s}}=this;if(i===0)return this.previousZoomValid=!0,!0;const o=this.getZoom(),a=Ac(Qe(e))<Ac(Qe(o)),n=Ac(ei(e))<Ac(ei(o));if(!a&&!n)return this.previousZoomValid=!0,!0;if(!this.previousZoomValid&&t?.directional)return!1;const r=t?.includeYVisibleRange??!1,l=this.autoScaler.enabled,c=s.isVisibleItemsCountAtLeast(e,i,{includeYVisibleRange:r,autoScaleYAxis:l});return this.previousZoomValid=t?.directional?c:!0,c}isAxisZoomValid(e,t,i){const{minVisibleItems:s,ctx:{zoomManager:o}}=this,a=this.getZoom(),n=t.max-t.min,r=a[e].max-a[e].min,l={...a,[e]:t};if(n>=r)return this.previousAxisZoomValid[e]=!0,!0;if(!this.previousAxisZoomValid[e]&&i?.directional)return!1;const c={includeYVisibleRange:!1,autoScaleYAxis:this.autoScaler.enabled},h=o.isVisibleItemsCountAtLeast(l,s,c);return this.previousAxisZoomValid[e]=i?.directional?h:!0,h}resetZoom(e){this.previousZoomValid=!0,this.previousAxisZoomValid={[bt.X]:!0,[bt.Y]:!0},this.ctx.zoomManager.resetZoom({source:"user-interaction",sourceDetail:e})}updateSyncZoom(e){this.updateZoom({source:"sync",sourceDetail:"internal-updateSyncZoom"},e)}updateChanges(e,t){const i=this.ctx.zoomManager.toZoomState(t)??{},s=wb(this.ctx.zoomManager.getZoom());this.updateZoom(e,{x:i.x??s.x,y:i.y??s.y})}updateZoom(e,t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e,t):this.updateUnifiedZoom(e,t)}updateUnifiedZoom(e,t,i){return t=this.constrainZoom(t),this.isZoomValid(t,i)?(this.ctx.zoomManager.updateZoom(e,t),!0):(this.ctx.updateService.update(dp.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e,t){this.updatePrimaryAxisZoom(e,t,bt.X),this.updatePrimaryAxisZoom(e,t,bt.Y)}updatePrimaryAxisZoom(e,t,i){const s=this.ctx.zoomManager.getPrimaryAxisId(i);s!=null&&this.updateAxisZoom(e,s,i,t[i])}updateAxisZoom(e,t,i,s,o){const{enableIndependentAxes:a,ctx:{zoomManager:n}}=this;if(!s)return!1;const r=this.getZoom();if(a!==!0)return r[i]=s,this.updateUnifiedZoom(e,r,o);if(!this.isAxisZoomValid(i,s,o))return!1;const{source:l,sourceDetail:c}=e;return n.updateChanges({source:l,sourceDetail:c,changes:{[t]:s},isReset:!1}),!0}updateAxisCursor(e){if(!this.domProxy)return;const{enableAxisDragging:t=this.enableAxisDragging,enableAxisScrolling:i=this.enableAxisScrolling,axisDraggingMode:s=this.axisDraggingMode}=e;t?this.domProxy.setAxisCursor(s==="pan"?"grab":void 0):i?this.domProxy.setAxisCursor("default"):this.domProxy.setAxisCursor(void 0)}toggleAxisDraggingCursors(){const{anchorPointX:e,anchorPointY:t,domProxy:i}=this,s=this.getZoom();let o=Qe(s)!==Zo,a=ei(s)!==Zo;if(!o){const n=Dc(s,.999,1);n.x=ti(n.x,s.x,e),o=this.isZoomValid(n,{includeYVisibleRange:!0})}if(!a){const n=Dc(s,1,.999);n.y=ti(n.y,s.y,t),a=this.isZoomValid(n,{includeYVisibleRange:!0})}i.toggleAxisDraggingCursor(bt.X,o),i.toggleAxisDraggingCursor(bt.Y,a)}getZoom(){return wb(this.ctx.zoomManager.getZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};u([rr({newValue(e){this.onEnabledChange(e)}}),Pe],Ae.prototype,"enabled",2),u([rr({changeValue(e){this.updateAxisCursor({enableAxisDragging:e})}}),Pe],Ae.prototype,"enableAxisDragging",2),u([rr({changeValue(e){this.updateAxisCursor({enableAxisScrolling:e})}}),Pe],Ae.prototype,"enableAxisScrolling",2),u([Pe],Ae.prototype,"enableDoubleClickToReset",2),u([rr({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),Pe],Ae.prototype,"enableIndependentAxes",2),u([Pe],Ae.prototype,"enablePanning",2),u([Pe],Ae.prototype,"enableScrolling",2),u([Pe],Ae.prototype,"enableSelecting",2),u([Pe],Ae.prototype,"enableTwoFingerZoom",2),u([Pe],Ae.prototype,"panKey",2),u([Pe],Ae.prototype,"axes",2),u([Pe],Ae.prototype,"scrollingStep",2),u([Pe],Ae.prototype,"keepAspectRatio",2),u([Pe],Ae.prototype,"minVisibleItems",2),u([Pe],Ae.prototype,"anchorPointX",2),u([Pe],Ae.prototype,"anchorPointY",2),u([Pe],Ae.prototype,"autoScaling",2),u([rr({changeValue(e){this.updateAxisCursor({axisDraggingMode:e})}}),Pe],Ae.prototype,"axisDraggingMode",2),u([Pe],Ae.prototype,"buttons",2),u([Pe],Ae.prototype,"onDataChange",2),u([Kz("panner.deceleration"),Pe],Ae.prototype,"deceleration",2);var Ic=Xo("pointer","start","middle","end"),ln={type:"plugin",name:"zoom",enterprise:!0,version:Pz,options:{enabled:Jt,enableAxisDragging:Jt,enableAxisScrolling:Jt,enableDoubleClickToReset:Jt,enablePanning:Jt,enableScrolling:Jt,enableSelecting:Jt,enableTwoFingerZoom:Jt,keepAspectRatio:Jt,anchorPointX:Ic,anchorPointY:Ic,axisDraggingMode:Xo("pan","zoom"),axes:Xo("x","y","xy"),deceleration:_z(Xo("off","short","long"),cp),minVisibleItems:zz,panKey:Xo("alt","ctrl","meta","shift"),scrollingStep:cp,autoScaling:{enabled:Jt,padding:cp},onDataChange:{strategy:Bz()("reset","preserveDomain","preserveRatios"),stickToEnd:Jt},buttons:{enabled:Jt,buttons:Rz({...Fz,value:Xo("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:Vz},"zoom button options array"),visible:Xo("always","zoomed","hover")}},themeTemplate:{enabled:!1,enableAxisDragging:!0,enableAxisScrolling:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$and:[{$eq:[{$path:"../axes"},"x"]},{$not:{$eq:[{$path:"/series/0/direction"},"horizontal"]}}]},padding:.05},onDataChange:{strategy:"preserveDomain",stickToEnd:!1},anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:{$path:"../enabled"},visible:"hover",buttons:{$shallowSimple:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]}}},create:e=>new Ae(e)};ln.options.enableIndependentAxes=hp(Jt),ln.options.buttons.anchorPointX=hp(Ic),ln.options.buttons.anchorPointY=hp(Ic);import{VERSION as YB}from"ag-charts-community";import{FILL_GRADIENT_BLANK_DEFAULTS as XB,FILL_IMAGE_BLANK_DEFAULTS as ZB,FILL_PATTERN_BLANK_DEFAULTS as QB,LEGEND_CONTAINER_THEME as qB,and as rv,array as JB,boolean as lv,borderOptionsDef as eV,callback as tV,colorUnion as iV,fontOptionsDef as sV,greaterThan as oV,legendPositionValidator as aV,lessThan as nV,number as cv,numberFormatValidator as rV,padding as lV,positiveNumber as ta,ratio as cV}from"ag-charts-core";import{_ModuleSupport as hV}from"ag-charts-community";import{BaseProperties as bp,Border as dV,CleanupRegistry as uV,Property as ii,ProxyProperty as vp,ZIndexMap as pV,createId as gV,expandLegendPosition as Dp}from"ag-charts-core";import{_ModuleSupport as mV}from"ag-charts-community";import{ZIndexMap as yV,cachedTextMeasurer as fV,countFractionDigits as xV,createId as SV,createIdsGenerator as bV,estimateTickCount as vV,findMinMax as DV,findRangeExtent as MV,isArray as kV,measureTextSegments as AV,toPlainText as IV,toTextString as NV}from"ag-charts-core";import{callWithContext as LV}from"ag-charts-core";function ur(e,t,i){return LV(e.chartService,t,i)}var{AxisInterval:TV,AxisLabel:CV,LinearScale:wV,BBox:OV,TranslatableGroup:EV,Selection:PV,Text:RV}=mV,Nc=class nm{constructor(t,i){this.ctx=t,this.dataProvider=i,this.id=SV(this),this.axisGroup=new EV({name:`${this.id}-AxisTicks`,zIndex:yV.AXIS}),this.labelSelection=PV.select(this.axisGroup,RV),this.interval=new TV,this.label=new CV,this.scale=new wV,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const{placement:t,translationX:i,translationY:s,horizontal:o,label:a}=this;function n(p){}let r,l;switch(t){case"top":case"top-right":case"top-left":r="bottom",l="center",a.mirrored=!1,a.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":r="top",l="center",a.mirrored=!1,a.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":r="middle",l="left",a.mirrored=!0,a.parallel=!1;break;default:}const c=[],h=this.generateTicks(),{ticks:d}=h;return this.labelSelection.update(d,void 0,p=>p.tickId),this.axisGroup.setProperties({translationX:i,translationY:s}),this.labelSelection.each((p,g)=>{p.fontFamily=a.fontFamily,p.fontSize=a.fontSize,p.fontStyle=a.fontStyle,p.fontWeight=a.fontWeight,p.fill=a.color,p.textBaseline=r,p.textAlign=l,p.text=g.tickLabel,p.x=o?g.translation:0,p.y=o?0:g.translation,c.push(p.getBBox())}),c.length>0?OV.merge(c).translate(i,s):void 0}tickFormatter(t,i,s,o){const{ctx:a}=this,{formatManager:n}=a,r=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:t,boundSeries:r,fractionDigits:o,visibleDomain:void 0};return this.label.formatValue((d,p)=>ur(a,d,p),h,c)??n.format((d,p)=>ur(a,d,p),h)??n.defaultFormat(h)}}inRange(t,i=.001){const[s,o]=DV(this.scale.range);return t>=s-i&&t<=o+i}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:o,tickCount:a}=vV(MV(this.scale.range),1,t,i,nm.DefaultTickCount,nm.DefaultMinSpacing),n=this.getTicksData({nice:[!0,!0],interval:this.interval.step,tickCount:a,minTickCount:o,maxTickCount:s});if(this.placement==="bottom"||this.placement==="top"){const r=fV(this.label),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;n.ticks=n.ticks.filter(p=>{if(Math.sign(p.translation-d)!==h)return!1;const{width:g}=kV(p.tickLabel)?AV(p.tickLabel,this.label):r.measureLines(NV(p.tickLabel));return d=p.translation+g*h,!0})}return n}getTicksData(t){const i=[],s=t.nice?this.scale.niceDomain(t):this.scale.domain,o=this.scale.ticks(t,s)?.ticks??[],a=o.reduce((l,c)=>Math.max(l,xV(c)),0),n=bV(),r=this.tickFormatter(s,o,!1,a);for(let l=0;l<o.length;l++){const c=o[l],h=this.scale.convert(c);if(!this.inRange(h))continue;const d=r(c,l);if(d==null||d==="")continue;const p=n(IV(d));i.push({tick:c,tickId:p,tickLabel:d,translation:h})}return{rawTicks:o,fractionDigits:a,ticks:i}}};Nc.className="AxisTicks",Nc.DefaultTickCount=5,Nc.DefaultMinSpacing=10;var _V=Nc,{LayoutElement:zV,Group:BV,Rect:hv,Marker:VV,TranslatableGroup:FV,BBox:Mp}=hV,kp=class extends bp{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};u([ii],kp.prototype,"thickness",2),u([ii],kp.prototype,"preferredLength",2);var Lc=class extends bp{constructor(e){super(),this.axisTicks=e}};u([vp("axisTicks.label")],Lc.prototype,"label",2),u([vp("axisTicks.interval")],Lc.prototype,"interval",2),u([vp("axisTicks.padding")],Lc.prototype,"padding",2);var si=class extends bp{constructor(e){super(),this.ctx=e,this.id=gV(this),this.legendGroup=new FV({name:"legend",zIndex:pV.LEGEND}),this.containerNode=this.legendGroup.appendChild(new hv({name:"legend-container"})),this.gradientRect=new hv,this.arrow=new VV({shape:"triangle"}),this.ticksGroup=new BV({name:"legend-axis-group"}),this.cleanup=new uV,this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new kp,this.spacing=20,this.border=new dV(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new _V(e,this),this.axisTicks.attachAxis(this.ticksGroup),this.scale=new Lc(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.cleanup.register(e.eventsHub.on("highlight:change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(zV.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){const{placement:e}=Dp(this.position);return e.startsWith("right")||e.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout({layoutBox:e}){const[t]=this.data;if(!this.enabled||!t?.enabled||t.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t),{strokeWidth:s,padding:o}=this.getContainerStyles(),a=this.updateGradientRect(e,i),n=this.updateAxis(t,a)??new Mp(0,0,0,0),r=Mp.merge([a,n]);r.grow(o).grow(s);const{left:l,top:c}=this.getMeasurements(e,r);this.updateContainer(r),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,o]=t,a=i.length;return t=i.map((n,r)=>r===0?s:r===a-1?o:s+(o-s)*r/(a-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i,gradient:s}=this,{preferredLength:o,thickness:a}=s,n=new Mp(0,0,0,0),r=Math.max(t.length-1,1);let l;return this.isVertical()?(l=0,n.width=a,n.height=Math.min(e.height,o)):(l=90,n.width=Math.min(e.width,o),n.height=a),i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((c,h)=>({stop:h/r,color:c})),rotation:l},n}updateAxis(e,t){const{axisTicks:i,gradient:s,scale:o}=this,{placement:a}=Dp(this.position),n=this.isVertical(),r=this.reverseOrder!==n;i.placement=a;const l=s.thickness+(o.padding??0);return i.translationX=n?l:t.x,i.translationY=n?t.y:l,i.scale.domain=r?e.colorDomain.slice().reverse():e.colorDomain,i.scale.range=n?[t.x,t.height]:[t.y,t.width],i.calculateLayout()}updateContainer(e){const t=this.getContainerStyles();this.containerNode.setStyleProperties(t),this.containerNode.cornerRadius=t.cornerRadius,this.containerNode.x=e.x,this.containerNode.y=e.y,this.containerNode.width=e.width,this.containerNode.height=e.height}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null){t.visible=!1;return}const{scale:i,label:s}=this.axisTicks,o=s.fontSize??0,a=i.convert(e.colorValue);let{x:n,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(n-=o/2,r+=a,l/=2):(n+=a,r-=o/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=o,t.translationX=n,t.translationY=r}getMeasurements(e,t){const i=p=>{};let{x:s,y:o}=e;const{width:a,height:n}=t,{placement:r,floating:l,xOffset:c,yOffset:h}=Dp(this.position),d=this.getContainerStyles();switch(s+=d.strokeWidth+d.padding.left,o+=d.strokeWidth+d.padding.top,r){case"left":o+=e.height/2-n/2;break;case"right":s+=e.width-a,o+=e.height/2-n/2;break;case"top":s+=e.width/2-a/2;break;case"bottom":s+=e.width/2-a/2,o+=e.height-n;break;case"right-top":case"top-right":s+=e.width-a;break;case"right-bottom":case"bottom-right":s+=e.width-a,o+=e.height-n;break;case"left-bottom":case"bottom-left":o+=e.height-n;break;case"left-top":case"top-left":break;default:i(r)}if(!l)switch(r){case"left":case"left-top":case"left-bottom":e.shrink(a+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":e.shrink(a+this.spacing,"right");break;case"top":case"top-left":case"top-right":e.shrink(n+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":e.shrink(n+this.spacing,"bottom");break;default:i(r)}return s+=c,o+=h,{top:o,left:s}}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:o,fillOpacity:a,padding:n}=this,r=typeof n=="number";return{cornerRadius:s,fill:o,fillOpacity:a,padding:{top:r?n:n.top??0,right:r?n:n.right??0,bottom:r?n:n.bottom??0,left:r?n:n.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0}}onChartHoverChange(){this.enabled&&this.updateArrow()}};si.className="GradientLegend",u([ii],si.prototype,"enabled",2),u([ii],si.prototype,"position",2),u([ii],si.prototype,"reverseOrder",2),u([ii],si.prototype,"gradient",2),u([ii],si.prototype,"spacing",2),u([ii],si.prototype,"border",2),u([ii],si.prototype,"cornerRadius",2),u([ii],si.prototype,"fill",2),u([ii],si.prototype,"fillOpacity",2),u([ii],si.prototype,"padding",2),u([ii],si.prototype,"scale",2);var Tc={type:"plugin",name:"gradientLegend",enterprise:!0,version:YB,options:{enabled:lv,position:aV,spacing:ta,reverseOrder:lv,border:eV,cornerRadius:cv,padding:lV,fill:iV,fillOpacity:cV,gradient:{preferredLength:ta,thickness:ta},scale:{label:{...sV,minSpacing:ta,format:rV,formatter:tV},padding:ta,interval:{step:cv,values:JB,minSpacing:rv(ta,nV("maxSpacing")),maxSpacing:rv(ta,oV("minSpacing"))}}},themeTemplate:{...qB,enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1,fill:{$applySwitch:[{$path:"type"},{$ref:"chartBackgroundColour"},["gradient",XB],["pattern",QB],["image",ZB]]}},create:e=>{const t=new si(e);return t.attachLegend(e.scene),t}};import{VERSION as HV}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as KV,FILL_IMAGE_DEFAULTS as GV,FILL_PATTERN_DEFAULTS as WV,LABEL_BOXING_DEFAULTS as jV,SINGLE_SERIES_HIGHLIGHT_STYLE as $V}from"ag-charts-core";import{VERSION as UV,_ModuleSupport as YV}from"ag-charts-community";import{_ModuleSupport as XV}from"ag-charts-community";var{Chart:ZV}=XV,Ap=class extends ZV{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,s=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=s,this.animationRect=s;for(const o of[t,i])o.translationX=Math.floor(s.x),o.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:e.layoutBox}})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const s of this.series)i.push(s.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};Ap.className="StandaloneChart",Ap.type="standalone";var{standaloneChartOptionsDefs:QV}=YV,cn={type:"chart",name:"standalone",enterprise:!0,version:UV,options:QV,create(e,t){return new Ap(e,t)}};import{_ModuleSupport as qV}from"ag-charts-community";import{Logger as JV,angleBetween as Cc,cachedTextMeasurer as eF,calcLineHeight as tF,evaluateBezier as wc,isBetweenAngles as dv,mergeDefaults as Oc,normalizeAngle360 as iF,toPlainText as sF,wrapText as oF}from"ag-charts-core";import{_ModuleSupport as Ec}from"ag-charts-community";import{Logger as aF}from"ag-charts-core";function uv(e,t,i){i||(t=nF(t));const s=new Map;for(const a of e){const n=a.datumIndex.type===0?`link-${a.datumIndex.index}`:`node-${a.datumIndex.index}`;s.set(a.id,{itemId:n,datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1})}let o=0;for(const[a,n]of s.entries())o=Math.max(o,Ip(s,t,n,a,-1,[])+Ip(s,t,n,a,1,[])+1);return{links:t,nodeGraph:s,maxPathLength:o}}function pv(e,t,i,s){const o=s.indexOf(t);if(o!==-1){for(let n=o;n<s.length;n+=1)i.add(s[n]);return}s.push(t);const{toNode:a}=t;for(const n of e)n.fromNode===a&&pv(e,n,i,s);s.pop()}function nF(e){const t=new Set;for(const i of e)pv(e,i,t,[]);return t.size!==0&&aF.warnOnce("Some links formed circular references. These will be removed from the output."),t.size===0?e:e.filter(i=>!t.has(i))}function Ip(e,t,i,s,o,a){if(a.includes(s))return 1/0;let n=o===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(n===-1){n=0;const r=o===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:h}=l,d=o===-1?h.id:c.id,p=o===-1?c.id:h.id,g=s===d?e.get(p):void 0;g!=null&&(r.push({node:g,link:l}),a?.push(s),n=Math.max(n,Ip(e,t,g,p,o,a)+1),a?.pop())}o===-1?i.maxPathLengthBefore=n:i.maxPathLengthAfter=n}return n}var{findNodeDatumInArray:rF,keyProperty:lF,valueProperty:Pc,DataController:cF,Group:pr,HighlightState:gv,Selection:ia,Series:hF,TransformableText:dF}=Ec,uF=class extends Ec.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:o}=i,a=s.contextNodeData?.nodeData.find(n=>n.datumIndex.type===o.type&&n.datumIndex.index===o.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},mv=class extends hF{constructor(){super(...arguments),this.NodeEvent=uF,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new pr({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new pr({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new pr({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new pr({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new pr({name:"linkGroup"})),this.labelSelection=ia.select(this.labelGroup,dF),this.linkSelection=ia.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=ia.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=ia.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=ia.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=ia.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=ia.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(t==null)return;const{fromKey:s,toKey:o,sizeKey:a,idKey:n,labelKey:r}=this.properties,l=new cF("standalone",e.suppressFieldDotNotation,this.ctx.eventsHub),c=i==null?null:l.request(this.id,Ec.DataSet.wrap(i)??Ec.DataSet.empty(),{props:[lF(n,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[Pc(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),h=e.request(this.id,t,{props:[Pc(s,void 0,{id:"fromValue",includeProperty:!1}),Pc(o,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[Pc(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[d,p]=await Promise.all([c??Promise.resolve(null),h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=p?.dataModel,this.linksProcessedData=p?.processedData;const g=new Map;if(d==null){const m=p.dataModel.resolveColumnById(this,"fromValue",p.processedData),y=p.dataModel.resolveColumnById(this,"toValue",p.processedData),S=b=>{const f=g.size,D=b;return{series:this,itemId:`node-${f}`,datum:{},datumIndex:{type:1,index:f},type:1,index:f,linksBefore:[],linksAfter:[],id:b,size:0,label:D,style:this.getNodeStyle({datumIndex:{type:1,index:f},datum:{},size:0,label:D},f,!1)}},x=p.processedData.dataSources.get(this.id)?.data;if(x)for(const[b]of x.entries()){const f=m[b],D=y[b];f==null||D==null||(g.has(f)||g.set(f,S(f)),g.has(D)||g.set(D,S(D)))}}else{const m=d.dataModel.resolveColumnById(this,"idValue",d.processedData),y=r==null?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData),S=d.processedData.dataSources.get(this.id)?.data;if(S)for(const[x,b]of S.entries()){const f=m[x],D=y?.[x],v={type:1,index:x};g.set(f,{series:this,itemId:`node-${x}`,datum:b,datumIndex:v,type:1,index:x,linksBefore:[],linksAfter:[],id:f,size:0,label:D,style:this.getNodeStyle({datumIndex:v,datum:b,size:0,label:D},x,!1)})}}this.processedNodes=g}findNodeDatum(e){return rF(e,this.contextNodeData?.nodeData)}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:o}=this;if(s==null||o==null){const{links:y,nodeGraph:S,maxPathLength:x}=uv(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:S,links:y,maxPathLength:x}}const{sizeKey:a}=this.properties,n=s.resolveColumnById(this,"fromValue",o),r=s.resolveColumnById(this,"toValue",o),l=a==null?void 0:s.resolveColumnById(this,"sizeValue",o),c=new Map;for(const y of this.processedNodes.values()){const S=e(y);c.set(y.id,S)}const h=[],d=o.dataSources.get(this.id)?.data;if(d)for(const[y,S]of d.entries()){const x=n[y],b=r[y],f=l==null?1:l[y],D=c.get(x),v=c.get(b);if(f<=0||D==null||v==null)continue;const M={type:0,index:y},A=t({series:this,itemId:`link-${y}`,datum:S,datumIndex:M,type:0,index:y,fromNode:D,toNode:v,size:f,style:this.getLinkStyle({datum:S,datumIndex:M},D.datumIndex,!1)});h.push(A)}const{links:p,nodeGraph:g,maxPathLength:m}=uv(c.values(),h,i);for(const y of g.values())y.datum.linksBefore=y.linksBefore.map(S=>S.link),y.datum.linksAfter=y.linksAfter.map(S=>S.link);return this.nodeCount=g.size,this.linkCount=p.length,{nodeGraph:g,links:p,maxPathLength:m}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[],a=this.getHighlightedDatum();this.contentGroup.visible=this.visible;const n=a==null?gv.None:gv.OtherItem;this.contentGroup.opacity=this.properties.highlight.getStyle(n).opacity??1,this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(d=>d.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(d=>d.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,l,c,h;a?.type===1?(r=s.filter(d=>d.type===0&&(d.toNode===a||d.fromNode===a)),l=r.map(d=>d.fromNode===a?d.toNode:d.fromNode),l.push(a),c=[],h=[a]):a?.type===0?(r=[a],l=[a.fromNode,a.toNode],c=[a],h=[]):(r=[],l=[],c=[],h=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:c,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:h,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this&&e.type==null){const{itemId:t}=e,i=this.contextNodeData?.nodeData??[];e=t==null?void 0:i.find(s=>s.type===1&&s.id===t)}else e?.series!==this&&(e=void 0);return e}isLabelHighlighted(e,t){return t==null?!1:t.type===1?t===e:t.type===0?t.fromNode===e||t.toNode===e:!1}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return{domain:[]}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:o}=this.properties,{fill:a=s[t%s.length],fillOpacity:n=1,stroke:r=o[t%o.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},o)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,o),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((o,a)=>{const n=o.distanceSquared(e,t);n<i&&(i=n,s=a)}),this.nodeSelection.each((o,a)=>{const n=o.distanceSquared(e,t);n<i&&(i=n,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}getDatumAriaText(e,t){if(e.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(e.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t})}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,s=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let o=s;if(i!==0||t===0)return;if(s?.type===0){const r=Array.from(this.linkSelection,h=>h.datum),c=r.indexOf(s)+t;c>=0&&c<r.length?o=r[c]:c>0?o=r.at(-1):o=Array.from(this.nodeSelection,d=>d.datum).at(-1)}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+t;c>=0&&c<r.length?o=r[c]:c<0?o=r[0]:o=Array.from(this.linkSelection,d=>d.datum)[0]}if(o==null)return;const a=o.type===1?Array.from(this.nodeSelection).find(r=>r.datum===o):Array.from(this.linkSelection).find(r=>r.datum===o);if(a==null)return;const n=this.computeFocusBounds(a.node);if(n!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:n,clipFocusBox:!0}}getCategoryValue(e){}datumIndexForCategoryValue(e){}};import{_ModuleSupport as pF}from"ag-charts-community";import{SceneChangeDetection as ro}from"ag-charts-core";var{Path:gF}=pF;function yv({radius:e,startAngle:t,endAngle:i,tension:s}){const o=e*Math.cos(t),a=e*Math.sin(t),n=e*Math.cos(i),r=e*Math.sin(i),l=o*s,c=a*s,h=n*s,d=r*s;return{x:[o,l,h,n],y:[a,c,d,r]}}var ks=class extends gF{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,s,o,a,n,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(s-t)*h+t,(o-n)*h+n,(a-r)*h+r,n,r)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:o,endAngle1:a,startAngle2:n,endAngle2:r}=this;o>n&&([o,n]=[n,o],[a,r]=[r,a]),e.clear();const l=t+s*Math.cos(o),c=i+s*Math.sin(o);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(r),i+s*Math.sin(r)),e.arc(t,i,s,r,n,!0),this.tensionedCurveTo(t+s*Math.cos(n),i+s*Math.sin(n),t,i,t,i,t+s*Math.cos(a),i+s*Math.sin(a)),e.arc(t,i,s,a,o,!0),e.closePath()}};u([ro()],ks.prototype,"centerX",2),u([ro()],ks.prototype,"centerY",2),u([ro()],ks.prototype,"radius",2),u([ro()],ks.prototype,"startAngle1",2),u([ro()],ks.prototype,"endAngle1",2),u([ro()],ks.prototype,"startAngle2",2),u([ro()],ks.prototype,"endAngle2",2),u([ro()],ks.prototype,"tension",2);import{_ModuleSupport as mF}from"ag-charts-community";import{BaseProperties as fv,Property as X}from"ag-charts-core";var{FillGradientDefaults:yF,FillPatternDefaults:fF,FillImageDefaults:xF,makeSeriesTooltip:SF,SeriesProperties:bF,Label:vF}=mF,Np=class extends vF{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};u([X],Np.prototype,"spacing",2),u([X],Np.prototype,"maxWidth",2);var Qi=class extends fv{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,tension:l}=this,c=this.fill??e[i%e.length],h=this.stroke??t[i%e.length];return{fill:c,fillOpacity:s,stroke:h,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,tension:l}}};u([X],Qi.prototype,"fill",2),u([X],Qi.prototype,"fillOpacity",2),u([X],Qi.prototype,"stroke",2),u([X],Qi.prototype,"strokeOpacity",2),u([X],Qi.prototype,"strokeWidth",2),u([X],Qi.prototype,"lineDash",2),u([X],Qi.prototype,"lineDashOffset",2),u([X],Qi.prototype,"tension",2),u([X],Qi.prototype,"itemStyler",2);var Li=class extends fv{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this,l=this.fill??e[i%e.length],c=this.stroke??t[i%e.length];return{fill:l,fillOpacity:s,stroke:c,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}}};u([X],Li.prototype,"spacing",2),u([X],Li.prototype,"width",2),u([X],Li.prototype,"fill",2),u([X],Li.prototype,"fillOpacity",2),u([X],Li.prototype,"stroke",2),u([X],Li.prototype,"strokeOpacity",2),u([X],Li.prototype,"strokeWidth",2),u([X],Li.prototype,"lineDash",2),u([X],Li.prototype,"lineDashOffset",2),u([X],Li.prototype,"itemStyler",2);var $e=class extends bF{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new yF,this.fillPatternDefaults=new fF,this.fillImageDefaults=new xF,this.fills=[],this.strokes=[],this.label=new Np,this.link=new Qi,this.node=new Li,this.tooltip=SF()}};u([X],$e.prototype,"fromKey",2),u([X],$e.prototype,"toKey",2),u([X],$e.prototype,"idKey",2),u([X],$e.prototype,"idName",2),u([X],$e.prototype,"labelKey",2),u([X],$e.prototype,"labelName",2),u([X],$e.prototype,"sizeKey",2),u([X],$e.prototype,"sizeName",2),u([X],$e.prototype,"nodes",2),u([X],$e.prototype,"fillGradientDefaults",2),u([X],$e.prototype,"fillPatternDefaults",2),u([X],$e.prototype,"fillImageDefaults",2),u([X],$e.prototype,"fills",2),u([X],$e.prototype,"strokes",2),u([X],$e.prototype,"label",2),u([X],$e.prototype,"link",2),u([X],$e.prototype,"node",2),u([X],$e.prototype,"tooltip",2);var{SeriesNodePickMode:xv,createDatumId:Rc,Sector:DF,getShapeStyle:_c,getLabelStyles:MF,BBox:kF}=qV,zc=e=>e.startAngle+Cc(e.startAngle,e.endAngle)/2,Lp=class extends mv{constructor(e){super({moduleCtx:e,pickModes:[xv.NEAREST_NODE,xv.EXACT_SHAPE_MATCH]}),this.properties=new $e}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new ks}nodeFactory(){return new DF}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:s}=this,{fromKey:o,toKey:a,sizeKey:n,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:h},node:{width:d,spacing:p}}=s,g=t/2,m=i/2;let y=[];const{nodeGraph:S,links:x}=this.getNodeGraph(C=>({...C,centerX:g,centerY:m,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),C=>({...C,centerX:g,centerY:m,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let b=0;for(const[C,{datum:R,linksBefore:V,linksAfter:E}]of S.entries()){const w=V.reduce((z,{link:B})=>z+B.size,0)+E.reduce((z,{link:B})=>z+B.size,0);if(w===0)S.delete(C);else{const{label:z}=s;R.size=w,b+=R.size;const B=z.enabled?this.getLabelText(R.label,R.datum,r,"label",[],z,{datum:R.datum,value:R.label,fromKey:o,toKey:a,sizeKey:n,size:R.size}):void 0;R.label=sF(B)}}let f=0;if(this.isLabelEnabled()){const C=eF(this.properties.label);let R=0;for(const{datum:V}of S.values()){const{id:E,label:w}=V;if(w==null)continue;const z=oF(w,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:B}=C.measureLines(z);R=Math.max(B,R),y.push({id:E,text:z,centerX:g,centerY:m,angle:Number.NaN,radius:Number.NaN,size:V.size,datumIndex:V.datumIndex,nodeDatum:V})}f=R+l}const D=S.size;let v=Math.min(t,i)/2-d-f,M=p/v;if(f!==0&&(D*M>=1.5*Math.PI||v<=0)&&(y=[],v=Math.min(t,i)/2-d,M=p/v),D*M>=2*Math.PI||v<=0){JV.warnOnce("There was insufficient space to display the Chord Series.");return}const A=v,I=v+d,k=Math.max((2*Math.PI-D*M)/b,0);let N=0;for(const{datum:C}of S.values()){C.innerRadius=A,C.outerRadius=I,C.startAngle=N,C.endAngle=N+C.size*k,N=C.endAngle+M;const R=(C.innerRadius+C.outerRadius)/2,V=zc(C);C.midPoint={x:C.centerX+R*Math.cos(V),y:C.centerY+R*Math.sin(V)}}const L=[];for(const{datum:C,linksBefore:R,linksAfter:V}of S.values()){const E=zc(C),w=[...R.map(B=>({link:B.link,distance:Cc(zc(B.node.datum),E),after:!1})),...V.map(B=>({link:B.link,distance:Cc(zc(B.node.datum),E),after:!0}))];let z=C.startAngle;for(const{link:B,after:K}of w.toSorted((_,j)=>_.distance-j.distance)){const _=B.size*k;K?(B.startAngle1=z,B.endAngle1=z+_):(B.startAngle2=z,B.endAngle2=z+_),z+=B.size*k}L.push(C)}const{tension:T}=this.properties.link;for(const C of x){C.radius=v;const R=yv({radius:v,startAngle:C.startAngle1,endAngle:C.endAngle2,tension:T}),V=yv({radius:v,startAngle:C.startAngle2,endAngle:C.endAngle1,tension:T}),E=wc(...R.x,.5),w=wc(...R.y,.5),z=wc(...V.x,.5),B=wc(...V.y,.5);C.midPoint={x:C.centerX+(E+z)/2,y:C.centerY+(w+B)/2},L.push(C)}for(const C of y){const R=S.get(C.id)?.datum;R!=null&&(C.radius=I+l,C.angle=iF(R.startAngle+Cc(R.startAngle,R.endAngle)/2),C.datumIndex=R.datumIndex,C.nodeDatum=R)}y.sort((C,R)=>C.angle-R.angle);let P=1/0,O=-1/0;return y=y.filter(C=>{const R=tF(h),V=Math.atan2(R/2,C.radius),E=C.angle-V,w=C.angle+V;return dv(P,E,w)||dv(O,E,w)?!1:(P=Math.min(E,P),O=Math.max(w,O),!0)}),{itemId:e,nodeData:L,labelData:y}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.getHighlightedDatum();e.labelSelection.each((s,o)=>{const{size:a,text:n,centerX:r,centerY:l,radius:c,angle:h,datumIndex:d,nodeDatum:p}=o;t.size=a;const g=this.isLabelHighlighted(p,i),m=this.getHighlightStyle(g,d),y=MF(this,void 0,t,this.properties.label,g,i),{fontStyle:S,fontWeight:x,fontSize:b,fontFamily:f,color:D}=y;s.visible=!0,s.translationX=r+c*Math.cos(h),s.translationY=l+c*Math.sin(h),s.text=n,s.fill=D,s.fontStyle=S,s.fontWeight=x,s.fontSize=b,s.fontFamily=f,s.textBaseline="middle",Math.cos(h)>=0?(s.textAlign="left",s.rotation=h):(s.textAlign="right",s.rotation=h-Math.PI);const v=m.opacity??1;s.opacity=v,s.fillOpacity=v,s.setBoxing(y)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Rc(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:o,strokes:a,fillGradientDefaults:n,fillPatternDefaults:r,fillImageDefaults:l}=s,{itemStyler:c}=s.node,h=this.getHighlightStyle(i,e.datumIndex),d=Oc(h,s.node.getStyle(o,a,t));let p=_c(d,n,r,l);if(c!=null&&e.datumIndex!=null){const g=this.cachedDatumCallback(Rc(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const m=this.makeItemStylerParams(e,i,p);return this.callWithContext(c,m)});g&&(p=_c(Oc(g,p),n,r,l))}return p.opacity=1,p}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},o,a){const{id:n}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,o,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:n,datum:e,highlightState:l,...a,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const{datumIndex:n}=a,r=this.getNodeStyle(a,n.index,i);o.setStyleProperties(r,s),o.centerX=a.centerX,o.centerY=a.centerY,o.innerRadius=a.innerRadius,o.outerRadius=a.outerRadius,o.startAngle=a.startAngle,o.endAngle=a.endAngle,o.inset=o.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Rc(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:o,properties:a}=this,{fills:n,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=a,{itemStyler:d}=a.link,p=this.getHighlightStyle(s,e),g=Oc(p,a.link.getStyle(n,r,i.index));let m=_c(g,l,c,h);if(d!=null&&e!=null){const y=this.ctx.highlightManager?.getActiveHighlight(),S=this.cachedDatumCallback(Rc(e.index,"link",s?"highlight":"node"),()=>{const x=this.getHighlightStateString(y,s,i);return this.callWithContext(d,{seriesId:o,datum:t,highlightState:x,...m})});S&&(m=_c(Oc(S,m),l,c,h))}return m.opacity=1,m}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const n=a.fromNode.datumIndex,r=this.getLinkStyle(a,n,i);o.centerX=a.centerX,o.centerY=a.centerY,o.radius=a.radius,o.startAngle1=a.startAngle1,o.endAngle1=a.endAngle1,o.startAngle2=a.startAngle2,o.endAngle2=a.endAngle2,o.tension=r.tension,o.setStyleProperties(r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),s=(e-i)/2,o=(t-i)/2,a=new kF(s,o,e,t);return{series:a,axis:a}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:o,ctx:{formatManager:a}}=this,{fromKey:n,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=o,d=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===e.type&&b.datumIndex.index===e.index);if(d==null)return;const p=d.type===0?d.fromNode.index:d.index,g=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,m=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let S;if(d.type===0){const b=d.fromNode.datumIndex;S=this.getLinkStyle({datumIndex:e,datum:m},b,!1)}else{const b=d.label;S=this.getNodeStyle({datumIndex:e,datum:m,size:y,label:b},e.index,!1)}const x=[];if(l!=null){const b=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});x.push({label:c,fallbackLabel:l,value:b??String(y)})}return this.formatTooltipWithContext(h,{title:g,symbol:this.legendItemSymbol(d.type,p,S),data:x},{seriesId:t,datum:m,title:g,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:y,...S})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};Lp.className="ChordSeries",Lp.type="chord";import{_ModuleSupport as AF}from"ag-charts-community";import{commonSeriesOptionsDefs as IF,constant as NF,fillGradientDefaults as LF,fillImageDefaults as TF,fillPatternDefaults as CF,required as Tp,string as Bc,undocumented as Cp}from"ag-charts-core";var{chordSeriesThemeableOptionsDef:wF}=AF,Vc={...wF,...IF,type:Tp(NF("chord")),fromKey:Tp(Bc),toKey:Tp(Bc),sizeKey:Bc,sizeName:Bc};Vc.fillGradientDefaults=Cp(LF),Vc.fillPatternDefaults=Cp(CF),Vc.fillImageDefaults=Cp(TF);var Sv={type:"series",name:"chord",chartType:"standalone",enterprise:!0,solo:!0,version:HV,dependencies:[cn],options:Vc,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:KV,fillPatternDefaults:WV,fillImageDefaults:GV,highlight:$V,label:{...jV,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}},create:e=>new Lp(e)};import{CartesianChartModule as OF,VERSION as EF}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as hn,CARTESIAN_POSITION as dn,DEFAULT_SHADOW_COLOUR as PF,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS as RF,FILL_IMAGE_DEFAULTS as _F,FILL_PATTERN_SINGLE_DEFAULTS as zF,LABEL_BOXING_DEFAULTS as BF}from"ag-charts-core";var un={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},bv={$clone:{$omit:[["placement","spacing"],{$path:"/series/0/stageLabel"}]}},vv={y:{type:{$if:[un,hn.NUMBER,hn.CATEGORY]},position:{$if:[un,dn.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},dn.RIGHT,dn.LEFT]}]},label:{$if:[un,void 0,bv]}},x:{type:{$if:[un,hn.CATEGORY,hn.NUMBER]},position:{$if:[un,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},dn.TOP,dn.BOTTOM]},dn.BOTTOM]},label:{$if:[un,bv,void 0]}}},VF={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",RF],["pattern",zF],["image",_F]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...BF,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:PF,xOffset:3,yOffset:3,blur:5},highlight:{unhighlightedItem:{opacity:.6}}},axes:{[hn.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[hn.CATEGORY]:{line:{enabled:!1}}}};import{_ModuleSupport as FF}from"ag-charts-community";import{ChartAxisDirection as HF}from"ag-charts-core";import{_ModuleSupport as wp}from"ag-charts-community";import{ChartAxisDirection as Op,SeriesZIndexMap as Dv}from"ag-charts-core";import{_ModuleSupport as KF}from"ag-charts-community";import{SceneChangeDetection as lo,lineDistanceSquared as Fc}from"ag-charts-core";var{BBox:GF,Path:WF}=KF,Mv=1e-6;function kv([e,t],[i,s]){return Math.abs(e-i)<=Mv&&Math.abs(t-s)<=Mv}var qi=class extends WF{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:a,x3:n,y3:r}=this;return{x:(e+i+o+n)/4,y:(t+s+a+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:o,y1:a,x2:n,y2:r,x3:l,y3:c}=this;return Math.min(Fc(e,t,i,s,o,a,1/0),Fc(e,t,o,a,n,r,1/0),Fc(e,t,n,r,l,c,1/0),Fc(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:a,x3:n,y3:r}=this,l=Math.min(e,i,o,n),c=Math.max(e,i,o,n)-l,h=Math.min(t,s,a,r),d=Math.max(t,s,a,r)-h;return new GF(l,h,c,d)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:o,x2:a,y2:n,x3:r,y3:l}=this,c=[[t,i],[s,o],[a,n],[r,l]];e.clear();let h,d;for(const p of c){if(h!=null&&kv(h,p)||d!=null&&kv(d,p))continue;const[g,m]=p;h==null?e.moveTo(g,m):e.lineTo(g,m),h??(h=p),d=p}e.closePath()}};u([lo()],qi.prototype,"x0",2),u([lo()],qi.prototype,"y0",2),u([lo()],qi.prototype,"x1",2),u([lo()],qi.prototype,"y1",2),u([lo()],qi.prototype,"x2",2),u([lo()],qi.prototype,"y2",2),u([lo()],qi.prototype,"x3",2),u([lo()],qi.prototype,"y3",2);import{_ModuleSupport as jF}from"ag-charts-community";var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:$F}=jF;function Av(e,t,i,s){const{x0:o,y0:a,x1:n,y1:r,x2:l,y2:c,x3:h,y3:d,opacity:p}=e;return i?{x0:(o+h)/2,y0:(a+d)/2,x1:(n+l)/2,y1:(r+c)/2,x2:(n+l)/2,y2:(r+c)/2,x3:(o+h)/2,y3:(a+d)/2,opacity:p}:{x0:(o+n)/2,y0:(a+r)/2,x1:(o+n)/2,y1:(a+r)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:p}}function UF(e,t){const i=a=>a==null;return{fromFn:(a,n,r)=>{r==="updated"&&i(n)?r="removed":r==="updated"&&i(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&t==="fade"?l={...gr(a,n),opacity:0}:r==="unknown"||r==="added"?l=Av(n,a.previousDatum,e,t):l={x0:a.x0,y0:a.y0,x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,x3:a.x3,y3:a.y3,opacity:a.opacity};const c=$F[r];return{...l,phase:c}},toFn:(a,n,r)=>{let l;return r==="removed"&&a.datum==null&&t==="fade"?l={...gr(a,n),opacity:0}:r==="removed"||i(n)?l=Av(n,a.previousDatum,e,t):l=gr(a,n),l}}}function gr(e,t){const{x0:i,y0:s,x1:o,y1:a,x2:n,y2:r,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:s,x1:o,y1:a,x2:n,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:Iv,valueProperty:YF,keyProperty:XF,updateLabelNode:ZF,SMALLEST_KEY_INTERVAL:QF,LARGEST_KEY_INTERVAL:qF,diff:JF,fixNumericExtent:eH,seriesLabelFadeInAnimation:Nv,resetMotion:tH,resetLabelFn:iH,animationValidation:sH,computeBarFocusBounds:oH,Group:aH,Selection:nH,PointerEvents:Lv,motion:rH,checkCrisp:lH,createDatumId:cH}=wp,hH=class extends wp.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},Tv=class extends wp.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[Iv.AXIS_ALIGNED,Iv.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:iH}}),this.NodeEvent=hH,this.connectorNodeGroup=this.contentGroup.appendChild(new aH({name:`${this.id}-series-connectorNodes`,zIndex:Dv.BACKGROUND})),this.connectorSelection=nH.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=Lv.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[Dv.BACKGROUND,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new qi}getKeyAxis(e){if(e===Op.X)return this.properties.xKeyAxis;if(e===Op.Y)return this.properties.yKeyAxis}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:o}=this,a=(y,S,x)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:o,itemId:x}),n=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:n,yScale:r}),d=[];this.needsDataModelDiff()&&this.processedData&&d.push(JF(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||d.push(sH());const p=this.visible?{}:{forceValue:0},g=this.properties.allowNullKeys??!1,{processedData:m}=await this.requestDataModel(e,this.data,{props:[XF(t,c,{id:"xValue",allowNullKey:g}),YF(i,h,{id:"yValue",...p,validation:a,invalidValue:0}),...l?[QF,qF]:[],...d],groupByKeys:!1});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:o}}=this;if(!t||!i)return{domain:[]};const{keys:[a]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n?.def.valueType==="category"){if(!this.hasData)return{domain:[]};const r=a.filter((c,h)=>o.getItemEnabled({seriesId:s,itemId:h})),l=i.getKeySortMetadata(this,"xValue",t);return{domain:r,sortMetadata:l}}return{domain:this.padBandExtent(a)}}else{const n=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...n),l=[-r,r];return{domain:eH(l)}}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,processedData:s,id:o,ctx:{legendManager:a}}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!(e&&t&&n&&r&&i&&s?.type==="ungrouped"))return;const l=n.scale,c=r.scale,h=this.getBarDirection()===Op.X,{stageKey:d,valueKey:p}=this.properties,g=`${p}`,m={itemId:g,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible},y=this.visible;if(!y)return m;const S=i.resolveKeysById(this,"xValue",s),x=i.resolveColumnById(this,"yValue",s),{groupOffset:b,barOffset:f,barWidth:D}=this.getBarDimensions(),v=lH(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let M;const A=s.dataSources.get(this.id)?.data??[];for(const[I,k]of A.entries()){const N=y&&a.getItemEnabled({seriesId:o,itemId:I}),L=S[I];if(L===void 0&&!this.properties.allowNullKeys)continue;const T=l.convert(L);if(!Number.isFinite(T))continue;const P=Math.round(T)+b+f,O=x[I],C=Math.round(c.convert(-O)),R=Math.round(c.convert(O)),V=this.getItemStyle({datum:k,datumIndex:I},!1),E=Math.max(V.strokeWidth??0,Math.abs(R-C)),w={x:h?Math.min(R,C):P,y:h?P:Math.min(R,C),width:h?E:D,height:h?D:E},z={x:w.x+w.width/2,y:w.y+w.height/2},B=this.createLabelData({datumIndex:I,rect:w,barAlongX:h,yDatum:O,datum:k,visible:N}),K={index:I,series:this,datum:k,datumIndex:I,xValue:L,yValue:O,xKey:d,yKey:p,x:w.x,y:w.y,width:w.width,height:w.height,midPoint:z,crisp:v,label:B,visible:N};if(m.nodeData.push(K),B!=null&&m.labelData.push(B),M!=null){const _=M.rect,j=M.nodeDatum,Z=M.datumIndex;h?m.connectorData.push({datum:j,datumIndex:Z,x0:_.x,y0:_.y+_.height,x1:_.x+_.width,y1:_.y+_.height,x2:w.x+w.width,y2:w.y,x3:w.x,y3:w.y,opacity:1}):m.connectorData.push({datum:j,datumIndex:Z,x0:_.x+_.width,y0:_.y,x1:w.x,y1:w.y,x2:w.x,y2:w.y+w.height,x3:_.x+_.width,y3:_.y+_.height,opacity:1})}N&&(M={itemId:g,rect:w,nodeDatum:K,datumIndex:I})}return m}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:s}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,o=>this.getDatumId(o))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const t=this.getShapeFillBBox();e.connectorSelection.each((i,s)=>{const{fill:o,fillOpacity:a,stroke:n,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.connectorStyle(s.datumIndex);i.setProperties(gr(i,s)),i.setStyleProperties({fill:o,stroke:n,fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h},t)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=Lv.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:s=!1,labelSelection:o}=e;o.each((a,n)=>{const r=this.getHighlightStyle(s,n.datumIndex);a.visible=n.visible||s,a.fillOpacity=r.opacity??1,a.opacity=r.opacity??1,ZF(this,a,t,this.properties.label,n,s,i)})}getHighlightLabelData(e,t){if(t.label)return[{...t.label}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{stageKey:a,valueKey:n,tooltip:r,legendItemName:l}=o,c=this.getCategoryAxis(),h=this.getValueAxis();if(!i||!s||!c||!h)return;const d=s.dataSources.get(this.id)?.data[e],p=i.resolveKeysById(this,"xValue",s)[e],g=i.resolveColumnById(this,"yValue",s)[e],m=this.properties.allowNullKeys??!1;if(!(p===void 0&&!m))return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",p,d,a,l),value:this.getAxisValueText(h,"tooltip",g,d,n,l)}]},{seriesId:t,datum:d,title:a,stageKey:a,valueKey:n,...this.tooltipStyle(d,e)})}resetAllAnimation(e){super.resetAllAnimation(e),tH([this.connectorSelection],gr)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),o=UF(i,"normal");rH.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],o),Nv(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),Nv(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return cH(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return oH(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,fill:n,stroke:r}=this.properties.getStyle(e);return{marker:{fill:n,fillOpacity:i,stroke:r,strokeWidth:t,strokeOpacity:s,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:o},visible:a}=this;if(!s||!i||e!=="category")return[];const{showInLegend:n}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=r[c],d=this.properties.allowNullKeys??!1;if(!(h==null&&!d))return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:a&&o.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!n}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};import{_ModuleSupport as dH}from"ag-charts-community";import{Property as Lt}from"ag-charts-core";var{Label:uH,AbstractBarSeriesProperties:pH,makeSeriesTooltip:gH,AxisLabel:mH}=dH,Ep=class extends uH{constructor(){super(...arguments),this.spacing=0}};u([Lt],Ep.prototype,"placement",2),u([Lt],Ep.prototype,"spacing",2);var Cv=class extends mH{};u([Lt],Cv.prototype,"placement",2);var oi=class extends pH{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new Ep,this.stageLabel=new Cv,this.tooltip=gH()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};u([Lt],oi.prototype,"stageKey",2),u([Lt],oi.prototype,"valueKey",2),u([Lt],oi.prototype,"fills",2),u([Lt],oi.prototype,"fillOpacity",2),u([Lt],oi.prototype,"strokes",2),u([Lt],oi.prototype,"strokeWidth",2),u([Lt],oi.prototype,"strokeOpacity",2),u([Lt],oi.prototype,"lineDash",2),u([Lt],oi.prototype,"lineDashOffset",2),u([Lt],oi.prototype,"label",2),u([Lt],oi.prototype,"stageLabel",2),u([Lt],oi.prototype,"tooltip",2);function wv(e,{x:t,y:i,width:s,height:o,opacity:a}){return{x1:t,y1:i,x2:t+s,y2:i+o,opacity:a??1}}var{Line:yH}=FF,Pp=class extends Tv{constructor(e){super({moduleCtx:e,animationResetFns:{datum:wv}}),this.properties=new oi}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.data.reduce((s,o,a)=>s+(t.getItemEnabled({seriesId:e,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:e},t){return this.properties.getStyle(e)}connectorStyle(e){return this.properties.getStyle(e)}nodeFactory(){return new yH}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:o,visible:a}){const{stageKey:n,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;if(!l.enabled)return;let d,p,g,m;if(i)switch(d=t.x+t.width/2,g="center",h){case"before":p=t.y-c,m="bottom";break;case"after":p=t.y+t.height+c,m="top";break;default:p=t.y+t.height/2,m="middle"}else switch(p=t.y+t.height/2,m="middle",h){case"before":d=t.x-c,g="right";break;case"after":d=t.x+t.width+c,g="left";break;default:d=t.x+t.width/2,g="center"}const y=this.getSeriesDomain(HF.Y).domain,S=this.getLabelText(s,o,r,"y",y,l,{itemId:r,value:s,datum:o,stageKey:n,valueKey:r});return{x:d,y:p,textAlign:g,textBaseline:m,text:S,itemId:r,datum:o,datumIndex:e,series:this,visible:a}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each((i,s)=>{i.setProperties(wv(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0,i.opacity=t?.opacity??1})}tooltipStyle(e,t){const{fill:i,stroke:s,fillOpacity:o,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}=this.properties.getStyle(t);return{fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};Pp.className="ConeFunnelSeries",Pp.type="cone-funnel";import{_ModuleSupport as fH}from"ag-charts-community";import{commonSeriesOptionsDefs as xH,constant as SH,required as Rp,string as Ov,without as bH}from"ag-charts-core";var{coneFunnelSeriesThemeableOptionsDef:vH}=fH,DH={...bH(xH,["showInLegend"]),...vH,type:Rp(SH("cone-funnel")),stageKey:Rp(Ov),valueKey:Rp(Ov)};import{CARTESIAN_AXIS_TYPE as Ev,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS as MH,FILL_IMAGE_DEFAULTS as kH,FILL_PATTERN_SINGLE_DEFAULTS as AH,LABEL_BOXING_DEFAULTS as IH,SAFE_RANGE2_OPERATION as Pv}from"ag-charts-core";var NH={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},Pv]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",MH],["pattern",AH],["image",kH]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},Pv]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...IH,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:{highlightedItem:{stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},seriesArea:{padding:{top:20,bottom:20}},axes:{[Ev.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[Ev.CATEGORY]:{line:{enabled:!1}}}},Rv={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:EF,dependencies:[OF],options:DH,defaultAxes:vv,themeTemplate:NH,create:e=>new Pp(e)};import{CartesianChartModule as LH,VERSION as TH}from"ag-charts-community";import{_ModuleSupport as CH}from"ag-charts-community";import{ChartAxisDirection as _v,mergeDefaults as _p}from"ag-charts-core";import{_ModuleSupport as wH}from"ag-charts-community";import{BaseProperties as OH,Property as he}from"ag-charts-core";var{Label:EH,DropShadow:PH,AbstractBarSeriesProperties:RH,makeSeriesTooltip:_H,AxisLabel:zH}=wH,BH=class extends EH{},zv=class extends zH{};u([he],zv.prototype,"placement",2);var As=class extends OH{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:e,stroke:t,fillOpacity:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this;return{fill:e,fillOpacity:i,stroke:t,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,opacity:1}}};u([he],As.prototype,"enabled",2),u([he],As.prototype,"fill",2),u([he],As.prototype,"fillOpacity",2),u([he],As.prototype,"stroke",2),u([he],As.prototype,"strokeWidth",2),u([he],As.prototype,"strokeOpacity",2),u([he],As.prototype,"lineDash",2),u([he],As.prototype,"lineDashOffset",2);var ct=class extends RH{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new As,this.shadow=new PH().set({enabled:!1}),this.label=new BH,this.stageLabel=new zv,this.tooltip=_H()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};u([he],ct.prototype,"stageKey",2),u([he],ct.prototype,"valueKey",2),u([he],ct.prototype,"fills",2),u([he],ct.prototype,"fillOpacity",2),u([he],ct.prototype,"strokes",2),u([he],ct.prototype,"strokeWidth",2),u([he],ct.prototype,"strokeOpacity",2),u([he],ct.prototype,"lineDash",2),u([he],ct.prototype,"lineDashOffset",2),u([he],ct.prototype,"spacingRatio",2),u([he],ct.prototype,"itemStyler",2),u([he],ct.prototype,"dropOff",2),u([he],ct.prototype,"shadow",2),u([he],ct.prototype,"label",2),u([he],ct.prototype,"stageLabel",2),u([he],ct.prototype,"tooltip",2);var{resetBarSelectionsFn:VH,prepareBarAnimationFunctions:Bv,midpointStartingBarPosition:Vv,createDatumId:FH,Rect:HH,motion:Fv}=CH,zp=class extends Tv{constructor(e){super({moduleCtx:e,animationResetFns:{datum:VH}}),this.properties=new ct}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(e){return _p(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new HH}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:o}){const{valueKey:a,stageKey:n,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain(_v.Y).domain,c=this.getLabelText(i,s,a,"y",l,r,{itemId:a,value:i,datum:s,stageKey:n,valueKey:a});return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:n,datum:s,datumIndex:e,series:this,visible:o}}getItemStyle({datum:e,datumIndex:t},i){const{id:s,properties:o}=this,{stageKey:a,valueKey:n,itemStyler:r}=o,l=this.getHighlightStyle(i,t);let h=_p(l,o.getStyle(t));if(r!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),p=this.cachedDatumCallback(FH(t,i?"highlight":"node"),()=>{const g=this.getHighlightStateString(d,i,t);return this.callWithContext(r,{seriesId:s,datum:e,highlightState:g,stageKey:a,valueKey:n,...h})});p&&(h=_p(p,h))}return h}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:s}=this.properties,o=this.getCategoryDirection()===_v.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=this.getItemStyle(r,t);n.setStyleProperties(l,a),n.visible=o?r.width>0:r.height>0,n.crisp=r.crisp,n.fillShadow=s})}tooltipStyle(e,t){return this.getItemStyle({datum:e,datumIndex:t},!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),o=Bv(Vv(i,"normal"),"unknown");Fv.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],o=Bv(Vv(this.isVertical(),"fade"),"added");Fv.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o,(a,n)=>n.xValue,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};zp.className="FunnelSeries",zp.type="funnel";import{_ModuleSupport as KH}from"ag-charts-community";import{commonSeriesOptionsDefs as GH,constant as WH,required as Bp,string as Hv,without as jH}from"ag-charts-core";var{funnelSeriesThemeableOptionsDef:$H}=KH,UH={...$H,...jH(GH,["showInLegend"]),type:Bp(WH("funnel")),stageKey:Bp(Hv),valueKey:Bp(Hv)},Kv={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:TH,dependencies:[LH],options:UH,defaultAxes:vv,themeTemplate:VF,create:e=>new zp(e)};import{VERSION as YH}from"ag-charts-community";import{FONT_SIZE as XH,LABEL_BOXING_DEFAULTS as ZH,SAFE_RANGE2_OPERATION as QH,SAFE_STROKE_FILL_OPERATION as qH,linearGaugeSeriesOptionsDef as JH}from"ag-charts-core";import{VERSION as e4}from"ag-charts-community";import{commonChartOptionsDefs as t4,defined as vt,linearGaugeSeriesOptionsDef as i4,positiveNumber as s4,radialGaugeSeriesOptionsDef as o4,tooltipOptionsDefs as a4,typeUnion as n4,undocumented as Gv,without as Wv}from"ag-charts-core";import{mergeArrayDefaults as jv,mergeDefaults as r4}from"ag-charts-core";function $v(e){const{enabled:t,mode:i,showArrow:s,range:o,position:a,pagination:n,delay:r,wrapping:l,interaction:c,renderer:h,...d}=e,p={enabled:t,showArrow:s,range:o,position:a,interaction:c,renderer:h,...d};return{chartTooltipOptions:{mode:i,pagination:n,delay:r,wrapping:l,...d},seriesTooltipOptions:p}}function l4(e){const{animation:t,background:i,container:s,contextMenu:o,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:S,title:x,width:b,type:f,cursor:D,nodeClickRange:v,tooltip:M,value:A,scale:I={},startAngle:k,endAngle:N,highlight:L,segmentation:T,bar:P,needle:O,targets:C,outerRadius:R,innerRadius:V,outerRadiusRatio:E,innerRadiusRatio:w,cornerRadius:z,cornerMode:B,label:K,secondaryLabel:_,spacing:j,...Z}=e,U=M!=null,ie=M??{},{chartTooltipOptions:ae,seriesTooltipOptions:re}=$v(ie),xe={...Z,type:f,cursor:D,context:a,nodeClickRange:v,value:A,scale:I,startAngle:k,endAngle:N,highlight:L,segmentation:T,bar:P,targets:C,outerRadius:R,innerRadius:V,outerRadiusRatio:E,innerRadiusRatio:w,cornerRadius:z,cornerMode:B,label:K,secondaryLabel:_,spacing:j};return U&&(xe.tooltip=re),O!=null&&(xe.needle={enabled:!0,...O}),{animation:t,background:i,container:s,contextMenu:o,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:S,title:x,width:b,...U?{tooltip:ae}:{},series:[xe]}}function c4(e){const{animation:t,background:i,container:s,contextMenu:o,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:S,title:x,width:b,type:f,cursor:D,nodeClickRange:v,tooltip:M,value:A,scale:I={},direction:k="vertical",thickness:N,highlight:L,segmentation:T,bar:P,targets:O,cornerRadius:C,cornerMode:R,label:V,...E}=e,w=M!=null,z=M??{},{chartTooltipOptions:B,seriesTooltipOptions:K}=$v(z),_={...E,type:f,cursor:D,nodeClickRange:v,value:A,scale:I,direction:k,thickness:N,highlight:L,segmentation:T,bar:P,targets:O,cornerRadius:C,cornerMode:R,label:V};return w&&(_.tooltip=K),{animation:t,background:i,container:s,contextMenu:o,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:S,title:x,width:b,...w?{tooltip:B}:{},series:[_]}}function Uv(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=r4(e,s),e.targets!=null&&i!=null&&(e.type==="radial-gauge"?e.targets=jv(e.targets,i):e.targets=jv(e.targets,i)),e}function h4(e,t){switch(e.type){case"radial-gauge":return l4(Uv(e,t));case"linear-gauge":return c4(Uv(e,t));default:return{series:[]}}}var Hc={theme:vt,container:vt,animation:vt,background:vt,contextMenu:vt,context:()=>!0,listeners:vt,locale:vt,width:vt,height:vt,minWidth:vt,minHeight:vt,title:vt,subtitle:vt,footnote:vt,padding:vt,tooltip:{...a4,...t4.tooltip}};Hc.overrideDevicePixelRatio=Gv(s4),Hc.foreground=Gv(vt);var Yv={type:"preset",name:"gauge-preset",enterprise:!0,version:e4,dependencies:[cn],options:n4({"linear-gauge":{...Wv(i4,["type"]),...Hc},"radial-gauge":{...Wv(o4,["type"]),...Hc}},"gauge options"),create:h4};import{_ModuleSupport as pn}from"ag-charts-community";import{StateMachine as d4,cachedTextMeasurer as Xv,easeOut as u4,findRangeExtent as p4,isArray as g4,measureTextSegments as m4,mergeDefaults as Zv,tickFormat as y4,toRadians as Qv,toTextString as f4}from"ag-charts-core";var qv=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const o=e.nodes();if(o.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const a=o[0],n=o.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??o.at(-1);this.node.datum=this.datum=a.datum,s(this.node,a,n)}}};import{isArray as x4}from"ag-charts-core";var Jv={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function eD(e,t){if(e==null)return"";const{min:i,max:s}=t,o=i===0?0:Math.ceil(Math.log10(Math.abs(i))),a=s===0?0:Math.ceil(Math.log10(Math.abs(s))),n=Math.max(2-Math.max(o,a),0);return e.toFixed(n)}function mr(e,t,i,s){if(i.text!=null)return i.text;const o=s??i.value;let a;return i?.formatter!=null&&(a=ur(t,i.formatter,{seriesId:e,datum:void 0,value:o})),a==null||x4(a)?a:String(a)}function tD({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}import{_ModuleSupport as iD}from"ag-charts-community";import{clamp as sD,iterate as S4}from"ag-charts-core";function oD(e,t){const i=S4(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function aD(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),s=sD(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:o,selection:a}=i[s];if(o==null||o.length===0)return;const n=sD(0,t.datumIndex,o.length-1),r=o[n];for(const l of a)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:n,otherIndex:s}}function nD(e,t){return iD.findNodeDatumInArray(t,e.contextNodeData?.nodeData)??iD.findNodeDatumInArray(t,e.contextNodeData?.targetData)}import{_ModuleSupport as Vp}from"ag-charts-community";import{BaseProperties as Kc,PropertiesArray as Fp,Property as H}from"ag-charts-core";import{BaseProperties as rD,Logger as b4,Property as gn}from"ag-charts-core";var Gc=class extends rD{getSegments(e,t){const{values:i,step:s,count:o}=this,a=Math.min(...e.domain),n=Math.max(...e.domain);let r;if(i!=null){const l=i.filter(c=>c>a&&c<n).sort((c,h)=>c-h);r=[a,...l,n]}else if(s!=null){const l=[];for(let c=a;c<n;c+=s)l.push(c);l.push(n),r=l}else if(o==null){const l=e.ticks({nice:[!0,!0],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter(c=>c>a&&c<n);r=l==null?void 0:[a,...l,n]}else{const l=o+1;r=Array.from({length:l+1},(c,h)=>h/l*(n-a)+a)}return r!=null&&r.length>t&&(b4.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[a,n]),r}};u([gn],Gc.prototype,"values",2),u([gn],Gc.prototype,"step",2),u([gn],Gc.prototype,"count",2);var yr=class extends rD{constructor(){super(...arguments),this.enabled=!1,this.interval=new Gc,this.spacing=0}};u([gn],yr.prototype,"enabled",2),u([gn],yr.prototype,"interval",2),u([gn],yr.prototype,"spacing",2);var{makeSeriesTooltip:v4,SeriesProperties:D4,Label:M4,AxisLabel:k4,getColorStops:A4}=Vp,lD=class extends M4{};u([H],lD.prototype,"spacing",2);var ht=class extends Kc{constructor(){super(...arguments),this.value=0,this.label=new lD}getStyle(e){const{fill:t=e.fill??"black",fillOpacity:i=e.fillOpacity??1,stroke:s=e.stroke??"black",strokeWidth:o=e.strokeWidth??0,strokeOpacity:a=e.strokeOpacity??1,lineDash:n=e.lineDash??[0],lineDashOffset:r=e.lineDashOffset??0}=this;return{fill:t,fillOpacity:i,stroke:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}}};u([H],ht.prototype,"text",2),u([H],ht.prototype,"value",2),u([H],ht.prototype,"shape",2),u([H],ht.prototype,"placement",2),u([H],ht.prototype,"spacing",2),u([H],ht.prototype,"size",2),u([H],ht.prototype,"rotation",2),u([H],ht.prototype,"fill",2),u([H],ht.prototype,"fillOpacity",2),u([H],ht.prototype,"stroke",2),u([H],ht.prototype,"strokeWidth",2),u([H],ht.prototype,"strokeOpacity",2),u([H],ht.prototype,"lineDash",2),u([H],ht.prototype,"lineDashOffset",2),u([H],ht.prototype,"label",2);var ai=class extends Kc{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new Fp(Vp.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fill:s,fills:o,fillMode:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:s??hD(o,a,e,i,t),fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};u([H],ai.prototype,"enabled",2),u([H],ai.prototype,"thickness",2),u([H],ai.prototype,"thicknessRatio",2),u([H],ai.prototype,"fills",2),u([H],ai.prototype,"fillMode",2),u([H],ai.prototype,"fill",2),u([H],ai.prototype,"fillOpacity",2),u([H],ai.prototype,"stroke",2),u([H],ai.prototype,"strokeWidth",2),u([H],ai.prototype,"strokeOpacity",2),u([H],ai.prototype,"lineDash",2),u([H],ai.prototype,"lineDashOffset",2);var fr=class extends Kc{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};u([H],fr.prototype,"values",2),u([H],fr.prototype,"step",2),u([H],fr.prototype,"minSpacing",2),u([H],fr.prototype,"maxSpacing",2);var cD=class extends k4{constructor(){super(...arguments),this.placement=void 0}};u([H],cD.prototype,"placement",2);var Dt=class extends Kc{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Fp(Vp.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new fr,this.label=new cD}getStyle(e,t,i,s){const{fill:o,fills:a,defaultFill:n,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:p,lineDashOffset:g}=this;return{fill:o??(e&&a.length===0?n:void 0)??hD(a,r,t,s,i),fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:p,lineDashOffset:g}}};u([H],Dt.prototype,"min",2),u([H],Dt.prototype,"max",2),u([H],Dt.prototype,"fills",2),u([H],Dt.prototype,"fillMode",2),u([H],Dt.prototype,"fill",2),u([H],Dt.prototype,"fillOpacity",2),u([H],Dt.prototype,"stroke",2),u([H],Dt.prototype,"strokeWidth",2),u([H],Dt.prototype,"strokeOpacity",2),u([H],Dt.prototype,"lineDash",2),u([H],Dt.prototype,"lineDashOffset",2),u([H],Dt.prototype,"defaultFill",2),u([H],Dt.prototype,"interval",2),u([H],Dt.prototype,"label",2);var Wc=class extends Wa{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};u([H],Wc.prototype,"text",2),u([H],Wc.prototype,"placement",2),u([H],Wc.prototype,"avoidCollisions",2);var Mt=class extends D4{constructor(){super(...arguments),this.value=0,this.segmentation=new yr,this.defaultColorRange=[],this.targets=new Fp(ht),this.defaultTarget=new ht,this.defaultScale=new Dt,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Dt,this.bar=new ai,this.label=new Wc,this.tooltip=v4()}};u([H],Mt.prototype,"value",2),u([H],Mt.prototype,"segmentation",2),u([H],Mt.prototype,"defaultColorRange",2),u([H],Mt.prototype,"targets",2),u([H],Mt.prototype,"defaultTarget",2),u([H],Mt.prototype,"defaultScale",2),u([H],Mt.prototype,"direction",2),u([H],Mt.prototype,"thickness",2),u([H],Mt.prototype,"cornerRadius",2),u([H],Mt.prototype,"cornerMode",2),u([H],Mt.prototype,"margin",2),u([H],Mt.prototype,"scale",2),u([H],Mt.prototype,"bar",2),u([H],Mt.prototype,"label",2),u([H],Mt.prototype,"tooltip",2);function hD(e,t,i,s,o){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:A4(e,i,s.domain,t),rotation:o?90:0,bounds:"series"}}import{_ModuleSupport as I4}from"ag-charts-community";import{cachedTextMeasurer as N4,isArray as L4,measureTextSegments as T4,toPlainText as C4,toTextString as w4}from"ag-charts-core";var{BBox:O4}=I4;function Hp(e){const{x0:t,y0:i,x1:s,y1:o,horizontalInset:a,verticalInset:n}=e,r=Math.min(t,s)+a,l=Math.min(i,o)+n,c=Math.max(Math.abs(s-t)-2*a,0),h=Math.max(Math.abs(o-i)-2*n,0);return{x:r,y:l,width:c,height:h}}function E4(e,t){if(t==null)return!0;const i=Hp(e),s=1e-6,o=i.x+s,a=i.y+s,n=i.x+i.width-s,r=i.y+i.height-s,l=t.x,c=t.x+t.width,h=t.y,d=t.y+t.height;return Math.max(o,l)<=Math.min(n,c)&&Math.max(a,h)<=Math.min(r,d)}function Kp(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:o}=e;return t!=null&&i!=null||s!=null&&o!=null}function P4(e){if(!Kp(e))return;const{x0:t,y0:i,x1:s,y1:o}=e,{x:a,y:n,width:r,height:l}=Hp(e);let{clipX0:c,clipX1:h,clipY0:d,clipY1:p}=e;(c==null||h==null)&&(c=t,h=s),(d==null||p==null)&&(d=i,p=o);const g=Math.min(c,h),m=Math.min(d,p),y=Math.abs(h-c),S=Math.abs(p-d);return c=Math.max(a,g),d=Math.max(n,m),h=Math.min(a+r,g+y),p=Math.min(n+l,m+S),new O4(Math.min(c,h),Math.min(d,p),Math.abs(h-c),Math.abs(p-d))}function dD(e,t){const i=e?"initial":"update";return{node:{fromFn(o,a){const n=o.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:p,clipX1:g,clipY1:m}=n??a;const{horizontalInset:y,verticalInset:S}=a,x=n!=null&&Kp(n),b=Kp(a);return x&&b||(!x&&b?({x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:p,clipX1:g,clipY1:m}=a,e&&(t?g=a.clipX0:m=a.clipY0)):x&&!b?({x0:r,y0:l,x1:c,y1:h}=a,d=void 0,p=void 0,g=void 0,m=void 0):e&&(t?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:p,clipX1:g,clipY1:m,horizontalInset:y,verticalInset:S,phase:i}},toFn(o,a){const{x0:n,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:p,clipY1:g,horizontalInset:m,verticalInset:y}=a;return{x0:n,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:p,clipY1:g,horizontalInset:m,verticalInset:y}},applyFn(o,a){o.setProperties(xr(o,a))}}}}function xr(e,t){const{x:i,y:s,width:o,height:a}=Hp(t),n=P4(t),r=E4(t,n);return{x:i,y:s,width:o,height:a,clipBBox:n,visible:r}}var R4={Before:"right",Center:"center",After:"left"},_4={Before:"top",Center:"middle",After:"bottom"},z4={Before:-1,Center:-.5,After:0},B4={Before:0,Center:-.5,After:-1};function V4(e,t,i,s,o,a){const{seriesRect:n,gaugeRect:r,barRect:l}=o,{padding:c,horizontal:h}=s;i.each((d,p)=>{const g=mr(e.id,t,p,a?.label);let m,y;p.placement==="outside-start"?h?(m=r.x,y=n.height):(m=n.width,y=n.height-(r.y+r.height)):p.placement==="outside-end"?h?(m=n.width-(r.x+r.width),y=n.height):(m=n.width,y=r.y):p.avoidCollisions&&(m=r.width,y=r.height);let S;if(g==null)return;if(m!=null&&y!=null){const C=()=>({width:m,height:y,meta:null});S=tr(C4(g),p,{padding:c},C)?.[0]}else{const C=N4(p),{width:R,height:V}=L4(g)?T4(g,p):C.measureLines(w4(g));S={text:g,fontSize:p.fontSize,lineHeight:p.lineHeight??C.lineHeight(),width:R,height:V}}if(S==null){d.visible=!1;return}const x=h?r.x:r.y+r.height,b=h?r.x+r.width:r.y,f=h?l.x:l.y+l.height,D=h?l.x+l.width:l.y,v=p.spacing*(h?1:-1);let M,A,I,k;switch(p.placement){case"outside-start":M=-1/0,A=1/0,I=x-v,k="Before";break;case"outside-end":M=-1/0,A=1/0,I=b+v,k="After";break;case"inside-start":M=x,A=D,I=x+v,k="After";break;case"inside-end":M=D,A=b,I=b-v,k="Before";break;case"inside-center":M=x,A=b,I=(x+b)/2,k="Center";break;case"bar-inside":M=f,A=D,I=(f+D)/2,k="Center";break;case"bar-inside-end":M=f,A=D,I=D-v,k="Before";break;case"bar-outside-end":M=D,A=b,I=D+v,k="After";break;case"bar-end":M=-1/0,A=1/0,I=D,k="Center";break}const N=h?I:r.x+r.width/2,L=h?r.y+r.height/2:I;let T,P;h?(T=N+z4[k]*S.width,P=T+S.width):(T=L+B4[k]*S.height,P=T+S.height);const O=Math.min(T,P)>=Math.min(M,A)&&Math.max(T,P)<=Math.max(M,A);if(p.avoidCollisions&&!O){d.visible=!1;return}d.visible=!0,d.text=S.text,d.fontSize=S.fontSize,d.lineHeight=S.lineHeight,d.textAlign=h?R4[k]:"center",d.textBaseline=h?"middle":_4[k],d.x=N,d.y=L})}var{fromToMotion:Gp,resetMotion:F4,SeriesNodePickMode:uD,createDatumId:pD,BBox:Ji,Group:sa,PointerEvents:gD,Selection:oa,Rect:H4,Text:mD,TransformableText:K4,Marker:G4,LinearScale:W4,generateTicks:j4,NiceMode:yD}=pn,$4={before:180,middle:0,after:0},U4={before:90,middle:0,after:-90},Wp=class extends pn.Series{constructor(e){super({moduleCtx:e,pickModes:[uD.EXACT_SHAPE_MATCH,uD.NEAREST_NODE]}),this.properties=new Mt,this.seriesRect=Ji.NaN,this.gaugeRect=Ji.NaN,this.scale=new W4,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new sa({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new sa({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new sa({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new sa({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new sa({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new sa({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new sa({name:"tickGroup"})),this.scaleSelection=oa.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=oa.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=oa.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=oa.select(this.itemTargetLabelGroup,mD),this.labelSelection=oa.select(this.itemLabelGroup,mD),this.highlightTargetSelection=oa.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=oa.select(this.tickGroup,K4),this.datumUnion=new qv,this.animationState=new d4("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=gD.None,this.tickGroup.pointerEvents=gD.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const e=new H4;return e.crisp=!0,e}markerFactory(){return new G4}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return eD(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:o}=this,{thickness:a}=e,n=p4(o.range),r=new Ji(t,i,s?n:a,s?a:n);return{axis:r,series:r}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:o=t.value??0,shape:a=t.shape??"triangle",rotation:n=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:d=t.label.color??"black",fontStyle:p=t.label.fontStyle??"normal",fontWeight:g=t.label.fontWeight??"normal",fontSize:m=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:S=t.label.spacing??0}=i.label;return{text:s,value:o,shape:a,placement:r,spacing:l,size:c,rotation:n,label:{enabled:h,color:d,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y,spacing:S},style:i.getStyle(t)}})}getTargetPoint(e){const{properties:t,originX:i,originY:s,horizontal:o,scale:a,gaugeRect:n}=this,{thickness:r}=t,{value:l,placement:c,spacing:h,size:d}=e,p=a.convert(l);let g;switch(c){case"before":g=-(h+d/2);break;case"after":g=r+h+d/2;break;default:g=r/2;break}return{x:i+n.x+(o?p:g),y:s+n.y+(o?g:p)}}getTargetLabel(e){const{size:t,placement:i,label:s}=e,{spacing:o,color:a,fontStyle:n,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,d=t/2+o;let p,g,m=0,y=0;return this.horizontal?(p="center",i==="after"?(g="top",y=d):(g="bottom",y=-d)):(g="middle",i==="before"?(p="right",m=-d):(p="left",m=d)),{offsetX:m,offsetY:y,fill:a,textAlign:p,textBaseline:g,fontStyle:n,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(e,t){const{placement:i,avoidCollisions:s,spacing:o,text:a,color:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:p,wrapping:g,overflowStrategy:m,formatter:y=S=>this.formatLabel(S.value)}=e;return{placement:i,avoidCollisions:s,spacing:o,text:a,value:t,fill:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:p,wrapping:g,overflowStrategy:m,formatter:y}}verticalLabelInset(){const{label:e}=this.properties,t=Xv(e),i=e.text?.split(`
|
|
`),s=(e.lineHeight??t.lineHeight())*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,o=s.text?.split(`
|
|
`),a=Xv(s),n=i.interval.values??e.ticks({nice:[!1,!1],interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(o??n?.map(c=>mr(this.id,this.ctx,this.labelDatum(s,c))??"")).reduce((c,h)=>{const{width:d}=g4(h)?m4(h,s):a.measureLines(f4(h));return Math.max(c,d)},0);return s.spacing+l}tickFormatter(e,t){const{format:i,formatter:s}=this.properties.scale.label;let o;return i!=null&&(o=y4(t,typeof i=="string"?i:void 0)),(a,n)=>{let r;return s&&(r??(r=ur(this.ctx,s,{value:a,index:n,domain:e,boundSeries:void 0}))),r??(r=o?.(a)),r??this.formatLabel(a)}}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:o}=this,{value:a,segmentation:n,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:p,defaultColorRange:g,defaultScale:m}=t;s.domain=[d.min,d.max],s.range=i?[0,o.width]:[o.height,0];let y,S;i?(S=1,y=Math.PI/-2):d.label.placement==="before"?(S=1,y=0):(S=-1,y=0);let x,b,f,D;i?(x=0,b=o.width,f=(o.height-r)/2,D=f+r,p.placement==="outside-start"?x+=this.horizontalLabelInset():p.placement==="outside-end"&&(b-=this.horizontalLabelInset())):(x=(o.width-r)/2,b=x+r,D=0,f=o.height,p.placement==="outside-start"?f-=this.verticalLabelInset():p.placement==="outside-end"&&(D+=this.verticalLabelInset())),this.gaugeRect=new Ji(Math.min(x,b),Math.min(f,D),Math.abs(b-x),Math.abs(D-f));const v=0,M=0;s.domain=[d.min,d.max],s.range=i?[x,b]:[f,D];const A=Zv({parallel:i},d.label,m.label),{tickData:{ticks:I}}=j4({scale:s,label:A,interval:d.interval,tickFormatter:(se,Q)=>this.tickFormatter(se,Q),domain:s.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:[yD.Off,yD.Off],labelOffset:0,axisRotation:y,sideFlag:S}),k=!1,N=this.getTargets(),L=[],T=[],P=[],O=[],[C,R]=s.range,V=Math.abs(R-C),E=i?s.convert(a):b,w=i?D:s.convert(a),z=n.enabled?n.spacing/2:0,B=i?z:0,K=i?0:z,_=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),j=-(r-_)/2,Z=i?0:j,U=i?j:0,ie=c==="item",ae=Math.ceil(V);let re=n.enabled?n.interval.getSegments(s,ae):void 0;const xe=h.getStyle(g,i,s),et=d.getStyle(h.enabled,g,i,s);if(re==null&&ie){const se=Math.min(...s.domain),Q=Math.max(...s.domain),ze={value:a,segmentStart:se,segmentEnd:Q};if(h.enabled){const ne=Math.min(l,_/2,V/2)*(k?-1:1),pt=i?ne:0,kt=i?0:ne;L.push({series:this,itemId:"value",datum:ze,datumIndex:{type:0},type:0,x0:v+x-pt-Z,y0:M+f-kt-U,x1:v+E+pt+Z,y1:M+w+kt+U,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:B,verticalInset:K,style:xe})}const ce=Math.min(l,r/2,V/2)*(k?-1:1),ue=i?ce:0,oe=i?0:ce;O.push({series:this,itemId:"scale",datum:ze,datumIndex:{type:0},type:0,x0:v+x-ue,y0:M+f-oe,x1:v+b+ue,y1:M+D+oe,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:B,verticalInset:K,style:et})}else{re??(re=s.domain);const se=v+x-Z,Q=M+f-U,ze=v+E+Z,tt=M+w+U;for(let ce=0;ce<re.length-1;ce+=1){const ue=re[ce+0],oe=re[ce+1],Ce={value:a,segmentStart:ue,segmentEnd:oe},ne=ce===0,pt=ce===re.length-2,kt=s.convert(ue),So=s.convert(oe),An=ie||ne?l:0,Ei=ie||pt?l:0,ws=i?An:Ei,fh=Ei,rm=i?Ei:An,lm=An;h.enabled&&L.push({series:this,itemId:`value-${ce}`,datum:Ce,datumIndex:{type:0},type:0,x0:v+(i?kt:x),y0:M+(i?f:kt),x1:v+(i?So:b),y1:M+(i?D:So),clipX0:se,clipY0:Q,clipX1:ze,clipY1:tt,topLeftCornerRadius:ws,topRightCornerRadius:fh,bottomRightCornerRadius:rm,bottomLeftCornerRadius:lm,horizontalInset:B,verticalInset:K,style:xe}),O.push({series:this,itemId:`scale-${ce}`,datum:Ce,datumIndex:{type:0},type:0,x0:v+(i?kt:x),y0:M+(i?f:kt),x1:v+(i?So:b),y1:M+(i?D:So),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:ws,topRightCornerRadius:fh,bottomRightCornerRadius:rm,bottomLeftCornerRadius:lm,horizontalInset:B,verticalInset:K,style:et})}}for(const se of[O,L])for(const Q of se){const ze=Q.clipX0??Q.x0,tt=Q.clipX1??Q.x1,ce=Q.clipY0??Q.y0,ue=Q.clipY1??Q.y1;Q.midPoint={x:(ze+tt)/2,y:(ce+ue)/2}}p.enabled&&P.push(this.labelDatum(p,a));const Gt=i?$4:U4;for(let se=0;se<N.length;se+=1){const Q=N[se],{value:ze,text:tt,shape:ce,size:ue,style:oe}=Q,Ce=this.getTargetPoint(Q),ne=Qv(Q.rotation+Gt[Q.placement]);T.push({series:this,itemId:`target-${se}`,midPoint:Ce,datum:{value:ze},datumIndex:{type:1,index:se},type:1,value:ze,text:tt,x:Ce.x,y:Ce.y,shape:ce,size:ue,rotation:ne,label:this.getTargetLabel(Q),style:oe})}return{itemId:e,nodeData:L,tickData:I,targetData:T,labelData:P,scaleData:O}}findNodeDatum(e){return nD(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,targetSelection:s,targetLabelSelection:o,scaleSelection:a,highlightTargetSelection:n,tickSelection:r}=this;this.seriesRect=e??Ji.NaN;const l=this.checkResize(e);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],p=this.contextNodeData?.scaleData??[],g=this.contextNodeData?.tickData??[],m=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:p,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:o}),this.updateTargetLabelNodes({targetLabelSelection:o}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:m==null?[]:[m],targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:g,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>pD(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i}=this,s=i.animationManager.isSkipped(),o=this.getShapeFillBBox();t.each((n,r)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=r;n.setStyleProperties(r.style,o),n.topLeftCornerRadius=l,n.topRightCornerRadius=c,n.bottomRightCornerRadius=h,n.bottomLeftCornerRadius=d,n.pointerEvents=this.properties.bar.enabled?pn.PointerEvents.All:pn.PointerEvents.None,(s||n.previousDatum==null)&&n.setProperties(xr(n,r))});const{horizontal:a}=this;this.datumUnion.update(t,this.itemGroup,pn.Rect,(n,r,l)=>{const c=Math.min(r.x,l.x),h=Math.max(r.x+r.width,l.x+l.width),d=Math.min(r.y,l.y),p=Math.max(r.y+r.height,l.y+l.height),g=h-c,m=p-d;n.pointerEvents=pn.PointerEvents.None,n.x=c,n.y=d,n.width=g,n.height=m,n.topLeftCornerRadius=a?r.topLeftCornerRadius:l.topLeftCornerRadius,n.topRightCornerRadius=l.topRightCornerRadius,n.bottomRightCornerRadius=a?l.bottomRightCornerRadius:r.bottomRightCornerRadius,n.bottomLeftCornerRadius=r.bottomLeftCornerRadius;const y=r.clipBBox,S=l.clipBBox??y;y&&S?n.clipBBox=Ji.merge([y,S]).intersection(a?new Ji(c,-1/0,g,1/0):new Ji(-1/0,d,1/0,m)):n.clipBBox=void 0})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>pD(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,i=this.getShapeFillBBox();t.each((s,o)=>{const{topLeftCornerRadius:a,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=o;s.setStyleProperties(o.style,i),s.setProperties(xr(s,o)),s.topLeftCornerRadius=a,s.topRightCornerRadius=n,s.bottomRightCornerRadius=r,s.bottomLeftCornerRadius=l,s.setProperties(xr(s,o))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((s,o)=>{const{x:a,y:n,shape:r,size:l,rotation:c}=o,h=this.getTargetStyle(i,o);s.setStyleProperties(h),s.size=l,s.shape=r==="line"?tD:r,s.translationX=a,s.translationY=n,s.rotation=c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return Zv(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{x:o,y:a,text:n}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:p,fontFamily:g,textAlign:m,textBaseline:y}=s.label;i.visible=!0,i.x=o+r,i.y=a+l,i.text=n,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=p,i.fontFamily=g,i.textAlign=m,i.textBaseline=y})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:o,color:a,fontFamily:n=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const p=Qv(i.scale.label.rotation??0);let g,m,y,S;this.horizontal?(d??(d="after"),g="center",m=d==="before"?"bottom":"top",S=this.originY+t.y+(d==="before"?-h:t.height+h)):(d??(d="before"),g=d==="before"?"end":"start",m="middle",y=this.originX+t.x+(d==="before"?-h:t.width+h)),e.tickSelection.each((x,b)=>{if(!o){x.visible=!1;return}const f=y??b.translation,D=S??b.translation;x.visible=!0,x.text=b.tickLabel,x.fill=a,x.fontFamily=n,x.fontSize=r,x.fontStyle=l,x.fontWeight=c,x.textBaseline=m,x.textAlign=g,x.x=f,x.y=D,x.rotationCenterX=f,x.rotationCenterY=D,x.rotation=p})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,o)=>{s.fill=o.fill,s.fontStyle=o.fontStyle,s.fontWeight=o.fontWeight,s.fontFamily=o.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:o,gaugeRect:a}=this,{x:n,y:r,width:l,height:c}=a,h=e?.label??this.properties.value;let d;if(i){const m=s.convert(h);d=new Ji(n,r,m-n,c)}else{const m=s.convert(h);d=new Ji(n,m,l,c-m)}const p={seriesRect:o,gaugeRect:a,barRect:d},{margin:g}=this.properties;V4(this,this.ctx,t,{padding:g,horizontal:i},p,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),F4([this.datumSelection],xr),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each((o,a)=>{o.opacity=1,i=o.previousDatum?.value??e.from??a.value,s=a.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const o=`${this.id}_labels`;t.animate({id:o,groupId:"label",from:{label:i},to:{label:s},phase:e.phase??"update",ease:u4,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:s})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=dD(!0,this.horizontal);Gp(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),Gp(this.id,"label",e,[this.labelSelection],Jv,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=dD(!1,this.horizontal);Gp(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return{domain:[0,1]}}dataCount(){return Number.NaN}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;if(e==null)return;let o,a,n;if(e.type===0?(o=i.value,a=i.label.text,n=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:o,text:a}=i.targets[e.index],n=this.ctx.localeManager.t("ariaLabelGaugeTarget")),o!=null)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:n,value:this.formatLabel(o)}]},{seriesId:t,title:void 0,datum:void 0,value:o})}pickNodeClosestDatum(e){return oD(this,e)}pickFocus(e){return aD(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};Wp.className="LinearGaugeSeries",Wp.type="linear-gauge";var Y4={minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},QH]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",qH,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...ZH,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:XH.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}},fD={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,dependencies:[Yv],version:YH,options:JH,themeTemplate:Y4,create:e=>new Wp(e)};import{VERSION as X4}from"ag-charts-community";import{LABEL_BOXING_DEFAULTS as Z4,MULTI_SERIES_HIGHLIGHT_STYLE as Q4,SAFE_RANGE2_OPERATION as q4,SAFE_STROKE_FILL_OPERATION as J4}from"ag-charts-core";import{VERSION as eK,_ModuleSupport as tK}from"ag-charts-community";import{_ModuleSupport as jp}from"ag-charts-community";import{ChartAxisDirection as xD,Property as iK,createId as SD}from"ag-charts-core";var{Chart:sK,MercatorScale:bD}=jp;function oK(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var jc=class extends sK{constructor(e,t){super(e,t),this.xAxis={id:SD(jp.Axis),direction:xD.X},this.yAxis={id:SD(jp.Axis),direction:xD.Y},this.ctx.zoomManager.setAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}updateData(){super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const i of this.series)oK(i)&&i.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,s=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=s,this.animationRect=s;const o=this.series,a=o.reduce((l,c)=>{if(!c.visible)return l;const h=c.topologyBounds;return h==null?l:l==null?h:l.merge(h)},void 0);let n;if(a!=null){const{lon0:l,lat0:c,lon1:h,lat1:d}=a,p=[[l,c],[h,d]],g=bD.bounds(p),{width:m,height:y}=s,S=Math.min(m/g.width,y/g.height),x=g.width*S,b=g.height*S,f=(m-x)/2,D=(y-b)/2,v=f,M=D,A=f+x,I=D+b,k=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),N=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),L=(A-v)/(k.max-k.min),T=v-L*k.min,P=(I-M)/(1-N.min-(1-N.max)),O=M-P*(1-N.max);n=new bD(p,[[T,O],[T+L,O+P]])}for(const l of o)l.scale=n;const r=this.series.some(l=>l.visible);t.visible=r;for(const l of[t,i])l.translationX=Math.floor(s.x),l.translationY=Math.floor(s.y),l.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:r,rect:s,paddedRect:e.layoutBox}})}};jc.className="TopologyChart",jc.type="topology",u([iK],jc.prototype,"topology",2);var{topologyChartOptionsDefs:aK}=tK,Sr={type:"chart",name:"topology",enterprise:!0,version:eK,options:aK,create(e,t){return new jc(e,t)}};import{deepClone as nK,jsonWalk as rK}from"ag-charts-core";var br={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1}};function es(e){const t=nK(e);return rK(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}import{_ModuleSupport as vD}from"ag-charts-community";import{Logger as DD,cachedTextMeasurer as lK,mergeDefaults as MD}from"ag-charts-core";import{_ModuleSupport as cK}from"ag-charts-community";import{SceneChangeDetection as hK,SceneObjectChangeDetection as dK,objectsEqual as uK}from"ag-charts-core";var pK=1e-9;function kD(e,t,i,s){const[o,a]=e,[n,r]=t,l=n-o,c=r-a,h=l*l+c*c;let d,p;if(Math.abs(h)<pK)d=o,p=a;else{let y=((i-o)*l+(s-a)*c)/h;y=Math.max(0,Math.min(1,y)),d=o+y*(n-o),p=a+y*(r-a)}const g=i-d,m=s-p;return g*g+m*m}function AD(e,t,i){let s=1/0,o=e.at(-1);for(const a of e)s=Math.min(s,kD(o,a,t,i)),o=a;return Math.sqrt(s)}function $p(e){let[t,i]=e[0],s=0;for(let o=1;o<e.length;o+=1){const[a,n]=e[o],r=Math.hypot(a-t,n-i);s+=r,t=a,i=n}return s}function $c(e){if(e.length===0)return;const t=$p(e)/2;let[i,s]=e[0],o=0;for(let a=1;a<e.length;a+=1){const[n,r]=e[a],l=Math.hypot(n-i,r-s),c=o+l;if(c>t){const h=(t-o)/l,d=[i+(n-i)*h,s+(r-s)*h],p=Math.atan2(r-s,n-i);return{point:d,angle:p}}o=c,i=n,s=r}}var vr=class LA{constructor(t,i,s,o){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=o}extend(t,i,s,o){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,s),this.lat1=Math.max(this.lat1,o),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,s,o,a){return t?t.extend(i,s,o,a):new LA(i,s,o,a)}};function mn(e,t){for(const i of e){const[s,o]=i;t=vr.extend(t,s,o,s,o)}return t}function gK(e){if(e.length===0)return;let t=0,i=0,s=0,[o,a]=e.at(-1);for(const[n,r]of e){const l=o*r-n*a;s+=l,t+=(o+n)*l,i+=(a+r)*l,o=n,a=r}return s*=3,[t/s,i/s]}function Uc(e,t,i){let s=!1,o=1/0;for(const a of e){let n=a.at(-1),[r,l]=n;for(const c of a){const[h,d]=c;d>i!=l>i&&t<(r-h)*(i-d)/(l-d)+h&&(s=!s),o=Math.min(o,kD(n,c,t,i)),n=c,r=h,l=d}}return(s?-1:1)*Math.sqrt(o)}var{Path:mK,ExtendedPath2D:yK,BBox:fK}=cK,yn=class extends mK{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new yK}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=e==null?void 0:this.drawGeometry(e,void 0)}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(e,t)?!1:this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,e,t);return s>0?s*s:0}geometryDistance(e,t,i){const{renderMode:s,strokeWidth:o}=this,a=(s&1)!==0,n=(s&2)!==0,r=Math.max(o/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,t,i)),1/0);case"MultiPolygon":return a?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(Uc(c,t,i),0)),1/0):1/0;case"Polygon":return a?Math.max(Uc(e.coordinates,t,i),0):1/0;case"MultiLineString":return n?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(AD(c,t,i)-r,0)),1/0):1/0;case"LineString":return n?Math.max(AD(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}shouldDrawPolygons(){return(this.renderMode&1)!==0}shouldDrawLines(){return(this.renderMode&2)!==0}drawGeometryCollection(e,t){for(const i of e)t=this.drawGeometry(i,t);return t}drawMultiPolygon(e,t){if(!this.shouldDrawPolygons())return t;for(const i of e)t=this.drawPolygon(this.path,i,t);return t}drawSinglePolygon(e,t){return this.shouldDrawPolygons()?this.drawPolygon(this.path,e,t):t}drawMultiLineString(e,t){if(!this.shouldDrawLines())return t;for(const i of e)t=this.drawLineString(this.strokePath,i,t,!1);return t}drawSingleLineString(e,t){return this.shouldDrawLines()?this.drawLineString(this.strokePath,e,t,!1):t}drawGeometry(e,t){switch(e.type){case"GeometryCollection":return this.drawGeometryCollection(e.geometries,t);case"MultiPolygon":return this.drawMultiPolygon(e.coordinates,t);case"Polygon":return this.drawSinglePolygon(e.coordinates,t);case"MultiLineString":return this.drawMultiLineString(e.coordinates,t);case"LineString":return this.drawSingleLineString(e.coordinates,t);case"Point":case"MultiPoint":return t}}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let s=1;s<t.length;s+=1){const o=t[s];this.drawLineString(e,o,void 0,!0)}return i}drawLineString(e,t,i,s){if(t.length<2)return i;const o=s?t.length-1:t.length;for(let a=0;a<o;a+=1){const[n,r]=t[a];if(a===0?e.moveTo(n,r):e.lineTo(n,r),i==null)i=new fK(n,r,0,0);else{const{x:l,y:c}=i,h=l+i.width,d=c+i.height;i.x=Math.min(l,n),i.y=Math.min(c,r),i.width=Math.max(h,n)-i.x,i.height=Math.max(d,r)-i.y}}return s&&e.closePath(),i}};u([dK({equals:uK})],yn.prototype,"projectedGeometry",2),u([hK()],yn.prototype,"renderMode",2);import"ag-charts-community";import"ag-charts-core";function ID(e){const t=mn(e[0],void 0);return t==null?0:Math.abs(t.lat1-t.lat0)*Math.abs(t.lon1-t.lon0)}function Yc(e,t){let i,s;for(const o of e){const a=t(o);a!=null&&(i==null||a>i)&&(i=a,s=o)}return s}function fn(e,t){if(e.bbox!=null){const[i,s,o,a]=e.bbox;return t=vr.extend(t,i,s,o,a),t}switch(e.type){case"GeometryCollection":for(const i of e.geometries)t=fn(i,t);break;case"MultiPolygon":for(const i of e.coordinates)i.length>0&&(t=mn(i[0],t));break;case"Polygon":e.coordinates.length>0&&(t=mn(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=mn(i,t);break;case"LineString":t=mn(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[s,o]=i;t=vr.extend(t,s,o,s,o)}break;case"Point":{const[i,s]=e.coordinates;t=vr.extend(t,i,s,i,s);break}}return t}function Xc(e){switch(e.type){case"Polygon":return e.coordinates;case"MultiPolygon":return Yc(e.coordinates,ID);case"GeometryCollection":{const t=e.geometries.map(Xc).filter(i=>i!=null);return Yc(t,ID)}case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Zc(e){switch(e.type){case"LineString":return e.coordinates;case"MultiLineString":return Yc(e.coordinates,$p);case"GeometryCollection":{const t=e.geometries.map(Zc).filter(i=>i!=null);return Yc(t,$p)}case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function Up(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>Up(i,t));case"MultiPolygon":case"Polygon":return(t&1)!==0;case"MultiLineString":case"LineString":return(t&2)!==0;case"MultiPoint":case"Point":return(t&4)!==0}}function aa(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>aa(i,t))};case"Polygon":return{type:"Polygon",coordinates:Yp(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:xK(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:Yp(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:Xp(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:Xp(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function xK(e,t){return e.map(i=>Yp(i,t))}function Yp(e,t){return e.map(i=>Xp(i,t))}function Xp(e,t){return e.map(i=>t.convert(i))}function SK(){return{fromFn:(i,s,o)=>o==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,o)=>o==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function ND(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(i!==void 0){for(const s of e.datumSelection.nodes())if(s.datum===i)return s}}import{_ModuleSupport as LD}from"ag-charts-community";var jq=class extends LD.SeriesProperties{},Dr=class extends LD.DataModelSeries{constructor(e){super(e),this.cleanup.register(this.ctx.eventsHub.on("data:update",()=>{}),this.ctx.eventsHub.on("legend:item-click",t=>{this.onLegendItemClick(t)}),this.ctx.eventsHub.on("legend:item-double-click",t=>{this.onLegendItemDoubleClick(t)}))}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:t}=this.properties,i=t!=null&&e?.datum==null&&t===e?.legendItemName;return e!=null&&(e.series!==this&&!i||e.datum==null)&&(e=void 0),e}};import{_ModuleSupport as bK}from"ag-charts-community";import{Property as ve}from"ag-charts-core";var{SeriesProperties:vK,makeSeriesTooltip:DK,Label:MK}=bK,ye=class extends vK{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new MK,this.tooltip=DK()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o,opacity:1}}};u([ve],ye.prototype,"topology",2),u([ve],ye.prototype,"title",2),u([ve],ye.prototype,"legendItemName",2),u([ve],ye.prototype,"idKey",2),u([ve],ye.prototype,"topologyIdKey",2),u([ve],ye.prototype,"idName",2),u([ve],ye.prototype,"labelKey",2),u([ve],ye.prototype,"labelName",2),u([ve],ye.prototype,"sizeKey",2),u([ve],ye.prototype,"sizeName",2),u([ve],ye.prototype,"colorKey",2),u([ve],ye.prototype,"colorName",2),u([ve],ye.prototype,"sizeDomain",2),u([ve],ye.prototype,"colorRange",2),u([ve],ye.prototype,"maxStrokeWidth",2),u([ve],ye.prototype,"stroke",2),u([ve],ye.prototype,"strokeOpacity",2),u([ve],ye.prototype,"strokeWidth",2),u([ve],ye.prototype,"lineDash",2),u([ve],ye.prototype,"lineDashOffset",2),u([ve],ye.prototype,"itemStyler",2),u([ve],ye.prototype,"label",2),u([ve],ye.prototype,"tooltip",2);var{getMissCount:kK,getLabelStyles:AK,createDatumId:TD,SeriesNodePickMode:CD,valueProperty:Mr,ColorScale:IK,LinearScale:NK,Selection:Qc,Text:wD,Transformable:LK}=vD,Zp=class extends Dr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[CD.EXACT_SHAPE_MATCH,CD.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new ye,this._chartTopology=void 0,this.colorScale=new IK,this.sizeScale=new NK,this.datumSelection=Qc.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=Qc.select(this.labelGroup,wD),this.highlightDatumSelection=Qc.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=Qc.select(this.highlightLabelGroup,wD),this.placedLabelData=[],this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new yn;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:o}=this,{topologyIdKey:a,idKey:n,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,p=new Map;for(const f of i?.features.values()??[]){const D=f.properties?.[a];D==null||!Up(f.geometry,2)||p.set(D,f)}const g=this.sizeScale.type,m=this.colorScale.type,y=this.scale?.type,{dataModel:S,processedData:x}=await this.requestDataModel(e,t,{props:[Mr(n,y,{id:"idValue",includeProperty:!1}),Mr(n,y,{id:"featureValue",includeProperty:!1,processor:()=>f=>p.get(f)}),...c==null?[]:[Mr(c,"category",{id:"labelValue"})],...r==null?[]:[Mr(r,g,{id:"sizeValue"})],...l==null?[]:[Mr(l,m,{id:"colorValue"})]]}),b=S.resolveColumnById(this,"featureValue",x);if(this.topologyBounds=b.reduce((f,D)=>{const v=D?.geometry;return v==null?f:fn(v,f)},void 0),r!=null){const f=S.resolveProcessedDataIndexById(this,"sizeValue"),D=x.domain.values[f]??[];s.domain=h??D}if(d!=null&&this.isColorScaleValid()){const f=S.resolveProcessedDataIndexById(this,"colorValue");o.domain=x.domain.values[f],o.range=d,o.update()}i==null&&DD.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=kK(this,i.defs.values[s].missing);return!(o===0||o===a)}getLabelDatum(e,t,i,s,o,a){if(s==null||o==null||i==null)return;const n=Zc(o);if(n==null)return;const{idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:p,labelKey:g,labelName:m,label:y}=this.properties;if(g==null||!y.enabled)return;const S=this.getLabelText(s,e,g,"label",[],y,{value:s,datum:e,idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:p,labelKey:g,labelName:m});if(S==null)return;const x=a.measureLines(String(S)),b=$c(n);if(b==null)return;const[f,D]=b.point,{width:v,height:M}=x;return{point:{x:f,y:D,size:0},label:{width:v,height:M,text:S},anchor:void 0,placement:void 0,datumIndex:t,idValue:i}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveLineDataColumns(e){const{sizeKey:t,colorKey:i,labelKey:s}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e),labelValues:this.resolveColumn(s,"labelValue",e),sizeValues:this.resolveColumn(t,"sizeValue",e),colorValues:this.resolveColumn(i,"colorValue",e)}}prepareProjectedLineGeometries(e,t,i){const s=new Map;for(const[o]of i.dataSources.get(this.id)?.data.entries()??[]){const a=e[o],n=t[o]?.geometry,r=n!=null&&this.scale!=null?aa(n,this.scale):void 0;a!=null&&r!=null&&s.set(a,r)}return s}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}DD.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:o}=this,{label:a,legendItemName:n,colorKey:r}=o;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const l=this.resolveLineDataColumns(i),c=o.maxStrokeWidth??o.strokeWidth;s.range=[Math.min(o.strokeWidth,c),c];const h=lK(a),d=this.prepareProjectedLineGeometries(l.idValues,l.featureValues,i),p=[],g=[],m=[],y=i.dataSources.get(this.id)?.data??[];for(const[S,x]of y.entries()){const b={idValue:l.idValues[S],colorValue:l.colorValues?.[S],sizeValue:l.sizeValues?.[S],labelValue:l.labelValues?.[S]},f=d.get(b.idValue);if(f==null&&m.push(b.idValue),r!=null&&b.colorValue==null)continue;const D=this.getLabelDatum(x,S,b.idValue,b.labelValue,f,h);D!=null&&g.push(D),p.push({series:this,datum:x,datumIndex:S,...b,projectedGeometry:f,legendItemName:n,style:this.getItemStyle({datumIndex:S,datum:x,colorValue:b.colorValue,sizeValue:b.sizeValue},!1)})}return this.warnMissingGeometries(m),{itemId:e,nodeData:p,labelData:g}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const i=this.ctx.chartService.highlight?.drawingMode??"overlay",s=this.getHighlightedDatum(),o=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1,drawingMode:"overlay"}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s==null?[]:[s],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0,drawingMode:i}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(s)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>TD(t.idValue))}getItemStyle({datumIndex:e=0,datum:t,colorValue:i,sizeValue:s},o){const{properties:a,colorScale:n,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,h=a.getStyle();i!=null&&(h.stroke=this.isColorScaleValid()?n.convert(i):l?.[0]??a.stroke);const d=this.getHighlightStyle(o,e),p=MD(d,h);s!=null&&(p.strokeWidth=r.convert(s,{clamp:!0}));let g;return c!=null&&(g=this.cachedDatumCallback(TD(e,o?"highlight":"node"),()=>{const m=this.makeItemStylerParams(t,e,o,p);return this.callWithContext(c,m)})),g?MD(p,g):p}makeItemStylerParams(e,t,i,s){const{id:o}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t);return{seriesId:o,datum:e,highlightState:n,...s}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){e.each((i,s)=>{const{projectedGeometry:o,style:a}=s;if(o==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=o,i.setProperties(a),i.drawingMode=t})}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=vD.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.getHighlightedDatum();t.each((o,a)=>{const{x:n,y:r,width:l,height:c,text:h,datum:d}=a,p=AK(this,void 0,i,i.label,e,s),{color:g,fontStyle:m,fontWeight:y,fontSize:S,fontFamily:x}=p;o.visible=!0,o.x=n+l/2,o.y=r+c/2,o.text=h,o.fill=g,o.fontStyle=m,o.fontWeight=y,o.fontSize=S,o.fontFamily=x,o.textAlign="center",o.textBaseline="middle";const b=d?.datumIndex;o.fillOpacity=this.getHighlightStyle(e,b).opacity??1,o.setBoxing(p)})}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=e?.idValue,i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(s=>s.datum.idValue===t);this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0&&this.highlightLabelSelection.cleanup(),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((o,a)=>{const n=o.distanceSquared(e,t);n<i&&(i=n,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=i==null?void 0:Zc(i),o=s==null?void 0:$c(s)?.point,a=o==null?void 0:{x:o[0],y:o[1]};return this._previousDatumMidPoint={datum:e,point:a},a}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{strokeWidth:o,strokeOpacity:a,lineDash:n}=s;let{stroke:r}=s;if(e!=null&&this.isColorScaleValid()){const c=t.resolveColumnById(this,"colorValue",i)[e];c!=null&&(r=this.colorScale.convert(c))}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{enabled:!0,stroke:r,strokeWidth:o,strokeOpacity:a,lineDash:n}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:o}=this,{title:a,legendItemName:n,idKey:r,idName:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const p=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:o,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:p}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:o,label:{text:n??a??l??r},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o,ctx:{formatManager:a}}=this,{idKey:n,idName:r,colorKey:l,colorName:c,sizeKey:h,sizeName:d,labelKey:p,labelName:g,title:m,legendItemName:y,tooltip:S}=o;if(!i||!s)return;const x=s.dataSources.get(this.id)?.data[e],b=i.resolveColumnById(this,"idValue",s),f=h==null?void 0:i.resolveColumnById(this,"sizeValue",s)[e],D=l==null?void 0:i.resolveColumnById(this,"colorValue",s)[e];if(l!=null&&D==null)return;const v=[];if(this.isLabelEnabled()&&p!=null&&p!==n){const A=i.resolveColumnById(this,"labelValue",s)[e],I=a.format(this.callWithContext.bind(this),{type:"category",value:A,datum:x,seriesId:t,legendItemName:y,key:p,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});v.push({label:g,fallbackLabel:p,value:I??A})}if(f!=null&&h!=null){const A=i.getDomain(this,"sizeValue","value",s).domain,I=a.format(this.callWithContext.bind(this),{type:"number",value:f,datum:x,seriesId:t,legendItemName:y,key:h,source:"tooltip",property:"size",domain:A,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});v.push({label:d,fallbackLabel:h,value:I??String(f)})}if(D!=null&&l!=null){const A=i.getDomain(this,"colorValue","value",s).domain,I=a.format(this.callWithContext.bind(this),{type:"number",value:D,datum:x,seriesId:t,legendItemName:y,key:l,source:"tooltip",property:"color",domain:A,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});v.push({label:c,fallbackLabel:l,value:I??String(D)})}const M=this.getItemStyle({datumIndex:e,datum:x,colorValue:D,sizeValue:f},!1);return this.formatTooltipWithContext(S,{heading:b[e],title:m??y,symbol:this.legendItemSymbol(e),data:v},{seriesId:t,datum:x,title:m,idKey:n,idName:r,colorKey:l,colorName:c,sizeKey:h,sizeName:d,labelKey:p,labelName:g,...M})}computeFocusBounds(e){const t=ND(this,e);return t?LK.toCanvas(this.contentGroup,t.getBBox()):void 0}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Zp.className="MapLineSeries",Zp.type="map-line";import{_ModuleSupport as TK}from"ag-charts-community";import{and as CK,arrayLength as wK,arrayOf as OK,color as EK,commonSeriesOptionsDefs as PK,constant as RK,geoJson as _K,required as OD,string as Ti,undocumented as zK,without as BK}from"ag-charts-core";var{mapLineSeriesThemeableOptionsDef:VK}=TK,ED={...BK(PK,["highlightStyle","highlight"]),...VK,type:OD(RK("map-line")),idKey:OD(Ti),sizeKey:Ti,colorKey:Ti,labelKey:Ti,idName:Ti,sizeName:Ti,colorName:Ti,labelName:Ti,topology:_K,topologyIdKey:Ti,legendItemName:Ti,title:Ti};ED.colorRange=zK(CK(OK(EK),wK(1)));var PD={type:"series",name:"map-line",chartType:"topology",enterprise:!0,version:X4,dependencies:[Sr],options:ED,themeTemplate:{...br,series:{stroke:es(J4),colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},es(q4)]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...Z4,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:es(Q4)},tooltip:{range:"exact"}},create:e=>new Zp(e)};import{VERSION as FK}from"ag-charts-community";import{_ModuleSupport as HK}from"ag-charts-community";import{Logger as KK}from"ag-charts-core";import{_ModuleSupport as GK}from"ag-charts-community";import{Property as na}from"ag-charts-core";var{SeriesProperties:WK,makeSeriesTooltip:jK}=GK,co=class extends WK{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=jK()}};u([na],co.prototype,"topology",2),u([na],co.prototype,"stroke",2),u([na],co.prototype,"strokeOpacity",2),u([na],co.prototype,"strokeWidth",2),u([na],co.prototype,"lineDash",2),u([na],co.prototype,"lineDashOffset",2),u([na],co.prototype,"tooltip",2);var{createDatumId:$K,Group:UK,Selection:YK,PointerEvents:RD}=HK,Qp=class extends Dr{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new co,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new UK({name:"itemGroup"})),this.datumSelection=YK.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=RD.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new yn;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=RD.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:fn(s,t)},void 0),e==null&&KK.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{stroke:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,strokeWidth:l}=s,c=[],h=[];for(const[d,p]of t.features.entries()){const{geometry:g}=p,m=g!=null&&i!=null?aa(g,i):void 0;m!=null&&c.push({series:this,datum:p,datumIndex:0,index:d,projectedGeometry:m,style:{stroke:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,strokeWidth:l}})}return{itemId:e,nodeData:c,labelData:h}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>$K(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:o}=s;if(o==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=o,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};Qp.className="MapLineBackgroundSeries",Qp.type="map-line-background";import{_ModuleSupport as XK}from"ag-charts-community";import{constant as ZK,geoJson as QK,required as qK}from"ag-charts-core";var{mapLineBackgroundSeriesThemeableOptionsDef:JK}=XK,eG={...JK,type:qK(ZK("map-line-background")),topology:QK},_D={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,version:FK,dependencies:[Sr],options:eG,themeTemplate:{...br,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}},create:e=>new Qp(e)};import{VERSION as tG}from"ag-charts-community";import{FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as iG,FILL_IMAGE_DEFAULTS as sG,FILL_PATTERN_DEFAULTS as oG,LABEL_BOXING_DEFAULTS as aG,MULTI_SERIES_HIGHLIGHT_STYLE as nG,SAFE_RANGE2_OPERATION as rG,ValidationError as lG,validate as cG}from"ag-charts-core";import{_ModuleSupport as zD}from"ag-charts-community";import{Logger as hG,StateMachine as dG,cachedTextMeasurer as uG,mergeDefaults as BD}from"ag-charts-core";import{insertListItemsSorted as pG}from"ag-charts-core";function VD(e,t,i){const s=mn(e[0],void 0);if(s==null)return;const o=(s.lon0+s.lon1)/2,a=(s.lat0+s.lat1)/2,n=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=gK(e[0]),[c,h]=l,d=-Uc(e,c,h);let p;const g=(v,M)=>{const I=Math.max(M-d,0);return v-.5*I},m=(v,M,A)=>{const{distance:I,maxDistance:k}=i(e,v,M,A),N=Math.hypot(c-v,h-M),L=Math.min(Math.max(c,v-A/2),v+A/2),T=Math.min(Math.max(h,M-A/2),M+A/2),P=Math.hypot(c-L,h-T),O=g(I,N),C=g(k,P);return{distance:I,maxDistance:k,value:O,maxValue:C,x:v,y:M,stride:A}},y=(v,M,A,I)=>{const k=m(M,A,I);k.maxDistance>=0&&v.push(k)},S=Math.min(n,r)/2;let x={value:m(o,a,S),next:null};for(;x!=null;){const v=x.value,{distance:M,value:A,maxValue:I,x:k,y:N,stride:L}=v;if(x=x.next,M>0&&(p==null||A>p.value)&&(p=v),p!=null&&I-p.value<=t)continue;const T=L/2,P=[];y(P,k-T,N-T,T),y(P,k+T,N-T,T),y(P,k-T,N+T,T),y(P,k+T,N+T,T),P.sort(FD),x=pG(x,P,FD)}if(p==null)return;const{distance:b,x:f,y:D}=p;return{x:f,y:D,distance:b}}var FD=(e,t)=>t.maxValue-e.maxValue;function qp(e,t){const i=VD(e,t,(a,n,r,l)=>{const c=-Uc(a,n,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:o}=i;return[s,o]}function HD(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(s=>HD(s,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const s=Xc(e);i=s==null?void 0:qp(s,t);break}case"Polygon":{const s=e.coordinates;i=s==null?void 0:qp(s,t);break}case"MultiLineString":{const s=Zc(e);i=s==null?void 0:$c(s)?.point;break}case"LineString":{const s=e.coordinates;i=$c(s)?.point;break}}return i==null?[]:[i]}import{_ModuleSupport as gG}from"ag-charts-community";var{BBox:mG}=gG;function KD(e){if(!e)return;const{range:t}=e,i=t[0][0],s=t[0][1],o=t[1][0]-i,a=t[1][1]-s,n=new mG(i,s,o,a);return{series:n,axis:n}}import{_ModuleSupport as yG}from"ag-charts-community";import{Property as ee}from"ag-charts-core";var{SeriesProperties:fG,makeSeriesTooltip:xG,Label:SG}=yG,GD=class extends SG{constructor(){super(...arguments),this.placement="bottom"}};u([ee],GD.prototype,"placement",2);var te=class extends fG{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new GD,this.tooltip=xG()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:o,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,opacity:1,stroke:o,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}}};u([ee],te.prototype,"topology",2),u([ee],te.prototype,"title",2),u([ee],te.prototype,"legendItemName",2),u([ee],te.prototype,"idKey",2),u([ee],te.prototype,"topologyIdKey",2),u([ee],te.prototype,"idName",2),u([ee],te.prototype,"latitudeKey",2),u([ee],te.prototype,"latitudeName",2),u([ee],te.prototype,"longitudeKey",2),u([ee],te.prototype,"longitudeName",2),u([ee],te.prototype,"labelKey",2),u([ee],te.prototype,"labelName",2),u([ee],te.prototype,"sizeKey",2),u([ee],te.prototype,"sizeName",2),u([ee],te.prototype,"colorKey",2),u([ee],te.prototype,"colorName",2),u([ee],te.prototype,"colorRange",2),u([ee],te.prototype,"shape",2),u([ee],te.prototype,"size",2),u([ee],te.prototype,"maxSize",2),u([ee],te.prototype,"sizeDomain",2),u([ee],te.prototype,"fill",2),u([ee],te.prototype,"fillOpacity",2),u([ee],te.prototype,"stroke",2),u([ee],te.prototype,"strokeWidth",2),u([ee],te.prototype,"strokeOpacity",2),u([ee],te.prototype,"lineDash",2),u([ee],te.prototype,"lineDashOffset",2),u([ee],te.prototype,"itemStyler",2),u([ee],te.prototype,"label",2),u([ee],te.prototype,"tooltip",2);var{fromToMotion:bG,getMissCount:vG,createDatumId:qc,SeriesNodePickMode:WD,valueProperty:ra,computeMarkerFocusBounds:DG,ColorScale:MG,LinearScale:kG,Group:AG,Selection:Jc,Text:jD,Marker:Jp,getLabelStyles:IG}=zD,eg=class extends Dr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[WD.EXACT_SHAPE_MATCH,WD.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new te,this._chartTopology=void 0,this.colorScale=new MG,this.sizeScale=new kG,this.markerGroup=this.contentGroup.appendChild(new AG({name:"markerGroup"})),this.labelSelection=Jc.select(this.labelGroup,jD,!1),this.highlightLabelSelection=Jc.select(this.highlightLabelGroup,jD,!1),this.markerSelection=Jc.select(this.markerGroup,Jp,!1),this.highlightMarkerSelection=Jc.select(this.highlightNodeGroup,Jp),this.placedLabelData=[],this.animationState=new dG("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[2,e],this.highlightGroup.zIndex=[3,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,sizeScale:i,colorScale:s}=this,{topologyIdKey:o,idKey:a,latitudeKey:n,longitudeKey:r,sizeKey:l,colorKey:c,labelKey:h,sizeDomain:d,colorRange:p}=this.properties,g=this.buildFeatureMap(o),m=this.sizeScale.type,y=this.colorScale.type,S=this.scale?.type,x=n!=null&&r!=null,{dataModel:b,processedData:f}=await this.requestDataModel(e,t,{props:[...a==null?[]:[ra(a,S,{id:"idValue",includeProperty:!1}),ra(a,S,{id:"featureValue",includeProperty:!1,processor:()=>A=>g.get(A)})],...x?[ra(n,S,{id:"latValue"}),ra(r,S,{id:"lonValue"})]:[],...h?[ra(h,"category",{id:"labelValue"})]:[],...l?[ra(l,m,{id:"sizeValue"})]:[],...c?[ra(c,y,{id:"colorValue"})]:[]]}),D=a==null?void 0:b.resolveColumnById(this,"featureValue",f),v=x?b.resolveColumnById(this,"latValue",f):void 0,M=x?b.resolveColumnById(this,"lonValue",f):void 0;if(this.topologyBounds=f.dataSources.get(this.id)?.data.reduce((A,I,k)=>{const L=D?.[k]?.geometry;if(L!=null&&(A=fn(L,A)),v!=null&&M!=null){const T=M[k],P=v[k];A=vr.extend(A,T,P,T,P)}return A},void 0),l!=null){const A=b.resolveProcessedDataIndexById(this,"sizeValue"),I=f.domain.values[A]??[];i.domain=d??I}if(p!=null&&this.isColorScaleValid()){const A=b.resolveProcessedDataIndexById(this,"colorValue");s.domain=f.domain.values[A],s.range=p,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=vG(this,i.defs.values[s].missing);return!(o===0||o===a)}getLabelDatum(e,t,i){if(t==null)return;const{idKey:s,idName:o,latitudeKey:a,latitudeName:n,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:p,labelKey:g,labelName:m,label:y,shape:S}=this.properties;if(g==null||!y.enabled)return;const{datum:x,datumIndex:b,index:f,idValue:D,lonValue:v,latValue:M,point:A}=e,{placement:I}=y,k=this.getLabelText(t,x,g,"label",[],y,{value:t,datum:x,idKey:s,idName:o,latitudeKey:a,latitudeName:n,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:p,labelKey:g,labelName:m});if(k==null)return;const{width:N,height:L}=i.measureLines(String(k)),T=Jp.anchor(S);return{point:{x:A.x,y:A.y,size:A.size},label:{width:N,height:L,text:k},anchor:T,placement:I,datumIndex:b,datumId:qc(f,D,v,M)}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveDataColumns(e){const{idKey:t,latitudeKey:i,longitudeKey:s,sizeKey:o,colorKey:a,labelKey:n}=this.properties,r=i!=null&&s!=null;return{idValues:this.resolveColumn(t,"idValue",e),featureValues:this.resolveColumn(t,"featureValue",e),latValues:r?this.resolveColumn(i,"latValue",e):void 0,lonValues:r?this.resolveColumn(s,"lonValue",e):void 0,labelValues:this.resolveColumn(n,"labelValue",e),sizeValues:this.resolveColumn(o,"sizeValue",e),colorValues:this.resolveColumn(a,"colorValue",e)}}prepareProjectedGeometries(e,t,i){if(e==null||t==null||this.scale==null)return;const s=new Map;for(const[o]of i.dataSources.get(this.id)?.data.entries()??[]){const a=e[o],n=t[o]?.geometry,r=n==null?void 0:aa(n,this.scale);a!=null&&r!=null&&s.set(a,r)}return s}calculateMarkerSize(e){return e==null?this.properties.size:this.sizeScale.convert(e,{clamp:!0})}buildNodeDatum(e,t,i,s,o){return{series:this,datum:e,datumIndex:t,index:i,...o,point:s,midPoint:{x:s.x,y:s.y},legendItemName:this.properties.legendItemName,style:this.getMarkerItemStyle({datumIndex:t,datum:e,colorValue:o.colorValue,sizeValue:o.sizeValue},!1)}}createNodeFromLatLon(e,t,i,s,o,a,n){if(this.scale==null)throw new Error("Scale is required for createNodeFromLatLon");const[r,l]=this.scale.convert([i,s]),c={x:r,y:l,size:a},h=this.buildNodeDatum(e,t,-1,c,o),d=this.getLabelDatum(h,o.labelValue,n)??void 0;return{node:h,label:d}}createNodesFromGeometry(e,t,i,s,o,a){const n=[],r=[];for(const[l,[c,h]]of HD(i,1).entries()){const d={x:c,y:h,size:o},p=this.buildNodeDatum(e,t,l,d,s);n.push(p);const g=this.getLabelDatum(p,s.labelValue,a);g&&r.push(g)}return{nodes:n,labels:r}}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}hG.warnOnce("some data items do not have matches in the provided topology",e)}buildFeatureMap(e){const t=new Map;for(const i of this.topology?.features.values()??[]){const s=i.properties?.[e];s!=null&&t.set(s,i)}return t}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:o,scale:a}=this,{label:n}=o;if(t==null||i==null||a==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const r=this.resolveDataColumns(i),l=o.maxSize??o.size;s.range=[Math.min(o.size,l),l];const c=uG(n),h=this.prepareProjectedGeometries(r.idValues,r.featureValues,i),d=[],p=[],g=[],m=i.dataSources.get(this.id)?.data??[];for(const[y,S]of m.entries()){const x={idValue:r.idValues?.[y],lonValue:r.lonValues?.[y],latValue:r.latValues?.[y],colorValue:r.colorValues?.[y],sizeValue:r.sizeValues?.[y],labelValue:r.labelValues?.[y]},b=this.calculateMarkerSize(x.sizeValue),f=x.idValue==null?void 0:h?.get(x.idValue);if(x.idValue!=null&&h!=null&&f==null&&g.push(x.idValue),x.lonValue!=null&&x.latValue!=null){const D=this.createNodeFromLatLon(S,y,x.lonValue,x.latValue,x,b,c);d.push(D.node),D.label&&p.push(D.label)}else if(f!=null){const D=this.createNodesFromGeometry(S,y,f,x,b,c);d.push(...D.nodes),p.push(...D.labels)}}return this.warnMissingGeometries(g),{itemId:e,nodeData:d,labelData:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:o}=this,a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const n=this.getHighlightedDatum(),r=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:r,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:n,drawingMode:"overlay"}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:n==null?[]:[n],markerSelection:o}),this.updateMarkerNodes({markerSelection:o,isHighlight:!0,highlightedDatum:n,drawingMode:a}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(n),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=zD.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.ctx.highlightManager?.getActiveHighlight();t.each((o,a)=>{const{x:n,y:r,width:l,height:c,text:h,datum:d}=a,p=IG(this,void 0,i,i.label,e,s),{color:g,fontStyle:m,fontWeight:y,fontSize:S,fontFamily:x}=p;o.visible=!0,o.x=n+l/2,o.y=r+c/2,o.text=h,o.fill=g,o.fontStyle=m,o.fontWeight=y,o.fontSize=S,o.fontFamily=x,o.textAlign="center",o.textBaseline="middle";const b=d?.datumIndex;o.fillOpacity=this.getHighlightStyle(e,b).opacity??1,o.setBoxing(p)})}getHighlightedLabelId(e=this.getHighlightedDatum()){if(e!=null)return qc(e.index,e.idValue,e.lonValue,e.latValue)}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=this.getHighlightedLabelId(e),i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(s=>s.datum.datumId===t);if(this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0){this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1;return}this.highlightLabelGroup.visible=!0,this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,s=>qc(s.index,s.idValue,s.lonValue,s.latValue))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:s},o){const{properties:a,colorScale:n,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,h=this.getHighlightStyle(o,e),d=BD(h,a.getStyle());!o&&i!=null&&(d.fill=this.isColorScaleValid()?n.convert(i):l?.[0]??d.fill),s!=null&&(d.size=r.convert(s,{clamp:!0}));let p=d;if(c!=null&&e!=null){const g=this.cachedDatumCallback(qc(e,o?"highlight":"node"),()=>{const m=this.makeItemStylerParams(t,e,o,p);return this.callWithContext(c,m)});g&&(p=BD(g,d))}return p}makeItemStylerParams(e,t,i,s){const{id:o}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,highlightState:n,...s,fill:r}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:s,drawingMode:o}=e,a=KD(this.scale);t.each((n,r)=>{const{datum:l,point:c}=r,h=this.getMarkerItemStyle(r,i);n.shape=h.shape,n.size=h.size,n.setStyleProperties(h,a),n.x=c.x,n.y=c.y,n.scalingCenterX=c.x,n.scalingCenterY=c.y,n.zIndex=!i&&s!=null&&l===s.datum?1:0,n.drawingMode=o})}isProcessedDataAnimatable(){return!0}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup(),this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1,this.placedLabelData=[]}animateMarkers(){const{animationManager:e}=this.ctx,t=SK();bG(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let s=1/0,o;for(const a of this.contextNodeData?.nodeData??[]){const{x:n,y:r,size:l}=a.point,c=Math.max(Math.abs(n-t)-l,0),h=Math.max(Math.abs(r-i)-l,0),d=c*c+h*h;d<s&&(s=d,o=a)}return o==null?void 0:{datum:o,distance:Math.sqrt(s)}}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{shape:o,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s;let{fill:d}=s;if(e!=null&&this.isColorScaleValid()){const g=t.resolveColumnById(this,"colorValue",i)[e];d=this.colorScale.convert(g)}return{marker:{shape:o,fill:d,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:o}=this,{title:a,legendItemName:n,idName:r,idKey:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const p=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:o,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:p}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:o,label:{text:n??a??r??l??s},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o,ctx:{formatManager:a}}=this,{idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:p,colorName:g,sizeKey:m,sizeName:y,labelKey:S,labelName:x,title:b,legendItemName:f,tooltip:D}=o;if(!i||!s)return;const v=s.dataSources.get(this.id)?.data[e],M=m==null?void 0:i.resolveColumnById(this,"sizeValue",s)[e],A=p==null?void 0:i.resolveColumnById(this,"colorValue",s)[e],I=[];if(this.isLabelEnabled()&&S!=null&&S!==n){const L=i.resolveColumnById(this,"labelValue",s)[e],T=a.format(this.callWithContext.bind(this),{type:"category",value:L,datum:v,seriesId:t,legendItemName:f,key:S,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});I.push({label:x,fallbackLabel:S,value:T??L})}if(m!=null&&M!=null){const L=i.getDomain(this,"sizeValue","value",s).domain,T=a.format(this.callWithContext.bind(this),{type:"number",value:M,datum:v,seriesId:t,legendItemName:f,key:m,source:"tooltip",property:"size",domain:L,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});I.push({label:y,fallbackLabel:m,value:T??String(M)})}if(p!=null&&A!=null){const L=i.getDomain(this,"colorValue","value",s).domain,T=a.format(this.callWithContext.bind(this),{type:"number",value:A,datum:v,seriesId:t,legendItemName:f,key:p,source:"tooltip",property:"color",domain:L,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});I.push({label:g,fallbackLabel:p,value:T??String(A)})}let k;if(n!=null)k=i.resolveColumnById(this,"idValue",s)[e];else if(l!=null&&h!=null){const L=i.resolveColumnById(this,"latValue",s)[e],T=i.resolveColumnById(this,"lonValue",s)[e];k=`${Math.abs(L).toFixed(4)}\xB0 ${L>=0?"N":"S"}, ${Math.abs(T).toFixed(4)}\xB0 ${T>=0?"W":"E"}`}const N=this.getMarkerItemStyle({datumIndex:e,datum:v,colorValue:A,sizeValue:M},!1);return this.formatTooltipWithContext(D,{heading:k,title:b??f,symbol:this.legendItemSymbol(e),data:I},{seriesId:t,datum:v,title:b,idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:p,colorName:g,sizeKey:m,sizeName:y,labelKey:S,labelName:x,...N})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return DG(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};eg.className="MapMarkerSeries",eg.type="map-marker";import{_ModuleSupport as NG}from"ag-charts-community";import{commonSeriesOptionsDefs as LG,constant as TG,geoJson as CG,required as wG,string as Tt,without as OG}from"ag-charts-core";var{mapMarkerSeriesThemeableOptionsDef:EG}=NG,PG={...OG(LG,["highlightStyle","highlight"]),...EG,type:wG(TG("map-marker")),idKey:Tt,latitudeKey:Tt,longitudeKey:Tt,sizeKey:Tt,colorKey:Tt,labelKey:Tt,idName:Tt,latitudeName:Tt,longitudeName:Tt,sizeName:Tt,colorName:Tt,labelName:Tt,topology:CG,topologyIdKey:Tt,legendItemName:Tt,title:Tt},$D={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,version:tG,dependencies:[Sr],options:PG,themeTemplate:{...br,series:{shape:"circle",maxSize:30,fill:es({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",iG],["image",sG],["pattern",oG]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},es(rG)]},fillOpacity:.5,label:{...aG,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:es(nG)},tooltip:{range:"exact"}},create:e=>new eg(e),validate(e,t,i){const s=cG(e,t,i),{cleared:o,invalid:a}=s;if(o?.idKey==null&&(o?.latitudeKey==null||o?.longitudeKey==null)){const n=l=>i?`${i}.${l}`:l,r=`Either \`${n("idKey")}\` or both \`${n("latitudeKey")}\` and \`${n("longitudeKey")}\` are required.`;a.push(new lG("required",r,null,i))}return s}};import{VERSION as RG}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as _G,FILL_IMAGE_DEFAULTS as zG,FILL_PATTERN_DEFAULTS as BG,LABEL_BOXING_DEFAULTS as VG,MULTI_SERIES_HIGHLIGHT_STYLE as FG,SAFE_RANGE2_OPERATION as HG}from"ag-charts-core";import{_ModuleSupport as UD}from"ag-charts-community";import{Logger as YD,cachedTextMeasurer as KG,isArray as GG,measureTextSegments as WG,mergeDefaults as XD,toPlainText as jG}from"ag-charts-core";function $G(e,{aspectRatio:t,precision:i}){const s=VD(e,i,(l,c,h,d)=>{const p=YG(l,c,h,t),g=p+2*d*t,m=p*Math.SQRT2,y=g*Math.SQRT2;return{distance:m,maxDistance:y}});if(s==null)return;const{x:o,y:a,distance:n}=s,r=n/Math.SQRT2;return{x:o,y:a,maxWidth:r}}function UG(e,t,i,s,o){const[a,n]=e,[r,l]=t,c=1/o,h=r-a,d=l-n,[p,g]=n<=l?e:t,[m,y]=a<=r?e:t,[S,x]=n<=l?t:e,[b,f]=a<=r?t:e;let D=1/0;if(h===0)for(let N=0;N<=1;N+=1){const T=(N===0?c:-c)*(a-i)+s;if(T>=g&&T<=x){const O=Math.abs(s-T)*2*o;D=Math.min(D,O)}}else{const N=d/h;for(let L=0;L<=1;L+=1){const T=L===0?c:-c,P=(N*a-n-T*i+s)/(N-T);if(P>=m&&P<=b){const O=Math.abs(i-P)*2;D=Math.min(D,O)}}}const v=o,M=Math.abs((p-i)/(g-s)),A=Math.abs((S-i)/(x-s));if(x<s&&A<v){const L=Math.abs(s-x)*2*o;D=Math.min(D,L)}else if(g>s&&M<v){const L=Math.abs(s-g)*2*o;D=Math.min(D,L)}const I=Math.abs((y-s)/(m-i)),k=Math.abs((f-s)/(b-i));if(b<i&&k<c){const N=Math.abs(i-b)*2;D=Math.min(D,N)}else if(m>i&&I<c){const N=Math.abs(i-m)*2;D=Math.min(D,N)}return D}function YG(e,t,i,s){let o=!1,a=1/0;for(const n of e){let r=n.at(-1),[l,c]=r;for(const h of n){const[d,p]=h;p>i!=c>i&&t<(l-d)*(i-p)/(c-p)+d&&(o=!o);const g=UG(r,h,t,i,s);a=Math.min(a,g),r=h,l=d,c=p}}return(o?1:-1)*a}function eh(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function XG(e,t,i,s,o,a){const n=o-a/2,r=o+a/2,[l,c]=t,[h,d]=i,p=h-l,g=d-c,[m,y]=l<=h?t:i,[S,x]=l<=h?i:t;if(p!==0){const b=g/p;for(let f=0;f<=1;f+=1){const v=((f===0?n:r)-c)/b+l;v>=m&&v<=S&&eh(e,s,v)}}else Math.max(n,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&eh(e,s,l);return S<s&&x>=n&&x<=r?eh(e,s,S):m>s&&y>=n&&y<=r&&eh(e,s,m),e}function ZG(e,t,i,s){const o={minX:-1/0,maxX:1/0};for(const r of e){let l=r.at(-1);for(const c of r)XG(o,l,c,t,i,s),l=c}const{minX:a,maxX:n}=o;return Number.isFinite(a)&&Number.isFinite(n)?{x:t+(a+n)/2,width:n-a}:{x:t,width:0}}import{_ModuleSupport as QG}from"ag-charts-community";import{Property as Ie}from"ag-charts-core";var{SeriesProperties:qG,makeSeriesTooltip:JG}=QG,De=class extends qG{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new Jl,this.tooltip=JG()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,opacity:1}}};u([Ie],De.prototype,"topology",2),u([Ie],De.prototype,"title",2),u([Ie],De.prototype,"legendItemName",2),u([Ie],De.prototype,"idKey",2),u([Ie],De.prototype,"idName",2),u([Ie],De.prototype,"topologyIdKey",2),u([Ie],De.prototype,"labelKey",2),u([Ie],De.prototype,"labelName",2),u([Ie],De.prototype,"colorKey",2),u([Ie],De.prototype,"colorName",2),u([Ie],De.prototype,"colorRange",2),u([Ie],De.prototype,"fill",2),u([Ie],De.prototype,"fillOpacity",2),u([Ie],De.prototype,"stroke",2),u([Ie],De.prototype,"strokeOpacity",2),u([Ie],De.prototype,"strokeWidth",2),u([Ie],De.prototype,"lineDash",2),u([Ie],De.prototype,"lineDashOffset",2),u([Ie],De.prototype,"padding",2),u([Ie],De.prototype,"itemStyler",2),u([Ie],De.prototype,"label",2),u([Ie],De.prototype,"tooltip",2);var{getMissCount:eW,createDatumId:th,SeriesNodePickMode:ZD,valueProperty:ih,ColorScale:tW,Group:QD,Selection:sh,Text:qD,PointerEvents:iW,getLabelStyles:sW}=UD,JD=UD.MercatorScale.fixedScale(),tg=class extends Dr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[ZD.EXACT_SHAPE_MATCH,ZD.NEAREST_NODE]}),this.properties=new De,this._chartTopology=void 0,this.colorScale=new tW,this.itemGroup=this.contentGroup.appendChild(new QD({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new QD({name:"itemLabelGroup"})),this.datumSelection=sh.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=sh.select(this.itemLabelGroup,qD),this.highlightDatumSelection=sh.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=sh.select(this.highlightLabelGroup,qD),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=iW.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new yn;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,colorScale:s}=this,{topologyIdKey:o,idKey:a,colorKey:n,labelKey:r,colorRange:l}=this.properties,c=new Map;for(const y of i?.features.values()??[]){const S=y.properties?.[o];S==null||!Up(y.geometry,1)||c.set(S,y)}const h=this.colorScale.type,d=this.scale?.type,{dataModel:p,processedData:g}=await this.requestDataModel(e,t,{props:[ih(a,d,{id:"idValue",includeProperty:!1}),ih(a,d,{id:"featureValue",includeProperty:!1,processor:()=>y=>c.get(y)}),...r?[ih(r,"category",{id:"labelValue"})]:[],...n?[ih(n,h,{id:"colorValue"})]:[]]}),m=p.resolveColumnById(this,"featureValue",g);if(this.topologyBounds=m.reduce((y,S)=>{const x=S?.geometry;return x==null?y:fn(x,y)},void 0),l!=null&&this.isColorScaleValid()){const y=p.resolveProcessedDataIndexById(this,"colorValue");s.domain=g.domain.values[y],s.range=l,s.update()}i==null&&YD.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=eW(this,i.defs.values[s].missing);return!(o===0||o===a)}getLabelLayout(e,t,i,s,o){if(t==null||s==null)return;const{idKey:a,idName:n,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:d,label:p}=this.properties;if(c==null||!p.enabled)return;const g=this.getLabelText(t,e,c,"label",[],p,{value:t,datum:e,idKey:a,idName:n,colorKey:r,colorName:l,labelKey:c,labelName:h});if(g==null)return;const m=GG(g)?WG(g,p):i.measureLines(String(g)),y=(m.width+2*d)/(m.height+2*d);if(o?.geometry===s&&o?.labelText===g&&o?.aspectRatio===y)return o;const S=aa(s,JD),x=Xc(S);if(x==null)return;const b=$G(x,{aspectRatio:y,precision:.001});if(b==null)return;const{x:f,y:D,maxWidth:v}=b;return{geometry:s,labelText:g,aspectRatio:y,x:f,y:D,maxWidth:v,fixedPolygon:x}}getLabelDatum(e,t,i,s){const{scale:o}=this;if(o==null)return;const{padding:a,label:n}=this.properties,{labelText:r,aspectRatio:l,x:c,y:h,maxWidth:d,fixedPolygon:p}=e,g={width:Math.ceil(d*t),height:Math.ceil(d*t/l),meta:c},m=tr(jG(r),n,{padding:a},(M,A)=>{if(!A)return g;const I=ZG(p,c,h,M/t);return{width:I.width*t,height:M,meta:I.x}});if(m==null)return;const[{text:y,fontSize:S,lineHeight:x,width:b},f]=m,D=b<g.width?c:f,v=this.scale.convert(JD.invert([D,h]));return{x:v[0],y:v[1],text:y,fontSize:S,lineHeight:x,datumIndex:i,idValue:s,datumId:th(s)}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveShapeDataColumns(e){const{colorKey:t,labelKey:i}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e),labelValues:this.resolveColumn(i,"labelValue",e),colorValues:this.resolveColumn(t,"colorValue",e)}}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}YD.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,scale:o,previousLabelLayouts:a}=this,{label:n,legendItemName:r,colorKey:l}=s;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const c=o==null?Number.NaN:(o.range[1][0]-o.range[0][0])/o.bounds.width,h=this.resolveShapeDataColumns(i),d=KG(n),p=new Map;this.previousLabelLayouts=p;const g=[],m=[],y=[],S=i.dataSources.get(this.id)?.data??[];for(const[x,b]of S.entries()){const f={idValue:h.idValues[x],colorValue:h.colorValues?.[x],labelValue:h.labelValues?.[x]},D=h.featureValues[x]?.geometry??void 0;if(D==null&&y.push(f.idValue),l!=null&&f.colorValue==null)continue;const v=this.getLabelLayout(b,f.labelValue,d,D,a?.get(f.idValue));v!=null&&p.set(f.idValue,v);const M=v!=null&&o!=null?this.getLabelDatum(v,c,x,f.idValue):void 0;M!=null&&m.push(M);const A=D!=null&&o!=null?aa(D,o):void 0;g.push({series:this,datum:b,datumIndex:x,...f,projectedGeometry:A,legendItemName:r,style:this.getItemStyle({datum:b,datumIndex:x,colorValue:f.colorValue},!1)})}return this.warnMissingGeometries(y),{itemId:e,nodeData:g,labelData:m}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const s=this.ctx.chartService.highlight?.drawingMode??"overlay",o=this.getHighlightedDatum(),a=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,drawingMode:"overlay"}),this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:t});const r=this.getHighlightLabelData(n,o);this.highlightLabelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.highlightLabelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o==null?[]:[o],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i,drawingMode:s})}getHighlightLabelData(e,t){if(e.length===0)return[];const i=th(t?.idValue);return e.filter(s=>s.datumId===i&&s.datumIndex===t?.datumIndex)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>th(t.idValue))}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{properties:o,colorScale:a}=this,{colorRange:n,itemStyler:r}=o,l=o.getStyle();if(i!=null){const d=this.isColorScaleValid()?a.convert(i):n?.[0];d!=null&&(l.fill=d)}const c=this.getHighlightStyle(s,e);let h=XD(c,l);if(r!=null&&e!=null){const d=this.cachedDatumCallback(th(e,s?"highlight":"node"),()=>{const p=this.makeItemStylerParams(t,e,s,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,p))});d&&(h=XD(d,h))}return h}makeItemStylerParams(e,t,i,s){const{id:o}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,highlightState:n,...s,fill:r}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){const i=KD(this.scale);e.each((s,o)=>{const{projectedGeometry:a}=o;if(a==null){s.visible=!1,s.projectedGeometry=void 0;return}s.visible=!0,s.projectedGeometry=a,s.setStyleProperties(o.style,i),s.drawingMode=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.ctx.highlightManager?.getActiveHighlight();t.each((o,a)=>{const{x:n,y:r,text:l,fontSize:c,lineHeight:h,datumIndex:d}=a,p=sW(this,void 0,i,i.label,e,s),{color:g,fontStyle:m,fontWeight:y,fontFamily:S}=p;o.visible=!0,o.x=n,o.y=r,o.text=l,o.fill=g,o.fontStyle=m,o.fontWeight=y,o.fontSize=c,o.lineHeight=h,o.fontFamily=S,o.textAlign="center",o.textBaseline="middle",o.fillOpacity=this.getHighlightStyle(e,d).opacity??1,o.setBoxing(p)})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((o,a)=>{const n=o.distanceSquared(e,t);n<i&&(i=n,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=i==null?void 0:Xc(i),o=s==null?void 0:qp(s,2),a=o==null?void 0:{x:o[0],y:o[1]};return this._previousDatumMidPoint={datum:e,point:a},a}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{fillOpacity:o,stroke:a,strokeWidth:n,strokeOpacity:r,lineDash:l,lineDashOffset:c}=s;let{fill:h}=s;if(e!=null&&this.isColorScaleValid()){const p=t.resolveColumnById(this,"colorValue",i)[e];p!=null&&(h=this.colorScale.convert(p))}return{marker:{fill:h,fillOpacity:o,stroke:a,strokeWidth:n,strokeOpacity:r,lineDash:l,lineDashOffset:c}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:o}=this,{title:a,legendItemName:n,idKey:r,idName:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const p=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:o,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:p}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:o,label:{text:n??a??l??r},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o,ctx:{formatManager:a}}=this,{idKey:n,idName:r,colorKey:l,colorName:c,labelKey:h,labelName:d,legendItemName:p,title:g,tooltip:m}=o;if(!i||!s)return;const y=s.dataSources.get(this.id)?.data[e],S=i.resolveColumnById(this,"idValue",s)[e],x=l==null?void 0:i.resolveColumnById(this,"colorValue",s)[e];if(l!=null&&x==null)return;const b=[];if(this.isLabelEnabled()&&h!=null&&h!==n){const D=i.resolveColumnById(this,"labelValue",s)[e],v=a.format(this.callWithContext.bind(this),{type:"category",value:D,datum:y,seriesId:t,legendItemName:p,key:h,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});b.push({label:d,fallbackLabel:h,value:v??D})}if(x!=null){const D=i.getDomain(this,"colorValue","value",s).domain,v=a.format(this.callWithContext.bind(this),{type:"number",value:x,datum:y,seriesId:t,legendItemName:p,key:l,source:"tooltip",property:"color",domain:D,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});b.push({label:c,fallbackLabel:l,value:v??String(x)})}const f=this.getItemStyle({datum:y,datumIndex:e,colorValue:x},!1);return this.formatTooltipWithContext(m,{heading:S,title:g??p,symbol:this.legendItemSymbol(e),data:b},{seriesId:t,datum:y,title:g,idKey:n,idName:r,colorKey:l,colorName:c,labelKey:h,labelName:d,...f})}computeFocusBounds(e){return ND(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};tg.className="MapShapeSeries",tg.type="map-shape";import{_ModuleSupport as oW}from"ag-charts-community";import{commonSeriesOptionsDefs as aW,constant as nW,geoJson as rW,required as eM,string as Is,without as lW}from"ag-charts-core";var{mapShapeSeriesThemeableOptionsDef:cW}=oW,hW={...lW(aW,["highlightStyle","highlight"]),...cW,type:eM(nW("map-shape")),idKey:eM(Is),colorKey:Is,labelKey:Is,idName:Is,colorName:Is,labelName:Is,topology:rW,topologyIdKey:Is,legendItemName:Is,title:Is},tM={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,version:RG,dependencies:[Sr],options:hW,themeTemplate:{...br,series:{fill:es({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",_G],["image",zG],["pattern",BG]]}),stroke:{$ref:"chartBackgroundColor"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},es(HG)]},fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{...VG,enabled:!0,color:{$ref:"chartBackgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"},highlight:es(FG)},tooltip:{range:"exact"}},create:e=>new tg(e)};import{VERSION as dW}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS as uW,FILL_IMAGE_DEFAULTS as pW,FILL_PATTERN_HIERARCHY_DEFAULTS as gW}from"ag-charts-core";import{_ModuleSupport as mW}from"ag-charts-community";import{Logger as yW}from"ag-charts-core";import{_ModuleSupport as fW}from"ag-charts-community";import{Property as Ns}from"ag-charts-core";var{SeriesProperties:xW,makeSeriesTooltip:SW}=fW,ts=class extends xW{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=SW()}};u([Ns],ts.prototype,"topology",2),u([Ns],ts.prototype,"fill",2),u([Ns],ts.prototype,"fillOpacity",2),u([Ns],ts.prototype,"stroke",2),u([Ns],ts.prototype,"strokeOpacity",2),u([Ns],ts.prototype,"strokeWidth",2),u([Ns],ts.prototype,"lineDash",2),u([Ns],ts.prototype,"lineDashOffset",2),u([Ns],ts.prototype,"tooltip",2);var{createDatumId:bW,Selection:vW,Group:DW,PointerEvents:iM}=mW,ig=class extends Dr{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new ts,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new DW({name:"itemGroup"})),this.datumSelection=vW.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=iM.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new yn;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=iM.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:fn(s,t)},void 0),e==null&&yW.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{fill:o,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s,d=[],p=[];for(const[g,m]of t.features.entries()){const{geometry:y}=m,S=y!=null&&i!=null?aa(y,i):void 0;S!=null&&d.push({series:this,datum:m,datumIndex:0,index:g,projectedGeometry:S,style:{fill:o,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}})}return{itemId:e,nodeData:d,labelData:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>bW(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:o}=s;if(o==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=o,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};ig.className="MapShapeBackgroundSeries",ig.type="map-shape-background";import{_ModuleSupport as MW}from"ag-charts-community";import{commonSeriesOptionsDefs as kW,constant as AW,geoJson as IW,required as NW}from"ag-charts-core";var{mapShapeBackgroundSeriesThemeableOptionsDef:LW}=MW,TW={...LW,...kW,type:NW(AW("map-shape-background")),topology:IW},sM={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,version:dW,dependencies:[Sr],options:TW,themeTemplate:{...br,series:{fill:es({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",uW],["image",pW],["pattern",gW]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1}},create:e=>new ig(e)};import{PolarChartModule as CW,VERSION as wW}from"ag-charts-community";import{ChartAxisDirection as oM,POLAR_AXIS_TYPE as aM}from"ag-charts-core";import{_ModuleSupport as OW}from"ag-charts-community";import{PolarZIndexMap as sg}from"ag-charts-core";import{_ModuleSupport as kr}from"ag-charts-community";import{ChartAxisDirection as is,isDefined as EW,isGradientFill as nM,normalizeAngle360 as rM}from"ag-charts-core";import{_ModuleSupport as lM}from"ag-charts-community";import{mergeDefaults as cM}from"ag-charts-core";var{createDatumId:PW,toHighlightString:RW}=lM;function _W(e,t){const{id:i}=e,{angleKey:s,cornerRadius:o,fill:a,fillOpacity:n,lineDash:r,lineDashOffset:l,radiusKey:c,stackGroup:h,stroke:d,strokeOpacity:p,strokeWidth:g}=e.properties,m=RW(t??lM.HighlightState.None);return{angleKey:s,cornerRadius:o,fill:a,fillOpacity:n,highlightState:m,lineDash:r,lineDashOffset:l,radiusKey:c,seriesId:i,stackGroup:h,stroke:d,strokeOpacity:p,strokeWidth:g}}function og(e,t,i){const{styler:s}=e.properties;let o={};if(!t&&s){const a=_W(e,i);o=e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.cachedCallWithContext(s,a)??{},{pick:!1})??{}}return{cornerRadius:o.cornerRadius??e.properties.cornerRadius,fill:o.fill??e.properties.fill,fillOpacity:o.fillOpacity??e.properties.fillOpacity,lineDash:o.lineDash??e.properties.lineDash,lineDashOffset:o.lineDashOffset??e.properties.lineDashOffset,stroke:o.stroke??e.properties.stroke,strokeOpacity:o.strokeOpacity??e.properties.strokeOpacity,strokeWidth:o.strokeWidth??e.properties.strokeWidth,opacity:1}}function zW(e,t,i,s){const{id:o,properties:a}=e,{angleKey:n,radiusKey:r}=a,l=e.ctx.highlightManager?.getActiveHighlight(),c=e.getHighlightStateString(l,i,t.datumIndex),h=e.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:t.datum,highlightState:c,angleKey:n,radiusKey:r,...s,fill:h}}function xn(e,t,i,s){const{properties:o}=e,{itemStyler:a}=o,n=e.getHighlightStyle(i,t?.datumIndex,s);let l=cM(n,og(e,t===void 0,s));if(a!=null&&t!=null){const c=e.cachedDatumCallback(PW(e.getDatumId(t),i?"highlight":"node"),()=>{const h=zW(e,t,i,l);return e.callWithContext(a,h)});c&&(l=cM(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS:BW,DEFAULT_POLAR_DIRECTION_NAMES:VW,PolarAxis:FW,diff:HW,fixNumericExtent:KW,groupAccumulativeValueProperty:hM,keyProperty:GW,normaliseGroupTo:WW,resetLabelFn:jW,seriesLabelFadeInAnimation:$W,seriesLabelFadeOutAnimation:UW,valueProperty:YW,animationValidation:XW,createDatumId:ZW,SeriesNodePickMode:dM,CategoryScale:QW,motion:uM,updateLabelNode:pM,getItemStyles:qW}=kr,JW=class extends kr.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},gM=class extends kr.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:BW,propertyNames:VW,canHaveAxes:!0,pickModes:[dM.NEAREST_NODE,dM.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:jW}}),this.NodeEvent=JW,this.groupScale=new QW,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===is.Angle)return t.getDomain(this,"angleValue","key",i);{const s=t.getDomain(this,"radiusValue-end","value",i).domain,o=Number.isFinite(s[1]-s[0])?[Math.min(s[0],0),Math.max(s[1],0)]:[];return{domain:KW(o)}}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,o=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),n=`${a}-trailing`,r=[];EW(s)&&r.push(WW([a,n],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&r.push(HW(this.id,this.processedData)),o&&r.push(XW());const l=this.visible?{}:{forceValue:0},c=this.axes[is.Radius]?.scale.type,h=this.axes[is.Angle]?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[GW(t,h,{id:"angleValue",allowNullKey:d}),YW(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...hM(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...hM(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:n,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e!==s.r||t!==s.cx||i!==s.cy?(this.circleCache={r:e,cx:t,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[is.Radius]?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[is.Radius];return e instanceof FW?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||e?.type!=="grouped")return;const s=this.axes[is.Angle],o=this.axes[is.Radius],a=s?.scale,n=o?.scale;if(!a||!n)return;const r=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),h=t.resolveColumnById(this,"radiusValue-raw",e);let d=0,p=0;s instanceof Do&&(d=s.groupPaddingInner,p=s.paddingInner);const m=(a.bandwidth??0)*(1-p),{index:y,visibleGroupCount:S}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:S}).map((E,w)=>String(w)),i.range=[-m/2,m/2],i.paddingInner=S>1?d:0;const x=this.isRadiusAxisReversed(),b=this.getAxisInnerRadius(),f=this.radius,D=f+b,{angleKey:v,radiusKey:M,angleName:A,radiusName:I,legendItemName:k,label:N}=this.properties,L=this.getSeriesDomain(is.Radius).domain,T=(E,w,z,B)=>{const K=this.getLabelText(w,E,M,"radius",L,N,{value:w,datum:E,angleKey:v,radiusKey:M,angleName:A,radiusName:I,legendItemName:k});if(K)return{x:z,y:B,text:K,textAlign:"center",textBaseline:"middle"}},P=[],O=qW((E,w,z)=>xn(this,E,w,z)),C={itemId:M,nodeData:P,labelData:P,styles:O};if(!this.visible)return C;const{dataSources:R}=e,V=R.get(this.id)?.data??[];for(const{datumIndex:E}of t.forEachGroupDatum(this,e)){const w=V[E],z=r[E];if(z===void 0&&!this.properties.allowNullKeys)return;const B=h[E],K=B>=0&&!Object.is(B,-0),_=l[E],j=c[E],Z=K===x;if(_===void 0||j===void 0)return;let U,ie,ae;if(V.length===1)U=-.5*Math.PI,ie=1.5*Math.PI,ae=U;else{const tt=a.convert(z);U=rM(tt+i.convert(String(y))),ie=rM(U+i.bandwidth),ae=U+i.bandwidth/2}const re=D-n.convert(_),xe=D-n.convert(j),et=(re+xe)/2,Gt=Math.cos(ae)*et,se=Math.sin(ae)*et,Q=this.properties.label.enabled?T(w,B,Gt,se):void 0,ze=this.getColumnWidth(U,ie);P.push({series:this,datum:w,datumIndex:E,point:{x:Gt,y:se,size:0},midPoint:{x:Gt,y:se},label:Q,angleValue:z,radiusValue:B,negative:Z,innerRadius:re,outerRadius:xe,stackInnerRadius:re,stackOuterRadius:xe,startAngle:U,endAngle:ie,midAngle:ae,axisInnerRadius:b,axisOuterRadius:f,columnWidth:ze,index:E})}return{itemId:M,nodeData:P,labelData:P,styles:O}}getColumnWidth(e,t){return Number.NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight();let o=[];const a=this.ctx.highlightManager?.getActiveHighlight();t?a?.datum&&a.series===this&&o.push(a):o=this.nodeData;const n=this.isRadiusAxisReversed(),r=n?this.radius:this.getAxisInnerRadius(),l=n?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),h=this.hasItemStylers();e.update(o,void 0,d=>this.getDatumId(d)).each((d,p)=>{const{midPoint:g}=p;if(h){const b=this.getHighlightState(a,t,p.datumIndex);p.style=xn(this,p,t,b)}const m=p.style??i.styles[this.getHighlightState(s,t,p.datumIndex)],y=m.fill,x=nM(y)&&y.bounds==="item"?{centerX:g?.x??0,centerY:g?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:l};this.updateItemPath(d,p,t),d.setStyleProperties(m,c,x),d.cornerRadius=m.cornerRadius??0,d.lineJoin="round"})}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=e?.series===this&&e?.datum?e:void 0,i=t?[t]:[];this.labelSelection.update(this.nodeData).each((s,o)=>{pM(this,s,this.properties,this.properties.label,o.label,!1,e),s.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1}),this.highlightLabelSelection.update(i,void 0,s=>this.getDatumId(s)).each((s,o)=>{pM(this,s,this.properties,this.properties.label,o.label,!0,e),s.fillOpacity=this.getHighlightStyle(!0,o.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();uM.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),$W(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();uM.fromToMotion(this.id,"datums",t,[e],i),UW(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=a,p=o[is.Angle],g=o[is.Radius],m=this.nodeData?.[e];if(!i||!s||!p||!g||!m)return;const y=s.dataSources.get(this.id)?.data[e],S=i.resolveKeysById(this,"angleValue",s)[e],x=i.resolveColumnById(this,"radiusValue-raw",s)[e];if(S===void 0&&!this.properties.allowNullKeys)return;const b=xn(this,m,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",S,y,n,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",x,y,l,void 0),missing:kr.isTooltipValueMissing(x)}]},{seriesId:t,datum:y,title:r,angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...b})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n}=og(this,!1,kr.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n};return nM(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{radiusKey:s,radiusName:o,legendItemName:a,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:a??o??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!n}]}getDatumId(e){return ZW(e.angleValue)}computeLabelsBBox(){return null}};import{_ModuleSupport as ej}from"ag-charts-community";import{Property as Ne}from"ag-charts-core";var{SeriesProperties:tj,makeSeriesTooltip:ij,Label:sj}=ej,fe=class extends tj{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new sj,this.tooltip=ij()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r,opacity:1}}};u([Ne],fe.prototype,"angleKey",2),u([Ne],fe.prototype,"angleName",2),u([Ne],fe.prototype,"radiusKey",2),u([Ne],fe.prototype,"radiusName",2),u([Ne],fe.prototype,"angleKeyAxis",2),u([Ne],fe.prototype,"radiusKeyAxis",2),u([Ne],fe.prototype,"legendItemName",2),u([Ne],fe.prototype,"fill",2),u([Ne],fe.prototype,"fillOpacity",2),u([Ne],fe.prototype,"stroke",2),u([Ne],fe.prototype,"strokeWidth",2),u([Ne],fe.prototype,"strokeOpacity",2),u([Ne],fe.prototype,"lineDash",2),u([Ne],fe.prototype,"lineDashOffset",2),u([Ne],fe.prototype,"cornerRadius",2),u([Ne],fe.prototype,"styler",2),u([Ne],fe.prototype,"itemStyler",2),u([Ne],fe.prototype,"rotation",2),u([Ne],fe.prototype,"stackGroup",2),u([Ne],fe.prototype,"normalizedTo",2),u([Ne],fe.prototype,"label",2),u([Ne],fe.prototype,"tooltip",2);import{_ModuleSupport as oj}from"ag-charts-community";import{_ModuleSupport as aj}from"ag-charts-community";var{motion:nj}=aj;function mM(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(n,r,l)=>{for(const c of t){const h=e[c];let d=(l==="removed"||l==="updated"?n:r)[c],p=(l==="removed"?n:r)[c];Number.isNaN(p)&&(p=n.previousDatum?.[c]??Number.NaN);const g=d-p;Math.abs(g)>Math.PI&&(d-=Math.sign(g)*2*Math.PI),h.set(r,{from:d,to:p})}},s=(n,r)=>({startAngle:e.startAngle.get(n)[r],endAngle:e.endAngle.get(n)[r]});return{calculate:i,from:n=>s(n,"from"),to:n=>s(n,"to")}}function yM(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.startAngle)||Number.isNaN(e.previousDatum.endAngle))return"added";if(Number.isNaN(t.startAngle)||Number.isNaN(t.endAngle))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function rj(e){const t=mM();return{toFn:(o,a,n)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,h,d,p,g;return n==="removed"?(c=o.innerRadius,h=o.innerRadius,d=o.columnWidth,p=o.axisInnerRadius,g=o.axisOuterRadius):(c=Number.isNaN(a.innerRadius)?e:a.innerRadius,h=Number.isNaN(a.outerRadius)?e:a.outerRadius,d=Number.isNaN(a.columnWidth)?o.columnWidth:a.columnWidth,p=a.axisInnerRadius,g=a.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:p,axisOuterRadius:g,startAngle:r,endAngle:l}},fromFn:(o,a,n)=>{n=yM(o,a,n),t.calculate(o,a,n);const{startAngle:r,endAngle:l}=t.from(a);let c,h,d,p,g;n==="removed"||n==="updated"?(c=o.innerRadius,h=o.outerRadius,d=o.columnWidth,p=o.axisInnerRadius,g=o.axisOuterRadius):(c=e,h=e,d=a.columnWidth,p=a.axisInnerRadius,g=a.axisOuterRadius);const m=nj.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:p,axisOuterRadius:g,startAngle:r,endAngle:l,phase:m}}}}function lj(e,{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:o,axisOuterRadius:a,startAngle:n,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:o,axisOuterRadius:a,startAngle:n,endAngle:r}}var{SectorBox:oh,motion:cj}=oj;function ag(e){const{negative:t,innerRadius:i,outerRadius:s,stackInnerRadius:o,stackOuterRadius:a}=e;return{innerRadius:t?a:o,outerRadius:t?o:a,clipInnerRadius:t?s:i,clipOuterRadius:t?i:s}}function hj(e){const t=mM();return{toFn:(o,a,n)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,h,d;if(n==="removed")c=e,h=e,d=new oh(r,l,c,h);else{let p,g;({innerRadius:c,outerRadius:h,clipInnerRadius:p,clipOuterRadius:g}=ag(a)),Number.isNaN(c)&&(c=e),Number.isNaN(h)&&(h=e),Number.isNaN(p)&&(p=e),Number.isNaN(g)&&(g=e),d=new oh(r,l,p,g)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d}},fromFn:(o,a,n)=>{n=yM(o,a,n),t.calculate(o,a,n);const{startAngle:r,endAngle:l}=t.from(a);let c,h,d;n==="removed"||n==="updated"?(c=o.innerRadius,h=o.outerRadius,d=o.clipSector):(c=e,h=e),d??(d=new oh(r,l,c,h));const p=cj.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d,phase:p}}}}function dj(e,t){const{startAngle:i,endAngle:s}=t,{innerRadius:o,outerRadius:a,clipInnerRadius:n,clipOuterRadius:r}=ag(t),l=new oh(i,s,n,r);return{innerRadius:o,outerRadius:a,startAngle:i,endAngle:s,clipSector:l}}var{Sector:uj,SectorBox:pj}=OW,ng=class extends gM{constructor(e){super(e,{animationResetFns:{item:dj}}),this.properties=new fe}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,sg.FOREGROUND,e],this.highlightGroup.zIndex=[0,sg.HIGHLIGHT,e],this.labelGroup.zIndex=[0,sg.LABEL,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new uj}updateItemPath(e,t,i){const{negative:s}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=s?0:this.properties.cornerRadius,e.endOuterCornerRadius=s?0:this.properties.cornerRadius,e.startInnerCornerRadius=s?this.properties.cornerRadius:0,e.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:o,endAngle:a}=t,{innerRadius:n,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=ag(t);e.innerRadius=n,e.outerRadius=r,e.startAngle=o,e.endAngle=a,e.clipSector=new pj(o,a,l,c)}}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return hj(e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};ng.className="NightingaleSeries",ng.type="nightingale";import{_ModuleSupport as gj}from"ag-charts-community";import{boolean as fM,commonSeriesOptionsDefs as mj,constant as yj,number as fj,required as rg,string as ho,undocumented as xM}from"ag-charts-core";var{nightingaleSeriesThemeableOptionsDef:xj}=gj,lg={...mj,...xj,type:rg(yj("nightingale")),angleKey:rg(ho),radiusKey:rg(ho),angleName:ho,radiusName:ho,legendItemName:ho,grouped:fM,stacked:fM,stackGroup:ho,normalizedTo:fj};lg.angleKeyAxis=xM(ho),lg.radiusKeyAxis=xM(ho);import{FILL_GRADIENT_RADIAL_SERIES_DEFAULTS as Sj,FILL_IMAGE_DEFAULTS as bj,FILL_PATTERN_DEFAULTS as vj,LABEL_BOXING_DEFAULTS as Dj,MULTI_SERIES_HIGHLIGHT_STYLE as Mj,POLAR_AXIS_SHAPE as SM,POLAR_AXIS_TYPE as bM}from"ag-charts-core";var kj={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Sj],["image",bj],["pattern",vj]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...Dj,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:{...Mj,bringToFront:!1}},axes:{[bM.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:SM.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[bM.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:SM.CIRCLE}}}},vM={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,stackedByDefault:!0,version:wW,dependencies:[CW],options:lg,defaultAxes:{angle:{type:aM.ANGLE_CATEGORY},radius:{type:aM.RADIUS_NUMBER}},axisKeys:{[oM.X]:"xKeyAxis",[oM.Y]:"yKeyAxis"},themeTemplate:kj,create:e=>new ng(e)};import{VERSION as Aj}from"ag-charts-community";import{_ModuleSupport as DM}from"ag-charts-community";import{StateMachine as Ij,cachedTextMeasurer as Nj,isArray as Lj,measureTextSegments as Tj,mergeDefaults as MM,toPlainText as kM,toTextString as Cj}from"ag-charts-core";import{_ModuleSupport as wj}from"ag-charts-community";import{Property as He}from"ag-charts-core";var{SeriesProperties:Oj,makeSeriesTooltip:Ej,Label:AM,DropShadow:Pj}=wj,Rj=class extends AM{},cg=class extends AM{constructor(){super(...arguments),this.spacing=0}};u([He],cg.prototype,"spacing",2),u([He],cg.prototype,"placement",2);var Ue=class extends Oj{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new Pj().set({enabled:!1}),this.label=new Rj,this.stageLabel=new cg,this.tooltip=Ej()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};u([He],Ue.prototype,"stageKey",2),u([He],Ue.prototype,"valueKey",2),u([He],Ue.prototype,"fills",2),u([He],Ue.prototype,"fillOpacity",2),u([He],Ue.prototype,"strokes",2),u([He],Ue.prototype,"strokeWidth",2),u([He],Ue.prototype,"strokeOpacity",2),u([He],Ue.prototype,"lineDash",2),u([He],Ue.prototype,"lineDashOffset",2),u([He],Ue.prototype,"direction",2),u([He],Ue.prototype,"reverse",2),u([He],Ue.prototype,"spacing",2),u([He],Ue.prototype,"aspectRatio",2),u([He],Ue.prototype,"itemStyler",2),u([He],Ue.prototype,"shadow",2),u([He],Ue.prototype,"label",2),u([He],Ue.prototype,"stageLabel",2),u([He],Ue.prototype,"tooltip",2);function IM(e,{x:t,y:i,top:s,right:o,bottom:a,left:n}){e.x0=t-s/2,e.x1=t+s/2,e.x2=t+a/2,e.x3=t-a/2,e.y0=i-n/2,e.y1=i-o/2,e.y2=i+o/2,e.y3=i+n/2}function _j(e){return{fromFn:(o,a)=>{const{x:n,y:r}=a;let{top:l,right:c,bottom:h,left:d}=a;return e==="vertical"?(l=0,h=0):(d=0,c=0),{x:n,y:r,top:l,right:c,bottom:h,left:d}},toFn:(o,a)=>{const{x:n,y:r,top:l,right:c,bottom:h,left:d}=a;return{x:n,y:r,top:l,right:c,bottom:h,left:d}},applyFn:IM}}var{valueProperty:NM,SeriesNodePickMode:LM,createDatumId:zj,BBox:hg,Group:dg,Selection:Ar,Text:ug,PointerEvents:TM,fromToMotion:Bj,seriesLabelFadeInAnimation:Vj,getLabelStyles:Fj}=DM,pg=class extends DM.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[LM.EXACT_SHAPE_MATCH,LM.NEAREST_NODE]}),this.properties=new Ue,this.itemGroup=this.contentGroup.appendChild(new dg({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new dg({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new dg({name:"stageLabelGroup"})),this.datumSelection=Ar.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Ar.select(this.itemLabelGroup,ug),this.stageLabelSelection=Ar.select(this.stageLabelGroup,ug),this.highlightLabelSelection=Ar.select(this.highlightLabelGroup,ug),this.highlightDatumSelection=Ar.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.animationState=new Ij("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=TM.None,this.stageLabelGroup.pointerEvents=TM.None,this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new qi}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}async processData(e){if(this.data==null)return;const{id:t,visible:i,ctx:{legendManager:s}}=this,{stageKey:o,valueKey:a}=this.properties,n="category",r="number",l=(d,p,g)=>i&&s.getItemEnabled({seriesId:t,itemId:g}),c=this.visible?{}:{forceValue:0},h=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[NM(o,n,{id:"xValue",allowNullKey:h}),NM(a,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:o,ctx:{legendManager:a}}=this,{stageKey:n,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:p,stageLabel:g}=s;if(t==null||i==null)return;const m=l==="horizontal",y=t.resolveColumnById(this,"xValue",i),S=t.resolveColumnById(this,"yValue",i),x=t.getDomain(this,"xValue","value",i).domain,b=t.getDomain(this,"yValue","value",i).domain,f=Nj(g);let D,v;m?(D="center",v=g.placement==="before"?"bottom":"top"):(D=g.placement==="after"?"left":"right",v="middle");const M=g.enabled?[]:void 0;let A=0,I=0,k=0;const N=i.dataSources.get(this.id)?.data??[];for(const[_,j]of N.entries()){const Z=y[_];if(Z===void 0&&!this.properties.allowNullKeys)continue;const U=S[_],ie=o&&a.getItemEnabled({seriesId:e,itemId:_});if(k+=U,M==null)continue;const ae=this.getLabelText(Z,j,n,"x",x,this.properties.stageLabel,{datum:j,value:U,stageKey:n,valueKey:r},this.properties.allowNullKeys??!1),{width:re,height:xe}=Lj(ae)?Tj(ae,p):f.measureLines(Cj(ae));A=Math.max(A,re),I=Math.max(I,xe),M.push({x:Number.NaN,y:Number.NaN,text:ae,textAlign:D,textBaseline:v,visible:ie})}const L=this._nodeDataDependencies?.seriesRectWidth??0,T=this._nodeDataDependencies?.seriesRectHeight??0,P=h*(i.input.count-1);let O;if(m){const _=I+g.spacing;O=new hg(0,g.placement==="before"?_:0,L,T-_)}else{const _=A+g.spacing;O=new hg(g.placement==="after"?0:_,0,L-_,T)}if(d!=null&&d!==0){const _=l==="horizontal"?1/d:d,j=Math.min(O.width,O.height*_),Z=j/_;O=new hg(O.x+(O.width-j)/2,O.y+(O.height-Z)/2,j,Z)}let C,R;m?R=g.placement==="before"?O.y-g.spacing:O.y+O.height+g.spacing:C=g.placement==="after"?O.x+O.width+g.spacing:O.x-g.spacing;const V=O.width-(m?P:0),E=O.height-(m?0:P);if(V<0||E<0)return;const w=[],z=[];let B=0,K=0;for(const[_,j]of N.entries()){const Z=y[_];if(Z===void 0&&!this.properties.allowNullKeys)continue;const U=S[_],ie=o&&a.getItemEnabled({seriesId:e,itemId:_}),ae=B+U,re=(B+ae)/(2*k),xe=(ae-B)/k,et=m?V*re+h*_:V*.5,Gt=m?E*.5:E*re+h*_,se=O.x+et,Q=O.y+Gt;if(M!=null){const ne=M[K++];ne.x=C??se,ne.y=R??Q}let ze,tt,ce,ue;if(m){const ne=V*xe;ze=ne,ce=ne;const pt=(et+ne/2)*(E/O.width),kt=(et-ne/2)*(E/O.width);tt=c?O.height-pt:pt,ue=c?O.height-kt:kt}else{const ne=E*xe;tt=ne,ue=ne;const pt=(Gt-ne/2)*(V/O.height),kt=(Gt+ne/2)*(V/O.height);ze=c?O.width-pt:pt,ce=c?O.width-kt:kt}const oe=this.getLabelText(U,j,r,"y",b,p,{datum:j,value:U,stageKey:n,valueKey:r}),Ce={x:se,y:Q,text:oe,textAlign:"center",textBaseline:"middle",visible:ie};z.push(Ce),w.push({series:this,datum:j,datumIndex:_,index:_,xValue:Z,yValue:U,x:se,y:Q,top:ze,right:tt,bottom:ce,left:ue,label:Ce,enabled:ie,midPoint:{x:se,y:Q},style:this.getItemStyle({datumIndex:_,datum:j},!1)}),B=ae}return{itemId:e,nodeData:w,labelData:z,stageLabelData:M,bounds:O}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:o,highlightLabelSelection:a}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();n!=null&&(n.series!==this||n.datum==null)&&(n=void 0);const r=this.contextNodeData?.nodeData??[],l=this.contextNodeData?.labelData??[],c=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:l,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:c,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel,checkActiveHighlight:!0});const h=this.getHighlightLabelData(l,n)??[];this.highlightLabelSelection=a.update(h),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,labelProperties:this.properties.label,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:n==null?[]:[n],datumSelection:o}),this.updateDatumStyles({datumSelection:o,isHighlight:!0}),this.updateDatumNodes({datumSelection:o,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{properties:s}=this,{itemStyler:o}=s,a=this.getHighlightStyle(i,e);let r=MM(a,s.getStyle(e));if(o!=null&&e!=null){const l=this.cachedDatumCallback(zj(e,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(t,e,i,r);return this.callWithContext(o,c)});l&&(r=MM(l,r))}return r}makeItemStylerParams(e,t,i,s){const{id:o,properties:a}=this,{stageKey:n,valueKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,stageKey:n,valueKey:r,highlightState:c,...s,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){const{properties:t}=this,{shadow:i}=t,s=this.contextNodeData?.bounds,o=s?{series:s,axis:s}:void 0;e.each((a,n)=>{a.setStyleProperties(n.style,o),IM(a,n),a.fillShadow=i})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight(),{labelSelection:i,labelProperties:s,isHighlight:o=!1,checkActiveHighlight:a=!1}=e;i.each((n,r,l)=>{const{visible:c,x:h,y:d,text:p,textAlign:g,textBaseline:m}=r,y=o||a&&t?.datumIndex===l,S=this.getHighlightStyle(y,l),x=Fj(this,void 0,this.properties,s,y,t),{color:b,fontSize:f,fontStyle:D,fontWeight:v,fontFamily:M}=x;n.visible=c,n.x=h,n.y=d,n.text=p,n.fill=b,n.opacity=(S.opacity??1)*(x.fillOpacity??1),n.fillOpacity=(S.opacity??1)*(x.fillOpacity??1),n.fontStyle=D,n.fontWeight=v,n.fontSize=f,n.fontFamily=M,n.textAlign=g,n.textBaseline=m,n.setBoxing(x)})}getHighlightLabelData(e,t){if(t?.label)return[{...t.label}]}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0){for(const i of this.datumSelection)if(i.datum===t)return i.node}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{stageKey:a,valueKey:n,tooltip:r}=o;if(!i||!s)return;const l=s.dataSources.get(this.id)?.data[e],c=i.resolveColumnById(this,"xValue",s)[e],h=i.resolveColumnById(this,"yValue",s)[e],d=this.properties.allowNullKeys??!1;if(c===void 0&&!d)return;const p=this.getLabelText(c,l,a,"x",i.getDomain(this,"xValue","value",s).domain,this.properties.stageLabel,{datum:l,value:c,stageKey:a,valueKey:n}),g=this.getItemStyle({datumIndex:e,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:kM(p),value:kM(h)}]},{seriesId:t,datum:l,title:void 0,stageKey:a,valueKey:n,...g})}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((o,a)=>{const n=o.distanceSquared(e,t);n<i&&(i=n,s=a)}),s==null?void 0:{datum:s,distance:Math.sqrt(i)}}legendItemSymbol(e){const{fills:t,strokes:i,strokeWidth:s,fillOpacity:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this.properties,l=t[e]??"black",c=i[e]??"black";return{marker:{fill:l,fillOpacity:o,stroke:c,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}}}getLegendData(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:o},visible:a}=this;if(!i||!t||e!=="category")return[];const{showInLegend:n}=this.properties,r=i.resolveColumnById(this,"xValue",t);return(t.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=r[c],d=this.properties.allowNullKeys??!1;if(!(h==null&&!d))return{legendType:"category",id:s,datum:l,itemId:c,seriesId:s,enabled:a&&o.getItemEnabled({seriesId:s,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),hideInLegend:!n}}).filter(l=>l!=null)}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,s=_j(i.direction);Bj(this.id,"nodes",this.ctx.animationManager,[e],s),Vj(this,"labels",this.ctx.animationManager,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};pg.className="PyramidSeries",pg.type="pyramid";import{_ModuleSupport as Hj}from"ag-charts-community";import{commonSeriesOptionsDefs as Kj,constant as Gj,required as gg,string as CM}from"ag-charts-core";var{pyramidSeriesThemeableOptionsDef:Wj}=Hj,jj={...Wj,...Kj,type:gg(Gj("pyramid")),stageKey:gg(CM),valueKey:gg(CM)};import{DEFAULT_SHADOW_COLOUR as $j,FILL_GRADIENT_LINEAR_DEFAULTS as Uj,FILL_IMAGE_DEFAULTS as Yj,FILL_PATTERN_DEFAULTS as Xj,LABEL_BOXING_DEFAULTS as wM}from"ag-charts-core";var Zj={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacing:2,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Uj],["pattern",Xj],["image",Yj]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},label:{...wM,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},stageLabel:{...wM,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:$j,xOffset:3,yOffset:3,blur:5},highlight:{unhighlightedItem:{opacity:.4}}}},OM={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,solo:!0,version:Aj,dependencies:[cn],options:jj,themeTemplate:Zj,create:e=>new pg(e)};import{PolarChartModule as Qj,VERSION as qj}from"ag-charts-community";import{ChartAxisDirection as EM,POLAR_AXIS_TYPE as PM}from"ag-charts-core";import{FILL_GRADIENT_LINEAR_DEFAULTS as Jj,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as e3,FILL_IMAGE_DEFAULTS as RM,FILL_PATTERN_DEFAULTS as _M,LABEL_BOXING_DEFAULTS as t3,MARKER_SERIES_HIGHLIGHT_STYLE as i3,POLAR_AXIS_TYPE as s3,SAFE_STROKE_FILL_OPERATION as o3,mergeDefaults as zM}from"ag-charts-core";var BM={series:{stroke:{$palette:"stroke"},label:{...t3,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",e3],["image",RM],["pattern",_M]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:i3,tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[s3.ANGLE_CATEGORY]:{label:{spacing:10}}}},a3=zM({series:{stroke:o3,strokeWidth:2}},BM),n3=zM({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Jj],["image",RM],["pattern",_M]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},BM);import{_ModuleSupport as VM}from"ag-charts-community";import{ChartAxisDirection as FM}from"ag-charts-core";import{_ModuleSupport as ah}from"ag-charts-community";import{ChartAxisDirection as Si,extent as r3,isFiniteNumber as HM,isNumberEqual as KM,mergeDefaults as l3}from"ag-charts-core";import{_ModuleSupport as c3}from"ag-charts-community";import{Property as qe}from"ag-charts-core";var{Label:h3,SeriesMarker:d3,SeriesProperties:u3,makeSeriesTooltip:p3}=c3,Ke=class extends u3{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new d3,this.label=new h3,this.tooltip=p3(),this.connectMissingData=!1}};u([qe],Ke.prototype,"angleKey",2),u([qe],Ke.prototype,"radiusKey",2),u([qe],Ke.prototype,"angleName",2),u([qe],Ke.prototype,"radiusName",2),u([qe],Ke.prototype,"angleKeyAxis",2),u([qe],Ke.prototype,"radiusKeyAxis",2),u([qe],Ke.prototype,"legendItemName",2),u([qe],Ke.prototype,"stroke",2),u([qe],Ke.prototype,"strokeWidth",2),u([qe],Ke.prototype,"strokeOpacity",2),u([qe],Ke.prototype,"lineDash",2),u([qe],Ke.prototype,"lineDashOffset",2),u([qe],Ke.prototype,"rotation",2),u([qe],Ke.prototype,"styler",2),u([qe],Ke.prototype,"marker",2),u([qe],Ke.prototype,"label",2),u([qe],Ke.prototype,"tooltip",2),u([qe],Ke.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:g3,DEFAULT_POLAR_DIRECTION_NAMES:m3,PolarAxis:y3,SeriesNodePickMode:GM,keyProperty:f3,valueProperty:x3,fixNumericExtent:S3,seriesLabelFadeInAnimation:b3,markerFadeInAnimation:v3,resetMarkerFn:D3,resetLabelFn:M3,animationValidation:k3,computeMarkerFocusBounds:A3,BBox:I3,Group:N3,Path:L3,Selection:mg,Text:T3,Marker:C3,updateLabelNode:WM,getMarkerStyles:w3}=ah,O3=class extends ah.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},yg=class extends ah.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:g3,propertyNames:m3,pickModes:[GM.NEAREST_NODE,GM.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:D3,label:M3},clipFocusBox:!1}),this.NodeEvent=O3,this.lineGroup=this.contentGroup.appendChild(new N3({name:"radar-line"})),this.lineSelection=mg.select(this.lineGroup,L3),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}renderToOffscreenCanvas(){return(this.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}nodeFactory(){return new C3}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===Si.Angle){const s=t.getDomain(this,"angleValue","key",i).domain,o=t.getKeySortMetadata(this,"angleValue",i);return{domain:s,sortMetadata:o}}else{const s=t.getDomain(this,"radiusValue","value",i).domain,o=r3(s.length===0?s:[0].concat(s));return{domain:S3(o)}}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(k3());const o=this.axes[Si.Radius]?.scale.type,a=this.axes[Si.Angle]?.scale.type,n=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[f3(t,a,{id:"angleValue",allowNullKey:n}),x3(i,o,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[Si.Radius];return e instanceof y3?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:o,radiusName:a,legendItemName:n,marker:r,label:l}=this.properties,c=this.axes[Si.Angle]?.scale,h=this.axes[Si.Radius]?.scale;if(!c||!h)return;const d=t.resolveKeysById(this,"angleValue",e),p=t.resolveColumnById(this,"radiusValue",e),g=this.getAxisInnerRadius(),m=this.getSeriesDomain(Si.Radius).domain,y=e.dataSources.get(this.id)?.data??[],S=this.properties.allowNullKeys??!1,x=[];for(let b=0;b<y.length;b++){const f=y[b],D=d[b];if(D===void 0&&!S)continue;const v=p[b],M=c.convert(D),A=this.radius+g-h.convert(v),I=Math.cos(M),k=Math.sin(M),N=I*A,L=k*A;let T;if(l.enabled){const P=this.getLabelText(v,f,s,"radius",m,l,{value:v,datum:f,angleKey:i,radiusKey:s,angleName:o,radiusName:a,legendItemName:n});if(P){let O="right";KM(I,0)?O="center":I>0&&(O="left");let C="bottom";KM(k,0)?C="middle":k>0&&(C="top"),T={x:N+I*r.size,y:L+k*r.size,text:P,textAlign:O,textBaseline:C}}}x.push({series:this,datum:f,datumIndex:b,index:b,point:{x:N,y:L,size:r.size},midPoint:{x:N,y:L},label:T,angleValue:D,radiusValue:v,missing:!HM(M)||!HM(A)})}return{itemId:s,nodeData:x,labelData:x,styles:w3(this,this.properties,r)}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0));const o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateMarkers(this.itemSelection,!1,"overlay"),this.updateMarkers(this.highlightSelection,!0,o),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=mg.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,s=this.visible&&e.shape&&i?this.nodeData:[];this.itemSelection.update(s)}updateHighlightSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=mg.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,s=this.ctx.highlightManager?.getActiveHighlight(),o=this.visible&&e.shape&&i&&s?.datum?[{...s}]:[];this.highlightSelection.update(o)}getMarkerFill(e){return e?.fill??this.getStyle().marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:s,radiusKey:o}=i;return{seriesId:t,datum:e,angleKey:s,radiusKey:o}}updateDatumStyles(e,t){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex),n=this.getStyle(a),{stroke:r,strokeWidth:l,strokeOpacity:c}=n;o.style=this.getMarkerStyle(this.properties.marker,o,this.getDatumStylerProperties(o.datum),{isHighlight:t,highlightState:a},n.marker,{stroke:r,strokeWidth:l,strokeOpacity:c})})}updateMarkers(e,t,i){const s=this.getShapeFillBBox(),{contextNodeData:o}=this;if(!o)return;const a=this.ctx.highlightManager.getActiveHighlight();i=this.getDrawingMode(t,i),e.each((n,r)=>{const l=r.style??o.styles[this.getHighlightState(a,t,r.datumIndex)];this.applyMarkerStyle(l,n,r.point,s),n.drawingMode=i})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?[{...t}]:[];this.labelSelection.update(this.nodeData).each((s,o)=>{o.label&&(s.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1,WM(this,s,e,e.label,o.label,!1,t))}),this.highlightLabelSelection.update(i).each((s,o)=>{o.label&&(s.fillOpacity=this.getHighlightStyle(!0,o.datumIndex).opacity??1,WM(this,s,e,e.label,o.label,!0,t))})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d,marker:p}=a,g=o[Si.Angle],m=o[Si.Radius];if(!i||!s||!g||!m)return;const y=s.dataSources.get(this.id)?.data[e],S=i.resolveKeysById(this,"angleValue",s)[e],x=i.resolveColumnById(this,"radiusValue",s)[e],b=this.properties.allowNullKeys??!1;if(S===void 0&&!b)return;const f=this.getMarkerStyle(p,{datum:y,datumIndex:e},this.getDatumStylerProperties(y),{isHighlight:!1});return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(g,"tooltip",S,y,n,void 0,b),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(m,"tooltip",x,y,l,void 0),missing:ah.isTooltipValueMissing(x)}]},{seriesId:t,datum:y,title:r,angleKey:n,radiusKey:l,angleName:r,radiusName:c,legendItemName:h,...f})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,marker:o}=this.getStyle();return{marker:{shape:o.shape,enabled:o.enabled||t<=0,fill:this.getMarkerFill()??o.stroke??e??"rgba(0, 0, 0, 0)",stroke:o.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{radiusKey:o,radiusName:a,legendItemName:n,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:o,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:o}),label:{text:n??a??o},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!r}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:s}=this,{x:o,y:a}=e,n=this.radius;if(Math.hypot(o-i,a-s)>n+this.maxChartMarkerSize)return;let l=1/0,c;for(const h of t){const{point:{x:d=Number.NaN,y:p=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(p))continue;const g=Math.hypot(e.x-d-i,e.y-p-s);g<l&&(l=g,c=h)}if(c){const h=Math.max(l-(c.point?.size??0)/2,0);return{datum:c,distance:h}}}computeLabelsBBox(){const{label:e}=this.properties;this.maybeRefreshNodeData();const t=[],i=new T3;for(const s of this.nodeData){if(!e.enabled||!s.label)continue;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(e),i.setAlign(s.label);const o=i.getBBox();t.push(o)}return t.length===0?null:I3.merge(t)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){this.updatePathNodes()}getPathNodesStyle(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.getHighlightState(e),i=this.getHighlightStyle(void 0,void 0,t),s=this.getStyle(t);return l3(i,s)}getLinePoints(){const{nodeData:e,resetInvalidToZero:t}=this,{connectMissingData:i}=this.properties;if(e.length===0)return[];const s=this.axes[Si.Radius],a=this.axes[Si.Angle]?.isReversed(),r=s?.isReversed()&&!a?[...e].reverse():e,l=[];let c=!1,h;for(const[d,p]of r.entries()){let{x:g,y:m}=p.point;const y=Number.isNaN(g)||Number.isNaN(m);y||(h??(h=p)),y&&!i&&(g=0,m=0);const S=d===0||!t&&!i&&(y||c);l.push({x:g,y:m,moveTo:S}),c=y}return h!==void 0&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(e,t,i){const{path:s}=e;s.clear(!0);const o=this.getAxisInnerRadius(),a=this.axes[Si.Radius],r=a?.isReversed()?this.radius+o-a?.scale.convert(0):o;for(const l of t){const{x:c,y:h,arc:d,radius:p=0,startAngle:g=0,endAngle:m=0,moveTo:y}=l,S=Math.atan2(h,c),x=r*Math.cos(S),b=r*Math.sin(S),f=i,D=x*(1-f)+c*f,v=b*(1-f)+h*f;d?s.arc(c,h,p,g,m):y?s.moveTo(D,v):s.lineTo(D,v)}e.checkPathDirty()}animatePaths(e){const t=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,t,e)}animateEmptyUpdateReady(){const{itemSelection:e,labelSelection:t}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:s=>this.animatePaths(s),onStop:()=>this.animatePaths(1)}),v3(this,i,"added",this.getAnimationDrawingModes(),e),b3(this,"labels",i,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints(),s=this.getStyle();e.fill=void 0,e.stroke=s.stroke,e.strokeWidth=s.strokeWidth,e.strokeOpacity=s.strokeOpacity,e.lineDash=s.lineDash,e.lineDashOffset=s.lineDashOffset,t.clear(!0);for(const{x:o,y:a,moveTo:n}of i)n?t.moveTo(o,a):t.lineTo(o,a);return e.checkPathDirty(),s}}getStylerResult(e,t){const{styler:i}=this.properties;if(i){const s=this.makeStylerParams(t),o=this.cachedCallWithContext(i,s)??{},a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],o,{pick:!1});a&&(e=a)}return e}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{angleKey:t,radiusKey:i},{isHighlight:!0})}computeFocusBounds(e){return A3(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};yg.className="RadarSeries";import"ag-charts-community";import{Property as jM}from"ag-charts-core";var fg=class extends Ke{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};u([jM],fg.prototype,"fill",2),u([jM],fg.prototype,"fillOpacity",2);var{Group:E3,HighlightState:P3,Path:R3,PointerEvents:$M,Selection:_3,toHighlightString:z3}=VM,xg=class extends yg{constructor(e){super(e),this.properties=new fg,this.areaGroup=this.contentGroup.appendChild(new E3({name:"radar-area"})),this.areaSelection=_3.select(this.areaGroup,R3),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){if(e?.fill!=null)return e.fill;const t=this.getStyle();return t.marker.fill??t.fill}updatePathNodes(){const e=this.getPathNodesStyle(),{fill:t,fillOpacity:i,strokeWidth:s,stroke:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:l}=e,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:$M.None,opacity:l,stroke:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r});const h=this.getAreaNode();h&&(h.setStyleProperties({fill:t,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),h.setProperties({lineJoin:"round",pointerEvents:$M.None,opacity:l}))}animatePaths(e){super.animatePaths(e);const t=this.getAreaNode();t&&this.animateSinglePath(t,this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=n=>{const r=this.axes[n];return r instanceof VM.PolarAxis?r:void 0},i=t(FM.Radius),s=t(FM.Angle);if(!i?.isReversed())return e;const a=s?.getAxisLinePoints()?.points??[];return e.concat(...a)}resetPaths(){const e=super.resetPaths(),t=this.getAreaNode();if(t){const{path:i}=t,s=this.getAreaPoints(),o=e??this.getStyle(),a=this.getShapeFillBBox();t.setStyleProperties({fill:o.fill,stroke:void 0,fillOpacity:o.fillOpacity,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},a),t.lineJoin=t.lineCap="round",i.clear(!0);for(const{x:n,y:r,moveTo:l,arc:c,radius:h=0,startAngle:d=0,endAngle:p=0}of s)c?i.arc(n,r,h,d,p):l?i.moveTo(n,r):i.lineTo(n,r);return i.closePath(),t.checkPathDirty(),o}}makeStylerParams(e){const{properties:t}=this,i=z3(e??P3.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,fill:t.fill,fillOpacity:t.fillOpacity,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,fill:i,fillOpacity:s,lineDash:o,lineDashOffset:a,stroke:n,strokeOpacity:r,strokeWidth:l}=this.properties,{size:c,shape:h,fill:d="transparent",fillOpacity:p}=t,g=this.getStylerResult({},e);return g.marker??(g.marker={}),{fill:g.fill??i,fillOpacity:g.fillOpacity??s,lineDash:g.lineDash??o,lineDashOffset:g.lineDashOffset??a,stroke:g.stroke??n,strokeOpacity:g.strokeOpacity??r,strokeWidth:g.strokeWidth??l,marker:{enabled:g.marker.enabled??t.enabled,fill:g.marker.fill??d,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??h,size:g.marker.size??c,lineDash:g.marker.lineDash??t.lineDash??o,lineDashOffset:g.marker.lineDashOffset??t.lineDashOffset??a,stroke:g.marker.stroke??t.stroke??n,strokeOpacity:g.marker.strokeOpacity??t.strokeOpacity??r,strokeWidth:g.marker.strokeWidth??t.strokeWidth??l}}}};xg.className="RadarAreaSeries",xg.type="radar-area";import{_ModuleSupport as B3}from"ag-charts-community";import{commonSeriesOptionsDefs as V3,constant as F3,required as Sg,string as la,undocumented as UM}from"ag-charts-core";var{radarAreaSeriesThemeableOptionsDef:H3}=B3,bg={...V3,...H3,type:Sg(F3("radar-area")),angleKey:Sg(la),radiusKey:Sg(la),angleName:la,radiusName:la,legendItemName:la};bg.angleKeyAxis=UM(la),bg.radiusKeyAxis=UM(la);var YM={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,version:qj,dependencies:[Qj],options:bg,defaultAxes:{angle:{type:PM.ANGLE_CATEGORY},radius:{type:PM.RADIUS_NUMBER}},axisKeys:{[EM.Angle]:"angleKeyAxis",[EM.Radius]:"radiusKeyAxis"},themeTemplate:n3,create:e=>new xg(e)};import{PolarChartModule as K3,VERSION as G3}from"ag-charts-community";import{ChartAxisDirection as XM,POLAR_AXIS_TYPE as ZM}from"ag-charts-core";import{_ModuleSupport as W3}from"ag-charts-community";var{HighlightState:j3,PointerEvents:$3,toHighlightString:U3}=W3,vg=class extends yg{constructor(){super(...arguments),this.properties=new Ke}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const e=this.getLineNode();if(!e)return;const t=this.getPathNodesStyle(),{strokeWidth:i,stroke:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,opacity:r}=t;e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:$3.None,opacity:r,stroke:s,strokeWidth:i,strokeOpacity:o,lineDash:a,lineDashOffset:n})}makeStylerParams(e){const{properties:t}=this,i=U3(e??j3.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,lineDash:i,lineDashOffset:s,stroke:o,strokeOpacity:a,strokeWidth:n}=this.properties,{size:r,shape:l,fill:c="transparent",fillOpacity:h}=t,d=this.getStylerResult({},e);return d.marker??(d.marker={}),{lineDash:d.lineDash??i,lineDashOffset:d.lineDashOffset??s,stroke:d.stroke??o,strokeOpacity:d.strokeOpacity??a,strokeWidth:d.strokeWidth??n,marker:{enabled:d.marker.enabled??t.enabled,fill:d.marker.fill??c,fillOpacity:d.marker.fillOpacity??h,shape:d.marker.shape??l,size:d.marker.size??r,lineDash:d.marker.lineDash??t.lineDash??i,lineDashOffset:d.marker.lineDashOffset??t.lineDashOffset??s,stroke:d.marker.stroke??t.stroke??o,strokeOpacity:d.marker.strokeOpacity??t.strokeOpacity??a,strokeWidth:d.marker.strokeWidth??t.strokeWidth??n}}}};vg.className="RadarLineSeries",vg.type="radar-line";import{_ModuleSupport as Y3}from"ag-charts-community";import{commonSeriesOptionsDefs as X3,constant as Z3,required as Dg,string as ca,undocumented as QM}from"ag-charts-core";var{radarLineSeriesThemeableOptionsDef:Q3}=Y3,Mg={...X3,...Q3,type:Dg(Z3("radar-line")),angleKey:Dg(ca),radiusKey:Dg(ca),angleName:ca,radiusName:ca,legendItemName:ca};Mg.angleKeyAxis=QM(ca),Mg.radiusKeyAxis=QM(ca);var qM={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,version:G3,dependencies:[K3],options:Mg,defaultAxes:{angle:{type:ZM.ANGLE_CATEGORY},radius:{type:ZM.RADIUS_NUMBER}},axisKeys:{[XM.Angle]:"angleKeyAxis",[XM.Radius]:"radiusKeyAxis"},themeTemplate:a3,create:e=>new vg(e)};import{PolarChartModule as q3,VERSION as J3}from"ag-charts-community";import{ChartAxisDirection as JM,POLAR_AXIS_TYPE as ek}from"ag-charts-core";import{_ModuleSupport as Ir}from"ag-charts-community";import{ChartAxisDirection as ss,angleBetween as e$,isDefined as t$,isGradientFill as tk}from"ag-charts-core";import{_ModuleSupport as i$}from"ag-charts-community";import{Property as Le}from"ag-charts-core";var{SeriesProperties:s$,makeSeriesTooltip:o$,Label:a$}=i$,Me=class extends s${constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new a$,this.tooltip=o$()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r,opacity:1}}};u([Le],Me.prototype,"angleKey",2),u([Le],Me.prototype,"radiusKey",2),u([Le],Me.prototype,"angleName",2),u([Le],Me.prototype,"radiusName",2),u([Le],Me.prototype,"angleKeyAxis",2),u([Le],Me.prototype,"radiusKeyAxis",2),u([Le],Me.prototype,"legendItemName",2),u([Le],Me.prototype,"fill",2),u([Le],Me.prototype,"fillOpacity",2),u([Le],Me.prototype,"stroke",2),u([Le],Me.prototype,"strokeWidth",2),u([Le],Me.prototype,"strokeOpacity",2),u([Le],Me.prototype,"lineDash",2),u([Le],Me.prototype,"lineDashOffset",2),u([Le],Me.prototype,"cornerRadius",2),u([Le],Me.prototype,"styler",2),u([Le],Me.prototype,"itemStyler",2),u([Le],Me.prototype,"rotation",2),u([Le],Me.prototype,"stackGroup",2),u([Le],Me.prototype,"normalizedTo",2),u([Le],Me.prototype,"label",2),u([Le],Me.prototype,"tooltip",2);import{_ModuleSupport as n$}from"ag-charts-community";var{SectorBox:ik,motion:r$}=n$;function l$(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.innerRadius)||Number.isNaN(e.previousDatum.outerRadius))return"added";if(Number.isNaN(t.innerRadius)||Number.isNaN(t.outerRadius))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function sk(e){return{toFn:(s,o,a)=>{let n,r,l,c,h;return a==="removed"?(n=e,r=e,l=o.innerRadius,c=o.outerRadius,h=new ik(n,r,l,c)):(n=o.startAngle,r=o.endAngle,l=Number.isNaN(o.innerRadius)?s.innerRadius:o.innerRadius,c=Number.isNaN(o.outerRadius)?s.outerRadius:o.outerRadius,h=o.clipSector),{startAngle:n,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,o,a)=>{a=l$(s,o,a);let n,r,l,c,h;a==="removed"||a==="updated"?(n=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(n=e,r=e,l=o.innerRadius,c=o.outerRadius),h??(h=new ik(n,r,l,c));const d=r$.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:n,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function c$(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:h$,DEFAULT_POLAR_DIRECTION_NAMES:d$,PolarAxis:u$,diff:p$,groupAccumulativeValueProperty:ok,keyProperty:g$,normaliseGroupTo:m$,valueProperty:y$,fixNumericExtent:f$,resetLabelFn:x$,seriesLabelFadeInAnimation:S$,seriesLabelFadeOutAnimation:b$,animationValidation:v$,createDatumId:D$,CategoryScale:M$,Sector:k$,SectorBox:A$,motion:ak,updateLabelNode:nk,getItemStyles:I$}=Ir,N$=class extends Ir.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},kg=class extends Ir.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:h$,propertyNames:d$,canHaveAxes:!0,animationResetFns:{item:c$,label:x$}}),this.properties=new Me,this.NodeEvent=N$,this.groupScale=new M$,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new k$}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===ss.Angle){const s=t.getDomain(this,"angleValue-end","value",i).domain,o=[Math.min(s[0],0),Math.max(s[1],0)];return{domain:f$(o)}}else return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,o=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),n=`${a}-trailing`,r=[];t$(s)&&r.push(m$([a,n],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&r.push(p$(this.id,this.processedData)),o&&r.push(v$());const l=this.visible?{}:{forceValue:0},c=this.axes[ss.Radius]?.scale.type,h=this.axes[ss.Angle]?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[g$(i,c,{id:"radiusValue",allowNullKey:d}),y$(t,h,{id:"angleValue-raw",invalidValue:null,...l}),...ok(t,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...ok(t,"trailing",{id:"angleValue-start",invalidValue:null,groupId:n,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[ss.Radius];return e instanceof u$?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||e?.type!=="grouped")return;const i=this.axes[ss.Angle],s=this.axes[ss.Radius],o=i?.scale,a=s?.scale;if(!o||!a)return;const n=t.resolveKeysById(this,"radiusValue",e),r=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof Mo&&(d=s.groupPaddingInner);const{groupScale:p}=this,{index:g,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);p.domain=Array.from({length:m}).map((E,w)=>String(w)),p.range=[0,Math.abs(a.bandwidth??0)],p.paddingInner=m>1?d:0;const y=p.bandwidth>=1?p.bandwidth:p.rawBandwidth,S=i.isReversed(),x=s.isReversed(),b=x?this.radius:this.getAxisInnerRadius(),D=(x?this.getAxisInnerRadius():this.radius)+b,v=this.getSeriesDomain(ss.Angle).domain,{angleKey:M,radiusKey:A,angleName:I,radiusName:k,legendItemName:N,label:L}=this.properties,T=(E,w,z,B)=>{const K=this.getLabelText(w,E,M,"angle",v,L,{value:w,datum:E,angleKey:M,radiusKey:A,angleName:I,radiusName:k,legendItemName:N});if(K)return{x:z,y:B,text:K,textAlign:"center",textBaseline:"middle"}},P=[],O=I$((E,w,z)=>xn(this,E,w,z)),C={itemId:A,nodeData:P,labelData:P,styles:O};if(!this.visible)return C;const{dataSources:R}=e,V=R.get(this.id)?.data??[];for(const{datumIndex:E,group:w}of t.forEachGroupDatum(this,e)){const z=V[E],B=n[E];if(B===void 0&&!this.properties.allowNullKeys)return;const K=c[E],_=r[E],j=l[E],Z=K>=0&&!Object.is(K,-0),U=w.aggregation[h][Z?1:0],ie=Z===S;let ae=o.convert(_,{clamp:!0}),re=o.convert(j,{clamp:!0}),xe=o.convert(0,{clamp:!0}),et=o.convert(U,{clamp:!0});ie&&([xe,et]=[et,xe],[ae,re]=[re,ae]);const se=D-a.convert(B)+p.convert(String(g)),Q=se+y,ze=(se+Q)/2,tt=ae+e$(ae,re)/2,ce=Math.cos(tt)*ze,ue=Math.sin(tt)*ze,oe=this.properties.label.enabled?T(z,K,ce,ue):void 0,Ce=new A$(ae,re,se,Q);P.push({series:this,datum:z,datumIndex:E,point:{x:ce,y:ue,size:0},midPoint:{x:ce,y:ue},label:oe,angleValue:K,radiusValue:B,innerRadius:se,outerRadius:Q,startAngle:xe,endAngle:et,clipSector:Ce,reversed:ie,index:E})}return C}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){let i=[];const s=this.ctx.highlightManager?.getActiveHighlight();t?s?.datum&&s.series===this&&i.push(s):i=this.nodeData;const{contextNodeData:o}=this;if(!o)return;const a=this.ctx.highlightManager.getActiveHighlight(),n=this.getShapeFillBBox(),r=this.hasItemStylers();e.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const h=Un(c);if(h==null)return;if(r){const y=this.getHighlightState(s,t,c.datumIndex);c.style=xn(this,c,t,y)}const d=c.style??o.styles[this.getHighlightState(a,t,c.datumIndex)],p=d.cornerRadius,g=d.fill,m=tk(g)&&g.bounds!=="item"?{centerX:0,centerY:0}:void 0;l.setStyleProperties(d,n,m),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=h.reversed?p:0,l.startOuterCornerRadius=h.reversed?p:0,l.endInnerCornerRadius=h.reversed?0:p,l.endOuterCornerRadius=h.reversed?0:p,t&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.clipSector=c.clipSector,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius)})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?t:void 0,s=i?[i]:[];this.labelSelection.update(this.nodeData).each((o,a)=>{nk(this,o,e,e.label,a.label,!1,t),o.fillOpacity=this.getHighlightStyle(!1,a.datumIndex).opacity??1}),this.highlightLabelSelection.update(s,void 0,o=>this.getDatumId(o)).each((o,a)=>{nk(this,o,e,e.label,a.label,!0,t),o.fillOpacity=this.getHighlightStyle(!0,a.datumIndex).opacity??1})}getBarTransitionFunctions(){const e=this.axes[ss.Angle]?.scale;let t=0;if(!e)return sk(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),sk(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();ak.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),S$(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();ak.fromToMotion(this.id,"datums",t,[e],i),b$(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=a,p=o[ss.Angle],g=o[ss.Radius],m=this.nodeData?.[e];if(!i||!s||!p||!g||!m)return;const y=s.dataSources.get(this.id)?.data[e],S=i.resolveKeysById(this,"radiusValue",s)[e],x=i.resolveColumnById(this,"angleValue-raw",s)[e];if(S===void 0&&!this.properties.allowNullKeys)return;const b=xn(this,m,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(g,"tooltip",S,y,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:n,value:this.getAxisValueText(p,"tooltip",x,y,n,void 0),missing:Ir.isTooltipValueMissing(x)}]},{seriesId:t,datum:y,title:r,angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...b})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n}=og(this,!1,Ir.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n};return tk(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{angleKey:s,angleName:o,legendItemName:a,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:a??o??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!n}]}getDatumId(e){return D$(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};kg.className="RadialBarSeries",kg.type="radial-bar";import{_ModuleSupport as L$}from"ag-charts-community";import{boolean as rk,commonSeriesOptionsDefs as T$,constant as C$,number as w$,required as Ag,string as uo,undocumented as lk}from"ag-charts-core";var{radialBarSeriesThemeableOptionsDef:O$}=L$,Ig={...T$,...O$,type:Ag(C$("radial-bar")),angleKey:Ag(uo),radiusKey:Ag(uo),angleName:uo,radiusName:uo,legendItemName:uo,grouped:rk,stacked:rk,stackGroup:uo,normalizedTo:w$};Ig.angleKeyAxis=lk(uo),Ig.radiusKeyAxis=lk(uo);import{FILL_GRADIENT_CONIC_SERIES_DEFAULTS as E$,FILL_IMAGE_DEFAULTS as P$,FILL_PATTERN_DEFAULTS as R$,LABEL_BOXING_DEFAULTS as _$,MULTI_SERIES_HIGHLIGHT_STYLE as z$,POLAR_AXIS_TYPE as B$}from"ag-charts-core";var V$={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",E$],["image",P$],["pattern",R$]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{..._$,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:z$},axes:{[B$.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},ck={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:J3,dependencies:[q3],options:Ig,defaultAxes:{angle:{type:ek.ANGLE_NUMBER},radius:{type:ek.RADIUS_CATEGORY}},axisKeys:{[JM.Angle]:"angleKeyAxis",[JM.Radius]:"radiusKeyAxis"},themeTemplate:V$,create:e=>new kg(e)};import{PolarChartModule as F$,VERSION as H$}from"ag-charts-community";import{ChartAxisDirection as hk,POLAR_AXIS_TYPE as dk}from"ag-charts-core";import{_ModuleSupport as K$}from"ag-charts-community";import{ChartAxisDirection as G$}from"ag-charts-core";import{Property as uk}from"ag-charts-core";var Ng=class extends fe{};u([uk],Ng.prototype,"columnWidthRatio",2),u([uk],Ng.prototype,"maxColumnWidthRatio",2);var{PolarAxis:W$,RadialColumnShape:j$,getRadialColumnWidth:$$}=K$,Lg=class extends gM{constructor(e){super(e,{animationResetFns:{item:lj}}),this.properties=new Ng}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new j$}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return rj(e)}isRadiusAxisCircle(){const e=this.axes[G$.Radius];return e instanceof W$?e.shape==="circle":!1}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return $$(e,t,this.radius,i,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};Lg.className="RadialColumnSeries",Lg.type="radial-column";import{_ModuleSupport as U$}from"ag-charts-community";import{boolean as pk,commonSeriesOptionsDefs as Y$,constant as X$,number as Z$,required as Tg,string as po,undocumented as gk}from"ag-charts-core";var{radialColumnSeriesThemeableOptionsDef:Q$}=U$,Cg={...Y$,...Q$,type:Tg(X$("radial-column")),angleKey:Tg(po),radiusKey:Tg(po),angleName:po,radiusName:po,legendItemName:po,grouped:pk,stacked:pk,stackGroup:po,normalizedTo:Z$};Cg.angleKeyAxis=gk(po),Cg.radiusKeyAxis=gk(po);import{FILL_GRADIENT_RADIAL_SERIES_DEFAULTS as q$,FILL_IMAGE_DEFAULTS as J$,FILL_PATTERN_DEFAULTS as e5,LABEL_BOXING_DEFAULTS as t5,MULTI_SERIES_HIGHLIGHT_STYLE as i5,POLAR_AXIS_SHAPE as mk,POLAR_AXIS_TYPE as yk}from"ag-charts-core";var s5={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",q$],["image",J$],["pattern",e5]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...t5,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:i5},axes:{[yk.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:mk.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[yk.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:mk.CIRCLE},innerRadiusRatio:.5}}},fk={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:H$,dependencies:[F$],options:Cg,defaultAxes:{angle:{type:dk.ANGLE_CATEGORY},radius:{type:dk.RADIUS_NUMBER}},axisKeys:{[hk.Angle]:"angleKeyAxis",[hk.Radius]:"radiusKeyAxis"},themeTemplate:s5,create:e=>new Lg(e)};import{VERSION as o5}from"ag-charts-community";import{FONT_SIZE_RATIO as a5,LABEL_BOXING_DEFAULTS as xk,SAFE_RANGE2_OPERATION as n5,SAFE_STROKE_FILL_OPERATION as r5,radialGaugeSeriesOptionsDef as l5}from"ag-charts-core";import{_ModuleSupport as ha}from"ag-charts-community";import{StateMachine as c5,isBetweenAngles as nh,isNumberEqual as Sk,mergeDefaults as h5,normalizeAngle360 as d5,normalizeAngle360Inclusive as bk,tickFormat as u5,toPlainText as p5,toRadians as Nr}from"ag-charts-core";import{_ModuleSupport as g5}from"ag-charts-community";var{SvgPath:m5,Rotatable:y5,Translatable:f5,Scalable:x5}=g5,wg=class extends y5(x5(f5(m5))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};wg.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";import{_ModuleSupport as rh}from"ag-charts-community";import{BaseProperties as Lr,PropertiesArray as Og,Property as F,normalizeAngle360 as S5,normalizeAngle360Inclusive as b5,toDegrees as v5}from"ag-charts-core";var{getColorStops:D5}=rh,{makeSeriesTooltip:M5,SeriesProperties:k5,AxisLabel:A5,Label:I5}=rh,vk=class extends I5{};u([F],vk.prototype,"spacing",2);var dt=class extends Lr{constructor(){super(...arguments),this.label=new vk}getStyle(){const{fill:e="black",fillOpacity:t=1,stroke:i="black",strokeWidth:s=0,strokeOpacity:o=1,lineDash:a=[0],lineDashOffset:n=0}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}}};u([F],dt.prototype,"text",2),u([F],dt.prototype,"value",2),u([F],dt.prototype,"shape",2),u([F],dt.prototype,"placement",2),u([F],dt.prototype,"spacing",2),u([F],dt.prototype,"size",2),u([F],dt.prototype,"rotation",2),u([F],dt.prototype,"fill",2),u([F],dt.prototype,"fillOpacity",2),u([F],dt.prototype,"stroke",2),u([F],dt.prototype,"strokeWidth",2),u([F],dt.prototype,"strokeOpacity",2),u([F],dt.prototype,"lineDash",2),u([F],dt.prototype,"lineDashOffset",2),u([F],dt.prototype,"label",2);var Ci=class extends Lr{constructor(){super(...arguments),this.enabled=!0,this.fills=new Og(rh.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t){const{enabled:i,fill:s,fills:o,fillMode:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:i?s??kk(o,a,e,t):"none",fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};u([F],Ci.prototype,"enabled",2),u([F],Ci.prototype,"fills",2),u([F],Ci.prototype,"fillMode",2),u([F],Ci.prototype,"fill",2),u([F],Ci.prototype,"fillOpacity",2),u([F],Ci.prototype,"stroke",2),u([F],Ci.prototype,"strokeWidth",2),u([F],Ci.prototype,"strokeOpacity",2),u([F],Ci.prototype,"lineDash",2),u([F],Ci.prototype,"lineDashOffset",2);var Tr=class extends Lr{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};u([F],Tr.prototype,"values",2),u([F],Tr.prototype,"step",2),u([F],Tr.prototype,"minSpacing",2),u([F],Tr.prototype,"maxSpacing",2);var N5=class extends A5{},Ct=class extends Lr{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Og(rh.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new Tr,this.label=new N5}getStyle(e,t,i){const{fill:s,fills:o,defaultFill:a,fillMode:n,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:p}=this;return{fill:s??(e&&o.length===0?a:void 0)??kk(o,n,t,i),fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:p}}};u([F],Ct.prototype,"min",2),u([F],Ct.prototype,"max",2),u([F],Ct.prototype,"fills",2),u([F],Ct.prototype,"fillMode",2),u([F],Ct.prototype,"fill",2),u([F],Ct.prototype,"fillOpacity",2),u([F],Ct.prototype,"stroke",2),u([F],Ct.prototype,"strokeWidth",2),u([F],Ct.prototype,"strokeOpacity",2),u([F],Ct.prototype,"lineDash",2),u([F],Ct.prototype,"lineDashOffset",2),u([F],Ct.prototype,"defaultFill",2),u([F],Ct.prototype,"interval",2),u([F],Ct.prototype,"label",2);var wi=class extends Lr{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};u([F],wi.prototype,"enabled",2),u([F],wi.prototype,"radiusRatio",2),u([F],wi.prototype,"spacing",2),u([F],wi.prototype,"fill",2),u([F],wi.prototype,"fillOpacity",2),u([F],wi.prototype,"stroke",2),u([F],wi.prototype,"strokeWidth",2),u([F],wi.prototype,"strokeOpacity",2),u([F],wi.prototype,"lineDash",2),u([F],wi.prototype,"lineDashOffset",2);var Dk=class extends Wa{};u([F],Dk.prototype,"text",2);var Mk=class extends Jl{};u([F],Mk.prototype,"text",2);var Re=class extends k5{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new yr,this.defaultColorRange=[],this.targets=new Og(dt),this.defaultTarget=new dt,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new Ct,this.bar=new Ci,this.needle=new wi,this.label=new Dk,this.secondaryLabel=new Mk,this.tooltip=M5()}};u([F],Re.prototype,"value",2),u([F],Re.prototype,"startAngle",2),u([F],Re.prototype,"endAngle",2),u([F],Re.prototype,"segmentation",2),u([F],Re.prototype,"defaultColorRange",2),u([F],Re.prototype,"targets",2),u([F],Re.prototype,"defaultTarget",2),u([F],Re.prototype,"outerRadiusRatio",2),u([F],Re.prototype,"innerRadiusRatio",2),u([F],Re.prototype,"outerRadius",2),u([F],Re.prototype,"innerRadius",2),u([F],Re.prototype,"cornerRadius",2),u([F],Re.prototype,"cornerMode",2),u([F],Re.prototype,"spacing",2),u([F],Re.prototype,"scale",2),u([F],Re.prototype,"bar",2),u([F],Re.prototype,"needle",2),u([F],Re.prototype,"label",2),u([F],Re.prototype,"secondaryLabel",2),u([F],Re.prototype,"tooltip",2);function kk(e,t,i,s){const{domain:o,range:a}=s,[n,r]=a,l=S5((n+r)/2+Math.PI),c=b5(r-n);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:D5(e,i,o,t).map(({color:d,stop:p})=>(p=Math.min(Math.max(p,0),1),p=(n+c*p-l)/(2*Math.PI),p=(p%1+1)%1,{stop:p,color:d})),bounds:"series",rotation:v5(l)+90}}import{_ModuleSupport as L5}from"ag-charts-community";import{toPlainText as Eg}from"ag-charts-core";var{SectorBox:Pg}=L5;function T5(e){const{startAngle:t,endAngle:i,clipStartAngle:s,clipEndAngle:o,innerRadius:a,outerRadius:n}=e;if(!(s==null||o==null))return new Pg(Math.max(s,t),Math.min(o,i),a,n)}function Ak(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function Rg(e){return e.clipStartAngle!=null&&e.clipEndAngle!=null}function _g(e,t){const{clipStartAngle:i,clipEndAngle:s,innerRadius:o,outerRadius:a}=e;return new Pg(i,t?i:s,o,a)}function Ik(e,t){const i=e?"initial":"update";return{node:{fromFn(a,n){const r=a.previousDatum;let{startAngle:l,endAngle:c}=r??n;const h=r!=null&&Rg(r)?_g(r,e):void 0,d=Rg(n)?_g(n,e):void 0;let p;return h!=null&&d!=null?p=h:h==null&&d!=null?(p=d,l=n.startAngle,c=n.endAngle):h!=null&&d==null?(p=void 0,l=n.startAngle,c=n.endAngle):e&&(c=l),{startAngle:l,endAngle:c,clipSector:p,phase:i}},toFn(a,n){const{startAngle:r,endAngle:l}=n;let c;return Rg(n)&&(c=_g(n,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(a,n){const{startAngle:r,endAngle:l}=n;let{clipSector:c}=n;c!=null&&(c=new Pg(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||Ak(r,l,c);a.startAngle=r,a.endAngle=l,a.clipSector=c,a.visible=h}},needle:{fromFn(a){let{angle:n}=a.previousDatum??a.datum;return e&&(n=t),{rotation:n,phase:i}},toFn(a,n){const{angle:r}=n;return{rotation:r}}}}}function zg(e,t){const{startAngle:i,endAngle:s}=t,o=T5(t),a=o==null||Ak(i,s,o);return{startAngle:i,endAngle:s,clipSector:o,visible:a}}function Nk(e,t){const{angle:i}=t;return{rotation:i}}var C5={top:0,middle:.5,bottom:1};function w5(e,t,i,s,o,a){const{padding:n,textAlign:r,verticalAlign:l}=s;let c,h;if(i.each((v,M)=>{M.label==="primary"?c=M:M.label==="secondary"&&(h=M)}),c==null)return;const d=mr(e.id,t,c,a?.label);if(d==null)return;const p=h==null?void 0:mr(e.id,t,h,a?.secondaryLabel),g={padding:n},m=r==="center"?2:1,y=l==="middle"?2:1,S=v=>({width:Math.sqrt(Math.max(o**2-(v/y)**2,0))*m,height:Math.min(v,y*o),meta:null});let x,b,f;if(h!=null&&p!=null){const v=Jx(Eg(d),c,Eg(p),h,g,S);x=v?.label,b=v?.secondaryLabel,f=v?.height??0}else{const v=tr(Eg(d),c,g,S);x=v?.[0],b=void 0,f=v?.[0].height??0}const D=f*C5[l];i.each((v,M)=>{let A;if(M.label==="primary"?A=x:M.label==="secondary"&&(A=b),A==null){v.visible=!1;return}v.visible=!0,v.text=A.text,v.fontSize=A.fontSize,v.lineHeight=A.lineHeight,v.textAlign=r,v.textBaseline="middle";const I=M.label==="primary"?A.height/2:f-A.height/2;v.y=M.centerY+I-D,v.x=M.centerX})}var{fromToMotion:Cr,resetMotion:Lk,SeriesNodePickMode:Tk,createDatumId:Bg,sectorBox:O5,BBox:E5,Group:go,PointerEvents:lh,Selection:mo,Sector:P5,SectorBox:R5,Transformable:_5,TransformableText:z5,Text:Ck,Marker:B5}=ha,V5={inside:90,middle:0,outside:-90},F5=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],H5=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],Vg=class extends ha.Series{constructor(e){super({moduleCtx:e,pickModes:[Tk.EXACT_SHAPE_MATCH,Tk.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new Re,this.scale=new Nm,this.scaleGroup=this.contentGroup.appendChild(new go({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new go({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new go({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new go({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new go({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new go({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new go({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new go({name:"tickGroup"})),this.scaleSelection=mo.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=mo.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=mo.select(this.itemNeedleGroup,wg),this.targetSelection=mo.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=mo.select(this.itemTargetLabelGroup,Ck),this.labelSelection=mo.select(this.itemLabelGroup,Ck),this.highlightTargetSelection=mo.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=mo.select(this.tickGroup,ha.TransformableText),this.datumUnion=new qv,this.animationState=new c5("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=lh.None,this.tickGroup.pointerEvents=lh.None,this.itemNeedleGroup.pointerEvents=lh.None,this.itemLabelGroup.pointerEvents=lh.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new P5}markerFactory(){const e=new B5;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return eD(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:o,outerRadius:a}=this.properties,{min:n,max:r,label:l,interval:c}=o,h=Nr(t.startAngle-90),d=Nr(t.endAngle-90),g=bk(d-h)>Math.PI,m=g||nh(1.5*Math.PI,h,d),y=g||nh(0*Math.PI,h,d),S=g||nh(.5*Math.PI,h,d),x=g||nh(1*Math.PI,h,d);let b;x&&!y?b="right":!x&&y?b="left":b="center";let f;m&&!S?f="bottom":!m&&S?f="top":f="middle";const D=O5({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),v=-(D.x+D.width/2)*2,M=-(D.y+D.height/2)*2,A=Math.min(i/D.width,s/D.height);e.domain=[n,r],e.range=[h,d],e.arcLength=A/2;const{maxSpacing:I,minSpacing:k}=c,{arcLength:N}=e,L=I?Math.floor(N/I):1,T=k?Math.floor(N/k):1/0,P=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),O=Math.max(L,Math.min(T,P)),C=c.values??e.ticks({nice:[!1,!1],interval:c.step,minTickCount:L,maxTickCount:T,tickCount:O})?.ticks??[],R=u5(C,typeof l.format=="string"?l.format:void 0),V=[];for(const[K,_]of C.entries()){let j;l.formatter&&(j=ur(this.ctx,l.formatter,{value:_,index:K,domain:e.domain,boundSeries:void 0})),j??(j=R?.(_)),j!=null&&V.push({index:K,value:_,text:j})}const E=.5*A,w=l.enabled&&a==null&&V.length>0?this.getTickLabelInset({tickData:V,radius:E,centerXOffset:v,centerYOffset:M,seriesRectWidth:i,seriesRectHeight:s,spacing:l.spacing,rotation:Nr(l.rotation??0)}):0,z=Math.max(E-w,0),B=a??z;return this.centerX=i/2+v*B,this.centerY=s/2+M*B,this.radius=B,this.textAlign=b,this.verticalAlign=f,V}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this,s=new E5(e-i,t-i,2*i,2*i);return{series:s,axis:s}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return e.targets.map(i=>{const{text:s=t.text,value:o=t.value??0,shape:a=t.shape??"triangle",rotation:n=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:d=t.label.color??"black",fontStyle:p=t.label.fontStyle??"normal",fontWeight:g=t.label.fontWeight??"normal",fontSize:m=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:S=t.label.spacing??0}=i.label;return{text:s,value:o,shape:a,placement:r,spacing:l,size:c,rotation:n,label:{enabled:h,color:d,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y,spacing:S},style:i.getStyle()}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:o}=i,{placement:a,spacing:n,size:r}=e,l=t*o,c=t*s;switch(a){case"inside":return Math.max(c-n-r/2,0);case"outside":return l+n+r/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:o,label:a}=e,{spacing:n,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=a,p=t.convert(i),g=Math.trunc(d5(p)/(Math.PI/2)),m=s/2+n;let y,S,x,b;switch(o){case"outside":({textAlign:y,textBaseline:S}=F5[g]),x=m*Math.cos(p),b=m*Math.sin(p);break;case"inside":({textAlign:y,textBaseline:S}=H5[g]),x=-m*Math.cos(p),b=-m*Math.sin(p);break;default:y="center",S="bottom",x=0,b=-m;break}return{offsetX:x,offsetY:b,fill:r,textAlign:y,textBaseline:S,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:o,centerX:a,centerY:n}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:p,needle:g,bar:m,scale:y,label:S,secondaryLabel:x}=s,{outerRadius:b=o*c,innerRadius:f=o*l,defaultColorRange:D}=s,v=this.getTargets(),M=[],A=[],I=[],k=[],N=[],L=p==="item",T=i.convert(i.domain[0]),P=i.convert(r),O=Math.ceil(bk(P-T)*o);let C=h.enabled?h.interval.getSegments(i,O):void 0;const R=m.getStyle(D,i),V=y.getStyle(m.enabled,D,i);if(C==null&&L){const E=Math.min(...i.domain),w=Math.max(...i.domain),z={value:r,segmentStart:E,segmentEnd:w},K=Math.min(d,(b-f)/2)/((f+b)/2);M.push({series:this,itemId:"value",datum:z,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:b,innerRadius:f,startAngle:T-K,endAngle:P+K,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:R}),N.push({series:this,itemId:"scale",datum:z,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:b,innerRadius:f,startAngle:i.range[0]-K,endAngle:i.range[1]+K,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:V})}else{C??(C=i.domain);for(let E=0;E<C.length-1;E++){const w=C[E],z=C[E+1],B={value:r,segmentStart:w,segmentEnd:z},K=E===0,_=E===C.length-2,j=i.convert(w),Z=i.convert(z);M.push({series:this,itemId:`value-${E}`,datum:B,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:b,innerRadius:f,startAngle:j,endAngle:Z,clipStartAngle:T,clipEndAngle:P,startCornerRadius:L||K?d:0,endCornerRadius:L||_?d:0,style:R}),N.push({series:this,itemId:`scale-${E}`,datum:B,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:b,innerRadius:f,startAngle:j,endAngle:Z,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:L||K?d:0,endCornerRadius:L||_?d:0,style:V})}}if(!g.enabled&&S.enabled){const{text:E,color:w,fontSize:z,minimumFontSize:B,fontStyle:K,fontWeight:_,fontFamily:j,lineHeight:Z,formatter:U=ie=>this.formatLabel(ie.value)}=S;k.push({label:"primary",centerX:a,centerY:n,text:E,value:r,fill:w,fontSize:z,minimumFontSize:B,fontStyle:K,fontWeight:_,fontFamily:j,lineHeight:Z,formatter:U})}if(!g.enabled&&x.enabled){const{text:E,color:w,fontSize:z,minimumFontSize:B,fontStyle:K,fontWeight:_,fontFamily:j,lineHeight:Z,formatter:U}=x;k.push({label:"secondary",centerX:a,centerY:n,text:E,value:r,fill:w,fontSize:z,minimumFontSize:B,fontStyle:K,fontWeight:_,fontFamily:j,lineHeight:Z,formatter:U})}if(g.enabled){let E=g.radiusRatio==null?f:o*g.radiusRatio;E=Math.max(E-g.spacing,0);const w=i.convert(r);I.push({centerX:a,centerY:n,radius:E,angle:w,series:this})}for(let E=0;E<v.length;E+=1){const w=v[E],{value:z,text:B,size:K,shape:_,style:j}=w;if(z<Math.min(...i.domain)||z>Math.max(...i.domain))continue;const Z=this.getTargetRadius(w),U=i.convert(z),ie=Nr(w.rotation+V5[w.placement]);A.push({series:this,itemId:`target-${E}`,midPoint:{x:Z*Math.cos(U)+a,y:Z*Math.sin(U)+n},datum:{value:z},datumIndex:{type:1,index:E},type:1,value:z,text:B,centerX:a,centerY:n,shape:_,radius:Z,angle:U,rotation:ie,size:K,label:this.getTargetLabel(w),style:j})}return{itemId:t,nodeData:M,needleData:I,targetData:A,labelData:k,scaleData:N,tickData:e}}findNodeDatum(e){return nD(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:s,targetSelection:o,targetLabelSelection:a,scaleSelection:n,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],p=this.contextNodeData?.needleData??[],g=this.contextNodeData?.targetData??[],m=this.contextNodeData?.scaleData??[],y=this.contextNodeData?.tickData??[],S=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:m,scaleSelection:n}),this.updateScaleNodes({scaleSelection:n}),this.needleSelection=this.updateNeedleSelection({needleData:p,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:g,targetSelection:o}),this.updateTargetStyles({targetSelection:o,isHighlight:!1}),this.updateTargetNodes({targetSelection:o}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:g,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:S==null?[]:[S],targetSelection:r}),this.updateTargetStyles({targetSelection:r,isHighlight:!0}),this.updateTargetNodes({targetSelection:r}),this.tickSelection=this.updateTickSelection({tickData:y,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Bg(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{segmentation:o}=s,a=o.spacing??0,n=i.animationManager.isSkipped(),r=this.getShapeFillBBox();t.each((l,c)=>{const{centerX:h,centerY:d,innerRadius:p,outerRadius:g,startCornerRadius:m,endCornerRadius:y}=c;l.centerX=h,l.centerY=d,l.innerRadius=p,l.outerRadius=g,l.pointerEvents=this.properties.bar.enabled?ha.PointerEvents.All:ha.PointerEvents.None,l.setStyleProperties(c.style,r),l.startOuterCornerRadius=m,l.startInnerCornerRadius=m,l.endOuterCornerRadius=y,l.endInnerCornerRadius=y,l.radialEdgeInset=(a+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,c.midPoint=l.getBBox().computeCenter(),(n||l.previousDatum==null)&&l.setProperties(zg(l,c))}),this.datumUnion.update(t,this.itemGroup,ha.Sector,(l,c,h)=>{l.clipSector??(l.clipSector=new R5(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),l.centerX=c.centerX,l.centerY=c.centerY,l.outerRadius=l.clipSector.outerRadius=c.outerRadius,l.innerRadius=l.clipSector.innerRadius=c.innerRadius,l.startAngle=l.clipSector.startAngle=c.startAngle,l.startInnerCornerRadius=c.startInnerCornerRadius,l.startOuterCornerRadius=c.startOuterCornerRadius,l.endAngle=h.endAngle,l.clipSector.endAngle=h.clipSector?.endAngle??h.endAngle,l.endInnerCornerRadius=h.endInnerCornerRadius,l.endOuterCornerRadius=h.endOuterCornerRadius,l.pointerEvents=ha.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>Bg(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{segmentation:i}=this.properties,s=i.spacing??0,o=this.getShapeFillBBox();t.each((a,n)=>{const{centerX:r,centerY:l,innerRadius:c,outerRadius:h,startCornerRadius:d,endCornerRadius:p}=n;a.centerX=r,a.centerY=l,a.innerRadius=c,a.outerRadius=h,a.setStyleProperties(n.style,o),a.startOuterCornerRadius=d,a.startInnerCornerRadius=d,a.endOuterCornerRadius=p,a.endInnerCornerRadius=p,a.radialEdgeInset=(s+a.strokeWidth)/2,a.concentricEdgeInset=a.strokeWidth/2,a.setProperties(zg(a,n))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>Bg(0))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((h,d)=>{const{centerX:p,centerY:g,radius:m}=d,y=m*2;h.d=wg.defaultPathData,h.setStyleProperties({fill:i,fillOpacity:s,stroke:o,strokeOpacity:a,strokeWidth:n/y,lineDash:r.map(S=>S/y),lineDashOffset:l/y}),h.translationX=p,h.translationY=g,h.scalingX=y,h.scalingY=y,c&&h.setProperties(Nk(h,d))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetStyles({targetSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getTargetStyle(t,s)})}updateTargetNodes({targetSelection:e}){e.each((t,i)=>{const{centerX:s,centerY:o,angle:a,radius:n,shape:r,size:l,rotation:c}=i;t.setStyleProperties(i.style),t.size=l,t.shape=r==="line"?tD:r,t.translationX=s+n*Math.cos(a),t.translationY=o+n*Math.sin(a),t.rotation=a+c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return h5(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{centerX:o,centerY:a,radius:n,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:d,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y,textAlign:S,textBaseline:x}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=o+n*Math.cos(r)+c,i.y=a+n*Math.sin(r)+h,i.text=l,i.fill=d,i.fontStyle=p,i.fontWeight=g,i.fontSize=m,i.fontFamily=y,i.textAlign=S,i.textBaseline=x})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>t.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,o)=>{s.fill=o.fill,s.fontStyle=o.fontStyle,s.fontWeight=o.fontWeight,s.fontFamily=o.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:o,properties:a}=this,{enabled:n,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:p}=a.scale.label,g=Nr(a.scale.label.rotation??0);e.tickSelection.each((m,y)=>{if(!n){m.visible=!1;return}m.visible=!0,m.text=y.text,m.fill=r,m.fontFamily=l,m.fontSize=c,m.fontStyle=h,m.fontWeight=d;const S=t.convert(y.value),{textAlign:x,textBaseline:b}=this.getTickLabelAlign(S),f=s+(i+p)*Math.cos(S),D=o+(i+p)*Math.sin(S);m.textAlign=x,m.textBaseline=b,m.x=f,m.y=D,m.rotationCenterX=f,m.rotationCenterY=D,m.rotation=g})}getTickLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,o;const a=Sk(t,0),n=Sk(i,0),r=t>0&&!a,l=i>0&&!n;return s="right",a?s="center":r&&(s="left"),o="bottom",n?o="middle":l&&(o="top"),{textAlign:s,textBaseline:o}}getTickLabelInset(e){const{tickData:t,radius:i,centerXOffset:s,centerYOffset:o,seriesRectWidth:a,seriesRectHeight:n,spacing:r,rotation:l}=e,{label:c}=this.properties.scale,h=a/2+s*i,d=n/2+o*i,p=new z5;p.fontFamily=c.fontFamily,p.fontSize=c.fontSize,p.fontStyle=c.fontStyle,p.fontWeight=c.fontWeight,p.rotation=l;const g=1e-6;let m=0;for(const y of t){const S=this.scale.convert(y.value),x=Math.cos(S),b=Math.sin(S),f=h+(i+r)*x,D=d+(i+r)*b,{textAlign:v,textBaseline:M}=this.getTickLabelAlign(S);p.text=y.text,p.x=f,p.y=D,p.textAlign=v,p.textBaseline=M,p.rotationCenterX=f,p.rotationCenterY=D;const A=l?_5.toCanvas(p):p.getBBox();if(A==null)continue;const I=A.x,k=A.x+A.width,N=A.y,L=A.y+A.height,T=Math.max(0,-I),P=Math.max(0,k-a),O=Math.max(0,-N),C=Math.max(0,L-n),R=s+x;Math.abs(R)>g&&(P>0&&R>0?m=Math.max(m,P/R):T>0&&R<0&&(m=Math.max(m,T/-R)));const V=o+b;Math.abs(V)>g&&(C>0&&V>0?m=Math.max(m,C/V):O>0&&V<0&&(m=Math.max(m,O/-V)))}return m}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:o}=this,{spacing:a,innerRadiusRatio:n}=this.properties;w5(this,this.ctx,t,{padding:a,textAlign:s,verticalAlign:o},i*n,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Lk([this.datumSelection],zg),Lk([this.needleSelection],Nk),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,s,o,a;if(this.labelSelection.each((n,r)=>{n.opacity=1,r.label==="primary"?(i=n.previousDatum?.value??e.from??r.value,s=r.value):r.label==="secondary"&&(o=n.previousDatum?.value??e.from??r.value,a=r.value)}),!this.labelsHaveExplicitText())if(s==null||a==null)this.formatLabelText();else if(i===s&&o===a)this.formatLabelText({label:s,secondaryLabel:a});else{const n=`${this.id}_labels`;t.animate({id:n,groupId:"label",from:{label:i,secondaryLabel:o},to:{label:s,secondaryLabel:a},phase:e.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:s,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=Ik(!0,this.scale.range[0]);Cr(this.id,"node",e,[this.datumSelection],t,(s,o)=>o.itemId),Cr(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),Cr(this.id,"label",e,[this.labelSelection],Jv,(s,o)=>o.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=Ik(!1,this.scale.range[0]);Cr(this.id,"node",e,[this.datumSelection],t,(s,o)=>o.itemId),Cr(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let o,a,n;if(e.type===0?(o=i.value,a=i.label.text,n=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:o,text:a}=i.targets[e.index],n=this.ctx.localeManager.t("ariaLabelGaugeTarget")),o!=null)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:n,value:this.formatLabel(o)}]},{seriesId:t,title:void 0,datum:void 0,value:o})}pickNodeClosestDatum(e){return oD(this,e)}pickFocus(e){return aD(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((i,s)=>{const o=mr(this.id,this.ctx,s);o!=null&&t.push(p5(o))}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};Vg.className="RadialGaugeSeries",Vg.type="radial-gauge";var wk={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,dependencies:[Yv],version:o5,options:l5,themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},n5]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",r5,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...xk,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...xk,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:a5.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}},create:e=>new Vg(e)};import{VERSION as K5}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as G5,FILL_IMAGE_DEFAULTS as W5,FILL_PATTERN_DEFAULTS as j5,LABEL_BOXING_DEFAULTS as $5,SAFE_FILLS_OPERATION as U5}from"ag-charts-core";import{_ModuleSupport as Y5}from"ag-charts-community";import{Logger as X5,cachedTextMeasurer as Z5,calcLineHeight as Q5,mergeDefaults as ch,toPlainText as q5,wrapText as Fg}from"ag-charts-core";import{_ModuleSupport as J5}from"ag-charts-community";import{SceneChangeDetection as Sn,Vec2 as Je,clamp as eU}from"ag-charts-core";var{BBox:tU,Path:iU}=J5,da=class extends iU{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[]}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new tU(e,i,t,s)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.height-2*this.inset,s=i/2;let o=this.x1+t,a=this.y1+t;e.moveTo(o,a);for(const l of this.elbows)this.updatePathSection(o,a,l.x,l.y,i,-s),o=l.x,a=l.y;const n=this.x2-t,r=this.y2+t;this.updatePathSection(o,a,n,r,i,-s),e.lineTo(n,r+i),o=n,a=r;for(const l of this.elbows.toReversed())this.updatePathSection(o,a,l.x,l.y,i,s),o=l.x,a=l.y;this.updatePathSection(o,a,this.x1+t,this.y1+t,i,s),e.closePath()}updatePathSection(e,t,i,s,o,a){const{path:n}=this,r=Je.from(e,t+a+o/2),l=Je.from(i,s+a+o/2);if(Math.abs(l.y-r.y)<2){n.lineTo(l.x,l.y);return}let c=Je.angle(Je.sub(l,r));c<0&&(c=2*Math.PI+c);const h=0,d=Math.PI/2,p=Math.PI,g=Math.PI*1.5,m=Ok(r,l,0),y=Ok(r,l,o);if(m.radius<o){n.cubicCurveTo((r.x+l.x)/2,r.y,(r.x+l.x)/2,l.y,l.x,l.y);return}c>=g?(n.arc(r.x,t-m.radius,m.radius,d,d+y.angle,!0),n.arc(l.x,s+y.radius,y.radius,g+y.angle,g),n.lineTo(l.x,l.y)):c>h&&c<=d?(n.arc(r.x,t+y.radius,y.radius,g,g+y.angle),n.arc(l.x,s-m.radius,m.radius,d+m.angle,d,!0),n.lineTo(l.x,l.y)):c>d&&c<=p?(n.arc(r.x,t+y.radius,y.radius-o,g,g+y.angle,!0),n.arc(l.x,s-m.radius,m.radius+o,d+m.angle,d),n.lineTo(l.x,l.y)):(n.arc(r.x,t-m.radius,m.radius+o,d,d+m.angle),n.arc(l.x,s+y.radius,y.radius-o,g+y.angle,g,!0),n.lineTo(l.x,l.y))}};u([Sn()],da.prototype,"x1",2),u([Sn()],da.prototype,"x2",2),u([Sn()],da.prototype,"y1",2),u([Sn()],da.prototype,"y2",2),u([Sn()],da.prototype,"height",2),u([Sn()],da.prototype,"inset",2);function Ok(e,t,i){const s=Je.angle(Je.sub(t,e)),o=Je.distance(e,t),a=Je.add(e,Je.rotate(Je.from(o/2,0),s)),n=-1/Je.gradient(e,t),r=Je.intercept(a,n),l=sU(.1,.5,Math.PI/2-Math.abs(Je.gradient(e,t))),c=Je.intersectAtX(n,r,e.x),h=Math.max(i,Je.distance(e,c)*l);return{angle:Je.angle(Je.sub(c,e),Je.sub(c,a))/-(1.1-l),radius:h}}function sU(e,t,i){return eU(e,(t-e)*i+e,t)}import{_ModuleSupport as oU}from"ag-charts-community";import{BaseProperties as Ek,Property as $}from"ag-charts-core";var{FillGradientDefaults:aU,FillPatternDefaults:nU,FillImageDefaults:rU,makeSeriesTooltip:lU,SeriesProperties:cU,Label:hU}=oU,hh=class extends hU{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};u([$],hh.prototype,"spacing",2),u([$],hh.prototype,"placement",2),u([$],hh.prototype,"edgePlacement",2);var Ls=class extends Ek{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};u([$],Ls.prototype,"fill",2),u([$],Ls.prototype,"fillOpacity",2),u([$],Ls.prototype,"stroke",2),u([$],Ls.prototype,"strokeOpacity",2),u([$],Ls.prototype,"strokeWidth",2),u([$],Ls.prototype,"lineDash",2),u([$],Ls.prototype,"lineDashOffset",2),u([$],Ls.prototype,"itemStyler",2);var wt=class extends Ek{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};u([$],wt.prototype,"spacing",2),u([$],wt.prototype,"minSpacing",2),u([$],wt.prototype,"width",2),u([$],wt.prototype,"alignment",2),u([$],wt.prototype,"verticalAlignment",2),u([$],wt.prototype,"sort",2),u([$],wt.prototype,"fill",2),u([$],wt.prototype,"fillOpacity",2),u([$],wt.prototype,"stroke",2),u([$],wt.prototype,"strokeOpacity",2),u([$],wt.prototype,"strokeWidth",2),u([$],wt.prototype,"lineDash",2),u([$],wt.prototype,"lineDashOffset",2),u([$],wt.prototype,"itemStyler",2);var _e=class extends cU{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new aU,this.fillPatternDefaults=new nU,this.fillImageDefaults=new rU,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new hh,this.link=new Ls,this.node=new wt,this.tooltip=lU()}getStyle(e,t,i,s){const{fillOpacity:o,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l,fill:c=t[s%t.length],stroke:h=i[s%t.length]}=e?this.link:this.node;return{fill:c,fillOpacity:o,stroke:h,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}}};u([$],_e.prototype,"nodes",2),u([$],_e.prototype,"fromKey",2),u([$],_e.prototype,"toKey",2),u([$],_e.prototype,"idKey",2),u([$],_e.prototype,"idName",2),u([$],_e.prototype,"labelKey",2),u([$],_e.prototype,"labelName",2),u([$],_e.prototype,"sizeKey",2),u([$],_e.prototype,"sizeName",2),u([$],_e.prototype,"fillGradientDefaults",2),u([$],_e.prototype,"fillPatternDefaults",2),u([$],_e.prototype,"fillImageDefaults",2),u([$],_e.prototype,"defaultColorRange",2),u([$],_e.prototype,"defaultPatternFills",2),u([$],_e.prototype,"fills",2),u([$],_e.prototype,"strokes",2),u([$],_e.prototype,"label",2),u([$],_e.prototype,"link",2),u([$],_e.prototype,"node",2),u([$],_e.prototype,"tooltip",2);var{Transformable:dU,SeriesNodePickMode:Pk,createDatumId:dh,getShapeStyle:Rk,getLabelStyles:uU,Rect:_k,BBox:zk}=Y5,Hg=class extends mv{constructor(e){super({moduleCtx:e,pickModes:[Pk.NEAREST_NODE,Pk.EXACT_SHAPE_MATCH]}),this.properties=new _e}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new da}nodeFactory(){return new _k}createNodeData(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this.properties.node.width,{nodeGraph:i,links:s,maxPathLength:o}=this.getNodeGraph(this.createNode.bind(this,t),this.createLink,{includeCircularReferences:!1}),a=i;if(a.size===0)return;const n=this.initialiseColumns(o);this.assignNodesToColumns(a,n,o);const r=Z5(this.properties.label),{columnLabelInsetBefore:l,columnLabelInsetAfter:c}=this.getColumnLabelInsets(n,r,o),h=(e-t-l-c)/(o-1);this.positionNodesInColumnsX(n,h,l),this.createGhostNodesAndColumnDiffs(a,n),this.weightNodes(n);const d=1,{sizeScale:p,nodeSpacing:g}=this.getScaleAndSpacing(n,d);if(p<0){X5.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}this.positionNodesInColumnsY(n,d,p,g),this.sortAndPositionLinks(a,p);const m=[],y=[];return this.createNodesNodeData(m,a,n,h,r,y),this.createLinksNodeData(m,s,d,p),{itemId:this.id,nodeData:m,labelData:y}}createNode(e,t){return{...t,x:Number.NaN,y:Number.NaN,width:e,height:Number.NaN}}createLink(e){return{...e,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}}initialiseColumns(e){const t=[];for(let i=0;i<e;i+=1)t.push({index:i,size:0,nodes:[],x:0});return t}assignNodesToColumns(e,t,i){const{fromKey:s,toKey:o,sizeKey:a,labelKey:n}=this.properties;for(const r of e.values()){const{datum:l,linksBefore:c,linksAfter:h}=r,d=Math.max(c.reduce((y,{link:S})=>y+S.size,0),h.reduce((y,{link:S})=>y+S.size,0));if(c.length===0&&h.length===0||d===0){r.columnIndex=-1;continue}const p=this.getNodeColumn(t,r,i);l.size=d;const{label:g}=this.properties,m=g.enabled?this.getLabelText(l.label,l.datum,n,"label",[],this.properties.label,{datum:l.datum,value:l.label,fromKey:s,toKey:o,sizeKey:a,size:d}):void 0;l.label=q5(m),p.nodes.push(r),p.size+=d,r.columnIndex=p.index}}getNodeColumn(e,t,i){const{node:{alignment:s}}=this.properties,{linksBefore:o,linksAfter:a,maxPathLengthBefore:n,maxPathLengthAfter:r}=t;let l;switch(s){case"left":l=e[n];break;case"right":l=e[i-1-r];break;case"center":{if(o.length!==0)l=e[n];else if(a.length===0)l=e[0];else{const c=a.reduce((h,d)=>Math.min(h,d.node.maxPathLengthBefore),i)-1;l=e[c]}break}case"justify":{l=a.length===0?e[i-1]:e[n];break}}return l}getColumnLabelInsets(e,t,i){const{label:{spacing:s,placement:o,edgePlacement:a},node:{width:n}}=this.properties,r=this._nodeDataDependencies?.seriesRectWidth??0;let l=0,c=0;if(this.isLabelEnabled()&&(a==="outside"||a==null)){const h=(d,p)=>{const g=p;if(g.datum.label==null||g.datum.label==="")return d;let m=(r-n)/(i-1)-s;o==="center"&&a==null&&(m/=2);const y=Fg(g.datum.label,{maxWidth:m,maxHeight:g.datum.height,font:this.properties.label,textWrap:"never"});let{width:S}=t.measureLines(y);return o==="center"&&a==null&&(S/=2),Math.max(d,S)};(o!=="right"||a==="outside")&&(l=n+e[0].nodes.reduce(h,0)),(o!=="left"||a==="outside")&&(c=n+e.at(-1).nodes.reduce(h,0))}return{columnLabelInsetBefore:l,columnLabelInsetAfter:c}}positionNodesInColumnsX(e,t,i){for(let s=0;s<e.length;s++){const o=e[s];o.x=i+s*t;for(const a of o.nodes)a.datum.x=o.x}}createGhostNodesAndColumnDiffs(e,t){for(const i of e.values()){i.weight=0;let s=1/0;for(const o of i.linksAfter){const a=o.node;s=Math.min(s,a.columnIndex-i.columnIndex)}if(s===1/0)for(const o of i.linksBefore){const a=o.node;s=Math.min(s,i.columnIndex-a.columnIndex)}i.closestColumnDiff=s,this.createNodeGhostNodes(i,t,s)}}createNodeGhostNodes(e,t,i){for(const s of e.linksAfter){const o=s.node;if(!(o.columnIndex<=e.columnIndex))for(let a=o.columnIndex-1;a>e.columnIndex;a--){const n=s.link.size,r={ghost:!0,datum:{...e.datum,size:n,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:a-1,datum:{size:n}}}],linksAfter:[{node:{columnIndex:a+1,datum:{size:n}}}],link:s.link,columnIndex:e.columnIndex,size:e.datum.size,closestColumnDiff:i,fromNode:{y:o.datum.y},toNode:{y:0}};t[a].size+=n,t[a].nodes.push(r)}}}weightNodes(e){const{properties:t}=this;if(t.node.sort==="data")return;if(t.node.sort!=="auto"){for(const o of e)o.nodes.sort((a,n)=>this.sortNodes(a,n));return}const i=e.toSorted((o,a)=>{const n=o.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0);return a.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0)-n}),s={};for(let o=0;o<i.length;o++)s[i[o].index]=Math.pow(10,i.length-o-1);for(const o of e){for(const a of o.nodes){if("ghost"in a&&a.ghost){a.weight=a.size/o.size*s[o.index];continue}a.weight=a.datum.size/o.size*s[o.index]}o.nodes.sort((a,n)=>a.weight-n.weight)}for(const o of e){for(const a of o.nodes)"ghost"in a&&a.ghost||(a.weight+=a.linksBefore.reduce((n,r)=>{if(r.node.columnIndex!==o.index-1)return n;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*s[r.node.columnIndex];return Math.max(n,l)},0),a.weight+=a.linksAfter.reduce((n,r)=>{if(r.node.columnIndex!==o.index+1)return n;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*s[r.node.columnIndex];return Math.max(n,l)},0));o.nodes.sort((a,n)=>this.sortNodes(a,n))}}getScaleAndSpacing(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0,s=n=>e.reduce((r,{size:l,nodes:c})=>{const h=i-c.length*t,p=(1-(c.length-1)*n/h)/l;return Math.min(r,p)},1/0);let o=this.properties.node.spacing,a=s(o);for(;a<0&&o>this.properties.node.minSpacing;)o-=1,a=s(o);return{nodeSpacing:o,sizeScale:a}}positionNodesInColumnsY(e,t,i,s){const o=this._nodeDataDependencies?.seriesRectHeight??0;for(const a of e){let n=0;for(const c of a.nodes){const h=o*c.datum.size*i;c.datum.height=Math.max(t,h),n+=h}const r=s*(a.nodes.length-1);let l=0;this.properties.node.verticalAlignment==="bottom"?l=o-n-r:this.properties.node.verticalAlignment==="center"&&(l=(o-n-r)/2);for(const c of a.nodes)c.datum.y=l,l+=o*c.datum.size*i+s,"ghost"in c&&c.ghost&&c.link.elbows.push({x:a.x,y:c.datum.y})}}sortAndPositionLinks(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0;for(const{datum:s,linksBefore:o,linksAfter:a}of e.values()){let n=s.y;o.sort((l,c)=>this.sortNodes(l.node,c.node));for(const{link:l}of o)l.y2=n,n+=l.size*i*t;let r=s.y;a.sort((l,c)=>this.sortNodes(l.node,c.node,{invertColumnSort:!0}));for(const{link:l}of a)l.y1=r,r+=l.size*i*t}}createNodesNodeData(e,t,i,s,o,a){for(const[n,r]of i.entries()){const l=n===0,c=n===i.length-1;let h=-1/0;r.nodes.sort((d,p)=>d.datum.y-p.datum.y);for(const d of r.nodes){if("ghost"in d&&d.ghost)continue;const{datum:p}=d;p.midPoint={x:p.x+p.width/2,y:p.y+p.height/2},e.push(p),h=this.createNodeLabelData(t,s,o,a,p,l,c,h)}}}createNodeLabelData(e,t,i,s,o,a,n,r){if(o.label==null)return r;const{label:{spacing:l,edgePlacement:c,fontSize:h}}=this.properties,d=this._nodeDataDependencies?.seriesRectWidth??0,p=o.y+o.height/2;let g;if(!a&&!n){const f=Q5(h),D=p-f,v=p+f;let M=d;for(const{datum:I}of e.values())I.x>o.x&&Math.max(I.y,D)<=Math.min(I.y+I.height,v)&&(M=Math.min(M,I.x-l));const A=M-o.x-2*l;g=Fg(o.label,{maxWidth:A,maxHeight:o.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(g==null||g===""){const f=c==null&&(a||n)?l:l*2;g=Fg(o.label,{maxWidth:t-f,maxHeight:o.height,font:this.properties.label,textWrap:"never"})}if(g==="")return r;const{height:m}=i.measureLines(g),y=p-m/2,S=p+m/2,{x,textAlign:b}=this.getNodeLabelPlacement(o,a,n);return y>=r&&(s.push({x,y:p,textAlign:b,text:g,size:o.size,nodeDatum:o,datumIndex:o.datumIndex}),r=S),r}getNodeLabelPlacement(e,t,i){const{label:{spacing:s,placement:o,edgePlacement:a}}=this.properties;let n=e.x+e.width+s,r="left",l=o;return t&&a==null&&o==null&&(l="left"),a==="outside"?(t&&(l="left"),i&&(l="right")):a==="inside"&&(t&&(l="right"),i&&(l="left")),l==="left"?(n=e.x-s,r="right"):l==="center"&&(n=e.x+e.width/2,r="center"),{x:n,textAlign:r}}createLinksNodeData(e,t,i,s){const o=this._nodeDataDependencies?.seriesRectHeight??0,a=this.properties.node.width;for(const n of t){const{fromNode:r,toNode:l,size:c}=n;n.height=Math.max(i,o*c*s),n.x1=r.x+a,n.x2=l.x,n.midPoint={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2+n.height/2},e.push(n)}}sortNodes(e,t,i){const{properties:s}=this;return s.node.sort==="ascending"?(e.datum.label??"").localeCompare(t.datum.label??""):s.node.sort==="descending"?(t.datum.label??"").localeCompare(e.datum.label??""):s.node.sort==="data"?0:e.columnIndex<t.columnIndex?i?.invertColumnSort?1:-1:e.columnIndex>t.columnIndex?i?.invertColumnSort?-1:1:e.weight===t.weight?e.datum.size-t.datum.size:e.closestColumnDiff<t.closestColumnDiff?1:e.closestColumnDiff>t.closestColumnDiff?-1:e.weight-t.weight}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t=this.getHighlightedDatum();e.labelSelection.each((i,s)=>{const{x:o,y:a,textAlign:n,text:r,datumIndex:l,nodeDatum:c}=s,h={fromKey:this.properties.fromKey,size:s.size,sizeKey:this.properties.sizeKey,toKey:this.properties.toKey},d=this.isLabelHighlighted(c,t),p=this.getHighlightStyle(d,l),g=uU(this,void 0,h,this.properties.label,d,t),{color:m,fontStyle:y,fontWeight:S,fontSize:x,fontFamily:b}=g;i.visible=!0,i.x=o,i.y=a,i.text=r,i.fill=m,i.fontStyle=y,i.fontWeight=S,i.fontSize=x,i.fontFamily=b,i.textAlign=n,i.textBaseline="middle";const f=p.opacity??1;i.opacity=f,i.fillOpacity=f,i.setBoxing(g)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>dh(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:o,strokes:a,defaultColorRange:n,defaultPatternFills:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=s,{itemStyler:d}=s.node,p=n[t%n.length].map(b=>({color:b})),g=r[t%r.length],m=this.getHighlightStyle(i,e.datumIndex),y=ch(m,s.getStyle(!1,o,a,t)),S=s.node.fill!=null;let x=Rk(y,S?l:{...l.toJson(),colorStops:p},S?c:{...c.toJson(),fill:g,stroke:g},h);if(d!=null&&e.datumIndex!=null){const b=this.cachedDatumCallback(dh(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const f=this.makeItemStylerParams(e,i,x);return this.callWithContext(d,f)});b&&(x=ch(b,x,{...l.toJson(),colorStops:p},{...c.toJson(),fill:g,stroke:g},h))}return x.opacity=1,x}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},o,a){const{id:n}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,o,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:n,datum:e,highlightState:l,...a,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const{datumIndex:n}=a,r=this.getNodeStyle(a,n.index,i);o.x=a.x,o.y=a.y,o.width=Math.max(a.width,0),o.height=Math.max(a.height,0),o.setStyleProperties(r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new zk(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>dh(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:o,properties:a}=this,{fills:n,strokes:r,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:p}=a,{itemStyler:g}=a.link,m=l[i.index%l.length].map(D=>({color:D})),y=c[i.index%c.length],S=this.getHighlightStyle(s,e),x=ch(S,a.getStyle(!0,n,r,i.index)),b=a.link.fill!=null;let f=Rk(x,b?h:{...h.toJson(),colorStops:m},b?d:{...d.toJson(),fill:y,stroke:y},p);if(g!=null&&e!=null){const D=this.cachedDatumCallback(dh(e.index,"link",s?"highlight":"node"),()=>{const v=this.ctx.highlightManager?.getActiveHighlight(),M=this.getHighlightStateString(v,s,e);return this.callWithContext(g,{seriesId:o,datum:t,highlightState:M,...f})});D&&(f=ch(D,f,{...h.toJson(),colorStops:m},{...d.toJson(),fill:y,stroke:y},p))}return f.opacity=1,f}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const n=a.fromNode.datumIndex,r=this.getLinkStyle(a,n,i);o.x1=a.x1,o.y1=a.y1,o.x2=a.x2,o.y2=a.y2,o.height=a.height,o.elbows=a.elbows,o.setStyleProperties(r,s),o.inset=o.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:o,ctx:{formatManager:a}}=this,{fromKey:n,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=o,d=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===e.type&&b.datumIndex.index===e.index);if(d==null)return;const p=d.type===0?d.fromNode.index:d.index,g=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,m=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let S;if(d.type===0){const b=d.fromNode.datumIndex;S=this.getLinkStyle({datumIndex:e,datum:m},b,!1)}else S=this.getNodeStyle({datumIndex:e,datum:m},e.index,!1);const x=[];if(l!=null){const b=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});x.push({label:c,fallbackLabel:l,value:b??String(y)})}return this.formatTooltipWithContext(h,{title:g,symbol:this.legendItemSymbol(d.type,p,S),data:x},{seriesId:t,datum:m,title:g,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:y,...S})}computeFocusBounds(e){if(e instanceof _k){const{x:t,y:i,width:s,height:o}=e,a=new zk(t,i,s,o);return dU.toCanvas(this.contentGroup,a)}return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};Hg.className="SankeySeries",Hg.type="sankey";import{_ModuleSupport as pU}from"ag-charts-community";import{arrayOf as Kg,color as Bk,commonSeriesOptionsDefs as gU,constant as mU,fillGradientDefaults as yU,fillImageDefaults as fU,fillPatternDefaults as xU,required as Gg,string as uh,undocumented as wr}from"ag-charts-core";var{sankeySeriesThemeableOptionsDef:SU}=pU,bn={...SU,...gU,type:Gg(mU("sankey")),fromKey:Gg(uh),toKey:Gg(uh),sizeKey:uh,sizeName:uh};bn.fillGradientDefaults=wr(yU),bn.fillPatternDefaults=wr(xU),bn.fillImageDefaults=wr(fU),bn.defaultColorRange=wr(Kg(Kg(Bk))),bn.defaultPatternFills=wr(Kg(Bk));var Vk={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,solo:!0,version:K5,dependencies:[cn],options:bn,themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:G5,fillPatternDefaults:j5,fillImageDefaults:W5,defaultColorRange:{$palette:"gradients"},defaultPatternFills:U5,highlight:{unhighlightedItem:{opacity:.5}},label:{...$5,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:{$if:[{$greaterThan:[{$path:"./minSpacing"},20]},{$path:"./minSpacing"},20]},minSpacing:0,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}}},legend:{enabled:!1,toggleSeries:!1}},create:e=>new Hg(e)};import{VERSION as bU}from"ag-charts-community";import{BASE_FONT_SIZE as Fk,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS as vU,FILL_IMAGE_DEFAULTS as DU,FILL_PATTERN_DEFAULTS as MU,FONT_SIZE_RATIO as Hk,LABEL_BOXING_DEFAULTS as Kk}from"ag-charts-core";import{_ModuleSupport as Wg}from"ag-charts-community";import{formatValue as Gk,isGradientFill as Wk,mergeDefaults as jk,normalizeAngle360 as kU,toPlainText as $k}from"ag-charts-core";import{_ModuleSupport as AU}from"ag-charts-community";import{BaseProperties as IU,Property as Te}from"ag-charts-core";var{HierarchySeriesProperties:NU,makeSeriesTooltip:LU,HighlightProperties:TU}=AU,yo=class extends IU{};u([Te],yo.prototype,"fill",2),u([Te],yo.prototype,"fillOpacity",2),u([Te],yo.prototype,"stroke",2),u([Te],yo.prototype,"strokeWidth",2),u([Te],yo.prototype,"strokeOpacity",2),u([Te],yo.prototype,"opacity",2);var jg=class extends TU{constructor(){super(...arguments),this.highlightedBranch=new yo,this.unhighlightedBranch=new yo}};u([Te],jg.prototype,"highlightedBranch",2),u([Te],jg.prototype,"unhighlightedBranch",2);var Ot=class extends NU{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlight=new jg,this.label=new Wa,this.secondaryLabel=new Jl,this.tooltip=LU()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:o,strokeOpacity:a,opacity:1}}};u([Te],Ot.prototype,"sizeName",2),u([Te],Ot.prototype,"labelKey",2),u([Te],Ot.prototype,"secondaryLabelKey",2),u([Te],Ot.prototype,"fillOpacity",2),u([Te],Ot.prototype,"strokeWidth",2),u([Te],Ot.prototype,"strokeOpacity",2),u([Te],Ot.prototype,"cornerRadius",2),u([Te],Ot.prototype,"sectorSpacing",2),u([Te],Ot.prototype,"padding",2),u([Te],Ot.prototype,"itemStyler",2),u([Te],Ot.prototype,"highlight",2),u([Te],Ot.prototype,"label",2),u([Te],Ot.prototype,"secondaryLabel",2),u([Te],Ot.prototype,"tooltip",2);var{fromToMotion:CU,createDatumId:wU,PointerEvents:OU,Sector:Uk,Group:ph,ScalableGroup:EU,Selection:$g,TransformableText:Ug,BBox:Yk,getLabelStyles:PU,toHierarchyHighlightString:RU}=Wg,_U=class extends Wg.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function Xk(e,t=0,i=2*Math.PI/e.sumSize){for(const s of e.children){const o=t+s.sumSize*i;s.startAngle=t,s.endAngle=o,Xk(s,t,i),t=o}}var Yg=class extends Wg.HierarchySeries{constructor(e){super(e),this.NodeClass=_U,this.properties=new Ot,this.scalingGroup=this.contentGroup.appendChild(new EU),this.sectorGroup=this.scalingGroup.appendChild(new ph),this.highlightSectorGroup=this.scalingGroup.appendChild(new ph),this.sectorLabelGroup=this.scalingGroup.appendChild(new ph),this.datumSelection=$g.select(this.sectorGroup,Uk),this.labelSelection=$g.select(this.sectorLabelGroup,ph),this.highlightSelection=$g.select(this.highlightSectorGroup,Uk),this.sectorLabelGroup.pointerEvents=OU.None}processData(){super.processData(),Xk(this.rootNode)}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(t==null||t.seriesRect==null)return;const s=Array.from(this.rootNode),o=a=>{a.append([new Ug({tag:0}),new Ug({tag:1})])};this.datumSelection.update(s,void 0,a=>this.getDatumId(a)),this.labelSelection.update(s,o,a=>this.getDatumId(a))}getItemStyle(e,t){const{properties:i,colorScale:s}=this,{itemStyler:o}=i,a=e.datumIndex?.[0]??0,n=this.getActiveHighlightNode(),r=this.getHierarchyHighlightState(t,n,e),l=this.getHierarchyHighlightStyles(r,this.properties.highlight),c=jk(l,i.getStyle(a));e.colorValue!=null&&l?.fill==null&&(c.fill=s.convert(e.colorValue));let h=c;if(o!=null&&e!=null){const d=this.cachedDatumCallback(wU(this.getDatumId(e),t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,h,RU(r));return this.callWithContext(o,p)});d&&(h=jk(d,h))}return h}makeItemStylerParams(e,t,i){const{id:s}=this,o=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:s,datum:e.datum,depth:e.depth??0,highlightState:i,...t,fill:o}}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(e==null||t==null)return;const{width:s,height:o}=e.seriesRect,{sectorSpacing:a=0,padding:n=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:p,sizeKey:g,sizeName:m}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=o/2;const y=a*.5,S=Math.min(s,o)/2,x=S/(i+1),b=-Math.PI/2,f={series:new Yk(-S,-S,2*S,2*S),axis:new Yk(-S,-S,2*S,2*S)};this.rootNode?.walk(I=>{const{startAngle:k,endAngle:N}=I;if(I.depth!=null){const L=(k+N)/2+b,T=(I.depth+.5)*x;I.midPoint.x=Math.cos(L)*T,I.midPoint.y=Math.sin(L)*T}}),this.rootNode?.walk(I=>{const{datum:k,depth:N,startAngle:L,endAngle:T,parent:P,sumSize:O}=I;I.label=void 0,I.secondaryLabel=void 0,I.contentHeight=0;let C;if(k!=null&&N!=null&&d!=null){const oe=k[d];C=this.getLabelText(oe,k,d,"label",[],this.properties.label,{depth:N,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:oe})}C===""&&(C=void 0);let R;if(k!=null&&N!=null&&p!=null){const oe=k[p];R=this.getLabelText(oe,k,p,"secondaryLabel",[],this.properties.secondaryLabel,{depth:N,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:oe})}if(R===""&&(R=void 0),N==null)return;const V=N*x+y,E=(N+1)*x-y,w=V>y?y/V:y,z=E>y?y/E:y,B=L+w,_=T+w-B,j=L+z,U=T+z-j,ie=oe=>{if(N===0&&P?.sumSize===O)return{width:2*Math.sqrt(E**2-(oe*.5)**2),height:oe,meta:0};const ne=oe,pt=2*Math.sqrt(E**2-(V+ne)**2),kt=_<Math.PI?2*V*Math.tan(_*.5):1/0,So=Math.min(pt,kt),An=Math.PI/4;let Ei,ws;return N===0?(Ei=oe,ws=Math.sqrt(E**2-(Ei/2)**2)-oe/(2*Math.tan(U*.5))):kU(_)<An?(Ei=2*V*Math.tan(_*.5),ws=Math.sqrt(E**2-(Ei/2)**2)-V):(ws=0,Ei=0),So>=ws?{width:So,height:ne,meta:1}:{width:ws,height:Ei,meta:2}},ae=fu($k(C),this.properties.label,$k(R),this.properties.secondaryLabel,{padding:n},ie);if(ae==null)return;const{width:re,height:xe,meta:et,label:Gt,secondaryLabel:se}=ae,Q=b+(L+T)/2,ze=Math.sin(Q)>=0,tt=Math.cos(Q)>=0,ce=(ze?3:12)&(tt?6:9);let ue;switch(et){case 0:ue=0;break;case 1:{const Ce=E-(x-xe)*.58,ne=Math.sqrt((E-n)**2-(re/2)**2);ue=Math.min(Ce,ne);break}case 2:if(N===0){const oe=xe/(2*Math.tan(_*.5))+re*.5,Ce=Math.sqrt(E**2-(xe*.5)**2)-re*.5;ue=(oe+Ce)*.5}else ue=(V+E)*.5;break}if(Gt!=null){const{fontStyle:oe="normal",fontFamily:Ce,fontWeight:ne="normal",color:pt="black"}=this.properties.label;I.label={...Gt,fontStyle:oe,fontFamily:Ce,fontWeight:ne,color:pt,labelPlacement:et,circleQuarter:ce,radius:ue,theta:Q}}if(se!=null){const{fontStyle:oe="normal",fontFamily:Ce,fontWeight:ne="normal",color:pt="black"}=this.properties.secondaryLabel;I.secondaryLabel={...se,fontStyle:oe,fontFamily:Ce,fontWeight:ne,color:pt,labelPlacement:et,circleQuarter:ce,radius:ue,theta:Q}}I.contentHeight=ae.height});const D=(I,k,N)=>{const{depth:L,startAngle:T,endAngle:P}=I;if(L==null){k.visible=!1;return}k.visible=!0;const O=this.getItemStyle(I,N),C=O.fill,R=O.strokeWidth,V=Wk(C)&&C.bounds!=="item"?f:void 0;k.setStyleProperties(O,V),k.centerX=0,k.centerY=0,k.innerRadius=L*x,k.outerRadius=(L+1)*x,k.startAngle=T+b,k.endAngle=P+b,k.inset=y+R*.5,k.cornerRadius=r};this.datumSelection.each((I,k)=>{D(k,I,!1)}),this.highlightSelection.each((I,k)=>{D(k,I,!0)});const v=this.getActiveHighlightNode(),M=(I,k,N,L)=>{const{depth:T,contentHeight:P}=I,O=N===0,C=O?I.label:I.secondaryLabel;if(T==null||C==null){k.visible=!1;return}const{labelPlacement:R,circleQuarter:V,radius:E,theta:w}=C,z=this.getHierarchyHighlightState(L,v,I),{opacity:B}=this.getHierarchyHighlightStyles(z,this.properties.highlight)??{},K={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:I.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},_=O?this.properties.label:this.properties.secondaryLabel,j=this.ctx.highlightManager?.getActiveHighlight(),Z=PU(this,I,K,_,L,j);switch(k.text=C.text,k.fontSize=C.fontSize,k.lineHeight=C.lineHeight,k.fontStyle=C.fontStyle,k.fontFamily=C.fontFamily,k.fontWeight=C.fontWeight,k.fillOpacity=B??1,k.fill=Z.color,k.setBoxing(Z),R){case 0:k.textAlign="center",k.textBaseline="top",k.translationX=0,k.translationY=(O?0:P-C.height)-P*.5,k.rotation=0;break;case 1:{const U=(V&3)!==0,ie=O===!U?E:E-(P-C.height);k.textAlign="center",k.textBaseline=U?"bottom":"top",k.translationX=Math.cos(w)*ie,k.translationY=Math.sin(w)*ie,k.rotation=U?w-Math.PI*.5:w+Math.PI*.5;break}case 2:{const U=(V&6)!==0,ie=O===!U?(P-C.height)*.5:(C.height-P)*.5;k.textAlign="center",k.textBaseline="middle",k.translationX=Math.cos(w)*E+Math.cos(w+Math.PI/2)*ie,k.translationY=Math.sin(w)*E+Math.sin(w+Math.PI/2)*ie,k.rotation=U?w:w+Math.PI;break}}k.visible=!0},A=this.getActiveHighlightNode();for(const I of this.labelSelection.selectByClass(Ug)){const k=I.closestDatum();M(k,I,I.tag,k===A)}}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{labelKey:o,secondaryLabelKey:a,childrenKey:n,sizeKey:r,sizeName:l,colorKey:c,colorName:h,tooltip:d}=i,{formatManager:p}=s,g=e.reduce((M,A)=>M?.children[A],this.rootNode);if(g==null)return;const{datum:m,depth:y}=g;if(m==null||y==null)return;const S=[],x=r==null?void 0:m[r];if(x!=null){const M=[0,this.rootNode?.sumSize??0],A=p.format(this.callWithContext.bind(this),{type:"number",value:x,datum:m,seriesId:t,legendItemName:void 0,key:r,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:M,fractionDigits:void 0,visibleDomain:void 0});S.push({label:l,fallbackLabel:r,value:A??Gk(x)})}const b=c==null?void 0:m[c];if(b!=null){const{colorDomain:M}=this,A=p.format(this.callWithContext.bind(this),{type:"number",value:b,datum:m,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:M,fractionDigits:void 0,visibleDomain:void 0});S.push({label:h,fallbackLabel:c,value:A??Gk(b)})}const f=this.getItemStyle({...g,colorValue:b??g.colorValue},!1),v={shape:"square",fill:f.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return Wk(v.fill)&&(v.fill={...v.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:o==null?void 0:m[o],symbol:{marker:v},data:S},{seriesId:t,datum:m,title:void 0,depth:y,labelKey:o,secondaryLabelKey:a,childrenKey:n,sizeKey:r,sizeName:l,colorKey:c,colorName:h,...f})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){CU(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Yg.className="SunburstSeries",Yg.type="sunburst";import{_ModuleSupport as zU}from"ag-charts-community";import{commonSeriesOptionsDefs as BU,constant as VU,required as FU,string as ua,without as HU}from"ag-charts-core";var{sunburstSeriesThemeableOptionsDef:KU}=zU,GU={...KU,...HU(BU,["highlightStyle","highlight","showInLegend"]),type:FU(VU("sunburst")),labelKey:ua,secondaryLabelKey:ua,childrenKey:ua,sizeKey:ua,colorKey:ua,sizeName:ua,colorName:ua},WU={series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",vU],["pattern",MU],["image",DU]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...Kk,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:Hk.LARGE},minimumFontSize:{$rem:9/Fk},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...Kk,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:Hk.SMALLEST},minimumFontSize:{$rem:7/Fk},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},Zk={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,solo:!0,version:bU,dependencies:[cn],options:GU,themeTemplate:WU,create:e=>new Yg(e)};import{VERSION as jU}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as $U,FILL_IMAGE_DEFAULTS as UU,FILL_PATTERN_DEFAULTS as YU,FONT_SIZE_RATIO as Qk,LABEL_BOXING_DEFAULTS as Xg}from"ag-charts-core";import{_ModuleSupport as gh}from"ag-charts-community";import{cachedTextMeasurer as XU,calcLineHeight as ZU,formatValue as qk,isGradientFill as QU,isNumberEqual as qU,mergeDefaults as Jk,toPlainText as eA,wrapText as JU}from"ag-charts-core";import{_ModuleSupport as eY}from"ag-charts-community";import{BaseProperties as vn,Property as G}from"ag-charts-core";var{HierarchySeriesProperties:tY,makeSeriesTooltip:iY,Label:sY}=eY,tA=class extends sY{constructor(){super(...arguments),this.spacing=0}};u([G],tA.prototype,"spacing",2);var fo=class extends vn{};u([G],fo.prototype,"fill",2),u([G],fo.prototype,"fillOpacity",2),u([G],fo.prototype,"stroke",2),u([G],fo.prototype,"strokeWidth",2),u([G],fo.prototype,"strokeOpacity",2),u([G],fo.prototype,"opacity",2);var Zg=class extends vn{constructor(){super(...arguments),this.highlightedItem=new fo,this.unhighlightedItem=new fo}};u([G],Zg.prototype,"highlightedItem",2),u([G],Zg.prototype,"unhighlightedItem",2);var os=class extends vn{};u([G],os.prototype,"fill",2),u([G],os.prototype,"fillOpacity",2),u([G],os.prototype,"stroke",2),u([G],os.prototype,"strokeWidth",2),u([G],os.prototype,"strokeOpacity",2),u([G],os.prototype,"opacity",2);var Or=class extends vn{constructor(){super(...arguments),this.highlightedBranch=new os,this.highlightedItem=new os,this.unhighlightedItem=new os,this.unhighlightedBranch=new os}};u([G],Or.prototype,"highlightedBranch",2),u([G],Or.prototype,"highlightedItem",2),u([G],Or.prototype,"unhighlightedItem",2),u([G],Or.prototype,"unhighlightedBranch",2);var ni=class extends vn{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new tA,this.highlight=new Zg}};u([G],ni.prototype,"fill",2),u([G],ni.prototype,"fillOpacity",2),u([G],ni.prototype,"stroke",2),u([G],ni.prototype,"strokeWidth",2),u([G],ni.prototype,"strokeOpacity",2),u([G],ni.prototype,"cornerRadius",2),u([G],ni.prototype,"textAlign",2),u([G],ni.prototype,"gap",2),u([G],ni.prototype,"padding",2),u([G],ni.prototype,"interactive",2),u([G],ni.prototype,"label",2),u([G],ni.prototype,"highlight",2);var Ht=class extends vn{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new Wa,this.secondaryLabel=new Jl,this.highlight=new Or}};u([G],Ht.prototype,"fill",2),u([G],Ht.prototype,"fillOpacity",2),u([G],Ht.prototype,"stroke",2),u([G],Ht.prototype,"strokeWidth",2),u([G],Ht.prototype,"strokeOpacity",2),u([G],Ht.prototype,"cornerRadius",2),u([G],Ht.prototype,"textAlign",2),u([G],Ht.prototype,"verticalAlign",2),u([G],Ht.prototype,"gap",2),u([G],Ht.prototype,"padding",2),u([G],Ht.prototype,"label",2),u([G],Ht.prototype,"secondaryLabel",2),u([G],Ht.prototype,"highlight",2);var as=class extends tY{constructor(){super(...arguments),this.tooltip=iY(),this.group=new ni,this.tile=new Ht,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,s){const{fillOpacity:o,strokeWidth:a,strokeOpacity:n,fill:r=e?t[s%t.length]:t[Math.min(s,t.length)],stroke:l=e?i[s%t.length]:i[Math.min(s,i.length)]}=e?this.tile:this.group;return{fill:r,fillOpacity:o,stroke:l,strokeWidth:a,strokeOpacity:n,opacity:1}}};u([G],as.prototype,"sizeName",2),u([G],as.prototype,"labelKey",2),u([G],as.prototype,"secondaryLabelKey",2),u([G],as.prototype,"itemStyler",2),u([G],as.prototype,"tooltip",2),u([G],as.prototype,"group",2),u([G],as.prototype,"tile",2),u([G],as.prototype,"undocumentedGroupFills",2),u([G],as.prototype,"undocumentedGroupStrokes",2);var{createDatumId:oY,Rect:iA,Group:sA,BBox:Dn,Selection:Qg,Text:qg,Transformable:aY,getLabelStyles:nY,HierarchyHighlightState:Oi,toHierarchyHighlightString:Er}=gh,rY=class extends gh.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function xo(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var oA={left:0,center:.5,right:1},lY={top:0,middle:.5,bottom:1},pte=class extends gh.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},Jg=class extends gh.HierarchySeries{constructor(){super(...arguments),this.NodeClass=rY,this.properties=new as,this.rectGroup=this.contentGroup.appendChild(new sA),this.datumSelection=Qg.select(this.rectGroup,iA),this.labelSelection=Qg.select(this.labelGroup,sA),this.highlightSelection=Qg.select(this.rectGroup,iA)}groupTitleHeight(e,t){const{label:s}=this.properties.group,{labelValue:o}=e,{fontSize:a}=s;if(s.enabled&&o!=null&&a<=t.width/3&&a<=t.height/3){const{height:n}=XU(s).measureLines(o);return Math.max(n,a)}}getNodePadding(e,t){if(e.parent==null)return{top:0,right:0,bottom:0,left:0};if(e.children.length===0){const{padding:n}=this.properties.tile;return{top:n,right:n,bottom:n,left:n}}const{padding:i,label:{spacing:s}}=this.properties.group,o=this.groupTitleHeight(e,t),a=o==null?0:o+s;return{top:i+a,right:i,bottom:i,left:i}}sortChildren({children:e}){const t=Array.from(e,(s,o)=>o).filter(s=>xo(e[s])>0).sort((s,o)=>xo(e[o])-xo(e[s]));return{sortedChildrenIndices:t,childAt:s=>{const o=t[s];return e[o]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0){e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN;return}const o=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);e.parent==null?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN):(e.bbox=t,e.padding=o,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:a,childAt:n}=this.sortChildren(e),r=a.every(v=>s[v].children.length===0),l=1,c=t.width-o.left-o.right,h=t.height-o.top-o.bottom;if(c<=0||h<=0)return;const d=a.length;let p=0,g=0,m=1/0,y=a.reduce((v,M)=>v+xo(s[M]),0);const S=new Dn(t.x+o.left,t.y+o.top,c,h),x=S.clone();let b=0;for(;b<d;){const v=xo(n(b)),M=xo(n(g)),A=x.width<x.height;p+=v;const I=A?x.height:x.width,k=A?x.width:x.height,N=k*M/p;let L=I*p/y;const T=Math.max(N,L)/Math.min(N,L),P=Math.abs(l-T);if(P<m){m=P,b++;continue}p-=v,L=I*p/y;let O=A?x.x:x.y;for(let C=g;C<b;C++){const R=n(C),V=xo(R),E=A?O:x.x,w=A?x.y:O,z=k*V/p,B=A?z:L,K=A?L:z,_=new Dn(E,w,B,K);this.applyGap(S,_,r),this.squarify(R,_),y-=V,O+=z}A?(x.y+=L,x.height-=L):(x.x+=L,x.width-=L),g=b,p=0,m=1/0}const f=x.width<x.height;let D=f?x.x:x.y;for(let v=g;v<d;v++){const M=n(v),A=f?D:x.x,I=f?x.y:D,k=xo(M)/y,N=x.width*(f?k:1),L=x.height*(f?1:k),T=new Dn(A,I,N,L);this.applyGap(S,T,r),this.squarify(M,T),D+=f?N:L}}applyGap(e,t,i){const s=i?this.properties.tile.gap*.5:this.properties.group.gap*.5,o=l=>({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=o(e),n=o(t),r=["top","right","bottom","left"];for(const l of r)qU(a[l],n[l])||t.shrink(s,l)}createNodeData(){}getItemStyle(e,t,i){const{properties:s,colorScale:o}=this,{itemStyler:a}=s,n=e.datumIndex?.[0]??0,r=t?s.fills:s.undocumentedGroupFills,l=t?s.strokes:s.undocumentedGroupStrokes,c=t?n:e.depth??-1,h=this.getActiveHighlightNode(),d=this.getHierarchyHighlightState(i,h,e),p=this.getGroupHighlightState(i,h,e),g=t?d:p,m=t?this.getTileHighlightStyle(d,p,h):this.getGroupHighlightStyle(p),y=Jk(m,s.getStyle(t,r,l,c));t&&e.colorValue!=null&&m?.fill==null&&(y.fill=o.convert(e.colorValue));let S=y;if(a!=null&&e!=null){const x=this.cachedDatumCallback(oY(this.getDatumId(e),i?"highlight":"node"),()=>{const b=this.makeItemStylerParams(e,S,Er(g));return this.callWithContext(a,b)});x&&(S=Jk(x,S))}return S}makeItemStylerParams(e,t,i){const{id:s}=this,o=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:s,datum:e.datum,depth:e.depth??-1,highlightState:i,...t,fill:o}}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,o=>this.getDatumId(o)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),s=o=>{o.append([new qg({tag:0}),new qg({tag:1})])};this.datumSelection.update(i,void 0,o=>this.getDatumId(o)),this.labelSelection.update(i,s,o=>this.getDatumId(o))}getActiveHighlightNode(){const e=super.getActiveHighlightNode();if(!(e?.children.length&&!this.properties.group.interactive))return e}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:o,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,tile:c,group:h}=this.properties,{seriesRect:d}=this.chart??{};if(!d||!t)return;this.rootNode?.walk(b=>{const{datum:f,depth:D,children:v}=b,M=v.length===0,A=M?c.label:h.label;let I;if(A.enabled&&f!=null&&D!=null&&a!=null){const N=f[a];I=this.getLabelText(N,f,a,"label",[],A,{depth:D,datum:f,childrenKey:i,colorKey:s,colorName:o,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,value:N})}I===""&&(I=void 0);let k;if(c.secondaryLabel.enabled&&M&&f!=null&&D!=null&&n!=null){const N=f[n];k=this.getLabelText(N,f,n,"secondaryLabel",[],c.secondaryLabel,{depth:D,datum:f,childrenKey:i,colorKey:s,colorName:o,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,value:N})}k===""&&(k=void 0),b.labelValue=eA(I),b.secondaryLabelValue=eA(k)});const{width:p,height:g}=d;this.squarify(e,new Dn(0,0,p,g)),this.rootNode?.walk(b=>{const{bbox:f,children:D,labelValue:v,secondaryLabelValue:M}=b;if(b.label=void 0,b.secondaryLabel=void 0,f!=null)if(D.length===0){const A={width:f.width,height:f.height,meta:null},I=fu(v,this.properties.tile.label,M,this.properties.tile.secondaryLabel,{padding:c.padding},()=>A);if(I==null)return;const{height:k,label:N,secondaryLabel:L}=I,{textAlign:T,verticalAlign:P,padding:O}=c,C=oA[T]??.5,R=f.x+O+(f.width-2*O)*C,V=lY[P]??.5,E=f.y+O+k*.5+(f.height-2*O-k)*V;if(N!=null){const{fontStyle:w="normal",fontFamily:z,fontWeight:B="normal",color:K="black"}=this.properties.tile.label;b.label={text:N.text,fontSize:N.fontSize,lineHeight:N.lineHeight,fontStyle:w,fontFamily:z,fontWeight:B,color:K,textAlign:T,verticalAlign:"middle",x:R,y:E-(k-N.height)*.5}}if(L!=null){const{fontStyle:w="normal",fontFamily:z,fontWeight:B="normal",color:K="black"}=this.properties.tile.secondaryLabel;b.secondaryLabel={text:L.text,fontSize:L.fontSize,lineHeight:L.fontSize,fontStyle:w,fontFamily:z,fontWeight:B,color:K,textAlign:T,verticalAlign:"middle",x:R,y:E+(k-L.height)*.5}}}else{if(v==null)return;{const{padding:A,textAlign:I}=h,k=this.groupTitleHeight(b,f);if(k==null)return;const N=f.width-2*A,L=JU(v,{maxWidth:f.width-2*A,font:h.label,textWrap:"never"}),T=oA[I]??.5,{fontStyle:P="normal",fontFamily:O,fontWeight:C="normal",color:R="black"}=this.properties.group.label;b.label={text:L,fontSize:h.label.fontSize,lineHeight:ZU(h.label.fontSize),fontStyle:P,fontFamily:O,fontWeight:C,color:R,textAlign:I,verticalAlign:"middle",x:f.x+A+N*T,y:f.y+A+k*.5}}}});const m={series:new Dn(0,0,p,g),axis:new Dn(0,0,p,g)},y=(b,f,D)=>{const{bbox:v}=b;if(v==null){f.visible=!1;return}const{depth:M=-1}=b,A=b.children.length===0,I=this.getItemStyle(b,A,D);f.crisp=!0,f.setStyleProperties(I,m),f.cornerRadius=A?c.cornerRadius:h.cornerRadius,f.zIndex=[0,M,D?1:0];const k=b.parent?.children.every(T=>T.children.length===0),N=b.parent==null?void 0:b.parent.bbox,L=b.parent==null?void 0:b.parent.padding;k===!0&&N!=null&&L!=null?(f.clipBBox=v,f.x=N.x+L.left,f.y=N.y+L.top,f.width=N.width-(L.left+L.right),f.height=N.height-(L.top+L.bottom)):(f.clipBBox=void 0,f.x=v.x,f.y=v.y,f.width=v.width,f.height=v.height),f.visible=!0};this.datumSelection.each((b,f)=>y(f,b,!1)),this.highlightSelection.each((b,f)=>{y(f,b,!0)});const S=(b,f,D,v)=>{const M=b.children.length===0,A=D===0?b.label:b.secondaryLabel;if(A==null){f.visible=!1;return}let I,k;D===0?(I=M?c.label:h.label,k=["series",`${this.declarationOrder}`,M?"tile":"group","label"]):(I=c.secondaryLabel,k=["series",`${this.declarationOrder}`,"tile","secondaryLabel"]);const{opacity:N}=this.getItemStyle(b,M,v)??{},L={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:b.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},T=this.ctx.highlightManager?.getActiveHighlight(),P=nY(this,b,L,I,v,T,k);f.text=A.text,f.fontSize=A.fontSize,f.lineHeight=A.lineHeight,f.fontStyle=A.fontStyle,f.fontFamily=A.fontFamily,f.fontWeight=A.fontWeight,f.fillOpacity=N??1,f.fill=P.color,f.setBoxing(P),f.textAlign=A.textAlign,f.textBaseline=A.verticalAlign,f.x=A.x,f.y=A.y,f.visible=!0,f.zIndex=1},x=this.getActiveHighlightNode();for(const b of this.labelSelection.selectByClass(qg)){const f=b.closestDatum();S(f,b,b.tag,f===x)}}getGroupHighlightState(e,t,i){const s=i.datumIndex,o=t?.datumIndex,a=this.isDescendantDatumIndex(s,o);if(i.children?.length===0)return s==null||t==null||t.children?.length===0?Oi.None:a?Oi.Item:Oi.OtherItem;if(t==null||t.children?.length===0)return Oi.None;const n=i.depth!=null&&t.depth!=null&&i.depth===t.depth;return a&&!n?Oi.None:e?Oi.Item:Oi.OtherItem}getTileHighlightStyle(e,t,i){if(i?.children&&i.children.length>0){const o=this.getGroupHighlightStyle(t);return o?.fillOpacity==null&&o?.strokeOpacity==null?void 0:{fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity}}return this.getHierarchyHighlightStyles(e,this.properties.tile.highlight)}getGroupHighlightStyle(e){const{highlight:t}=this.properties.group;switch(e){case Oi.Item:return t.highlightedItem;case Oi.OtherItem:return t.unhighlightedItem;default:return}}getHighlightStateString(e,t,i){if(i==null)return Er(Oi.None);const s=i.reduce((r,l)=>r?.children[l],this.rootNode),o=this.getActiveHighlightNode();if(s==null)return Er(Oi.None);if((s.children?.length??0)===0){const r=this.getHierarchyHighlightState(t??!1,o,s);return Er(r)}const n=this.getGroupHighlightState(t??!1,o,s);return Er(n)}isDescendantDatumIndex(e,t){if(t==null||t.length===0)return!0;if(e==null||e.length<t.length)return!1;for(let i=0;i<t.length;i+=1)if(e[i]!==t[i])return!1;return!0}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return t.length!==0?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{formatManager:o}=s,{labelKey:a,secondaryLabelKey:n,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:d,tooltip:p}=i,g=e.reduce((k,N)=>k?.children[N],this.rootNode);if(g==null)return;const{datum:m,depth:y,children:S}=g;if(m==null||y==null)return;const x=S.length===0,b=[],f=l==null?void 0:m[l];if(f!=null){const k=[0,this.rootNode?.sumSize??0],N=o.format(this.callWithContext.bind(this),{type:"number",value:f,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:k,fractionDigits:void 0,visibleDomain:void 0});b.push({label:c,fallbackLabel:l,value:N??qk(f)})}const D=h==null?void 0:m[h];if(D!=null){const{colorDomain:k}=this,N=o.format(this.callWithContext.bind(this),{type:"number",value:D,datum:m,seriesId:t,legendItemName:void 0,key:h,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:k,fractionDigits:void 0,visibleDomain:void 0});b.push({label:d,fallbackLabel:h,value:N??qk(D)})}const v=this.getItemStyle({...g,colorValue:D??g.colorValue},x,!1),A={shape:"square",fill:v.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};QU(A.fill)&&(A.fill={...A.fill,gradient:"linear",rotation:0,reverse:!1});const I=x?{marker:A}:void 0;return this.formatTooltipWithContext(p,{title:a==null?void 0:m[a],symbol:I,data:b},{seriesId:t,datum:m,title:void 0,depth:y,labelKey:a,secondaryLabelKey:n,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:d,...v})}computeFocusBounds(e){return aY.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};Jg.className="TreemapSeries",Jg.type="treemap";import{_ModuleSupport as cY}from"ag-charts-community";import{arrayOf as aA,color as nA,commonSeriesOptionsDefs as hY,constant as dY,required as uY,string as pa,undocumented as rA,without as pY}from"ag-charts-core";var{treemapSeriesThemeableOptionsDef:gY}=cY,em={...gY,...pY(hY,["highlightStyle","highlight","showInLegend"]),type:uY(dY("treemap")),labelKey:pa,secondaryLabelKey:pa,childrenKey:pa,sizeKey:pa,colorKey:pa,sizeName:pa,colorName:pa};em.undocumentedGroupFills=rA(aA(nA)),em.undocumentedGroupStrokes=rA(aA(nA));var lA={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,solo:!0,version:jU,dependencies:[cn],options:em,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",$U],["pattern",YU],["image",UU]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...Xg,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left",highlight:{unhighlightedItem:{opacity:.2,fillOpacity:.2,strokeOpacity:.2}}},tile:{label:{...Xg,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:Qk.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...Xg,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:Qk.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},create:e=>new Jg(e)};import{AllCommunityModule as mY}from"ag-charts-community";import{AllCartesianAxesModule as yY}from"ag-charts-community";var cA=[yY,wh].flat();import{AllCartesianSeriesModule as fY}from"ag-charts-community";var hA=[fY,ou,Ql,Rv,Kv,vu,tc,lc,dc,Uu].flat(),dA=[cA,hA,wn,_d,zd,_l,$n,Gd,Fl,jd,px,Tc,Yu,tp,xb,op,lp,ln].flat();import{BarSeriesModule as xY,LineSeriesModule as SY,NumberAxisModule as bY,TimeAxisModule as vY}from"ag-charts-community";import{VERSION as DY}from"ag-charts-community";import{array as MY,boolean as ga,commonChartOptionsDefs as kY,defined as de,positiveNumber as AY,string as Mn,tooltipOptionsDefs as IY,undocumented as NY,union as LY}from"ag-charts-core";import"ag-charts-community";import{Logger as TY,SAFE_STROKE_FILL_OPERATION as CY,mergeDefaults as wY}from"ag-charts-core";import*as OY from"ag-charts-core";import{FONT_SIZE_RATIO as tm}from"ag-charts-core";var{DEFAULT_ANNOTATION_HANDLE_FILL:EY,DEFAULT_ANNOTATION_STATISTICS_COLOR:PY,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:RY,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:uA,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:pA,DEFAULT_ANNOTATION_STATISTICS_FILL:_Y,DEFAULT_ANNOTATION_STATISTICS_STROKE:zY,DEFAULT_FIBONACCI_STROKES:gA,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:kn,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Ts,DEFAULT_TEXTBOX_COLOR:BY,DEFAULT_TEXTBOX_FILL:VY,DEFAULT_TEXTBOX_STROKE:FY,DEFAULT_TEXT_ANNOTATION_COLOR:HY}=OY,bi={stroke:Ts},ut={fill:EY},mA={color:"white",fill:Ts},Cs={color:Ts},ma={color:HY,fontSize:{$rem:tm.LARGE},fontFamily:{$ref:"fontFamily"}},im={...ma,fontSize:{$ref:"fontSize"},color:PY,fill:_Y,stroke:zY,strokeWidth:1,divider:{stroke:RY,strokeWidth:1,strokeOpacity:.5}},sm={...bi,background:{fill:kn,fillOpacity:.2},handle:{...ut},text:{...Cs},statistics:{...im}},KY={line:{...bi,handle:{...ut},text:{...Cs}},"horizontal-line":{...bi,handle:{...ut},axisLabel:{...mA},text:{...Cs}},"vertical-line":{...bi,handle:{...ut},axisLabel:{...mA},text:{...Cs}},"disjoint-channel":{...bi,background:{fill:kn,fillOpacity:.2},handle:{...ut},text:{...Cs}},"parallel-channel":{...bi,background:{fill:kn,fillOpacity:.2},handle:{...ut},text:{...Cs}},"fibonacci-retracement":{...bi,strokes:gA,rangeStroke:Ts,handle:{...ut},text:{...Cs,position:"center"},label:{...ma,color:void 0,fontSize:{$rem:tm.SMALLER}}},"fibonacci-retracement-trend-based":{...bi,strokes:gA,rangeStroke:Ts,handle:{...ut},text:{...Cs,position:"center"},label:{...ma,color:void 0,fontSize:{$rem:tm.SMALLER}}},callout:{...bi,...ma,color:{$ref:"textColor"},handle:{...ut},fill:kn,fillOpacity:.2},comment:{...ma,color:"white",fontWeight:700,handle:{...ut},fill:Ts},note:{...ma,color:BY,fill:Ts,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ut},background:{fill:VY,stroke:FY,strokeWidth:1}},text:{...ma,handle:{...ut}},arrow:{...bi,handle:{...ut},text:{...Cs}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...ut,stroke:Ts}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...ut,stroke:Ts}},"date-range":{...sm},"price-range":{...sm},"date-price-range":{...sm},"quick-date-price-range":{up:{...bi,fill:kn,fillOpacity:.2,handle:{...ut},statistics:{...im,color:"#fff",fill:kn,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...bi,stroke:pA,fill:uA,fillOpacity:.2,handle:{...ut,stroke:pA},statistics:{...im,color:"#fff",fill:uA,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},GY=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],WY=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function jY(e,t,i){const{dateKey:s="date",highKey:o="high",openKey:a="open",lowKey:n="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:d=!0,rangeButtons:p=!0,statusBar:g=!0,toolbar:m=!0,zoom:y=!0,sync:S=!1,theme:x,data:b,formatter:f,...D}=e,v=UY(c,s,o,n,a,r),M=$Y(i,s,a,r,d,l),I={navigator:{enabled:h,...d?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:CY,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},k={annotations:{enabled:m,optionsToolbar:{enabled:m},snap:!0,toolbar:{enabled:m,buttons:WY,padding:0},data:b,xKey:s,volumeKey:d?l:void 0}},N=g?{statusBar:{enabled:!0,highKey:o,openKey:a,lowKey:n,closeKey:r,volumeKey:d?l:void 0}}:null,L={zoom:{enabled:y,autoScaling:{enabled:!0},onDataChange:{stickToEnd:!0},enableIndependentAxes:!0}},T={ranges:{enabled:p}},P=S?{sync:{enabled:S,nodeInteraction:!0,zoom:!0}}:null,O=d?{yVolume:{type:"number",position:"left",label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}}:{};return{theme:{baseTheme:typeof x=="string"?x:"ag-financial",...wY(typeof x=="object"?x:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:m},annotations:{...KY},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}},category:{gridLine:{enabled:!0}},time:{gridLine:{enabled:!0}},"unit-time":{gridLine:{enabled:!0}},"ordinal-time":{gridLine:{enabled:!0}}}},bar:{series:{fillOpacity:.5,highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},line:{series:{marker:{enabled:!1},highlight:{unhighlightedSeries:{opacity:1}},...mh(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...mh(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},ohlc:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},"range-area":{series:{fillOpacity:.3,strokeWidth:2,highlight:{bringToFront:!1,unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...mh(c,{hlc:{fill:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.fill"},{$palette:"down.fill"}]},stroke:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.stroke"},{$palette:"down.stroke"}]}}})}},"range-bar":{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...mh(c,{"high-low":{fill:{$palette:"neutral.fill"},stroke:{$palette:"neutral.stroke"}}})}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...M,...v],axes:{y:{type:"number",position:"right",crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...O,x:{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}},tooltip:{enabled:!1},data:b,formatter:f,...k,...I,...N,...L,...T,...P,...D}}function $Y(e,t,i,s,o,a){return o?[{type:"bar",xKey:t,yKey:a,yKeyAxis:"yVolume",tooltip:{enabled:!1},simpleItemStyler(n){const{up:r,down:l}=e().palette;return{fill:n[i]<n[s]?r?.fill:l?.fill}},focusPriority:1,highlight:{unhighlightedSeries:{opacity:1}}}]:[]}var yA="range-area";function UY(e,t,i,s,o,a){const n={xKey:t,openKey:o,closeKey:a,highKey:i,lowKey:s},r={xKey:t,yKey:a},l={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return YY(l,n);case"line":case"step-line":return XY(l,r);case"hlc":return ZY(l,r,n);case"high-low":return QY(l,n);case"candlestick":case"hollow-candlestick":return fA(l,n);default:return TY.warnOnce(`unknown chart type: ${e}; expected one of: ${GY.join(", ")}`),fA(l,n)}}function YY(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function XY(e,t){return[{type:"line",focusPriority:0,...e,...t}]}function ZY(e,t,{xKey:i,highKey:s,closeKey:o,lowKey:a}){return[{type:yA,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:o},{type:yA,focusPriority:0,...e,xKey:i,yHighKey:o,yLowKey:a},{type:"line",...e,...t}]}function QY(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,tooltip:{range:"nearest"},focusPriority:0}]}function fA(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function mh(e,t){return t[e]??t.default}var qY={chartType:LY("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:Mn,openKey:Mn,highKey:Mn,lowKey:Mn,closeKey:Mn,volumeKey:Mn,navigator:ga,volume:ga,rangeButtons:ga,statusBar:ga,toolbar:ga,zoom:ga,sync:ga,theme:de,container:de,width:de,height:de,minWidth:de,minHeight:de,listeners:de,initialState:de,title:de,data:MY,formatter:de},JY={theme:de,container:de,animation:de,background:de,contextMenu:de,context:()=>!0,listeners:de,locale:de,width:de,height:de,minWidth:de,minHeight:de,title:de,subtitle:de,footnote:de,padding:de,tooltip:{...IY,...kY.tooltip}};JY.overrideDevicePixelRatio=NY(AY);var eX={type:"preset",name:"price-volume",enterprise:!0,dependencies:[_l,op],version:DY,options:qY,create:jY},xA=[eX,xY,SY,Ql,tc,dc,lc,wn,_d,zd,_l,$n,Gd,Fl,jd,Tc,Yu,tp,lp,ln,wh,vY,bY],SA=[fD,wk];import{AllPolarModule as tX}from"ag-charts-community";var bA=[tX,Lm,km,Wm,Gm,vM,YM,qM,ck,fk,wn,$n,Fl,Tc].flat(),vA=[PD,_D,$D,tM,sM],DA=[mY,dA,bA,vA,SA,xA,Sv,OM,Vk,Zk,lA].flat();import{AgCharts as yh,ModuleRegistry as MA,VERSION as iX,_Scene as sX,_Theme as oX,_Util as aX}from"ag-charts-community";import"ag-charts-community";import{ModuleRegistry as nX,enterpriseRegistry as Pr}from"ag-charts-core";function rX(){nX.registerModules(DA),Pr.styles=gm,Pr.licenseManager=e=>new vo(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),Pr.injectWatermark=pm,Pr.createBackground=e=>new xh(e),Pr.createForeground=e=>new Nn(e)}var lX={setLicenseKey(e){vo.setLicenseKey(e)}},cX={VERSION:iX,_Scene:sX,_Theme:oX,_Util:aX,create:yh.create.bind(yh),createSparkline:yh.__createSparkline.bind(yh),setup:()=>{MA.setRegistryMode(MA.RegistryMode.Integrated),rX()},setGridContext:vo.setGridContext.bind(vo),setLicenseKey:vo.setLicenseKey.bind(vo),isEnterprise:!0};cm.setRegistryMode(cm.RegistryMode.Enterprise),In.styles=gm,In.licenseManager=e=>new vo(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),In.injectWatermark=pm,In.createBackground=e=>new xh(e),In.createForeground=e=>new Nn(e);export{cX as AgChartsEnterpriseModule,mm as AgTooltipAnchorToType,ym as AgTooltipPlacementType,cA as AllCartesianAxesModule,dA as AllCartesianModule,hA as AllCartesianSeriesModule,DA as AllEnterpriseModule,SA as AllGaugeModule,vA as AllMapSeriesModule,bA as AllPolarModule,km as AngleCategoryAxisModule,Lm as AngleNumberAxisModule,wn as AnimationModule,_d as AnnotationsModule,zd as BandHighlightModule,ou as BoxPlotSeriesModule,Ql as CandlestickSeriesModule,_l as ChartToolbarModule,Sv as ChordSeriesModule,Rv as ConeFunnelSeriesModule,$n as ContextMenuModule,Gd as CrosshairModule,Fl as DataSourceModule,jd as ErrorBarsModule,xA as FinancialChartModule,px as FlashOnUpdateModule,Kv as FunnelSeriesModule,Tc as GradientLegendModule,vu as HeatmapSeriesModule,lX as LicenseManager,fD as LinearGaugeModule,_D as MapLineBackgroundSeriesModule,PD as MapLineSeriesModule,$D as MapMarkerSeriesModule,sM as MapShapeBackgroundSeriesModule,tM as MapShapeSeriesModule,Yu as NavigatorModule,vM as NightingaleSeriesModule,tc as OhlcSeriesModule,wh as OrdinalTimeAxisModule,OM as PyramidSeriesModule,YM as RadarAreaSeriesModule,qM as RadarLineSeriesModule,ck as RadialBarSeriesModule,fk as RadialColumnSeriesModule,wk as RadialGaugeModule,Gm as RadiusCategoryAxisModule,Wm as RadiusNumberAxisModule,lc as RangeAreaSeriesModule,dc as RangeBarSeriesModule,tp as RangesModule,Vk as SankeySeriesModule,xb as ScrollbarModule,op as StatusBarModule,Zk as SunburstSeriesModule,lp as SyncModule,lA as TreemapSeriesModule,Uu as WaterfallSeriesModule,ln as ZoomModule};
|